Bug 412911

Summary: Convert all XM management calls to either lib virt or virsh
Product: Red Hat Enterprise Linux 5 Reporter: Scott Crenshaw <crenshaw>
Component: rgmanagerAssignee: Lon Hohberger <lhh>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: bstevens, burghardt, clasohm, cluster-maint, cward, edamato, grimme, nhappel, notting, pep, rmccabe, robert, samuel.kielek, tao
Target Milestone: alpha   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 11:04:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 479737, 499835    
Attachments:
Description Flags
virsh based vm.sh
none
More complete implementation
none
ocf-shellfuncs file (needed to hand-test vm.sh)
none
Ready to go.
none
My working version for libvirt / kvm none

Description Rob Kenna 2007-12-05 21:01:27 UTC
Calls to the "xm" cli should be deprecated, because:

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

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 Program Management 2008-06-04 22:47:36 UTC
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
release.

Comment 5 Lon Hohberger 2008-08-22 15:06:38 UTC
*** Bug 303201 has been marked as a duplicate of this bug. ***

Comment 12 Lon Hohberger 2009-04-02 16:48:45 UTC
*** Bug 303111 has been marked as a duplicate of this bug. ***

Comment 13 Lon Hohberger 2009-04-09 21:26:54 UTC
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):
  <resource-defaults>
    <vm uri="qemu:///system" />
  </resource-defaults>

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 21:27:33 UTC
* The migration operation function also is incorrect and does not currently work.

Comment 15 Lon Hohberger 2009-05-14 15:37:13 UTC
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 15:56:23 UTC
Created attachment 343999 [details]
ocf-shellfuncs file (needed to hand-test vm.sh)

Comment 17 Lon Hohberger 2009-05-14 16:11:23 UTC
*** Bug 488024 has been marked as a duplicate of this bug. ***

Comment 18 Lon Hohberger 2009-05-14 18:41:09 UTC
Update:

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 18:42:44 UTC
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 20:53:47 UTC
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 17:59:12 UTC
~~ 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 13:23:16 UTC
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 18:41:44 UTC
Hi Robert,

Please submit a patch to cluster-devel - 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:

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

The above patch is not in 5.4 beta.

Comment 29 errata-xmlrpc 2009-09-02 11:04:29 UTC
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.

http://rhn.redhat.com/errata/RHSA-2009-1339.html