Thin-provisioned disks, or thin disks, have been getting a lot of exposure as a new feature in vSphere, but they can already be used in VMware Infrastructure 3 (VI3). If not properly managed, however, you can overcommit disk space to the point where you can run out of Virtual Machine File System (VMFS) space, which would cause your virtual machines (VMs) to crash or fail. (For information on what thin disks are and the other virtual disk types that are used in ESX, see Choosing a virtual disk type for VMware ESX: Raw, thick and thin disks.) There are a few things you should know about managing think disks to prevent this from happening.
The reason that thin disks are being branded as a new feature in vSphere is that they are a lot easier to use and manage in vSphere than they were in VI3. In VI3, you could create thin disks, but you had to do it using the Service Console command-line utility vmkfstools; all disks created using the VMware Infrastructure Client (VI Client) were thick disks.
In vSphere you can create thin disks using the VI Client when you are creating a virtual machine, as seen in Creating a VMware vSphere guest OS: What’s new. There is also a new Storage View that allows you to see the true size of all your virtual disk files, and you can inflate a thin disk to its maximum size using the VI Client as well as convert an existing thick disk to a thin disk using Storage VMotion. These new features make using thin disks much easier, but before you start using them you should make sure you understand them in order to properly monitor them.
If left unmonitored, thin disks can cause big problems in your environment, as this technology essentially allows you to overcommit disk space similarly to how you can overcommit memory in ESX. Here are a few things you should know if you plan on using thin disks:
1. Monitor your data store free space carefully. There is a new alarm in vSphere to monitor data store free space called Datastore Usage on Disk that will alert you when your data store disk space usage grows to a defined percentage. Additionally there is another alarm that you can set called Datastore Disk Overallocation % which will trigger when your disk space over-allocation reaches a defined limit (i.e. 300%).
2. Be aware of snapshots in your environment which can affect the amount of free disk space on your data stores. Having two types of disk files that can grow on your data stores is a double threat. Setting the newly available alarms for snapshot size will alert you to when snapshots grow too large, which is when you should delete them.
3. The new Storage View is your friend; it shows detailed VM file information all in one view that displays snapshot sizes, true thin disk sizes, .vswp and other file sizes. Use this view so you can see all your VM file sizes at once. You can also click on column headings to sort on them.
4. Avoid using thin disks with servers that that will have disks that will not grow that much and will be near their capacity right away. There’s not much benefit to using thin disks if a VM is going to be using most of its disk space from the get go. In this case, it’s better to size your VM’s virtual disks to what they will need and not give them space that they will never use.
You get the most benefit out of using thin disks when you apply the function to servers whose disk space usage will start small and grow over time, such as with file and database servers. If you have mostly static servers like application and Web servers, give them the disk they need and don’t go overboard. You can always grow the disks later on if you find you are running out of space.
5. Avoid doing operating systems disk defragmentations on VMs with thin disks. This will cause the VM disk file to grow quickly which may fill up your data store before you can react to any alarms that the process may trigger.
6. Be aware that thin disks grow or inflate as data is written to previously unwritten disk blocks, but they do not automatically shrink or deflate when data is deleted. If you have a VM with a thin disk that had a lot of data on its virtual disk that was later deleted, you can manually recover this space by doing a Storage VMotion and specifying a thin disk type again. This will create a new disk file that will be slightly larger than the amount of data that is in use on the disk.
By being aware of these things and staying vigilant you can enjoy the disk savings that thin disks provide without causing problems or disruptions in your environment.