Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use an upstart script to monitor a vm and respawn it when it gets killed. I would like to simulate a failover by doing the following. Create a clone of the VM1 say VM2. When either of them is running , I have the other VM in saved state. As soon as one gets killed , I resume the other and start the killed vm but keep it paused.

How should I modify this single vm script to work for 2 vms or maybe multiple vms even?

start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [016]

console output

respawn
respawn limit 5 10

pre-stop script
su pankajm -c “VBoxManage controlvm ubuntu-server savestate”
end script

exec su pankajm -c “VBoxHeadless –startvm ubuntu-server”
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.