Computer Tips and Tricks
Get the latest posts via rss

Thursday, 12 April 2012

How to Increase a Virtual Disk in VSphere 4

Recently we have had a couple of incidents where we had run out of disk space on our Windows servers. Sometimes we were able to rectify this just with simple housekeeping: Removing programs no longer needed, or deleting profiles, and temp files etc.

There have been times though when this just isn't enough, and nothing short of a bigger disk will do. With  vmware it is possible to increase the size of a non system volume quite easily with a few simple steps. It can also be performed without shutting the server down and zero downtime.

Note: Before attempting this you need to check 3 things.

1. That you have a backups of your data in case anything should go wrong.
2. You need to identify which disk (in vmware) that you need to increase.
3. That the LUN that your disk resides on has enough space to cope with the increase or move it accordingly.

In the vsphere client, right click the server you wish to increase your disk space on, and select "edit settings."
Select the disk you wish to increase. If you have multiple disks, make sure you select the correct one. Also make sure it is NOT a system drive (c:), we will come to those later.

Increase the "Provisioned size" to the desired capacity and click OK. Allow a minute or two for vmware to do its job.

  • Log on to the server and load Windows Server Manager.
  • Open Disk Management to display your disks/volumes.

You will find that the disk you are increasing will now have some unallocated space. This will need to be merged with the current partition using Diskpart.

Open an Administrative Command prompt and type "Diskpart" to load the tool, then use the following commands to extend the volume.

  • list volume
  • select volume [volume number you want, based on result of last command]
  • extend

If the operation completes successfully, exit Diskpart and close the command prompt. Go back to Disk Management, and your unallocated space will now have been added to your disk.

As mentioned earlier, this procedure is for non System partitions. If you have a boot drive with a similar issue, there are further steps to perform. The server must also be powered down to do this.

Beware though, increasing a boot partition is risky, and could prevent the server from boot up again afterwards. Make sure you have a adequate backups. You perform this operation at your own risk.

Once powered down, increase the "Provisioned size" as before for the disk in edit Settings and click OK.

Once vmware has completed the increase, you need to attach the disk to another virtual machine. This can be any non essential server. We just need the disk to be seen as a non system disk. This VM does NOT need to be power down. It is also not required for the disk to be removed from the original server.

Now follow the same steps as before. When loading the disk management, you will get the following box.

Click OK and carry on with the procedure.

Once completed, remove the disk from the VM and reboot the original server.

If the gods of computing are generous, your server will boot up with the newly allocated space added to your system partition.


Post a Comment