Bugzilla – Bug 623201
drbd xvd will fail in new xen4 packages due to wrong popen2 arguments in blkif.py
Last modified: 2010-09-21 15:28:21 UTC
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.6) Gecko/20100629 Mandriva Linux/1.9.2.6-0.1mdv2010.0 (2010.0) Firefox/3.6.6 Aften updating to newer xen4 rpms, e.g. xen-4.0.0_21091_05-70.1.x86_64 drbd virtual disks stopped working (getting error on xm create). The problem is in file /usr/lib64/python/site-packages/xen/util/blkif.py, line 84 The os.popen2() expects a single string, not a tuple or a list. I have fixed it following way: 84c84 < (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", "sh-dev", fn]) --- > (drbdadmstdin, drbdadmstdout) = os.popen2("/sbin/drbdadm "+"sh-dev "+fn) which works now. Anyway, the os.popen2() function is deprecated and should be replaced by subprocess module. Reproducible: Always Steps to Reproduce: 1.simply try to start pvm domU using drbd partitions 2. 3.
Thanks for the patch!
(In reply to comment #0) > User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.6) > Gecko/20100629 Mandriva Linux/1.9.2.6-0.1mdv2010.0 (2010.0) Firefox/3.6.6 > > Aften updating to newer xen4 rpms, e.g. xen-4.0.0_21091_05-70.1.x86_64 > drbd virtual disks stopped working (getting error on xm create). > > The problem is in file > /usr/lib64/python/site-packages/xen/util/blkif.py, line 84 > > The os.popen2() expects a single string, not a tuple or a list. > I have fixed it following way: > > 84c84 > < (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", > "sh-dev", fn]) > --- > > (drbdadmstdin, drbdadmstdout) = os.popen2("/sbin/drbdadm "+"sh-dev "+fn) > > which works now. Anyway, the os.popen2() function is deprecated and should be > replaced by subprocess module. > > Reproducible: Always > > Steps to Reproduce: > 1.simply try to start pvm domU using drbd partitions > 2. > 3. I created a drbd partition. Attach it to a xen4 domu in its config file as follows. "disk=[ 'phy:/dev/sda5,hda,w','phy:/dev/drbd12,hdb,w', ]" Run xm create [config file]. The domu was created successfully. I didn't got any error. My xen os is sles 11 sp1 x64. Did I reproduce this bug in correct way?
I don't understand what you are trying to do. For drbd partition you are supposed to use drbr:drbd_name, not phy: Otherwise domU migration wont work.
"disk=[ 'phy:/dev/sda5,hda,w','phy:/dev/drbd12,hdb,w', ]" means domu is install on /dev/sda5 and /dev/drbd12 is attached to domu as additional partition. Your domu reside on drdb partition?
Well, this bug was about broken drbd: partitions not phy: do to an error in python code. It has been fixed. So I don't understand your questions. Why are you trying to use phy: with a drbd partition on xen ? Thats not the case related to this bug. Further, you MUST use drbd: or live migration will never work. Please RTFM !!!
I am testing this patch and verifying the fix. I created a drbd partition with two machines. The partition is /dev/drbd12 on the two machines(dom0). I created a domu by "running xm create <conf file>" on one machine. The guest os image is on /dev/sda5 partition. The disk option in conf file is as follows ==================== kernel="/usr/lib/xen/boot/hvmloader" boot="c" disk=[ 'phy:/dev/sda5,hda,w','phy:/dev/drbd12,hdb,w', ] vif=[ 'mac=00:16:3e:7a:82:36,bridge=br0,model=rtl8139,type=netfront', ] ==================== The domu was created successfuly with on error. Then I changed disk option in conf file to disk=[ 'phy:/dev/sda5,hda,w','drbd:/dev/drbd12,hdb,w', ]. I got error: sled-11-sp1:/etc/xen/vm # xm create sled11 Using config file "./sled11". Error: Device 832 (vbd) could not be connected. /etc/xen/scripts/block failed; error detected. No difference after the patch was applied. I just need to know if these are the right steps to reproduce your bug or how to catch the bug? Thanks
The bug (in python code) was already fixed, it works ok. I can confirm it is fixed using your last xen-tools-4.0.0_21091_06-80.3.x86_64 from the repository. If you want/have to do testing of xen+drbd, it would be good to understand it / read the manuals and examples first. drbd has got very good documentation... Anyway, as I stated above, you have to use drbd:drbd_name. drbd_name is not the physical device, it is the resource name defined in your drbd.conf...
Further, you have to put all your partitions on drbd, live migration won't work if one is on phy and another on drbd. (But that is not relevant to reproduce this bug which happens already on 'xm create')
Update released for: virt-manager, vm-install, xen, xen-debugsource, xen-devel, xen-doc-html, xen-doc-pdf, xen-kmp, xen-kmp-default, xen-kmp-default-debuginfo, xen-kmp-desktop, xen-kmp-desktop-debuginfo, xen-kmp-pae, xen-kmp-pae-debuginfo, xen-libs, xen-libs-debuginfo, xen-tools, xen-tools-debuginfo, xen-tools-domU, xen-tools-domU-debuginfo Products: openSUSE 11.3 (debug, i586, x86_64)
Update released for: virt-manager, virt-manager-debuginfo, virt-manager-debugsource, vm-install, xen, xen-debuginfo, xen-debugsource, xen-devel, xen-doc-html, xen-doc-pdf, xen-kmp-debug, xen-kmp-default, xen-kmp-pae, xen-kmp-trace, xen-kmp-vmi, xen-libs, xen-tools, xen-tools-domU Products: SLE-DEBUGINFO 11-SP1 (i386, x86_64) SLE-DESKTOP 11-SP1 (i386, x86_64) SLE-SDK 11-SP1 (i386, x86_64) SLE-SERVER 11-SP1 (i386, x86_64)