PowerCLI – Indentify VMs with RDM disks

SCRIPT SYNOPSIS / REASON CREATED – At the time of this script, we have over 800 VMs across multiple datacenters. In a few of those DCs, we have a small number of VMs that have RDMs attached (for use with Microsoft Clustering). Our current environment is VMware 5.5 hosts, so we still are VERY careful when doing anything (vMotion, etc.) on these VMs with RDMs. Per the article at https://blogs.vmware.com/apps/2015/02/say-hello-vmotion-compatible-shared-disks-windows-clustering-vsphere.html this will be a non-issue for us when we get all hosts upgraded to vSphere 6.


OVERVIEW OF STEPS – This is a very simple script that connects to your vCenter with the supplied credentials and then gets all VMs in the environment, specifically looking for VMs with a disk type of “RawPhysical” or “RawVirtual.” Once the script identifies VMs with these types of disks, it outputs the Parent (VM) Name, Disk File Type, and SCSI Canonical Name. There is an additional line of code that is currently remarked out that can output the results to a CSV file if desired.


Create Patch Baselines and Remediate Hosts in a Cluster

SCRIPT SYNOPSIS / REASON CREATED – With Several Hundred Hosts in our environment, we seemingly are constantly applying host patches…many times, before we get all hosts updated to a current version, there are additional patches/fixes that need to be applied. The goal for this script is to make it easier to update all VMHosts in a designated cluster.

OVERVIEW OF STEPS – After manually putting the host(s) to be remediated into Maintenance Mode, the script below connects to vCenter, creates custom baselines (if not previously created), attaches baselines to the designated cluster, scans for needed patches, and then remediates the host(s) while disabling Power Management/FT/HA and runs simultaneously on all hosts in the cluster.