VMware Cloud Community
zenivox
Hot Shot
Hot Shot
Jump to solution

Set to manual the DRS for a group of VMs

Hello I need to ensure a group of VMs provided by a txt or csv file (placed on different vClusters) will have their DRS set Manual. So they won't automatically vMotion. I had a look at William Lam post and I used his Disable-vSphereMethod function:

https://www.virtuallyghetto.com/2016/07/how-to-easily-disable-vmotion-cross-vcenter-vmotion-for-a-pa...

but apart from not producing any result (no errors either), I'm not sure it is exactly what I'm looking for. It seems that acts on disabling a method which is available for a given VM entity. What I'm trying to achieve is at cluster level I believe. However I cannot find anything in the mob that can help me. I used to help myself with Onyx but we recently migrated to 6.5. I think it is probably PlaceVM but not sure ..

However is there a way to achieve this via pure PowerCLI?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

There are two options here, disable the vMotion altogether (William's post) or disallow automatic vMotion of the VM through DRS.

For the 2nd option you could use the following

Import-Csv -Path C:\Temp\vmnames.csv -UseCulture | %{

    Get-VM -Name $_.Name | Set-VM -DrsAutomationLevel Manual -Confirm;$false

}

Note that this only affects DRS, a user will still be able to 'migrate' the VM through the Web Client or with a Move-VM cmdlet.


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

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

There are two options here, disable the vMotion altogether (William's post) or disallow automatic vMotion of the VM through DRS.

For the 2nd option you could use the following

Import-Csv -Path C:\Temp\vmnames.csv -UseCulture | %{

    Get-VM -Name $_.Name | Set-VM -DrsAutomationLevel Manual -Confirm;$false

}

Note that this only affects DRS, a user will still be able to 'migrate' the VM through the Web Client or with a Move-VM cmdlet.


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

0 Kudos