VMware Cloud Community
Cinfo
Contributor
Contributor

Conditioned startup of VMs

Hi,

is it possible to make an automatic start of a VM when another VM goes off?

Example:

VM1 is on
VM2 is off

if VM1 go off automatically VM2 starts

if VM2 go off automatically VM1 starts

I use vSphere 6.7

4 Replies
depping
Leadership
Leadership

No, this is not something that we have as a feature in vSphere. What would be the use case for this?

0 Kudos
sjesse
Leadership
Leadership

I'm curious as well as the reason, but you could make a powercli script that ran say every 5 mins and checked the powerstate of the vms and if one is off to and to start the other one if its off. Something like this, I haven't tested this but it should be pretty close to a simple version of what you would need. You would just run this from an external server at a regular interval your happy with.

$vm1=Get-VM vm1

$vm2=Get-VM vm2

if ($vm1.PowerState -eq "PoweredOff") {

  Start-VM -VM $vm2

}

if ($vm1.PowerState -eq "PoweredOff") {

  Start-VM -VM $vm1

}

0 Kudos
berndweyand
Expert
Expert

or create an alarm definition that triggers a script to start the other vm

nachogonzalez
Commander
Commander

Hey, hope you are doing fine.
There is a feature that works similar to what you are asking
Check fault tolerance

What is Fault Tolerance and How it Works? | Vsphere | VMware | LATAM

Please note it only works with up to 8 vCPU in vSphere 6.7 according to licensing:

  • vSphere Standard and Enterprise. Allows up to 2 vCPUs
  • vSphere Enterprise Plus. Allows up to 8 vCPUs


Do you have HA?
Do you have DRS?

Can you tell a little about the VMs?

Warm regards

0 Kudos