Extending Primary partition hard disk size of virtual machine in VMware ESX4.0

In this post I am going to illustrate how to extend hard disk on test VM (referred to as Increase_Space_VM) with a 10gig C: drive to a 25gig C: drive.
Increase_Space_VM == VM on which we want to increase disk space
Spare_VM == VM which is not in production usage and can be powered-on/powered-off at will
  1. Make complete backup, then shutdown Increase_Space_VM.
  2. Open ssh session to ESX host containing the Increase_Space_VM.  Change directory to /vmfs/volumes/<specific-LUN-holding-VMdisk-files>/<Increase_Space_VM>/
  3. Run command:  vmkfstools –X 25G Increase_Space_VM.vmdk
    -X specifies to extend the disk.  25G is the new *complete* size.  In my example, I started with a 10gig C: drive and I wanted to make it 25gig (25G).  
  4. Power off Spare_VM.  Edit settings on Spare_VM, adding Increase_Space_VM.vmdk as a second hard disk
  5. Power on Spare_VM.  Once booted into Windows, open a command prompt
  6. Once at the command prompt, run disk partition tool DISKPART. (see screenshot at end).
    Note, Disk 1 is shown at 25 GB, with 15GB free.  This is Increase_Space_VM’s C: drive, mounted as E: on Spare_VM.  10GB is in use, and can now be extended to 25GB total.  In the screenshot, you’ll see the syntax for selecting the proper disk, proper volume, and then typing extend.  Quit out of DISKPART and power-off Spare_VM
  7. Once Spare_VM is powered-off, Edit the settings to remove the 2nd hard-drive.
  8. Power on Increase_Space_VM.  Once booted up, C: will now be the full 25GB instead of 10GB.
Extending primary partition hard disk space in VMware ESX4.0

0 comments:

Post a Comment