Wednesday, April 11, 2012

VMware ESXi Virtual Disks

There is a VMware Knowledge Base article here, which covers the basic procedure for all the different VMware products, but it's rather brief so we'll go through the steps using the vSphere Client:
First of all, make sure that there are no snapshots of the VM (right-click the VM and select "Snapshot Manager" to check). If there are, you will need to "Delete All" to commit them - bear in mind that the process is much quicker if the VM is shut down when you do this. If you are running ESXi 4.1 or later, and the VM has VM Tools installed, then you can expand the virtual disk without having to shutdown first, otherwise you will get an error message. It goes without saying of course (but I will say it anyway!) that you should make sure you have an up to date backup of the VM before you attempt this process. There should be little risk of any problems but if something does go wrong, you could potentially lose an entire drive of data.
When you are ready, right-click on the VM in the lefthand pane and select "Edit Settings." You should then see a window like this:

Now your first challenge if your VM has more than one disk listed, is to ensure you choose the correct disk. Usually it should be pretty obvious as your system (C:) drive will be on "Hard disk 1". You can also often differentiate the disks by checking their size, but if you are still not sure, then checking the disk properties within Windows will show you the SCSI ID which you can match up to the "Virtual Device Node" on this page. Bear in mind that it is best to get it right the first time, as shrinking a virtual disk is actually much more time consuming than expanding one. When you are confident that you have identified the disk you want, click to select it in the left pane, then increase its size in the "Provisioned Size" box on the right. The "Maximum Size" figure below shows you how much free space is on the datastore, so in theory how large you can make your virtual disk, however it's never a good idea to fully allocate all your datastore storage. The amount of space to leave free depends on a number of factors, in particular, the number of thin provisioned disks you have. Try to leave a suitable buffer or else you may find all your thin provisioned VMs freezing because the datastore has run out of space.
Once you have changed the size, click "Ok" to close the "Virtual Machine Properties" window and you will see a task executing in the bottom pane of the vSphere Client. It should show as "Successful" after a few seconds; if it says "Error" you will need to look at the details to see what the problem was. Assuming the task was successful, the next step in the process depends on your Windows version.

No comments:

Post a Comment