4 Replies Latest reply on Mar 10, 2010 2:10 AM by DAckroyd

    Expand VM's hard disk size - powerCLI

    DAckroyd Lurker

      Hi all,

      I think this should be an easy one...

      I used to expand Virtual Hard Disks in vCenter just by heading in and increasing the size but that option is now greyed out scince upgrading to vSphere 4.0... I have PowerCLI on the network and I've got as far as "get-VM | get-HardDisk" and I get a list of the 2 drives attached to the VM, it's the data drive not the system drive I want to expand and that should be easy enough to do as far as I know...

       

      can I set this via PowerCLI and if so how? if not and anyone knows how to do this are you able to point me in the right direction please?

       

      Thanks,

      Dave

        • 1. Re: Expand VM's hard disk size - powerCLI
          DAckroyd Lurker

          OK, I may be barking up the wrong tree on this anyway... the Provisionsed Size is grayed out and Max side says N/A - I have checked an another VM and it's settings are avalible - same guest OS etc... Below are outputs of both Guests - the top one gives options to change the bottom one doesn't - settings are the same in VIClient also appart from bottom one is greyed out

           

          C:\> get-vm "Academy Apps/Updates Server" | Get-HardDisk | se lect *

           

          StorageFormat : Thick

          Persistence : Persistent

          DiskType : Flat Filename : Academy AppsJQ-2fUpdates Server/Academy AppsJ Q-2fUpdates Server.vmdk

          CapacityKB : 41943040

          ParentId : VirtualMachine-vm-134

          ConnectionState :

          Id : VirtualMachine-vm-134/2000

          Name : Hard disk 1

           

          StorageFormat : Thick

          Persistence : Persistent

          DiskType : Flat

          Filename : Academy AppsJQ-2fUpdates Server/Academy AppsJ Q-2fUpdates Server_1.vmdk

          CapacityKB : 209715200

          ParentId : VirtualMachine-vm-134

          ConnectionState :

          Id : VirtualMachine-vm-134/2001

          Name : Hard disk 2

           

          C:\> get-vm phwds | Get-HardDisk | select *

           

          StorageFormat : Thick

          Persistence : Persistent

          DiskType : Flat

          Filename : phwds/phwds-000001.vmdk

          CapacityKB : 41943040

          ParentId : VirtualMachine-vm-1366

          ConnectionState :

          Id : VirtualMachine-vm-1366/2000

          Name : Hard disk 1

           

          StorageFormat : Thick

          Persistence : Persistent

          DiskType : Flat

          Filename : phwds/phwds_1-000001.vmdk

          CapacityKB : 52428800

          ParentId : VirtualMachine-vm-1366

          ConnectionState :

          Id : VirtualMachine-vm-1366/2001

          Name : Hard disk 2

          • 2. Re: Expand VM's hard disk size - powerCLI
            khughes Virtuoso

            I wish I was more savy with the PowerCLI, trying to work on it in my spare time, but if you really want an some scripting guru's to see this you should go ahead and repost your question in the PowerCLI board area found here - http://communities.vmware.com/community/vmtn/vsphere/automationtools/powercli?view=discussions

             

            I'm sure there will be more than a couple people there that could help you.

             

            • Kyle

             

            • 3. Re: Expand VM's hard disk size - powerCLI
              DAckroyd Lurker

              Sorry - problem was that there was a snapshot of the computer which stopped me being able to alter the size of the disk

              • 4. Re: Expand VM's hard disk size - powerCLI
                DAckroyd Lurker

                Size wouldn't change due to snapshot existing