Delete SATA controller

This commit is contained in:
Michael Kuzmin 2018-05-07 10:20:27 +03:00
parent f46f373e3a
commit 8bdebe65a4
1 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,13 @@ func (s *StepRemoveCDRom) Run(_ context.Context, state multistep.StateBag) multi
return multistep.ActionHalt
}
ui.Say("Deleting SATA controller...")
sata := devices.SelectByType((*types.VirtualAHCIController)(nil))
if err = vm.RemoveDevice(true, sata...); err != nil {
state.Put("error", err)
return multistep.ActionHalt
}
return multistep.ActionContinue
}