Add comment explaining a section

This commit is contained in:
Fabricio Duarte 2025-07-29 22:31:11 -03:00
parent 1913e537c8
commit bb819b6c6b
1 changed files with 8 additions and 0 deletions

View File

@ -2101,6 +2101,14 @@ public class VmwareStorageProcessor implements StorageProcessor {
AttachAnswer answer = new AttachAnswer(disk);
if (isAttach) {
// Let's first find which disk controller should be used for the volume being attached.
//
// `controllerInfo` can not be null here. It is always defined when creating the `AttachComand` in
// `com.cloud.storage.VolumeApiServiceImpl#sendAttachVolumeCommand`.
//
// If `VmDetailConstants.ROOT_DISK_CONTROLLER` or `VmDetailConstants.DATA_DISK_CONTROLLER` are not present
// in `controllerInfo`, `com.cloud.hypervisor.vmware.util.VmwareHelper#getDiskControllersFromVmSettings`
// will return default values.
String rootDiskControllerDetail = controllerInfo.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
String dataDiskControllerDetail = controllerInfo.get(VmDetailConstants.DATA_DISK_CONTROLLER);
Pair<DiskControllerMappingVO, DiskControllerMappingVO> specifiedDiskControllers = VmwareHelper.getDiskControllersFromVmSettings(rootDiskControllerDetail, dataDiskControllerDetail, false);