VMware Cloud Community
roddam
Contributor
Contributor

Restart VMs using PowerCLI on APD

Hi All,

     My cluster consists of 2 hosts running vSphere 5.1 and 4 VMs - VM1, VM2, VM3 and vCenter. All are SUSE based, even the vCenter which is bootstrapped into the cluster.

     I have enabled DRS (with affinity rules) and HA in this cluster. I have a lot of CPU and memory resources, where the above VMs use only 20% of it. All VMs reside in a common datastore on storage array.

     Each host has two HBA ports (one HBA card). One of the tests I did in the lab was to create a APD scenario by unplugging the FC cables from the HBA ports of one of the hosts. In this scenario HA fails to restart the VMs on the second host. I understand why HA fails to do so, and I am also pursuing the option of adding another HBA card which might be not possible in the short term. In the mean time, I am trying to find a temporary solution for this problem.

1. Can APD be converted to a PDL, since there are setting in vSphere 5.1 that lets us enable HA in a PDL scenario.

2. Has anyone used alarm-actions to run a script that would restart the VMs on the other host?

3. Does anyone have PowerCLI scripts for SUSE, that I can run within the vCenter by storing these scripts in the vCEnter VM it self.

Thanks a ton..

Reply
0 Kudos
3 Replies
roddam
Contributor
Contributor

My bad.. Since it is SUSE based vCEnter, I will need perl scripts using the Perl SDK.

Reply
0 Kudos
LucD
Leadership
Leadership

Independent if your vCenter runs on a WIndows or *nix platform, you can still use PowerCLI.

The script do not have to run on the vCenter, they can run on any Windows platform that has PowerShell and PowerCLI, and that can connect to the vCenter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
roddam
Contributor
Contributor

I do not think I can disclose much of the details as I can get into trouble for it, but what I have is only the cluster. There is no other entity that I can run PowerCLI from.

This is my plan now - Install perl SDK and vCLI on vCenter. Build a script that can restart VMs on another host on a datastore loss. Put this perl script in the action of an alarm that gets triggered on a datastore loss.

I will repost it on perl SDK community if I cannot work with the sample scripts that come with perl SDK install..

Thanks!

Reply
0 Kudos