winterhazel commented on code in PR #9433:
URL: https://github.com/apache/cloudstack/pull/9433#discussion_r1688382930
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -4650,16 +4650,25 @@ private void updateVMDiskController(UserVmVO vm,
Map<String, String> customParam
vm.setDetail(VmDetailConstants.DATA_DISK_CONTROLLER,
dataDiskControllerSetting);
}
- String controllerSetting =
StringUtils.defaultIfEmpty(_configDao.getValue(Config.VmwareRootDiskControllerType.key()),
- Config.VmwareRootDiskControllerType.getDefaultValue());
-
// Don't override if VM already has root/data disk controller
detail
if (vm.getDetail(VmDetailConstants.ROOT_DISK_CONTROLLER) == null) {
- vm.setDetail(VmDetailConstants.ROOT_DISK_CONTROLLER,
controllerSetting);
+ String vmwareRootDiskControllerTypeFromSetting =
StringUtils.defaultIfEmpty(_configDao.getValue(Config.VmwareRootDiskControllerType.key()),
+ Config.VmwareRootDiskControllerType.getDefaultValue());
+ vm.setDetail(VmDetailConstants.ROOT_DISK_CONTROLLER,
vmwareRootDiskControllerTypeFromSetting);
+ if (vm.getDetail(VmDetailConstants.DATA_DISK_CONTROLLER) ==
null) {
+ if
(vmwareRootDiskControllerTypeFromSetting.equalsIgnoreCase("scsi")) {
+ vm.setDetail(VmDetailConstants.DATA_DISK_CONTROLLER,
"scsi");
+ }
+ }
Review Comment:
Are those lines necessary?
In the condition below, if the `dataDiskController` detail is null, and the
`rootDiskController` is a SCSI controller, we're already updating
`dataDiskController` to match `rootDiskController`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]