Commit 13251ced authored by Mikhail Zholobov's avatar Mikhail Zholobov Committed by Rickard von Essen

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.
parent 280c3c52
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment