Bug 412911 - Convert all XM management calls to either lib virt or virsh
Convert all XM management calls to either lib virt or virsh
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rgmanager (Show other bugs)
All Linux
medium Severity medium
: alpha
: ---
Assigned To: Lon Hohberger
Cluster QE
: 303111 303201 488024 (view as bug list)
Depends On:
Blocks: 479737 499835
  Show dependency treegraph
Reported: 2007-12-05 16:01 EST by Scott Crenshaw
Modified: 2010-10-22 16:58 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 07:04:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
virsh based vm.sh (10.83 KB, application/x-sh)
2009-04-09 17:26 EDT, Lon Hohberger
no flags Details
More complete implementation (16.34 KB, text/plain)
2009-05-14 11:37 EDT, Lon Hohberger
no flags Details
ocf-shellfuncs file (needed to hand-test vm.sh) (5.01 KB, text/plain)
2009-05-14 11:56 EDT, Lon Hohberger
no flags Details
Ready to go. (16.73 KB, text/plain)
2009-05-20 16:53 EDT, Lon Hohberger
no flags Details
My working version for libvirt / kvm (17.87 KB, application/x-shellscript)
2009-08-11 09:23 EDT, Robert Verspuy
no flags Details

  None (edit)
Description Rob Kenna 2007-12-05 16:01:27 EST
Calls to the "xm" cli should be deprecated, because:

a) libvirt and virsh will support XEN along with vmware and other virtualization

b) xm migrate is now supported in libvirt/virsh in 5.2 and should provide
superior error reporting which is non existent in 5.0/5.1
Comment 3 RHEL Product and Program Management 2008-06-04 18:47:36 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 5 Lon Hohberger 2008-08-22 11:06:38 EDT
*** Bug 303201 has been marked as a duplicate of this bug. ***
Comment 12 Lon Hohberger 2009-04-02 12:48:45 EDT
*** Bug 303111 has been marked as a duplicate of this bug. ***
Comment 13 Lon Hohberger 2009-04-09 17:26:54 EDT
Created attachment 339000 [details]
virsh based vm.sh

This vm.sh is incomplete.  What is missing:

* Restore all xm commands because xm supports a "--path" during creation / deletion which is in use by customers.  KVM does not support this, so there's no reason to support it.

* (Optional) Provide a global override for defaults in resource agents (requires changes to rgmanager):
    <vm uri="qemu:///system" />

Would be nice because it's a pain in the butt to have to specify the same thing over and over and over (once per VM).  This is particularly nasty with migration mappings.  As an alternative, we can tell people to change their content defaults directly within vm.sh.
Comment 14 Lon Hohberger 2009-04-09 17:27:33 EDT
* The migration operation function also is incorrect and does not currently work.
Comment 15 Lon Hohberger 2009-05-14 11:37:13 EDT
Created attachment 343995 [details]
More complete implementation

virsh or xm-based vm.sh.

Unit tests done with only basic required values (virtual machine name and use_virsh set to 0 to force XM mode when required):

* virsh mode
  * with kvm/qemu
    * start = OK
    * stop = OK
    * status = OK
    * migrate = NO TESTING DONE
  * with Xen
    * start = OK
    * stop = OK
    * status = OK
    * migrate = OK
* xm mode (Xen only)
  * start = OK
  * stop = OK
  * status = OK
  * migrate = OK
Comment 16 Lon Hohberger 2009-05-14 11:56:23 EDT
Created attachment 343999 [details]
ocf-shellfuncs file (needed to hand-test vm.sh)
Comment 17 Lon Hohberger 2009-05-14 12:11:23 EDT
*** Bug 488024 has been marked as a duplicate of this bug. ***
Comment 18 Lon Hohberger 2009-05-14 14:41:09 EDT

Did unit tests in the above cases live migration enabled.

Everything seems to work, but a strange thing occurred - virsh reports a domain as "shut off" when migrating it to another host.  For example:

[root@lisa ~]# OCF_RESKEY_name=r5filebacked0 ./vm.sh migrate marge
Hypervisor: xen
Management tool: virsh
Hypervisor URI: xen:///
Migration URI format: xenmigr://target_host/
CMD: virsh migrate r5filebacked0 xen:/// xenmigr://marge/

(another terminal)
[root@lisa ~]# virsh list

 Id Name                 State
  0 Domain-0             running
 15 r5filebacked0        shut off

When using live migration, it reported the state as expected (running or idle).

Still need to get a KVM cluster to test live-migration on KVM and locate common migration failure cases for the other bz.
Comment 19 Lon Hohberger 2009-05-14 14:42:44 EDT
The previous comments should not affect cluster operation since we do not currently check status on the migration-source, only the target, during the migration operation.  However, when we address bug 499835, it *may* become problematic.

Typically "shut off" means "shut off".
Comment 20 Lon Hohberger 2009-05-20 16:53:47 EDT
Created attachment 344875 [details]
Ready to go.

Few minor bugfixes.  I negative-tested qemu live-migration and did several other negative tests.  Also ensured that --path (the only reason we are keeping xm support) is still handled correctly.  Previous attachment didn't handle --path.
Comment 25 Chris Ward 2009-07-03 13:59:12 EDT
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.
Comment 27 Robert Verspuy 2009-08-11 09:23:16 EDT
Created attachment 357021 [details]
My working version for libvirt / kvm

The script from 'ready-to-go' didn't work at all with my Centos 5.3 server (latest updates).
I've made some changes.
And added a new xml paramter "config", where you can define directory
which holds libvirt xml files.
This way you can define and start a VM trough a simple XML file.
and manually defining it (on all cluster nodes) is not needed,
when you pick this file up from a NFS mount.

This can be used together with the snapshot parameter.
If no snapshot is there, the VM is defined based on the xml file.
If a snapshot is available, then the snapshot is restored.

This is not a production ready version, but at least starting and stopping kvm is working on centos 5.3
Comment 28 Lon Hohberger 2009-08-11 14:41:44 EDT
Hi Robert,

Please submit a patch to cluster-devel@redhat.com - I suspect yours conflicts somewhat with what was already merged upstream for specifying XML files (instead of directories).  Here is Federico Simoncelli's patch which was merged awhile ago:


The above patch is not in 5.4 beta.
Comment 29 errata-xmlrpc 2009-09-02 07:04:29 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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