VMware Cloud Community
devzero
Expert
Expert
Jump to solution

shutdown test VMs when datacenter failure

hello,

let`s say we have 6 esx hosts in one cluster with ha+drs.

3 hosts are in datacenter1 and 3 hosts in datacenter2.

production VMs fit on 3 hosts, so there is enough capacity for a datacenter failover.

now we`d like to use the remaining free capacity for testing VMs and when there is a datacenter failure (i.e. 3 hosts are down), i`d like to have the testing VMs automatically shutdown and make room for the production VMs which being restarted by HA on the surviving site.


So my question is: how can this be done ?

I assume this is not possible with "builtin" functionality, so maybe somebody made an intelligent script which can detect number of active hosts or datacenter failure and trigger shutdown of the testing VMs !?

regards

roland

1 Solution

Accepted Solutions
cjscol
Expert
Expert
Jump to solution

Are you able to put all of the Test VMs in a folder, e.g. TestVMs?

Then you could use the following PowerCLI command to stop all of the VMs in the TestVMs folder.

Get-VM -Location TestVMs | Stop-VM

If your folder structure does not allow for this, are all of the Test VMs in there own datastore(s) with none of the Production VMs, you could use


Get-VM -Datastore TestVMDataStore | Stop-VM

Tricky bit will be automating the triggering of the command to run. Do you have any server monitoring tools?

Calvin Scoltock VCP 2.5, 3.5, 4, 5 & 6 VCAP5-DCD VCAP5-DCA http://pelicanohintsandtips.wordpress.com/blog LinkedIn: https://www.linkedin.com/in/cscoltock

View solution in original post

4 Replies
rcporto
Leadership
Leadership
Jump to solution

Site Recovery Manager is the solution that will orchestrate the failover between sites, including shutdown the test virtual machines to make room for the production virtual machines. Take a look: VMware Site Recovery Manager: IT Disaster Recovery Software | United States

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
devzero
Expert
Expert
Jump to solution

mhh, isn`t that a very expensive product (thousands of dollars for packs of 25VM`s) ?

i suspect that is a little bit over the top, as we coud make no other use of it (besides shutting down test), as our two sites are active/active (SVC storage).

0 Kudos
cjscol
Expert
Expert
Jump to solution

Are you able to put all of the Test VMs in a folder, e.g. TestVMs?

Then you could use the following PowerCLI command to stop all of the VMs in the TestVMs folder.

Get-VM -Location TestVMs | Stop-VM

If your folder structure does not allow for this, are all of the Test VMs in there own datastore(s) with none of the Production VMs, you could use


Get-VM -Datastore TestVMDataStore | Stop-VM

Tricky bit will be automating the triggering of the command to run. Do you have any server monitoring tools?

Calvin Scoltock VCP 2.5, 3.5, 4, 5 & 6 VCAP5-DCD VCAP5-DCA http://pelicanohintsandtips.wordpress.com/blog LinkedIn: https://www.linkedin.com/in/cscoltock
devzero
Expert
Expert
Jump to solution

we have all of them in a ressource pool and on two datastores.

looks promising.

we use nagios for monitoring

0 Kudos