VMware Cloud Community
sixteensix
Contributor
Contributor
Jump to solution

Resizing Virtual HDD's

Pardon my ignorance here but I need something clearing up...

We are currently in a Live ESX environment, which is administrated by two of my colleagues. We were made to believe (the sell factor) that with the virtual hard disks you could just change the size of them on the fly e.g. using a slide bar. But when problems arise from disk becoming full, they seem to go down the route of creating a new vHDD and mark it as Dynamic (Windows Shop) and extend the volume. This is now taking us down the avenue where by a single volume is having multiples dynamic disks.

Is their a way of doing this on the fly? Do servers need to be taken offline?

Any information, suggestions and opinions would be greatly appreciated.

Many thanks

Sixteensix

Message was edited by:

sixteensix

0 Kudos
1 Solution

Accepted Solutions
paulo_meireles
Jump to solution

Panzer's instructions are correct.

One drawback is that you cannot do this on the fly on the boot-disk. You will have to mount the vmdk-file as a second disk on another Windows VM, and the run DISKPART to extend it.

Let me just add a tiny bit of info that drove me mad for weeks. When you add a disk to an existing VM, it may not assign drive letters. The problem is, if a volume doesn't have a drive letter, it cannot be extended[/u]. So, be sure to type "assign" in diskpart just after you have selected the volume. Otherwise, if it doesn't have a drive letter, it will fail to extend .

Paulo

View solution in original post

0 Kudos
8 Replies
alelievre
Enthusiast
Enthusiast
Jump to solution

You can use the command vmware-vdiskmanager to resize your virtual disks.

I'm almost sure you'll have to poweroff your VMs.

0 Kudos
mbrkic
Hot Shot
Hot Shot
Jump to solution

vmware-vdiskmanager is a utility for the hosted products (i.e., Workstation, Virtual Server). On an ESX server you can use vmkfstools -X (see man vmkfstools for details) to grow a vmdk file. You then still have to grow the filesystem in the guest OS (i.e., Wndows, Linux...)

0 Kudos
Panzer
Enthusiast
Enthusiast
Jump to solution

Here is what you can do without rebooting the Windows VM:

1. extend the virtual disk with:

\# vmkfstools -X 10G myDisk.vmdk (not vmdk-flat)

This will extend the available partition to a total of 10GByte, not increase it by 10G.

2. In the Windows VM:

c:\> diskpart

c:\> List volume

c:\> Select extend

This will extend the partition and make use of all the extra space you gave it with vmkfstools.

One drawback is that you cannot do this on the fly on the boot-disk. You will have to mount the vmdk-file as a second disk on another Windows VM, and the run DISKPART to extend it.

sixteensix
Contributor
Contributor
Jump to solution

Thanks all! This will help greatly!!

Cheers

Sixteensix

0 Kudos
Panzer
Enthusiast
Enthusiast
Jump to solution

Please give points for helpful answers

paulo_meireles
Jump to solution

Panzer's instructions are correct.

One drawback is that you cannot do this on the fly on the boot-disk. You will have to mount the vmdk-file as a second disk on another Windows VM, and the run DISKPART to extend it.

Let me just add a tiny bit of info that drove me mad for weeks. When you add a disk to an existing VM, it may not assign drive letters. The problem is, if a volume doesn't have a drive letter, it cannot be extended[/u]. So, be sure to type "assign" in diskpart just after you have selected the volume. Otherwise, if it doesn't have a drive letter, it will fail to extend .

Paulo

0 Kudos
jftuga
Enthusiast
Enthusiast
Jump to solution

When I wanted to extend C:, I was able to upload a UBCD4WIN .iso file to the ESX server and use this for the CD-ROM. I booted the guest from the UBCD4Win disc and was able to run diskpart and extend the C: volume without any issues. I also ran a chkdsk /f /x C: and it did not find any problems either.

If you have not heard of UBCD4Win: http://www.ubcd4win.com/

-John

0 Kudos
jjohnston1127
Hot Shot
Hot Shot
Jump to solution

All of the above will work. What has worked best for me is this:

Use vmkfstools to extend the disk. Boot the Virtual Machine with GPARTED (http://gparted.sourceforge.net) and use it to extend teh partition then reboot. There are a few dozen programs out there that will do it but that's my flavor of choice.

Keep in mind, with VC 2.5 you can now change the size of the hard drive via "Edit Settings" on the VM. It does have to be powered off just like teh command line version.

0 Kudos