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:
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?
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
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