VMware Cloud Community
mdangel1
Enthusiast
Enthusiast
Jump to solution

script to execute DRS recommendations

Hello Community, I need your assistance

I upgraded to VC 6.5 U1G and it has a bug that when deploying a VM with DRS enabled it crashes vpxd

Until I upgrade to 6.0 U2 (need to wait for an app verification I need help with the following

I was forced to set DRS to manual, I am manually checking DRS recommendations every night and clicking run DRS if there are recommendations

Can someone help me scripting that? please.  JUst a script to execute recommendations

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

There are cmdlets for that, see Get-DrsRecommendation and Invoke-DrsRecommendation.

For example

$clusterName = 'MyCLuster'

Get-Cluster -Name $clusterName | Get-DrsRecommendation | Invoke-DrsRecommendation


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

There are cmdlets for that, see Get-DrsRecommendation and Invoke-DrsRecommendation.

For example

$clusterName = 'MyCLuster'

Get-Cluster -Name $clusterName | Get-DrsRecommendation | Invoke-DrsRecommendation


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
mdangel1
Enthusiast
Enthusiast
Jump to solution

Thank you so much, quick question, may I add multiple clusters? We have many clusters on that VC, again, big thank you

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, you can.

For a selected set of clusters

$clusterName = 'cluster1','cluster2','cluster3'

Get-Cluster -Name $clusterName | Get-DrsRecommendation | Invoke-DrsRecommendation

or for all clusters

Get-Cluster | Get-DrsRecommendation | Invoke-DrsRecommendation


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos