Join us for a virtual Nutanix User Group meeting with Jarian Gibson as he covers Nutanix Cloud Clusters (NC2) on Azure and AWS with Citrix. <\/span><\/p>

Jarian will take a deep dive into NC2 on Azure architecture and Citrix on NC2 on Azure\u00a0that helps you strengthen your business continuity and disaster recovery position. He\u2019ll also provide the latest updates for NC2 on AWS.<\/span><\/p>

Plus, we're\u00a0giving away a Nutanix suitcase to one lucky winner!\u00a0Opt-in when you register\u00a0to be entered to win.\u00a0<\/p>","author":{"id":113632,"url":"\/members\/karlie-beil-113632","name":"Karlie Beil","avatar":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/icon\/200x200\/1581aab3-bcf6-49f4-b2fb-3d11e8c010dc.png","userTitle":"Community Manager","rank":{"isBold":false,"isItalic":false,"isUnderline":false,"name":"Community Manager","color":"#0873ba"},"userLevel":4},"type":"Webinar","url":"https:\/\/next.nutanix.com\/events\/global-nug-nc2-on-azure-and-aws-with-citrix-151","image":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/attachment\/f9693b5b-436b-427a-9b98-531b4040ff24_thumb.png","location":"","startsAt":1678298400,"endsAt":1678302000,"contentType":"event","attendees":[],"attendeeCount":0,"isLoggedInUserAttendee":false,"createdAt":"1675974969"},"phrases":{"Forum":{"{n} year|{n} years":"{n} year|{n} years","{n} month|{n} months":"{n} month|{n} months","{n} day|{n} days":"{n} day|{n} days","{n} hour|{n} hours":"{n} hour|{n} hours","{n} minute|{n} minutes":"{n} minute|{n} minutes","just":"just now","{plural} ago":"{plural} ago"}}}">

解决了

关闭VM的分组


徽章 +1
你好。

我们有大量的VM分组,这些VM并不总是需要运行,并希望找到一种在周日晚上关闭这些特定VM的方法。



现在,任何人都知道如何找到一组VM(通过标签,项目,类别等)并传递关闭命令。理想情况下,我想通过PowerShell做到这一点,但我会采取任何措施。
图标

最好的答案Devwangler2019年3月12日,01:58

\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"}">
查看原件

该主题已关闭以供评论

6个答复

UserLevel 2
徽章 +3
有多种列出VM的方法,然后为您想要的“组”过滤,但这取决于您的命名约定。



要关闭VM,您也有多个选项:

视窗:

DOS CMD:

代码:
关闭 / / M \\ {计算机} {options}


电源外壳:

代码:
stop-computer –computer {computername} –credential {accountId}




Linux:

代码:
ssh -t {user}@{computerip}'sudo shutdown -h现在'




因此,您要做的就是通过过滤的计算机列表循环上述。
Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu