VMware Cloud Community
lmuser
Contributor
Contributor
Jump to solution

Resizing a virtual disk

This is probably an easy question, but I just want to make sure so I don't risk any data loss here. I have a win2k3 VM with two drives: C, D. Each drive is a separate vmdk. C drive is the system disk, and I just need to expand the space on D. Would this be the correct procedure?

1. Shut down the VM

2. login to SC and run: vmkfstools -X 20GB (current size is 16GB)

3. Start VM and under disk management, resize the D partition to utilize the new free space.

The only other possible variable I can see here is that I have two snapshots of the VM currently. Will this cause problems? If so, do I just need to remove the snapshots before performing this operation?

Thanks!

Reply
0 Kudos
1 Solution

Accepted Solutions
brentcochran
Enthusiast
Enthusiast
Jump to solution

We perform the procedure all the time on system and data partitions. As with everything, there are many ways to do it, but this is ours:

1. shut down VM

2. select 'modify settings' in the VIC and change the drive size to 20G

3. fire up VM and extend data partiton with diskpart (will need to download from MS on win2k).

diskpart

list volume

select volume ?

extend

If you need to do this with a system partition, the process is the same except that you'll have to mount the vmdk with a different server and run diskpart from there.

Good luck!

Brent

View solution in original post

Reply
0 Kudos
7 Replies
brentcochran
Enthusiast
Enthusiast
Jump to solution

We perform the procedure all the time on system and data partitions. As with everything, there are many ways to do it, but this is ours:

1. shut down VM

2. select 'modify settings' in the VIC and change the drive size to 20G

3. fire up VM and extend data partiton with diskpart (will need to download from MS on win2k).

diskpart

list volume

select volume ?

extend

If you need to do this with a system partition, the process is the same except that you'll have to mount the vmdk with a different server and run diskpart from there.

Good luck!

Brent

Reply
0 Kudos
lmuser
Contributor
Contributor
Jump to solution

Thanks! That helps a lot. Can you perform this procedure on a VM with snapshots or do I have to delete those before doing this?

Reply
0 Kudos
mikepodoherty
Expert
Expert
Jump to solution

provide multiple options for resizing the virtual disk with detailed instructions in this thread:

java_cat33
Virtuoso
Virtuoso
Jump to solution

Do NOT resize a disk with snapshots. If possible, always take a copy of the vmdk before extending it as a quick recovery method.

I use the same method as brentcochran mentioned, however if the disk extended is the system volume I boot the VM off a Barts PE environment and extend the disk from within the PE environment so no other disk signatures could be written to the disk.

depping
Leadership
Leadership
Jump to solution

commit the snapshots first, otherwise resizing will screw up the vm.



Duncan

Blogging: http://www.yellow-bricks.com

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
lmuser
Contributor
Contributor
Jump to solution

Cool thanks. Last dumb question of the day. Can I delete snapshots while the VM is running?

My situation looks like:

VM

--snap1

-


snap2

-


current state

I just want to do a delete all I'm assuming in order to commit the changes?

Sizes are as follows:

HD1 Delta1- 13GB

HD1 Delta2- 13GB

HD1 Flat- 17GB

HD2 Delta1- 21GB

HD2 Delta2- 10GB

HD2 Flat- 34GB

I've never deleted snaps before, how long (roughly) can I expect this to take?

Thank again to everyone for the help!

Reply
0 Kudos
java_cat33
Virtuoso
Virtuoso
Jump to solution

Yes you can delete the snapshots while the VM is running. It will take a while - maybe 1 hr due to the size of them. It also depends on the type of storage you are using etc....

If you are going to "delete all" make sure you have enough free space on your datastore as from my understanding and calculations - you will require an additional 50GB of space while the 4 deltas are committed to the base vmdk.

If you have the option of powering off the VM - power it off, delete all the snapshots and then power the VM back on - it will be quicker and reduce the risk.

Reply
0 Kudos