我们有一个大的VM的分组,并不总是需要运行,希望找到一个方法关闭这些特定的虚拟机的周日晚上。
现在任何人都知道如何找到一组VM的(通过标签,项目,类别等)和传递一个关机命令。理想情况下,我希望通过PowerShell实现这一点,但我愿意接受任何方法。
最佳答案devwangler
\r\n\r\nCreated a category in Prism, assigned all the VM's that I want to shutdown to the category.
\r\n
\r\nThen 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.
\r\n
\r\nIt now runs via a scheduled task once a week, powering down all non-essential VM's.
\r\n
\r\nhttps:\/\/github.com\/leepryor\/Nutanix_Powershell\/blob\/master\/Shutdown-Categorized-VMs.ps1","className":"post__content__best_answer"}">