From 8bdebe65a4205395a5aea5ec63d9993762171468 Mon Sep 17 00:00:00 2001 From: Michael Kuzmin Date: Mon, 7 May 2018 10:20:27 +0300 Subject: [PATCH] Delete SATA controller --- iso/step_remove_cdrom.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iso/step_remove_cdrom.go b/iso/step_remove_cdrom.go index b72c714e8..4d41811b2 100644 --- a/iso/step_remove_cdrom.go +++ b/iso/step_remove_cdrom.go @@ -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 }