Bug 237652 - vm.sh incorrectly assembles the command line arguments passed to xm in order to start virtual machines
Summary: vm.sh incorrectly assembles the command line arguments passed to xm in order ...
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rgmanager   
(Show other bugs)
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Lon Hohberger
QA Contact: Cluster QE
Depends On:
TreeView+ depends on / blocked
Reported: 2007-04-24 14:46 UTC by Jacques Botha
Modified: 2009-09-11 00:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-29 20:29:04 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

Description Jacques Botha 2007-04-24 14:46:06 UTC
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"


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 14:46:06 UTC
Created attachment 153356 [details]
Patch to fix vm.sh

Comment 2 Lon Hohberger 2007-05-29 20:29:04 UTC
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.


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"
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 20:31:17 UTC
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 17:19:11 UTC
Moving all RHCS ver 5 bugs to RHEL 5 so we can remove RHCS v5 which never existed.

Comment 5 Seb 2009-09-10 03:52:45 UTC
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 17:53:19 UTC
Yes, but that's because of the following:


Comment 7 Lon Hohberger 2009-09-10 17:54:56 UTC
There's a related patch in STABLE3 which adds 'xmlfile' for virsh support:


This is more like what the bugzilla submitter wanted I think.

Comment 8 Seb 2009-09-11 00:51:15 UTC
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!


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