Re: How to prevent virtual machines running twice on the disk images?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 05/11/2012 01:07 PM, Regendoerp, Achim wrote:
>> -----Original Message-----
>> From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] On
>> Behalf Of Theo Band
>> Sent: 11 May 2012 11:51
>> To: CentOS mailing list
>> Subject:  How to prevent virtual machines running twice on the disk
>> images?
>>
>> I use KVM on two identical centos5 hosts.
>>
>> I can live migrate the virtual machines from one to the other and it works
>> great. Once I do this, I can see VM definitions on both hosts using virt-
>> manager or virsh list --all On one machine the VM is running, on the other it
>> reports "shut off".
>> The disk images are accessible to both host machines and I want to have only
>> one running a the time (of course). If the VM locks up, I could by mistake
>> think that the machine is not running and try to start it on the wrong host.
>>
>> My question is, how can I prevent host A from starting a "shut off" VM that
>> actually has been migrated to host B? The VM could actually be running on
>> any another host. It could also have been crashed. The most simple solution
>> would be some sort of lock file placed next to the disk image location, so
>> seen by all hosts. But perhaps there is another way of working with virt-
>> manager that I am not aware of?
>>
>> Theo
> Are those machines clustered? I used drbd/pacemaker/corosync to achieve something similar across two CentOS hosts with KVM machines, and the VM can only be started on the master node where the DRBD drive is mounted and accessible. Live migrations are fairly easy too with this method
>
No, not clustered.
drbd I do use, but that means a drbd block devices for every individual
vm. I tried that but find it a lot of effort to maintain. One shared
(NFS) filesystem gives a lot more freedom to move a VM to a machine host
machine that has a lower load. I don't mind doing that by hand. It's not
for high availability.

Theo


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux