Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 201745

Set-VMRecourceConfiguration -MemLimitMB to The currently configured memory.

$
0
0

Hi Guys

 

 

 

I am am about to set the memory limit of all my virtual machines in a datacenter to Unlimited.

 

 

 

With this: (pretty easy)

 

 

 

Get-Datacenter -name "Target Datacenter" | Get-Cluster | Get-VM | Get-VMResourceConfiguration | where {$_.MemLimitMB -ne "-1"} | Set-VMResourceConfiguration -MemLimitMB $null

 

 

 

But don't really know how to approach the reverse.

 

 

 

$Details

$SettingsVM

$Details = Get-Datacenter -name "Target Datacenter" | Get-Cluster | Get-VM | Select Name,MemoryMB

$SettingsVM.Name = $Details.Name

$SettingsVM.MemoryMB = $Details.MemoryMB

 

Get-VM -name $SettingsVM.Name | Get-VMResourceConfiguration | where {$_.MemLimitMB -eq $Null} | Set-VMResourceConfiguration -MemLimitMB $Details.MemoryMB

 

 

 

Thanks

John


Viewing all articles
Browse latest Browse all 201745

Trending Articles