[libvirt-users] Deploying libvirt with live migration

I have two physical servers: Virt1 and Virt2. I'm setting up live migration with CentOS 5.5 between the two. I've done this by NFS mounting /etc/libvirt and /var/lib/libvirt/images on both servers. This is working well for me except for one thing. I see the same list of VMs on each server (as expected), but each server (Virt1 and Virt2) are able to start the same VM at the same time. This obviously causes IP conflicts and thrashes the disk image. Is there a way to tell my VM "cluster" that a VM is only allowed to be opened on one host at a time? -- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253

I've run into the same scenario... I've often wondered if it wouldn't make sense to have a lock file or some other notification in place to let both hosts know who currently has "ownership" of the VM. David. On Mon, 13 Dec 2010, Scott Baker wrote:
I have two physical servers: Virt1 and Virt2. I'm setting up live migration with CentOS 5.5 between the two. I've done this by NFS mounting /etc/libvirt and /var/lib/libvirt/images on both servers. This is working well for me except for one thing.
I see the same list of VMs on each server (as expected), but each server (Virt1 and Virt2) are able to start the same VM at the same time. This obviously causes IP conflicts and thrashes the disk image. Is there a way to tell my VM "cluster" that a VM is only allowed to be opened on one host at a time?
-- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

2010/12/13 Scott Baker <bakers@canbytel.com>:
I have two physical servers: Virt1 and Virt2. I'm setting up live migration with CentOS 5.5 between the two. I've done this by NFS mounting /etc/libvirt and /var/lib/libvirt/images on both servers. This is working well for me except for one thing.
I see the same list of VMs on each server (as expected), but each server (Virt1 and Virt2) are able to start the same VM at the same time. This obviously causes IP conflicts and thrashes the disk image. Is there a way to tell my VM "cluster" that a VM is only allowed to be opened on one host at a time?
Well don't share /etc/libvirt, there is no need to. Just have the domain config on the host that currently executes the domain and tell libvirt to migrate the persistent domain condif along with the domain: virsh migrate --persistent --undefinesource vm1 qemu://virt2/system Matthias

On 12/13/2010 02:28 PM, Matthias Bolte wrote:
Well don't share /etc/libvirt, there is no need to.
Just have the domain config on the host that currently executes the domain and tell libvirt to migrate the persistent domain condif along with the domain:
virsh migrate --persistent --undefinesource vm1 qemu://virt2/system
I suppose that would work... but if Virt2 dies and I need to start its VMs on Virt1 those XML configs won't be there and it will make it more complicated. Not just a simple "virsh start Foobar" -- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253

Even if your not sharing /etc/libvirt, if you have migrated at least once, both systems see the VM's as available for starting/running so just not sharing /etc/libvirt is not a solution to the problem/concern... Ideally if you try to start a VM that is already running on a different host it should balk and you should get an (overridable) warning. (IMHO) David. On Mon, 13 Dec 2010, Scott Baker wrote:
On 12/13/2010 02:28 PM, Matthias Bolte wrote:
Well don't share /etc/libvirt, there is no need to.
Just have the domain config on the host that currently executes the domain and tell libvirt to migrate the persistent domain condif along with the domain:
virsh migrate --persistent --undefinesource vm1 qemu://virt2/system
I suppose that would work... but if Virt2 dies and I need to start its VMs on Virt1 those XML configs won't be there and it will make it more complicated.
Not just a simple "virsh start Foobar"
-- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

