我们有大量的VM分组,这些VM并不总是需要运行,并希望找到一种在周日晚上关闭这些特定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"}">