mgartley
Contributor
Contributor

Setting the disk share level with PowerCLI not working

Jump to solution

I'm in the process of building a quick script that pulls a bunch of VMs from a text file and then changes the value of their disk share level from normal to high. I've never used this command before in powercli so I was just trying to get the syntax right in a one liner at the console. I can use the Set-VMResourceConfiguration command to successfully set memory and CPU shares to high but when I try to set the disk shares to high the command completes successfully but the actual value does not change in virtual center from normal to high as it does for the memory and CPU settings... Has anyone ran into this behavior before? The VMs are running hardware version 10 and have updated tools. Thanks in advance.

example.JPG

0 Kudos
1 Solution

Accepted Solutions
Wh33ly
Hot Shot
Hot Shot

You need to specify the shares per disk

Might not be the best way to do it, but it works Smiley Happy

Get-VM VM|Get-VMResourceConfiguration|Set-VMResourceConfiguration -Disk (Get-HardDisk VM) -DiskSharesLevel High

View solution in original post

4 Replies
Wh33ly
Hot Shot
Hot Shot

You need to specify the shares per disk

Might not be the best way to do it, but it works Smiley Happy

Get-VM VM|Get-VMResourceConfiguration|Set-VMResourceConfiguration -Disk (Get-HardDisk VM) -DiskSharesLevel High

mgartley
Contributor
Contributor

ah that does it, would of thought if something like that was required it would of yelled at me... Thanks for the help!

0 Kudos
rajkumaremail
Contributor
Contributor

When i tried to do the same in ESXi 5.1 it worked without any issues. But in case of 5.5 it failed saying that

"Task ReconfigVM_Task failed with error: The attempted operation cannot be performed in the current state (Powered on)."

Do we have any restriction or known issues that we cannot set diskshares on a powered ON vm?

0 Kudos
SamDulam
Contributor
Contributor

We have seen this issue for IDE disks, Setting limits for SCSI disks work fine even for powered on VMs

0 Kudos