A bit debugging for CD-ROM creation problems
This commit is contained in:
parent
483df213fd
commit
69e31bc126
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/vmware/govmomi/object"
|
||||
"github.com/vmware/govmomi/vim25/mo"
|
||||
"github.com/vmware/govmomi/vim25/types"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
@ -575,6 +576,7 @@ func (vm *VirtualMachine) AddCdrom(controllerType string, isoPath string) error
|
|||
devices.InsertIso(cdrom, isoPath)
|
||||
}
|
||||
|
||||
log.Printf("Creating CD-ROM on controller '%v' with iso '%v'", controller, isoPath)
|
||||
return vm.addDevice(cdrom)
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ func (s *StepAddCDRom) Run(_ context.Context, state multistep.StateBag) multiste
|
|||
if len(s.Config.ISOPaths) > 0 {
|
||||
for _, path := range s.Config.ISOPaths {
|
||||
if err := vm.AddCdrom(s.Config.CdromType, path); err != nil {
|
||||
state.Put("error", fmt.Errorf("error mounting an image: %v", err))
|
||||
state.Put("error", fmt.Errorf("error mounting an image '%v': %v", path, err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ func (s *StepAddCDRom) Run(_ context.Context, state multistep.StateBag) multiste
|
|||
|
||||
if path, ok := state.GetOk("iso_remote_path"); ok {
|
||||
if err := vm.AddCdrom(s.Config.CdromType, path.(string)); err != nil {
|
||||
state.Put("error", fmt.Errorf("error mounting an image: %v", err))
|
||||
state.Put("error", fmt.Errorf("error mounting an image '%v': %v", path, err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue