code comments yo
This commit is contained in:
parent
24d2cc34e5
commit
f26051a7da
|
@ -243,6 +243,7 @@ func getCreateVMScript(vmName string, path string, harddrivePath string, ram int
|
|||
vhdx = vmName + ".vhd"
|
||||
}
|
||||
|
||||
// Create VHD
|
||||
templateString := `$vhdPath = Join-Path -Path {{ .Path }} -ChildPath {{ .VHDX }}` + "\n"
|
||||
if harddrivePath != "" {
|
||||
if diffDisks {
|
||||
|
@ -252,13 +253,15 @@ func getCreateVMScript(vmName string, path string, harddrivePath string, ram int
|
|||
}
|
||||
} else {
|
||||
if fixedVHD {
|
||||
// We only end up in here with generation 1 vms, because gen 2 doesn't support VHDs
|
||||
templateString = templateString + `Hyper-V\New-VHD -Path $vhdPath -Fixed -SizeBytes {{ .NewVHDSizeBytes }}` + "\n"
|
||||
} else {
|
||||
templateString = templateString + `Hyper-V\New-VHD -Path $vhdPath -SizeBytes {{ .NewVHDSizeBytes }} -BlockSizeBytes {{ .VHDBlockSizeBytes }}` + "\n"
|
||||
}
|
||||
}
|
||||
|
||||
// Create new VM using the VHD you just made
|
||||
templateString = templateString + `Hyper-V\New-VM -Name {{ .VMName }} -Path {{ .Path }} -MemoryStartupBytes {{ .MemoryStartupBytes }} -VHDPath $vhdPath -SwitchName {{ .SwitchName }}`
|
||||
// Add optional tags to the end of the VM creation command
|
||||
if generation == 2 {
|
||||
templateString = templateString + ` -Generation {{ .Generation }}`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue