Oh Snap! Watch your block size!

23 02 2010

             So, here is the scenario.  You have a VM with a regular, lets say 40GB OS drive, and a 300 GB Data drive.  Now you want to backup the vm using something like vranger or veeam.  As part of the backup process, the VM is snapshotted (is that a word?).  Only problem is, you get this lovely error….

image

          Uh oh!  But my OS and Data drive are on separate volumes!  There is plenty of room on both!  What gives?  It all boils down to where your working directory is, and the block size of the volume that it resides on.  As you may know, when you are creating and formatting a volume for use in vsphere, you are asked what block size you would like to use.  By default this is set to 1MB block sizes.  The block size directly relates to how large of a file that can be created on the datastore. Let’s look at a table of the maximums as it relates to block size.

Block Size                            Maximum File Size

1MB 256 GB
2 MB 512 GB
4 MB 1024 GB
8 MB 2048 GB

                As you can see, if you go with the default 1MB block size, you can only have a file of 256GB in size.  One more piece of the puzzle reveals our underlying issue….the working directory.

image

                In vsphere, when a snapshot is created, there are some checks that are done to make sure that files created can fit into the datastore.  BUT this check is done against the datastore that contains the working directory for your VM.  In our example, the OS drive.  If our OS datastore only has a 1MB block size, it thinks that your 300GB snapshot of your data drive wont fit!  It does not base it’s estimation on if it will fit on the datastore where the 300GB vmdk resides, but instead on where the working directory resides……the 1MB block size datastore!  We cant fit a 300GB file on a 1MB block size datastore, so the snapshot fails!

                 Ok great.  It failed.  Now what?  We need to storage vmotion the OS drive and configuration files to a datastore with an 8MB block size.  This is to accommodate a secondary drive all the way up to 2TB, while simultaneously changing the working directory.  Right click the offending vm, choose Migrate, then Change Datastore, then click the advanced button and select a datastore for the config file and hard disk 1 that has a 8MB block size.

image

Once the storage vmotion is complete, you can now snaphot your vm and get it backed up!

 

More info:

http://www.yellow-bricks.com/2009/08/24/vsphere-vm-snapshots-and-block-size/

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1012384

Advertisements