From f8e3970d87f61987f8090acd2447d621a1f22799 Mon Sep 17 00:00:00 2001 From: Taliesin Sisson Date: Sat, 7 Nov 2015 16:20:55 +0000 Subject: [PATCH] By default a gen 1 vm get a dvd drive. Remove it on creation so that it behaves the same as gen 2. --- powershell/hyperv/hyperv.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/powershell/hyperv/hyperv.go b/powershell/hyperv/hyperv.go index e26e432cb..0d86d441c 100644 --- a/powershell/hyperv/hyperv.go +++ b/powershell/hyperv/hyperv.go @@ -215,7 +215,12 @@ New-VM -Name $vmName -Path $path -MemoryStartupBytes $memoryStartupBytes -NewVHD ` var ps powershell.PowerShellCmd err := ps.Run(script, vmName, path, strconv.FormatInt(ram, 10), strconv.FormatInt(diskSize, 10), switchName) - return err + + if err != nil { + return err + } + + return DeleteDvdDrive(vmName, 1, 0) } }