Hi.
We have a large grouping of VM's that are not always required to be running and would like to find a way to shutdown these particular VM's on a sunday night.
Now anyone know how to find a group of VM's (either via label, project, category etc) and pass a shutdown command. Ideally I would like to do this via PowerShell but I will take anything.
Solved
Shutdown Grouping of VM's

Best answer by devwangler
How I solved this:
Created a category in Prism, assigned all the VM's that I want to shutdown to the category.
Then I wrote the script below which queries the category via REST API into a hash table. Then using the Nutanix PS cmdlets, I iterate the hash table and power down the VM's.
It now runs via a scheduled task once a week, powering down all non-essential VM's.
https://github.com/leepryor/Nutanix_Powershell/blob/master/Shutdown-Categorized-VMs.ps1
View originalCreated a category in Prism, assigned all the VM's that I want to shutdown to the category.
Then I wrote the script below which queries the category via REST API into a hash table. Then using the Nutanix PS cmdlets, I iterate the hash table and power down the VM's.
It now runs via a scheduled task once a week, powering down all non-essential VM's.
https://github.com/leepryor/Nutanix_Powershell/blob/master/Shutdown-Categorized-VMs.ps1
This topic has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.