Automation

 View Only
  • 1.  Setting the disk share level with PowerCLI not working

    Posted Aug 22, 2014 03:45 PM

    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.



  • 2.  RE: Setting the disk share level with PowerCLI not working
    Best Answer

    Posted Aug 22, 2014 04:10 PM

    You need to specify the shares per disk

    Might not be the best way to do it, but it works :smileyhappy:

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



  • 3.  RE: Setting the disk share level with PowerCLI not working

    Posted Aug 22, 2014 06:11 PM

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



  • 4.  RE: Setting the disk share level with PowerCLI not working

    Posted Oct 02, 2014 03:41 AM

    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?



  • 5.  RE: Setting the disk share level with PowerCLI not working

    Posted Jul 19, 2016 12:35 AM

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