2010/12/13 David Ehle <ehle@agni.phys.iit.edu>:
Even if your not sharing /etc/libvirt, if you have migrated at least once, both systems see the VM's as available for starting/running so just not sharing /etc/libvirt is not a solution to the problem/concern...
Well, that depends on the flags you pass to the migrate command. The default libvirt migration semantic is a bit unexpected as it leaves the domain defined but in shutdown state on the source host and on the destination host it's running as a transient guest. That's why I gave it the --persistent --undefinesource flags to make it take it's config with it.
Ideally if you try to start a VM that is already running on a different host it should balk and you should get an (overridable) warning. (IMHO)
There is ongoing work on a lock manager system for libvirt that shall prevent two domains from using the same disk image at the same time. That's not exactly what you're looking for but it's related. Matthias
David.
On Mon, 13 Dec 2010, Scott Baker wrote:
On 12/13/2010 02:28 PM, Matthias Bolte wrote:
Well don't share /etc/libvirt, there is no need to.
Just have the domain config on the host that currently executes the domain and tell libvirt to migrate the persistent domain condif along with the domain:
virsh migrate --persistent --undefinesource vm1 qemu://virt2/system
I suppose that would work... but if Virt2 dies and I need to start its VMs on Virt1 those XML configs won't be there and it will make it more complicated.
Not just a simple "virsh start Foobar"
-- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On Mon, 13 Dec 2010, Matthias Bolte wrote:
2010/12/13 David Ehle <ehle@agni.phys.iit.edu>:
Even if your not sharing /etc/libvirt, if you have migrated at least once, both systems see the VM's as available for starting/running so just not sharing /etc/libvirt is not a solution to the problem/concern...
Well, that depends on the flags you pass to the migrate command. The default libvirt migration semantic is a bit unexpected as it leaves the domain defined but in shutdown state on the source host and on the destination host it's running as a transient guest. That's why I gave it the --persistent --undefinesource flags to make it take it's config with it.
Thank you for explaining that - I usually use the gui admin tool so some of the details I'm oblivious too.
Ideally if you try to start a VM that is already running on a different host it should balk and you should get an (overridable) warning. (IMHO)
There is ongoing work on a lock manager system for libvirt that shall prevent two domains from using the same disk image at the same time. That's not exactly what you're looking for but it's related.
I think that would be more than sufficient ;) Is that project publicly accesible? I might be interested in lending a hand :) David.
Matthias
David.
On Mon, 13 Dec 2010, Scott Baker wrote:
On 12/13/2010 02:28 PM, Matthias Bolte wrote:
Well don't share /etc/libvirt, there is no need to.
Just have the domain config on the host that currently executes the domain and tell libvirt to migrate the persistent domain condif along with the domain:
virsh migrate --persistent --undefinesource vm1 qemu://virt2/system
I suppose that would work... but if Virt2 dies and I need to start its VMs on Virt1 those XML configs won't be there and it will make it more complicated.
Not just a simple "virsh start Foobar"
-- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

2010/12/13 David Ehle <ehle@agni.phys.iit.edu>:
On Mon, 13 Dec 2010, Matthias Bolte wrote:
2010/12/13 David Ehle <ehle@agni.phys.iit.edu>:
Even if your not sharing /etc/libvirt, if you have migrated at least once, both systems see the VM's as available for starting/running so just not sharing /etc/libvirt is not a solution to the problem/concern...
Well, that depends on the flags you pass to the migrate command. The default libvirt migration semantic is a bit unexpected as it leaves the domain defined but in shutdown state on the source host and on the destination host it's running as a transient guest. That's why I gave it the --persistent --undefinesource flags to make it take it's config with it.
Thank you for explaining that - I usually use the gui admin tool so some of the details I'm oblivious too.
Ideally if you try to start a VM that is already running on a different host it should balk and you should get an (overridable) warning. (IMHO)
There is ongoing work on a lock manager system for libvirt that shall prevent two domains from using the same disk image at the same time. That's not exactly what you're looking for but it's related.
I think that would be more than sufficient ;)
Is that project publicly accesible? I might be interested in lending a hand :)
Search the libvir-list (not the libvirt-users one) for "lock manager" or "sync manager". This threads here are probably be a good starting point to read about it: https://www.redhat.com/archives/libvir-list/2010-August/msg00179.html https://www.redhat.com/archives/libvir-list/2010-September/msg00167.html Matthias
David.
Matthias
David.
On Mon, 13 Dec 2010, Scott Baker wrote:
On 12/13/2010 02:28 PM, Matthias Bolte wrote:
Well don't share /etc/libvirt, there is no need to.
Just have the domain config on the host that currently executes the domain and tell libvirt to migrate the persistent domain condif along with the domain:
virsh migrate --persistent --undefinesource vm1 qemu://virt2/system
I suppose that would work... but if Virt2 dies and I need to start its VMs on Virt1 those XML configs won't be there and it will make it more complicated.
Not just a simple "virsh start Foobar"
-- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
participants (3)
-
David Ehle
-
Matthias Bolte
-
Scott Baker