In part 1, we installed StarWind iSCSI and added a simple virtual disk for a VM. In my lab I have a server (NAS1) with a 750 GB C: drive and the server is iSCSI-enabled using Starwind. From XenServer I want to install 20 VMs (Windows 2008 R2) on it, each with a 72 GB system disk. The installed OS will not take up more than 12 GB, so each VM will have 60 GB free space for future use. Sure, I could just give them 20 GB but I’m lazy and don’t want to spend time later to extend C: at a later time when/if I decide to add data to C:.
20*72 = 1440 GB does not of course fit that 750 GB disk, but in reality, used space will only be 20*12 = 240 GB. This is also since I have many VMs in my lab, many of them switched off and only powered on when I need to do some testing. So instead of taking up 1440 GB disk, they will only take up 240 GB when switched off.
Thin provisioning enables what I need. It will create a virtual disk starting at just a few bytes and once I start installing the OS and adding data, the disk will grow. In XenServer, thin provisioning is possible using local storage if you make sure to set the local disks to Ext3 format.
Since I want to over-allocate disk space, it means I need to make sure I don’t pass the 750 GB limit before I decide to do something about it. In some production cases, this is not recommended since you will definitely get in trouble if you fill the disk and all your VMs will come to a sudden stop. But, in a lab/test environment, this is very useful.
Just a side note here, this was what I figured out using XenServer 5.6 FP1 and StarWind 5.6 – in future versions, this might change. This information was pretty hard to figure out but this forum post explained it pretty well:
As for thin provisioning in XenServer, as mentioned it depends on the type of storage in use. XenServer can only create thin provisioned virtual disks on certain storage repository types, specifically Local EXT, NFS, and SRs managed by StorageLink. XenServer won’t do thin provisioning on SRs on iSCSI (hardware or software) or FC if they are not managed by StorageLink, and not on Local LVM at all. Thin provisioning done by XenServer is separate from thin provisioning done by your storage.
But when creating a basic disk in StarWind, the physical size of the .img file will be the full size. Sure, you could add a ~750 GB basic virtual .img file but if you add a 72 GB VM to it, it will take 72 GB and after about 10 VMs, you have run out of “space”. Instead, when creating the disk, you can choose to create an Advanced Virtual disk instead:
Choose Snapshot and CDP device:
Choose to Create new virtual disk:
Choose where to store the virtual disk and as you can see, I put the size to 10 TB even though the disk is only 750 GB:
Choose Growing Image (Thin Provisioning):
Finish the wizard and you will see the size is nowhere near 10 TB:
Add storage to the XenServer (see part 1 how to) and you’ll see the amazing size 🙂
Once you start adding VMs it will grow over time and XenServer will still think there are TB:s of space left.
Once again, remember that this is for my lab – in a production environment, you would probably design this differently.