Changes between Version 14 and Version 15 of VirtualMachineBehaviors


Ignore:
Timestamp:
05/22/11 17:27:57 (3 years ago)
Author:
digimer
Comment:

Fixed the last copy from the old wiki to work on the new Trac syntax.

Legend:

Unmodified
Added
Removed
Modified
  • VirtualMachineBehaviors

    v14 v15  
    1 [[RGManager]] handles virtual machines slightly differently from other non-VM services. 
     1[[TOC]] 
     2 
     3[wiki:RGManager] handles virtual machines slightly differently from other non-VM services. 
    24 
    35== Normal Operations == 
    4 VMs manaaged by rgmanager should only be administered using clusvcadm or another cluster aware tool.  Most of the behaviors are common with normal services.  This includes: 
     6VMs managed by rgmanager should only be administered using clusvcadm or another cluster aware tool.  Most of the behaviors are common with normal services.  This includes: 
    57 * Starting (enabling) 
    68 * Stopping (disabling) 
     9 * Status monitoring 
    710 * Relocation 
    811 * Recovery 
    912 
    10 == Special Operations == 
    11 In addition, virtual machines support one behavior not supported by other services: 
    12  * Migration - live or paused 
     13== Migration == 
     14In addition to normal service operations, virtual machines support one behavior not supported by other services: ''migration''.  Migration minimizes downtime of virtual machines by removing the requirement for a start/stop in order to change the location of a virtual machine within a cluster. 
     15 
     16There are two types of migration supported by rgmanager which are selected on a per-VM basis by the {{{migrate}}} attribute: 
     17 * '''live''' (default) - the virtual machine continues to run while most of its memory contents are copied to the destination host.  This minimizes the inaccessibility of the VM (typically well under 1 second) at the expense of performance of the VM during the migration and total amount of time it takes for the migration to complete. 
     18 * '''pause''' - the virtual machine is frozen in memory while its memory contents are copied to the destination host.  This minimizes the amount of time it takes for a virtual machine migration to complete. 
     19 
     20Which migration style you use is dependent on availability and performance requirements.  For example, a live migration may mean 29 seconds of degraded performance and 1 second of complete unavailability while a pause migration may mean 8 seconds of complete unavailability and no otherwise degraded performance. 
     21 
     22For increased performance of migration operations, virtual machine resources may have a ''migration mapping'' which maps alternative hostnames to cluster nodes.  This may be added on a per-VM basis by adding a {{{migration_mapping}}} attribute to the virtual machine resource(s) in question. 
     23{{{ 
     24<cluster ...> 
     25  <clusternodes> 
     26    <clusternode name="node1" nodeid="1" votes="1"> 
     27      <fence> ... </fence> 
     28    </clusternode>  
     29    <clusternode name="node2" nodeid="2" votes="1"> 
     30      <fence> ... </fence> 
     31    </clusternode>  
     32  </clusternodes> 
     33  ... 
     34  <rm> 
     35    <vm name="foo" migrate="live" 
     36        migration_mapping="node1:migration-hostname-1,node2:migration-hostname-2" /> 
     37    <vm name="foo2" migrate="pause" /> 
     38  </rm> 
     39</cluster> 
     40}}} 
     41 
     42=== Important Notes === 
     43 * A virtual machine may be a component of service, but doing this disables all forms of migration and most of the below convenience features. 
     44 * The use of migration with KVM requires careful configuration of {{{ssh}}}.  See KvmMigration for more details. 
    1345 
    1446== Convenience Features == 
    1547Stuff rgmanager does to try to make life easier. 
     48=== Virtual Machine Tracking === 
    1649 * Starting a virtual machine with clusvcadm if the VM is already running will cause rgmanager to search the cluster for the VM and mark the VM as 'started' wherever it is found 
    17    * '''Note''': If the VM is running in 2+ places, rgmanager does nothing to warn you 
     50 * Administrators who accidentally migrate a VM between cluster nodes with non-cluster tools such as virsh will cause rgmanager to search the cluster for the VM and mark the VM as 'started' wherever it is found 
     51 
     52'''Note''': If the VM is running in 2+ places, rgmanager does nothing to warn you. 
     53 
     54=== Transient Domain Support === 
     55Rgmanager supports transient virtual machines which are supported by libvirt.  This enables rgmanager to create and remove virtual machines on the fly, helping reduce the possibility of accidental double-starts of virtual machines due to the use of non-cluster tools. 
     56 
     57Support of transient virtual machines also enables you to store libvirt XML description files on a clustered file system so that you do not have to manually keep {{{/etc/libvirt/qemu}}} in sync across the cluster. 
     58 
     59==== Using XML Files Directly ==== 
     60This is done using an optional attribute on each virtual machine called {{{xmlfile}}}.  For example: 
     61{{{ 
     62<vm name="foo" xmlfile="/mnt/gfs2_vmstore/foo.xml" /> 
     63}}} 
     64 
     65The above will cause rgmanager to look for a file called {{{/mnt/gfs2_vmstore/foo.xml}}} in order to manage a virtual machine named {{{foo}}}. 
     66 
     67Notes: 
     68 * The file name must match the virtual machine name. 
     69 * If the file name does not have a .xml extension, it may be treated as a Xen domain configuration file. 
     70 
     71==== Using Path Spec Support ==== 
     72This is done using an optional attribute on each virtual machine called {{{path}}}.  For example: 
     73{{{ 
     74<vm name="foo" path="/mnt/gfs2_vmstore:/mnt/gfs2_vmstore2" /> 
     75}}} 
     76 
     77The above will cause rgmanager to look in {{{/mnt/gfs2_vmstore}}} for a file called {{{foo}}} (Xen) or {{{foo.xml}}} (Xen or KVM; libvirt XML description).  If it does not find either in {{{/mnt/gfs2_vmstore}}}, it will then look in {{{/mnt/gfs2_vmstore2}}}. 
     78 
     79Once found, the {{{xmlfile}}} parameter is set and the domain is started. 
     80 
     81Notes: 
     82 * The {{{path}}} attribute is not required and should not be specified when using default locations for virtual machine descriptions. 
     83 * See notes above on the {{{xmlfile}}} parameter 
     84 
     85=== Management Features === 
    1886 * Adding or removing a VM from cluster.conf will not start or stop the VM; it will simply cause rgmanager to start or stop paying attention to the VM 
    19  * Administrators who accidentally migrate a VM between cluster nodes with non-cluster tools such as virsh will cause rgmanager to search the cluster for the VM and mark the VM as 'started' wherever it is found 
    2087 * Failback (moving to a more preferred node) is performed using migration to minimize downtime 
    2188 
    2289== Unhandled Behaviors == 
     90<<Anchor(bad_ideas)>> 
    2391Stuff you should never do. 
    24  * Starting using a non-cluster-aware tool (such as virsh) on a cluster host when the VM is already running on another cluster host. 
    25  * Migrating a cluster-managed VM to a non-cluster node or a node in the cluster which is not running rgmanager.  Rgmanager will restart the VM in the cluster in the previous location, causing data corruption. 
     92 
     93 * Using a non-cluster-aware tool (such as virsh or xm) to manipulate a virtual machine's state or configuration while the cluster is managing the virtual machine.  Checking the virtual machine's state is fine (e.g. {{{virsh list}}}, {{{virsh dumpxml}}}). 
     94 * Migrating a cluster-managed VM to a non-cluster node or a node in the cluster which is not running rgmanager.  Rgmanager will restart the VM in the previous location, causing two instances of the VM to be running, resulting in file system corruption.