由于要修改一批VDI机器的内存,数量比较多,就拿出了PowerCLI来进行批量修改,命令如下:
Connect-VIServer -Server vcenter.test.local -User admin -Password password
$VMs = Get-Cluster “Cluster” | Get-VM | Where { $_.Name -like “vdi-*” }
ForEach ($VM in $VMs) { Set-VM $VM -MemoryMB 2176 -Confirm:$False }