VMware Cloud Community
jimmyc11
Contributor
Contributor
Jump to solution

Expand Hard-Disk size on VI Image

Hi,

Is there anyway to expand the HD size on an image I've already uploaded to my ESXi (3.5) server? I have tried powering down the image, and editing it's hard disk size under settings, but this didn't make any difference.

I am familiar with how to change the HD size on VMWare Workstation images. Is it similar to this or is there any easier way to do it?

This image is an application server and I stupidly deleted the original from my laptop, so this is the only copy I have. So is there a way I can increase the HD size on this image easily?

Thanks.

Reply
0 Kudos
1 Solution

Accepted Solutions
VMmatty
Virtuoso
Virtuoso
Jump to solution

Do you have a backup of the VM that you can go back to? It looks like something got messed up with the partitions during the expansion.

I would try attaching the C drive of that VM to another virtual machine and powering it up. See if you can use diskpart to extend the volume or if it thinks it is already extended.

For future reference, with Windows Server 2008 you do not need a helper VM or even need to power off the VM itself to expand the hard drive. You can simply extend the space using the VI Client, and then Windows Server 2008 has hard drive expansion functionality built in. Goto Disk Management, right click and select Rescan disks to see the new size of the drive. Then right click on the current partition and select "Extend Volume" and a short wizard walks you through the rest. You can do this with no downtime.

Matt | http://www.thelowercasew.com | @mattliebowitz

View solution in original post

Reply
0 Kudos
14 Replies
Troy_Clavell
Immortal
Immortal
Jump to solution

what is your guest OS? Also, if you are expanding the drive using the VIC and the guest has a snapshot you will not be able to expand it. You can't have snapshots present when trying to expand a guests HDD.

Reply
0 Kudos
jimmyc11
Contributor
Contributor
Jump to solution

The guest OS is Windows Server 2008.

I have a snapshot, but can I just delete it and re-take it after I expand the drive?

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

yes, delete the snapshot, once it's gone you can move forward with extending out the guests HDD. If the drive you are extending is system volume (C: drive) you will have to use a helper VM and attach the HDD and then run diskpart. Otherwise if it's a non system HDD you can just run diskpart and extend the volume in the W2k8 guest.

make sense?

jimmyc11
Contributor
Contributor
Jump to solution

OK, so it is the C:\ drive I want to expand. So I delete my snapshot.

I'm not sure what you mean by using a 'helper-vm'?

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

yes, first delete the snapshot, then expand the HDD with the VIC, shutdown your guest and follow the steps below, starting at step 4

http://vmprofessional.com/index.php?content=2k3resize

RDPetruska
Leadership
Leadership
Jump to solution

Refer to Eric's page for many methods of resizing virtual disks.

Reply
0 Kudos
jimmyc11
Contributor
Contributor
Jump to solution

Thanks a lot guys. I can't attempt this right now, as the app the image is hosting is in use.

I'll give this a try tomorrw and let you know if I've any problems.

Thanks.

Reply
0 Kudos
jimmyc11
Contributor
Contributor
Jump to solution

Hi guys,

I tried the following procedure:

- SSH to ESX and run the command to allocate more GB's to this image (worked OK)

  • Mount gparted ISO and power on image.

  • Expand the partition in gparted, (operation was a success)

But - When I powered back on my image, all I get is a black screen with flashing white dots! See the attached screenshot. The OS is Windows server 2008. Have I done something incorreclty or is there an issue with doing this on server 2008 VM's?

Thanks.

Reply
0 Kudos
VMmatty
Virtuoso
Virtuoso
Jump to solution

Do you have a backup of the VM that you can go back to? It looks like something got messed up with the partitions during the expansion.

I would try attaching the C drive of that VM to another virtual machine and powering it up. See if you can use diskpart to extend the volume or if it thinks it is already extended.

For future reference, with Windows Server 2008 you do not need a helper VM or even need to power off the VM itself to expand the hard drive. You can simply extend the space using the VI Client, and then Windows Server 2008 has hard drive expansion functionality built in. Goto Disk Management, right click and select Rescan disks to see the new size of the drive. Then right click on the current partition and select "Extend Volume" and a short wizard walks you through the rest. You can do this with no downtime.

Matt | http://www.thelowercasew.com | @mattliebowitz
Reply
0 Kudos
jimmyc11
Contributor
Contributor
Jump to solution

Hi,

Yes, luckily I took a backup before attemping the expansion, so I have now reverted to that.

I didn't realise I could extend the space with no downtime. I will try what you outline below.

Thanks,

Jimmy

Reply
0 Kudos
jimmyc11
Contributor
Contributor
Jump to solution

I can't believe how easy that was!!!

Thanks VMmatty!!!

Reply
0 Kudos
fafa24
Enthusiast
Enthusiast
Jump to solution

I also need to expand a VM hard drive, but luckily it's only a D drive with data on it and no system drive.

In my case does it mean I can expand the hard drive using Virtual Center, move the slider to the right and later use the diskpart command in the guest OS? It's a Windows 2003 Server.

Thank you

Edy

Reply
0 Kudos
VMmatty
Virtuoso
Virtuoso
Jump to solution

Yes, if it's a data volume then you can do what you describe with no downtime. Extend the space in vCenter, make sure the new space is visible in the VM (Disk Management/Rescan Disks), and then use the "extend" command in Diskpart to extend the space.

Matt | http://www.thelowercasew.com | @mattliebowitz
Reply
0 Kudos
fafa24
Enthusiast
Enthusiast
Jump to solution

Thank you, brilliant news.

Reply
0 Kudos