VMs with invalid IDE configuration when using Solidfire as primary storage
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
Domain XML with multiple disks attached using Solidfire primary storage
CLOUDSTACK VERSION
Master branch
OS / ENVIRONMENT
Solidfire primary storage
SUMMARY
Example: When we select "Windows Server 2016 (64-bit)" as OS Type for an W2K16 cd image the resulting VMs will not start with multiple disks attached. This is due to the usage of multiple IDE interfaces in the VM description XML.
It seems this is not just a problem with this OS Type but with the way the domain XMLs are generated when using solidfire storage.
This only happens when the disks are on Solidfire primary storage. We confirmed that using NFS primary storage this is not the case.
STEPS TO REPRODUCE
Try to use boot a VM with at least two disks on solidfire primary storage. Depending on the OS-Type that is selected for the image that was used to create the VM, the domain xml generated may be invalid.
In our case we tested this with a W2K16 vm which will not start when using OS Type "Windows Server 2016 (64-bit)". Libvirt does not boot the machine and raise the following error message:
org.libvirt.LibvirtException: unsupported configuration: Only a single IDE controller is supported for this machine type
Logs & Attachments
Here you can see two excerpts from the generated domain xmls. First the working one (NFS) and below that the one not working (Solidfire).
NFS Primary Storage
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/mnt/e0e5ba2b-15bc-3fd8-a010-40a404c3cdfc/2f4ddade-b93e-47c5-b97f-b738f395d9e1'/>
<backingStore/>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/mnt/43c36bb7-1d8d-3405-b9b8-ddd402ef7913/215-34-015cecb6-7c65-3a37-80da-fde928458db4.iso'/>
<backingStore/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/mnt/e0e5ba2b-15bc-3fd8-a010-40a404c3cdfc/49e52a7f-1bfb-4034-ad81-1efacb402b24'/>
<backingStore/>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/mnt/e0e5ba2b-15bc-3fd8-a010-40a404c3cdfc/3b1c3083-6775-4c21-889a-0f80af9b2fc0'/>
<backingStore/>
<target dev='vdc' bus='virtio'/>
<serial>xxxxxxxxxxxxxxxx</serial>
<alias name='virtio-disk2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
Solidfire Primary Storage
<disk device='disk' type='block'>
<driver name='qemu' type='raw' cache='none' />
<source dev='/dev/disk/by-path/ip-10.xx.xx.230:3260-iscsi-iqn.2010-01.com.solidfire:nhjj.root-323.127-lun-0'/>
<target dev='hda' bus='ide'/>
</disk>
<disk device='disk' type='block'>
<driver name='qemu' type='raw' cache='none' />
<source dev='/dev/disk/by-path/ip-10.xx.xx.230:3260-iscsi-iqn.2010-01.com.solidfire:nhjj.testplatte1-sf.128-lun-0'/>
<target dev='hdb' bus='ide'/>
</disk>
<disk device='disk' type='block'>
<driver name='qemu' type='raw' cache='none' />
<source dev='/dev/disk/by-path/ip-10.xx.xx.230:3260-iscsi-iqn.2010-01.com.solidfire:nhjj.testplatte2-sf.129-lun-0'/>
<target dev='hde' bus='ide'/>
</disk>
<disk device='cdrom' type='file'>
<driver name='qemu' type='raw' />
<source file='/mnt/c0aa527c-017e-3cca-b6b8-4b6055b0d03a/219-2-5d32553d-5dc1-3ad5-9275-1ff0ad5c7efc.iso'/>
<target dev='hdc' bus='ide'/>
</disk>
Logfile excerpt
2018-12-07 15:04:07,604 DEBUG [resource.wrapper.LibvirtStartCommandWrapper] (agentRequest-Handler-4:null) (logid:faa09e72) starting i-61-323-VM: <domain type='kvm'>
<name>i-61-323-VM</name>
<uuid>33fc81ae-68a6-4723-9335-f9bf2c611b71</uuid>
<description>Windows Server 2016 (64-bit)</description>
<cpu mode='host-model'><model fallback='allow'></model><topology sockets='1' cores='4' threads='1' /></cpu><sysinfo type='smbios'>
<system>
<entry name='manufacturer'>Apache Software Foundation</entry>
<entry name='product'>CloudStack KVM Hypervisor</entry>
<entry name='uuid'>33fc81ae-68a6-4723-9335-f9bf2c611b71</entry>
</system>
</sysinfo>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
<smbios mode='sysinfo'/>
</os>
<on_reboot>restart</on_reboot>
<on_poweroff>destroy</on_poweroff>
<on_crash>destroy</on_crash>
<memory>16777216</memory>
<devices>
<memballoon model='none'/>
</devices>
<vcpu>4</vcpu>
<features>
<pae/>
<apic/>
<acpi/>
</features>
<cputune>
<shares>2664</shares>
</cputune>
<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup' >
</timer>
</clock>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<watchdog model='i6300esb' action='none'/>
<console type='pty'>
<target port='0'/>
</console>
<disk device='disk' type='block'>
<driver name='qemu' type='raw' cache='none' />
<source dev='/dev/disk/by-path/ip-10.xx.xx.230:3260-iscsi-iqn.2010-01.com.solidfire:nhjj.root-323.127-lun-0'/>
<target dev='hda' bus='ide'/>
<serial>xxxxxxxxxxxxxxxxxxxx</serial></disk>
<disk device='disk' type='block'>
<driver name='qemu' type='raw' cache='none' />
<source dev='/dev/disk/by-path/ip-10.xx.xx.230:3260-iscsi-iqn.2010-01.com.solidfire:nhjj.testplatte1-sf.128-lun-0'/>
<target dev='hdb' bus='ide'/>
<serial>xxxxxxxxxxxxxxxxxxxx</serial></disk>
<disk device='disk' type='block'>
<driver name='qemu' type='raw' cache='none' />
<source dev='/dev/disk/by-path/ip-10.xx.xx.230:3260-iscsi-iqn.2010-01.com.solidfire:nhjj.testplatte2-sf.129-lun-0'/>
<target dev='hde' bus='ide'/>
<serial>xxxxxxxxxxxxxxxx</serial></disk>
<disk device='cdrom' type='file'>
<driver name='qemu' type='raw' />
<source file='/mnt/c0aa527c-017e-3cca-b6b8-4b6055b0d03a/219-2-5d32553d-5dc1-3ad5-9275-1ff0ad5c7efc.iso'/>
<target dev='hdc' bus='ide'/>
</disk>
<serial type='pty'>
<target port='0'/>
</serial>
<graphics type='vnc' autoport='yes' listen='xxxxxxxxxxxx' passwd='xxxxxxxxxxxxxxxxxxxxx'/>
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/i-61-323-VM.org.qemu.guest_agent.0'/>
<address type='virtio-serial'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
<rng model='virtio'>
<rate period='1000' bytes='2048' />
<backend model='random'>/dev/random</backend></rng>
<input type='tablet' bus='usb'/>
<interface type='bridge'>
<source bridge='xxxxxxxx'/>
<mac address='xxxxxxxxxxxxxxx'/>
<model type='e1000'/>
<bandwidth>
<inbound average='25600' peak='25600'/>
<outbound average='25600' peak='25600'/>
</bandwidth>
<virtualport type='openvswitch'>
</virtualport>
<vlan trunk='no'>
<tag id='xxxx'/>
</vlan><link state='up'/>
</interface>
</devices>
</domain>
2018-12-07 15:04:07,609 WARN [resource.wrapper.LibvirtStartCommandWrapper] (agentRequest-Handler-4:null) (logid:faa09e72) LibvirtException
org.libvirt.LibvirtException: unsupported configuration: Only a single IDE controller is supported for this machine type
at org.libvirt.ErrorHandler.processError(Unknown Source)
at org.libvirt.Connect.processError(Unknown Source)
at org.libvirt.Connect.processError(Unknown Source)
at org.libvirt.Connect.domainCreateXML(Unknown Source)
at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.startVM(LibvirtComputingResource.java:1413)
at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStartCommandWrapper.execute(LibvirtStartCommandWrapper.java:84)
at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStartCommandWrapper.execute(LibvirtStartCommandWrapper.java:46)
at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:1445)
at com.cloud.agent.Agent.processRequest(Agent.java:644)
at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:1082)
at com.cloud.utils.nio.Task.call(Task.java:83)
at com.cloud.utils.nio.Task.call(Task.java:29)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2018-12-07 15:04:07,609 DEBUG [kvm.storage.KVMStoragePoolManager] (agentRequest-Handler-4:null) (logid:faa09e72) Disconnecting disk /iqn.2010-01.com.solidfire:nhjj.root-323.127/0
@andrijapanic I'm with you on this. Would be much better to explicitely choose controller and NIC. Also it would be much better to allow choosing in a VM-centric manner.
As of now if you hit any problem and change the OS-type of a template (or iso) you also change the hardware-configuration of any VM that has this template/ISO configured. At first noone will notice this but if you shutdown an affected VM and start it, its MAC address (we had this) and IDE/SCSI configuration will have changed.
This seems to be not intended like this
Em... just for sake of completeness... incidentally, was playing a lot last for 2 days with different controller types on different HV....
So for KVM @kiwiflyer - you can ALREADY (4.11.2) choose ide/scsi/virtio/virtio-scsi as the disk controller types - and FYI all data disks are attached to same virtio or scsi/virtio-scsi (both rscsi and virtio-scsi results in virtio-scsi being used, a.k.a. new controller type) - all disk (root/data) on same controller.
Reference: @skattoju4 & @syed