Skip to content

Commit 4cc6439

Browse files
committed
feat: recognize disk partion 0 as a valid option
This adds support for running VM images using LVM file systems in snapshot mode by skipping default disk injections but still allowing minimega snapshots to be enabled. Documentation has been added to the main phenix documentation for this feature.
1 parent 5d57651 commit 4cc6439

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/go/tmpl/templates/minimega_script.tmpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ ns add-host localhost
3333
{{- if (derefBool .General.Snapshot) -}}
3434
{{ $firstDrive := index .Hardware.Drives 0 }}
3535
disk snapshot {{ $firstDrive.Image }} {{ $.SnapshotName .General.Hostname }}
36-
{{- if gt (len .Injections) 0 }}
36+
{{- if ne $firstDrive.GetInjectPartition 0 }}
37+
{{- if gt (len .Injections) 0 }}
3738
disk inject {{ $.SnapshotName .General.Hostname }}:{{ $firstDrive.GetInjectPartition }} files {{ .FileInjects $basedir }}
38-
{{- end }}
39-
{{- if gt (len .Deletions) 0 }}
39+
{{- end }}
40+
{{- if gt (len .Deletions) 0 }}
4041
disk inject {{ $.SnapshotName .General.Hostname }}:{{ $firstDrive.GetInjectPartition }} delete files {{ .FileDeletions }}
42+
{{- end }}
4143
{{- end }}
4244
{{- end }}
4345
clear vm config

0 commit comments

Comments
 (0)