Bug 237652 - vm.sh incorrectly assembles the command line arguments passed to xm in order to start virtual machines
vm.sh incorrectly assembles the command line arguments passed to xm in order ...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rgmanager (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Lon Hohberger
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-24 10:46 EDT by Jacques Botha
Modified: 2009-09-10 20:51 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-29 16:29:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to fix vm.sh (447 bytes, patch)
2007-04-24 10:46 EDT, Jacques Botha
no flags Details | Diff

  None (edit)
Description Jacques Botha 2007-04-24 10:46:06 EDT
Description of problem:

/usr/share/cluster/vm.sh incorrectly assembles the command line arguments passed
to xm (xen)  to start a virtual machine

Version-Release number of selected component (if applicable): 2.0.23-1

How reproducible: Always

Steps to Reproduce:
1. clusvcadm -e vm:testvm1
  
Actual results:
It fails with a "generic error"

Apr 18 12:07:39 base1 clurgmgrd[4024]: <notice> start on vm "testvm1" returned 1
(generic error) 
Apr 18 12:07:39 base1 clurgmgrd[4024]: <warning> #68: Failed to start
vm:testvm1; return value: 1 
Apr 18 12:07:39 base1 clurgmgrd[4024]: <notice> Stopping service vm:testvm1 


Expected results:
Apr 18 12:07:40 base1 clurgmgrd[25585]: <notice> Service vm:testvm1 started

Additional info:

xm expects its arguments in the following way :
xm <subcommand> [args]
create [-c] configfile [name=value]..

vm.sh tries to pass xm:

xm create testvm1 restart="never" --path="/etc/xen/testvm1"

what vm.sh _should_ have passed:

xm create "/etc/xen/testvm1" restart="never"

Faults:

1) vm.sh _pre-appends_ the virtual machine name to the arguments.  xm does not
understand this in that position

2) vm.sh _appends_  --path=  to the arguments.  xm does not understand --path=

3) vm.sh incorrectly puts the  restart="never"  argument _before_ the configfile
argument.  xm does not expect it in that position

The attached patch fixed it for me.
Comment 1 Jacques Botha 2007-04-24 10:46:06 EDT
Created attachment 153356 [details]
Patch to fix vm.sh
Comment 2 Lon Hohberger 2007-05-29 16:29:04 EDT
The --path option (path in cluster.conf) should be a directory separated by
colons.  It does work, despite not being in the man page, and it is not directly
analogous to the path="xxx" Xen config file option.

Example:

I created a bogus xen config file called "foo" and put it in /etc/xen and /tmp.
 Then, I called xm create foo --path="/mnt:/tmp".  It selected the entry in /tmp
and not /etc/xen (I did not place the entry in /mnt).


[root@marge ~]# xm create foo --path="/mnt:/tmp"
Using config file "/tmp/foo".
Error: Invalid disk specifier: /dev/null,w
[root@marge ~]# cat /tmp/foo
# Automatically generated xen config file
name = "foo"
memory = "500"
disk = [ '/dev/null,w', ]
vif = [ 'mac=00:16:3e:32:0b:ff, bridge=xenbr0', ]
vfb = ["type=vnc,vncunused=1"]
uuid = "2287fbd8-75ab-5972-300f-37200e713c20"
bootloader="/usr/bin/pygrub"
vcpus=1
on_reboot   = 'restart'
on_crash    = 'restart'
[root@marge ~]# ls -l /tmp/foo
-rw-r--r-- 1 root root 308 May 29 16:05 /tmp/foo
[root@marge ~]# ls -l /etc/xen/foo
-rw-r--r-- 1 root root 308 May 29 16:05 /etc/xen/foo
[root@marge ~]# 


Comment 3 Lon Hohberger 2007-05-29 16:31:17 EDT
That is - change your "path" attribute in cluster.conf to "/etc/xen" (or delete
the path attribute entirely) and it will work.
Comment 4 Nate Straz 2007-12-13 12:19:11 EST
Moving all RHCS ver 5 bugs to RHEL 5 so we can remove RHCS v5 which never existed.
Comment 5 Seb 2009-09-09 23:52:45 EDT
So does this mean that the only place you can put your vm config file is /etc/xen?
Comment 6 Lon Hohberger 2009-09-10 13:53:19 EDT
Yes, but that's because of the following:

https://bugzilla.redhat.com/show_bug.cgi?id=519786
Comment 7 Lon Hohberger 2009-09-10 13:54:56 EDT
There's a related patch in STABLE3 which adds 'xmlfile' for virsh support:

http://git.fedorahosted.org/git/?p=cluster.git;a=commit;h=ea90559c936792e22576cac7a0bd0a2a50573426

This is more like what the bugzilla submitter wanted I think.
Comment 8 Seb 2009-09-10 20:51:15 EDT
Thanks a lot Lon.
I did not think I would get a reply for this post, as it was last updated in 2007.
I spent a lot of time trying to figure out why the vm would not start when using Luci. 
Luci is a good tool but I think it needs a lot of work before it can be called enterprise. Specially in reporting back errors.
In any case good work!

Regards
Sebastian

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