Hello,
*Very* new to PowerShell so pardon if this is trivial ...
I would like to set Disk Shares to i.e. 'Low' on a VM that is member of a specific Resource Pool.
I.e. all VM's contained in a specific Resource Pool should have : -DiskSharesLevel low
Brgds.
Bjarke
Hi Bjarke,
If your resource pool is called "test" then you can set the disk shares level to low for all the VM's in this resource pool with:
Get-ResourcePool test | Get-VM | Get-VMResourceConfiguration | `Set-VMResourceConfiguration -DisksharesLevel Low
Regards, Robert
Hi Bjarke,
If your resource pool is called "test" then you can set the disk shares level to low for all the VM's in this resource pool with:
Get-ResourcePool test | Get-VM | Get-VMResourceConfiguration | `Set-VMResourceConfiguration -DisksharesLevel Low
Regards, Robert
... and still, not able to get it to work ...
The code :
Get-ResourcePool Low | Get-VM | Get-VMResourceConfiguration | Set-VMResourceConfiguration -DiskSharesLevel Low
Parses the correct VMs - but when I check the DiskShares they are untouched 😞
Brgds.
Bjarke
You have to specify the hard disks for which you want to change the shares level.
Get-ResourcePool test | Get-VM | %{ Get-VMResourceConfiguration -VM $_ | `
Set-VMResourceConfiguration -Disk (Get-HardDisk $_) -DisksharesLevel Low
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Solved ! Thx a bundle !
Brgds.
Bjarke