Red Hat Bugzilla – Bug 795093
[libvirt] missing 'source file' attribute when passing 'optional' param in xml
Last modified: 2014-01-12 19:51:10 EST
Description of problem: missing 'source dev' attribute when passing 'optional' param in XML with regardless wither source-dev exists or not. xml: <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source startupPolicy='optional'/> <target dev='hdc' bus='ide'/> <readonly/> <serial></serial> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> log (vdsm): Thread-221::ERROR::2012-02-19 09:59:17,807::utils::399::vm.Vm::(collect) vmId=`2aed27de-bc3f-40cb-85b3-1839f8e38279`::Stats function failed: <AdvancedStatsFunction _sampleDiskLatency at 0x207a7a0> Traceback (most recent call last): File "/usr/share/vdsm/utils.py", line 395, in collect statsFunction() File "/usr/share/vdsm/utils.py", line 272, in __call__ retValue = self._function(*args, **kwargs) File "/usr/share/vdsm/libvirtvm.py", line 158, in _sampleDiskLatency diskLatency[vmDrive.name] = stats[vmDrive.alias] AttributeError: 'Drive' object has no attribute 'alias'
Created attachment 564175 [details] libvirt logs attached libvirt log contains starting of new vm with cd attached
domain was started with <disk device="cdrom" snapshot="no" type="file"> <source file="/rhev/data-center/2319b7ff-09f6-488c-83c4-aa78139db3b4/019d4b6f-5450-4eb6-80ee-c63ea062de49/images/11111111-1111-1111-1111-111111111111/en_windows_7_enterprise_x64_dvd_x15-70749.iso" startupPolicy="optional"/> <target bus="ide" dev="hdc"/> <serial></serial> </disk> the source file is accessible on the nfs mount. However, libvirt claims 2012-02-19 11:54:41.779+0000: 22269: debug : qemuDomainCheckDiskPresence:1634 : Dropping disk 'hdc' on domain 'xtream-vm-001' (UUID 'f9ea04b0-1a1e-4793-870f-b3b1f8b6c6e4') due to inaccessible source '/rhev/data-center/2319b7ff-09f6-488c-83c4-aa78139db3b4/019d4b6f-5450-4eb6-80ee-c63ea062de49/images/11111111-1111-1111-1111-111111111111/en_windows_7_enterprise_x64_dvd_x15-70749.iso' and drops the "file" attribute from the <source> element. If startupPolicy="optional" is dropped, the domain starts up fine. libvirt-0.9.9-1.fc16.x86_64
note also that libvirt's behaviour is inconsistent with the case of starting with an empty cdrom. There, the <source> element is completely dropped from XMLDesc().
Moving to POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-February/msg01258.html
*** Bug 796637 has been marked as a duplicate of this bug. ***
Verify pass on libvirt-0.9.10-3.el6.x86_64 qemu-kvm-0.12.1.2-2.232.el6.x86_64 kernel-2.6.32-225.el6.x86_64 When cdrom image exists, start guest and dump running domain xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/cdrom.img' startupPolicy='optional'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> when cdrom image does not exist, start guest and dump running domain xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source startupPolicy='optional'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk>
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html