Bug 795093 - [libvirt] missing 'source file' attribute when passing 'optional' param in xml
[libvirt] missing 'source file' attribute when passing 'optional' param in xml
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
unspecified Severity urgent
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
: TestBlocker
: 796637 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-19 05:22 EST by Haim
Modified: 2014-01-12 19:51 EST (History)
17 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:48:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libvirt logs (643.04 KB, text/plain)
2012-02-19 07:02 EST, Haim
no flags Details

  None (edit)
Description Haim 2012-02-19 05:22:44 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'
Comment 1 Haim 2012-02-19 07:02:26 EST
Created attachment 564175 [details]
libvirt logs

attached libvirt log contains starting of new vm with cd attached
Comment 3 Dan Kenigsberg 2012-02-22 03:50:14 EST
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
Comment 4 Dan Kenigsberg 2012-02-22 03:58:08 EST
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().
Comment 10 Jiri Denemark 2012-02-23 06:26:55 EST
*** Bug 796637 has been marked as a duplicate of this bug. ***
Comment 13 weizhang 2012-02-29 01:59:46 EST
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>
Comment 15 errata-xmlrpc 2012-06-20 02:48:33 EDT
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

Note You need to log in before you can comment on or make changes to this bug.