[ClusterLabs] kvm live migration, resource moving
Cédric Dufour - Idiap Research Institute
cedric.dufour at idiap.ch
Thu Feb 4 13:09:10 UTC 2016
Hello,
Here, we have live migration working like a charm through the cluster.
Below the XML expert of a resource configuration:
<resources>
<group id="FOOBAR">
<primitive id="FOOBAR-LibvirtQemu" class="ocf" provider="custom"
type="LibvirtQemu">
<instance_attributes id="FOOBAR-LibvirtQemu-IA">
<nvpair id="FOOBAR-LibvirtQemu-IA-config" name="config"
value="/havc/config/libvirt/FOOBAR.xml"/>
</instance_attributes>
<meta_attributes id="FOOBAR-LibvirtQemu-MA">
<nvpair id="FOOBAR-LibvirtQemu-MA-allow-migrate"
name="allow-migrate" value="true"/>
</meta_attributes>
<operations>
<op id="FOOBAR-LibvirtQemu-OP-monitor" name="monitor"
timeout="30s" interval="60s"/>
<op id="FOOBAR-LibvirtQemu-OP-start" name="start" timeout="60s"
interval="0"/>
<op id="FOOBAR-LibvirtQemu-OP-stop" name="stop" timeout="60s"
interval="0"/>
<op id="FOOBAR-LibvirtQemu-OP-migrate-to" name="migrate_to"
timeout="60s" interval="0"/>
<op id="FOOBAR-LibvirtQemu-OP-migrate-from" name="migrate_from"
timeout="60s" interval="0"/>
</operations>
</primitive>
</group>
</resources>
The LibvirtQemu agent is a custom one derived from the VirtualDomain
agent (for reasons that are off-topic).
The points worth seeing are:
- the "allow-migrate" meta attribute (see
http://www.linux-ha.org/wiki/VirtualDomain_%28resource_agent%29 "If the
allow-migrate meta parameter is set to true, then a resource migration
will not map to a domain shutdown/startup cycle, but to an actual,
potentially live, resource migration between cluster nodes. ")
- the "migrate-from" and "migrate-to" timeouts (which must be set
relative to how big - RAM-wise - your VMs are and the bandwidth
available for migration); passed this timeout, the migration will be
interrupted and the VM will be shutdown/restarted
Hope it helps,
Cédric
On 04/02/16 13:44, Kyle O'Donnell wrote:
> That is helpful but I think I am looking at the wrong documentation:
>
> http://www.linux-ha.org/wiki/VirtualDomain_(resource_agent)
> http://linux-ha.org/doc/man-pages/re-ra-VirtualDomain.html
>
> Can you point me to the docs you are referencing?
>
> ----- Original Message -----
> From: "RaSca" <rasca at miamammausalinux.org>
> To: "users" <users at clusterlabs.org>
> Sent: Thursday, February 4, 2016 6:48:26 AM
> Subject: Re: [ClusterLabs] kvm live migration, resource moving
>
> If your environment is successfully configured even from the libvirt
> side, everything should work out of the box, if it does not work you can
> pass migrate_options to make it work.
>
> From the resource agent documentation:
>
> migrate_options: Extra virsh options for the guest live migration. You
> can also specify here --migrateuri if the calculated migrate URI is
> unsuitable for your environment. If --migrateuri is set then
> migration_network_suffix and migrateport are effectively ignored. Use
> "%n" as the placeholder for the target node name.
> Please refer to the libvirt documentation for details on guest migration.
>
> Hope this helps,
>
More information about the Users
mailing list