hello
I have vsphere clients with 4gb ram deployed and wish to reduce this amount to 1 gb, they are running w8.1
can I do this using the powershell cli software and script?
I can do this one by one by powering down each and then decreasing RAM within the vsphere interface and then powering back on but I need a better and faster way
and if one can do this by using powershell is there a readymade script I can use or edit?
thanks
Hi
With PowerCLI you can use cmdlets Set-VM with parameter MemoryGB something like below:
Get-VM VM1 | Set-VM -MemoryGB 2
or
Get-VM $VMName | Set-VM -MemoryGB $memorysize -Confirm:$false
If you want to power the VM off first, you can do this
Get-VM $VMName | Stop-VM -RunAsync -Confirm:$false
#or
Get-VM $VMName | Shutdown-VMGuest -Confirm:$false
#set memory in GB
Get-VM $VMName | Set-VM -MemoryGB $memorysize -Confirm:$false
#then power it on
Get-VM $VMName | Start-VM -RunAsync -Confirm:$false
References:
vSphere PowerCLI Reference Set-VM: vSphere 5.5 Documentation Center
VMware KB: Managing virtual machines using PowerCLI
Thanks,
Bayu
Hi
With PowerCLI you can use cmdlets Set-VM with parameter MemoryGB something like below:
Get-VM VM1 | Set-VM -MemoryGB 2
or
Get-VM $VMName | Set-VM -MemoryGB $memorysize -Confirm:$false
If you want to power the VM off first, you can do this
Get-VM $VMName | Stop-VM -RunAsync -Confirm:$false
#or
Get-VM $VMName | Shutdown-VMGuest -Confirm:$false
#set memory in GB
Get-VM $VMName | Set-VM -MemoryGB $memorysize -Confirm:$false
#then power it on
Get-VM $VMName | Start-VM -RunAsync -Confirm:$false
References:
vSphere PowerCLI Reference Set-VM: vSphere 5.5 Documentation Center
VMware KB: Managing virtual machines using PowerCLI
Thanks,
Bayu
thank you very much for the information and the links you provided
I'm going to try this on a few test machines soon