Skip to content

Commit

Permalink
vm run: avoid adding empty "mounts" section to user-data
Browse files Browse the repository at this point in the history
An empty "mounts" section causes cloud-init to fail to start. It gets
far enough that the VM is accessible, but still registers as a failed
unit in systemd. Prevent this by only writing the "mounts" section when
there are actual mounts.
  • Loading branch information
JoelColledge committed Nov 8, 2021
1 parent b41c687 commit c686a94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/virter/cloudconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ fqdn: {{ .VMName }}.{{ .DomainSuffix }}
{{- else }}
fqdn: {{ .VMName }}
{{- end }}
{{- if .Mount }}
mounts:
{{- range .Mount }}
- [ "{{ . }}", "{{ . }}", "virtiofs"]
{{- end }}
{{- end }}
`

func (v *Virter) metaData(vmName string) (string, error) {
Expand Down

0 comments on commit c686a94

Please sign in to comment.