Creating rules to maintain memberships of DRS groups using a custom function

In this recipe, you will create a list of rules that leverage the Update-VmDrsGroup function that you created in the previous recipe in order to keep assignments up to date in a very dynamic environment. These rules can be defined and then set as a scheduled job in PowerShell to ensure that the assignments are up to date at all times, even if administrators move a virtual machine to a different location.

Getting ready

To begin this recipe, you will need a PowerCLI window and the function that you created in the previous recipe. You will also need an active connection to a vCenter Server. All of the cmdlets will update groups on the cluster, BigCluster. You will need to ...

Get PowerCLI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.