Script to take host in maintenance mode after an alert from idrac
I observed for PSOD, other hardware issue on the Dell server before it goes for sudden reboot or PSOD idrac logs general alert logs.
I was thinking if we can made a script based on predefined idrac log and check if the idrac get predefined alert it should immediately take the host in maintenance mode. These way we can save our VM to get rebooted after HA.
Not script related, but one feature released in vSphere 6.5 was Proactive HA. This takes necessary action when certain events are retrieved from CIM agents to perform a Host Failure or Quarantine Mode.
A Proactive HA failure occurs when a host component fails, which results in a loss of redundancy or a noncatastrophic failure. However, the functional behavior of the VMs residing on the host is not yet affected. For example, if a power supply on the host fails, but other power supplies are available, that is a Proactive HA failure.
If a Proactive HA failure occurs, you can automate the remediation action taken in the vSphere Availability section of the vSphere Client. The VMs on the affected host can be evacuated to other hosts and the host is either placed in Quarantine mode or Maintenance mode.
Ok... also no powershell script but Dell has for 7 years now... Dell Management Plugin for VMware vCenter -> Dell OpenManage Integration for VMware vCenter (OMIVV) which bringt in ~30 HW Alarms and the inbuild feature when something hardware related happens to place the host into MM.
You can buy a lic with every Poweredge Server and it costs around 80,- or a 5 or 10 Host bundle with 3 or 5Y supscription/support. Trial for 5 hosts and 90? days is available. OMIVV comes as a linux based VA and can be downloaded from the dell.com/support (select your model) page.