header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Expand VM's hard disk size - powerCLI
Last Post 10 Mar 2010 02:13 AM by Dave_Ackroyd. 4 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Resolved
Dave_AckroydUser is Offline
New Member
New Member
Posts:7
Avatar

--
08 Mar 2010 06:35 AM
    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
    Marco Shaw (MVP)User is Offline
    Veteran Member
    Veteran Member
    Posts:1642
    Avatar

    --
    08 Mar 2010 06:40 AM
    You should consider going to the VMWare forums in this case:
    http://communities.vmware.com/commu...s/powercli
    Marco

    *Microsoft MVP - Windows PowerShell
    https://mvp.support.microsoft.com/profile/Marco.Shaw
    *Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
    *Blog - http://marcoshaw.blogspot.com
    RvdNieuwendijkUser is Offline
    New Member
    New Member
    Posts:3
    Avatar

    --
    08 Mar 2010 01:46 PM
    You can do this in PowerCLI with the Set-HardDisk cmdlet.

    Set-HardDisk -HardDisk $hd -CapacityKB $extendedCapacity -HostCredential $hostCred -GuestCredential $guestCred

    Extends a hard disk with the specified capacity. The command also extends the disk on the guest OS.

    Robert
    Dave_AckroydUser is Offline
    New Member
    New Member
    Posts:7
    Avatar

    --
    09 Mar 2010 12:36 AM
    thanks for your reply - just trying it out now
    what do I use for -HardDisk? I tried the Id bit it cannot bind parameter 'HardDisk'?
    thanks
       EDIT:
    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

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

    StorageFormat : Thick
    Persistence : Persistent
    DiskType : Flat Filename : [MSA2000_1_2] Academy Apps+JQ-2fUpdates Server/Academy Apps+J 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 : [MSA2000_1_2] Academy Apps+JQ-2fUpdates Server/Academy Apps+J Q-2fUpdates Server_1.vmdk
    CapacityKB : 209715200
    ParentId : VirtualMachine-vm-134
    ConnectionState :
    Id : VirtualMachine-vm-134/2001
    Name : Hard disk 2

    [vSphere PowerCLI] C:\> get-vm phwds | Get-HardDisk | select *

    StorageFormat : Thick
    Persistence : Persistent
    DiskType : Flat
    Filename : [MSA2000_1_3] 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 : [MSA2000_1_3] phwds/phwds_1-000001.vmdk
    CapacityKB : 52428800
    ParentId : VirtualMachine-vm-1366
    ConnectionState :
    Id : VirtualMachine-vm-1366/2001
    Name : Hard disk 2
    Dave_AckroydUser is Offline
    New Member
    New Member
    Posts:7
    Avatar

    --
    10 Mar 2010 02:13 AM
    Simple problem - there was a snapshot which prevented the disk size being changed - thanks for the help
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer