Bug 674357

Summary: [vdsm] [libvirt] unable to start vm with vfd (floppy) disk - permission error
Product: Red Hat Enterprise Linux 6 Reporter: Haim <hateya>
Component: vdsmAssignee: Yotam Oron <yoron>
Status: CLOSED CURRENTRELEASE QA Contact: yeylon <yeylon>
Severity: high Docs Contact:
Priority: medium    
Version: 6.1CC: abaron, bazulay, bowe, danken, hateya, iheim, ilvovsky, mgoldboi, srevivo, yeylon
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: vdsm-4.9-52.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-19 15:10:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
vdsm log. none

Description Haim 2011-02-01 15:48:03 UTC
Created attachment 476422 [details]
vdsm log.

Description of problem:

can't start machine with vfd floppy, there is a permission error. 
the file should be readable also by qemu. 
see attached log. 

tested on:

vdsm-4.9-46.el6.x86_64
libvirt-0.8.7-3.el6.x86_64
qemu-kvm-0.12.1.2-2.129.el6.x86_64

-rw-r--r--. vdsm kvm system_u:object_r:nfs_t:s0      
/rhev/data-center/a8e3a5e0-1437-4dfb-9ac5-c6835227a074/56bc1515-cd7e-4e41-81c6-4f84ce2f75a2/images/11111111-1111-1111-1111-111111111111/virtio-win-1.1.16.vf

Thread-83::ERROR::2011-02-01
10:21:09,869::vm::636::vds.vmlog.e2abe5b9-0f5d-43d0-9b55-bb1ad054b343::(_startUnderlyingVm)
Traceback (most recent call last):
  File "/usr/share/vdsm/vm.py", line 606, in _startUnderlyingVm
    self._run()
  File "/usr/share/vdsm/libvirtvm.py", line 747, in _run
    self._connection.createXML(domxml, flags),
  File "/usr/share/vdsm/libvirtvm.py", line 1098, in wrapper
    raise e
libvirtError: internal error process exited while connecting to monitor: qemu:
could not open disk image
/rhev/data-center/a8e3a5e0-1437-4dfb-9ac5-c6835227a074
/56bc1515-cd7e-4e41-81c6-4f84ce2f75a2/images/11111111-1111-1111-1111-111111111111/virtio-win-1.1.16.vfd:
Permission denied


Thread-83::DEBUG::2011-02-01
10:21:09,871::vm::1752::vds.vmlog.e2abe5b9-0f5d-43d0-9b55-bb1ad054b343::(setDownStatus)
Changed state to Down: internal error proc
ess exited while connecting to monitor: qemu: could not open disk image
/rhev/data-center/a8e3a5e0-1437-4dfb-9ac5-c6835227a074/56bc1515-cd7e-4e41-81c6-4f84ce2f
75a2/images/11111111-1111-1111-1111-111111111111/virtio-win-1.1.16.vfd:
Permission denied

Comment 3 Dan Kenigsberg 2011-02-03 09:04:04 UTC
TestBlocker? Please!

chmod u-w /rhev/data-center/a8e3a5e0-1437-4dfb-9ac5-c6835227a074
/56bc1515-cd7e-4e41-81c6-4f84ce2f75a2/images/11111111-1111-1111-1111-111111111111/virtio-win-1.1.16.vfd

makes it goes away.

Comment 4 Yotam Oron 2011-02-24 12:05:24 UTC
we should check whether qemu process can write to the vfd and set <readonly/>  accordingly. We should probably first define a constant QEMU_PROCESS_USER = "qemu".

Comment 6 Haim 2011-03-08 14:19:07 UTC
managed to start vm with vfd: 

attached call create success response. 

