Bug 623201 - drbd xvd will fail in new xen4 packages due to wrong popen2 arguments in blkif.py
Summary: drbd xvd will fail in new xen4 packages due to wrong popen2 arguments in blki...
Status: VERIFIED FIXED
Alias: None
Product: openSUSE 11.2
Classification: openSUSE
Component: Xen (show other bugs)
Version: Final
Hardware: All openSUSE 11.2
: P5 - None : Major with 1 vote (vote)
Target Milestone: ---
Assignee: Charles Arnold
QA Contact: Jason Douglas
URL:
Whiteboard: maint:released:11.3:35306 maint:relea...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-17 11:50 UTC by Samuel Kvasnica
Modified: 2010-09-21 15:28 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Kvasnica 2010-07-17 11:50:47 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.
Comment 1 Charles Arnold 2010-07-20 19:55:27 UTC
Thanks for the patch!
Comment 2 Tony Yuan 2010-09-10 08:55:40 UTC
(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?
Comment 3 Samuel Kvasnica 2010-09-10 11:06:46 UTC
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.
Comment 4 Tony Yuan 2010-09-13 09:51:20 UTC
 "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?
Comment 5 Samuel Kvasnica 2010-09-13 12:02:11 UTC
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 !!!
Comment 6 Tony Yuan 2010-09-15 10:02:24 UTC
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
Comment 7 Samuel Kvasnica 2010-09-15 10:14:56 UTC
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...
Comment 8 Samuel Kvasnica 2010-09-15 10:17:31 UTC
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')
Comment 9 Swamp Workflow Management 2010-09-20 11:17:20 UTC
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)
Comment 10 Swamp Workflow Management 2010-09-21 15:28:21 UTC
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)