calvix commented on code in PR #14247:
URL: https://github.com/apache/cloudstack/pull/14247#discussion_r4250383347


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java:
##########
@@ -1544,10 +1544,19 @@ protected DiskDef.DiskBus getAttachDiskBusType(int 
deviceId, List<DiskDef> disks
             }
             if (disk.getBusType() == DiskDef.DiskBus.SCSI) {
                 return DiskDef.DiskBus.SCSI;
-            } else if (disk.getBusType() == DiskDef.DiskBus.VIRTIOBLK) {
-                return DiskDef.DiskBus.VIRTIOBLK;
             }
         }
+        if (deviceId != 0 && DiskDef.DiskBus.VIRTIOBLK == 
DiskDef.DiskBus.fromValue(
+                MapUtils.getString(controllerInfo, 
VmDetailConstants.ROOT_DISK_CONTROLLER))) {

Review Comment:
   It's the same thing scsi already does. On VM start, if a data disk has no 
dataDiskController set, it just takes the root disk's bus when that's scsi:
   
https://github.com/apache/cloudstack/blob/376c1b40174ab4b8d7f9aced5401143cbc09d587/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java#L3210-L3212
   
   I did the same for virtio-blk. If dataDiskController is set it wins, 
otherwise the data disk uses the root controller. On attach I have to read 
rootDiskController because the running VM shows virtio-blk disks as plain 
virtio, so I can't pick it up from the existing disks like it works for scsi.
   



-- 
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]

Reply via email to