Bug 214908

Summary: Concurrent-access flag is not provided via libvirt's virDomainGetXMLDesc()
Product: Red Hat Enterprise Linux 5 Reporter: Lon Hohberger <lhh>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 5.0CC: berrange, kanderso, mspqa-list, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: beta2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-23 02:27:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
xm list --long of domain running w/ the w! flag.
none
patch to support shrareable disks none

Description Lon Hohberger 2006-11-09 22:29:36 UTC
Config File:
---------------------------------------------
# Automatically generated xen config file
name = "kanderso-xen-22"
memory = "1024"
disk = [ 'phy:/dev/RootVolumes/Node2-02,xvda,w',
'phy:/dev/RootVolumes/ClusterFS0,xvdb,w!' ]

# ^ xvdb is a shared disk image; note the ! flag.

vif = [ 'mac=02:10:15:84:00:22, bridge=xenbr0', ]
nographic=1
bootloader="/usr/bin/pygrub"
vcpus=1
on_reboot   = 'restart'
on_crash    = 'restart'
----------------------------------------------

Error Messages
----------------------------------------------

Rebooting domain kanderso-xen-22...
[[ XML Domain Info ]]
<domain type='xen' id='107'>
  <name>kanderso-xen-22</name>
  <uuid>0ac92eac79a37a1b541bd83d55ecb4c4</uuid>
  <bootloader>/usr/bin/pygrub</bootloader>
  <os>
    <type>linux</type>
    <kernel>/var/lib/xen/vmlinuz.Q8oxJB</kernel>
    <initrd>/var/lib/xen/initrd.ILqJte</initrd>
    <cmdline>ro root=/dev/VolGroup00/LogVol00 console=xvc0 rhgb quiet</cmdline>
  </os>
  <memory>1048576</memory>
  <vcpu>1</vcpu>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <interface type='bridge'>
      <source bridge='xenbr0'/>
      <mac address='02:10:15:84:00:22'/>
      <script path='vif-bridge'/>
    </interface>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/RootVolumes/Node2-02'/>
      <target dev='xvda'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/RootVolumes/ClusterFS0'/>
      <target dev='xvdb'/>
    </disk>
    <console tty='/dev/pts/5'/>
  </devices>
</domain>

[[ XML END ]]
Clearing 212 bytes starting @ 0x6296d9
[[ XML Domain Info (modified) ]]
<domain type='xen' id='107'>
  <name>kanderso-xen-22</name>
  <uuid>0ac92eac79a37a1b541bd83d55ecb4c4</uuid>
  <bootloader>/usr/bin/pygrub</bootloader>
                                                                               
                                                                               
                                                      
  <memory>1048576</memory>
  <vcpu>1</vcpu>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <interface type='bridge'>
      <source bridge='xenbr0'/>
      <mac address='02:10:15:84:00:22'/>
      <script path='vif-bridge'/>
    </interface>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/RootVolumes/Node2-02'/>
      <target dev='xvda'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/RootVolumes/ClusterFS0'/>
      <target dev='xvdb'/>
    </disk>
    <console tty='/dev/pts/5'/>
  </devices>
</domain>

[[ XML END ]]
Calling virDomainDestroy
libvir: Xen Daemon error : GET operation failed: No such domain kanderso-xen-22
Domain no longer exists
Calling virDomainCreateLinux()...
libvir: Xen Daemon error : POST operation failed: (xend.err 'Device 51728 (vbd)
could not be connected.\nDevice /dev/RootVolumes/ClusterFS0 is mounted in a
guest domain,\nand so cannot be mounted now.')
Failed to get devices for domain kanderso-xen-22


Expected results:  Flag in XML description returned from virDomainGetXMLDesc()
which indicates that the disk image is allowed to be used by more than one
domain simultaneously (corresponding to the ! flag in the configuration).  This
should eliminate the error incurred.

Additional info:  'xm create' always works correctly.

Comment 1 Lon Hohberger 2006-11-09 22:33:03 UTC
Created attachment 140848 [details]
xm list --long of domain running w/ the w! flag.

Comment 2 Kiersten (Kerri) Anderson 2006-11-09 22:36:05 UTC
Adding blocker flags for GA release.  Not having this capability requires
operator intervention after node failures in a cluster.  This will block full
verification and recovery testing in a virtual environment.

Comment 3 Daniel Berrangé 2006-11-09 22:37:57 UTC
Ok, so we currently just check the (mode)  bit of the sexpression for 'r' to
signify read-only - assuming that the only other value was 'w' for writable. It
appears we have an extra option to deal with:

            (mode 'w!')

We need to check for that, and then probably add a '<sharable>' element in the
disk specification, eg


 <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/RootVolumes/ClusterFS0'/>
      <target dev='xvdb'/>
      <sharable/>
 </disk>


Comment 4 Daniel Veillard 2006-11-10 13:35:24 UTC
Easy enough, I have an early patch, attached, not yet commited I need to add
regression tests first, getting it upstream is no brainer, getting it in RHEL5
is another piece of cake !

Daniel

Comment 5 Daniel Veillard 2006-11-10 13:36:34 UTC
Created attachment 140884 [details]
patch to support shrareable disks

Comment 6 Daniel Veillard 2006-11-22 14:02:58 UTC
patch has been commited in libvirt upstream,

Daniel

Comment 7 Jay Turner 2006-12-01 14:12:27 UTC
QE ack for RHEL5 . . . comment 2 pretty well sums things up.

Comment 8 Daniel Veillard 2006-12-04 15:38:43 UTC
libvirt-0.1.8-3.el5 has been built with the fix to test,

Daniel

Comment 9 RHEL Program Management 2006-12-23 02:27:00 UTC
A package has been built which should help the problem described in 
this bug report. This report is therefore being closed with a resolution 
of CURRENTRELEASE. You may reopen this bug report if the solution does 
not work for you.