builder/parallels: Added setting the boot order
CD/DVD drive with installation ISO should be exactly the 2nd device in the VM boot order. This ensures that VM will boot from this ISO at the first boot time only.
This commit is contained in:
parent
280c3c52de
commit
13251ced49
|
@ -29,7 +29,6 @@ func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction {
|
|||
|
||||
// Attach the disk to the controller
|
||||
ui.Say("Attaching ISO to the new CD/DVD drive...")
|
||||
|
||||
cdrom, err := driver.DeviceAddCdRom(vmName, isoPath)
|
||||
|
||||
if err != nil {
|
||||
|
@ -39,6 +38,19 @@ func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction {
|
|||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
ui.Say("Setting the boot order...")
|
||||
command := []string{
|
||||
"set", vmName,
|
||||
"--device-bootorder", fmt.Sprintf("hdd0 %s cdrom0 net0", cdrom),
|
||||
}
|
||||
|
||||
if err := driver.Prlctl(command...); err != nil {
|
||||
err := fmt.Errorf("Error setting the boot order: %s", err)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
// Track the device name so that we can can delete later
|
||||
s.cdromDevice = cdrom
|
||||
|
||||
|
|
Loading…
Reference in New Issue