Thread-5636::DEBUG::2011-03-08 16:03:25,186::clientIF::47::vds::(wrapper) return create with {'status': {'message': 'Done', 'code': 0}, 'vmList': {'cdrom': '/r
hev/data-center/4298f4ab-5638-4cc8-baeb-751e72ee5ef6/56bc1515-cd7e-4e41-81c6-4f84ce2f75a2/images/11111111-1111-1111-1111-111111111111/en_windows_7_enterprise_x
64_dvd_x15-70749.iso', 'bridge': 'rhevm', 'acpiEnable': 'true', 'emulatedMachine': 'rhel6.0.0', 'tabletEnable': 'true', 'pid': '0', 'transparentHugePages': 'fa
lse', 'displaySecurePort': '-1', 'spiceSslCipherSuite': 'DEFAULT', 'cpuType': 'Conroe', 'ifid': '10', 'custom': {}, 'executable': '/usr/libexec/qemu-kvm', 'mac
Addr': '00:1a:4a:16:90:48', 'boot': 'dcn', 'smp': '1', 'vmType': 'kvm', 'memSize': 512, 'smpCoresPerSocket': '1', 'vmName': 'iSCSI_RH_pool-54', 'spiceMonitors'
: '1', 'nice': '0', 'status': 'WaitForLaunch', 'floppy': '/rhev/data-center/4298f4ab-5638-4cc8-baeb-751e72ee5ef6/56bc1515-cd7e-4e41-81c6-4f84ce2f75a2/images/11
111111-1111-1111-1111-111111111111/virtio-win-1.1.16.vfd', 'vmId': '55753817-5555-4847-b21a-89d23f315bfd', 'displayIp': '0', 'drives': [{'domainID': '5c8c771a-
03e7-438b-aca4-11db17834426', 'format': 'cow', 'bus': '0', 'boot': 'true', 'volumeID': '43f1e40c-c073-4366-a49f-82c1d8ce356b', 'imageID': '4da7dbea-44e5-4c46-8
fd7-3a3953afc6e0', 'poolID': '4298f4ab-5638-4cc8-baeb-751e72ee5ef6', 'propagateErrors': 'off', 'if': 'virtio'}], 'displayPort': '-1', 'clientIp': '', 'nicModel
': 'pv', 'keyboardLayout': 'en-us', 'kvmEnable': 'true', 'soundDevice': 'ac97', 'timeOffset': '13', 'spiceSecureChannels': 'smain,sinputs', 'display': 'vnc'}}
Thread-5637::DEBUG::2011-03-08 16:03:25,190::clientIF::1082::vds::(memTestAndCommit) 55753817-5555-4847-b21a-89d23f315bfd: memAvailable 28008 memRequired 577 M
b

Comment 7 Bowe Strickland 2011-05-26 18:33:40 UTC
I'm seeing similar behaviour reading floppy image from NFS server... for some reason libvirt seems to want to chown the file qemu:qemu.

libvirt definition:

    <disk type='file' device='floppy'>
      <driver name='qemu' cache='none' io='threads'/>
      <source file='/net/instructor/var/ftp/pub/cloud/isos/floppy/rhevm_unattend.img'/>
      <target dev='fda' bus='fdc'/>
      <readonly/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' io='threads'/>
      <source file='/net/instructor/var/ftp/pub/cloud/isos/win_server_2008.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>

resulting virt-install error:

Thu, 26 May 2011 14:24:08 ERROR    unable to set user and group to '107:107' on '/net/instructor/var/ftp/pub/cloud/isos/floppy/rhevm_unattend.img': Invalid argument
Thu, 26 May 2011 14:24:08 DEBUG    Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 1079, in start_install
    dom = guest.start_install(conscb, meter, wait=wait_on_console)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1193, in start_install
    start_xml, final_xml, is_initial)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1252, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1341, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)


when floppy image is copied locally, it similarly fails on CD ISO image.  When both are copied locally, it works, but does in fact needlessly chown 0444 image files to qemu:qemu:

[root@vega ~]# ls -l /tmp/
total 2928012
...
-r--r--r--. 1 qemu qemu    1474560 May 26 14:21 rhevm_unattend.img
-r--r--r--. 1 qemu qemu 2996799488 May 26 14:22 win_server_2008.iso
...