diff --git a/pkg/multicloud/esxi/host.go b/pkg/multicloud/esxi/host.go index 609d504145..c4232fc877 100644 --- a/pkg/multicloud/esxi/host.go +++ b/pkg/multicloud/esxi/host.go @@ -795,7 +795,8 @@ func (self *SHost) DoCreateVM(ctx context.Context, ds *SDatastore, params SCreat index = ideIdx % 2 ideIdx += 1 } - log.Debugf("size: %d, image path: %s, uuid: %s, index: %d, ctrlKey: %d", size, imagePath, uuid, index, ctrlKey) + log.Debugf("size: %d, image path: %s, uuid: %s, index: %d, ctrlKey: %d, driver: %s.", size, imagePath, uuid, + index, ctrlKey, disk.Driver) spec := addDevSpec(NewDiskDev(size, imagePath, uuid, int32(index), 2000, int32(ctrlKey))) spec.FileOperation = "create" deviceChange = append(deviceChange, spec) diff --git a/pkg/multicloud/esxi/vdisk.go b/pkg/multicloud/esxi/vdisk.go index 39cc7008be..74965e9574 100644 --- a/pkg/multicloud/esxi/vdisk.go +++ b/pkg/multicloud/esxi/vdisk.go @@ -270,7 +270,10 @@ func (disk *SVirtualDisk) GetDriver() string { controller := disk.vm.getVdev(disk.getControllerKey()) name := controller.GetDriver() name = strings.Replace(name, "controller", "", -1) - return driverMap[name] + if driver, ok := driverMap[name]; ok { + return driver + } + return name } func (disk *SVirtualDisk) GetCacheMode() string {