Let me paint a picture for you on something that I have seen pop up more than once. You send a request to the SAN team to get some storage added to your virtual infrastructure. The SAN team replies back that your LUNS are ready and available. You rescan your adapters and find the new 1TB LUN that the SAN team just provided. You follow the wizard and use the default settings to create your Datastore and format VMFS. So life is good, you have another terabyte of space and that should tie you over for at least a little while. Time goes by and you have created a few virtual machines on the new LUN and then you get the request for a virtual machine that will have a 300GB data drive. You start to create the virtual machine and things come to a screeching halt. An error has occurred because you used the default setting when you created the datastore. The LUN was formatted with a 1MB block size and the largest file size that can be on this LUN is 256GB. To really make thing worse, you cannot change the block size without destroying the LUN and starting over from scratch. You do not have enough room to storage vMotion, the virtual machines, to different LUNs. That puts the virtual machine request on hold until you get more space available to work with.
Oh, if there was only a way to get some kind of idiot check or warning; “Are you sure you want to do that?” There is no warning for this built in to vCenter but using vWire’s searching capabilities we can search out the datastore’s block size and have the ability to send out an alert when a LUN is detected with non standard block size. Create the LUN and then get an email before you get too far along loading up the new LUN with virtual machines.
Let’s take a look at the choices and sizes of the block size:
- 1MB block size - 256GB maximum file size
- 2MB block size - 512GB maximum file size
- 4MB block size - 1024GB maximum file size
- 8MB block size - 2048GB maximum file size
The first thing to make note of is that the VMware SDK reports disk space in bytes and therefore a little conversion will be needed. I found and like to use this site to quickly make the conversion for me.
Let’s take a look at what the search looks like for this event. I convert 256GB to bytes and get a value of 274877906944. So, for this search I am looking for any datastore’s that are greater than 274877906944 or 256GB and block size equals 1MB. Below is an example of the actual search string.
SELECT DatastoreEntity_5097 FROM DatastoreEntity AS DatastoreEntity_5097
WHERE ( DatastoreEntity_5097.summary.capacity > 274877906944 )
AND ( DatastoreEntity_5097.info.vmfs.blockSizeMb = 1 )
That handles the 1MB block size so let’s take a look what the search would look like for datastore’s that was larger than 256GB and smaller than 512GB and was supposed to have a block size of 2MB.
SELECT DatastoreEntity_1691 FROM DatastoreEntity AS DatastoreEntity_1691
WHERE ( DatastoreEntity_1691.summary.capacity > 274877906944 )
AND ( DatastoreEntity_1691.summary.capacity < 549755813888 )
AND ( ( DatastoreEntity_1691.info.vmfs.blockSizeMb is null ) OR ( DatastoreEntity_1691.info.vmfs.blockSizeMb <> 2 ) )
We know from the last example that 274877906944 bytes equals 256GB and another conversion of 512GB to 549755813888 so our search will look for datastore’s that are bigger then 274877906944 and less than 549755813888 and also have a block size that is greater than or less than 2MB.
We can follow the 2MB example and change the byte size and block size to get the search needed for LUNS that are 512GB - 1TB in size.
SELECT DatastoreEntity_1691 FROM DatastoreEntity AS DatastoreEntity_1691
WHERE ( DatastoreEntity_1691.summary.capacity > 549755813888 )
AND ( DatastoreEntity_1691.summary.capacity < 1099511627776 )
AND ( ( DatastoreEntity_1691.info.vmfs.blockSizeMb is null ) OR ( DatastoreEntity_1691.info.vmfs.blockSizeMb <> 4 ) )
Lastly, let’s look at the example for datastore’s that are larger than 1TB and have a block size that is greater than or less than 8MB.
SELECT DatastoreEntity_1691 FROM DatastoreEntity AS DatastoreEntity_1691
WHERE ( DatastoreEntity_1691.summary.capacity > 1099511627776 )
AND ( ( DatastoreEntity_1691.info.vmfs.blockSizeMb is null ) OR ( DatastoreEntity_1691.info.vmfs.blockSizeMb <> 8 ) )
Pretty straight forward, but yet very powerful to get information and an alert that you need when you need it. This is just one example of how you can use vWire to help bring you situational awareness of your environment.
Block Size, ESX, VMFS, vmware
Previous Post
Automated Fix for a DRS Issue
This entry was posted on Wednesday, October 7th, 2009 at 12:19 pm and is filed under Virtual Tech. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.






