mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-21 01:27:15 +08:00
fix(esxi): Fix GetDriver and add driver log for vdisk.
In GetDriver, return 'name' directly if driverMap is empty.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user