slavkap commented on a change in pull request #4773:
URL: https://github.com/apache/cloudstack/pull/4773#discussion_r598603409
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
##########
@@ -725,7 +725,7 @@ private String getDevLabel(int devId, DiskBus bus, boolean
forIso) {
} else if(devId >= 2) {
devId += 2;
}
- return (DiskBus.SATA == bus) ? "sdb" : "hd" +
getDevLabelSuffix(devId);
+ return (DiskBus.SATA == bus) ? "sd" + getDevLabelSuffix(devId) :
"hd" + getDevLabelSuffix(devId);
Review comment:
@DaanHoogland actually this is only applied only for SATA disks, and
without the change, the problem will appear when we deploy Windows VM from a
template with 2 disks.
```
<disk device='disk' type='file'>
<driver name='qemu' type='qcow2' cache='none' />
<source
file='/mnt/46aa22fc-815b-34cd-96fe-fb1f8fea2754/f28ed907-b9e4-46c2-b543-2b34f0140018'/>
<target dev='sda' bus='sata'/>
<serial>f28ed907b9e446c2b543</serial></disk>
<disk device='disk' type='file'>
<driver name='qemu' type='qcow2' cache='none' />
<source
file='/mnt/46aa22fc-815b-34cd-96fe-fb1f8fea2754/bb1c40f8-0867-4197-a1e7-3cef7da7f1e5'/>
<target dev='vdb' bus='virtio'/>
<serial>bb1c40f808674197a1e7</serial></disk>
<disk device='cdrom' type='file'>
<driver name='qemu' type='raw' />
<source file=''/>
<target dev='sda' bus='sata'/>
</disk>
```
`org.libvirt.LibvirtException: XML error: target 'sda' duplicated for disk
sources
'/mnt/46aa22fc-815b-34cd-96fe-fb1f8fea2754/f28ed907-b9e4-46c2-b543-2b34f0140018'
and '<null>'`
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]