Detecting and Grouping Ungrouped VMs
One of my customers uses DRS groups heavily. The environment contains a set of specialized ESXi servers for a specific subset of machines and a set of general ESXi servers for everything else. However, in order to maximize availability, all of these ESXi servers are part of one big cluster. That means that every VM in their environment must be a member of at least one DRS group, placing the VM on either these specialized ESXi servers or the general ESXi servers. Until we get an automated solution in place (probably through Orchestrator), we need to depend on the administrators to place the VM in the correct group (almost always the general group) upon machine creation. As you might expect, that's not going too well. So, I put together a quick PowerCLI script to detect any VMs that are not grouped and (optionally) place them into the specified group. This is what I came up with! The script is easy to use, but it requires a non-standard PowerCLI mod...