Skip navigation
VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (6 pts)
725 Views 10 Replies Last post: Mar 6, 2011 7:21 PM by depping RSS
Simon.H Enthusiast 79 posts since
Oct 1, 2007
Currently Being Moderated

Mar 5, 2011 7:58 AM

Thin provisioning - size of next block?

I've always used thick disks for my virtual machines, simply because I don't want to cause disk fragmentation artificially.

 

However, I do think it would save me a fair amount of disk space across all VMs if I could use thin provisioning. If I did I'd want to do so in a way that when a disk expanded it took a large chunk of physical disk in one go. For example, let's say I have a Linux root disk requirement of 4GB. Typically I would create a 6 or 8GB thick disk, e.g.

vmkfstools -c 8G -d eagerzeroedthick -a lsilogic <vm_name>-root.vmdk

 

What I would like is to be able to create a thin provisioned disk of minimum size 4GB which then would extend, as space was required, in chunks of 1GB. In that way I'm thinking I could save some space, as well as give greater headroom for disks to grow, without causing lots of fragmentation. For those familiar with the traditional way an Oracle database worked I am thinking of an equivalent to the tablespace's initial extent size (i.e. the amount contiguously allocation at creation time) and the next extent size (i.e. the amount contiguously allocated when more space is required).

 

Is this possible? Is the theory behind this still valid, or does vmfs scatter data across a device anyway?

 

TIA!

 

 

Simon

a.p. Guru User Moderators vExpert 11,728 posts since
May 18, 2007
Currently Being Moderated
1. Mar 5, 2011 9:06 AM in response to: Simon.H
Re: Thin provisioning - size of next block?

I thought about this too some time ago, however there's no way you can do that out of the box.

What you can do is to create a thin provisioned disk and use a tool (e.g. "dd") to create and then delete a file with the initial disk size you want. Writing this file will allocate the blocks and also zeroes these blocks during the first write, so you will end up with an "eagerzeroed" thin disk with the minimum size you want.

About the block size you may want to read http://www.yellow-bricks.com/2009/05/14/block-sizes-and-growing-your-vmfs/. Reading the comments, it seems there's no real benefit from choosing larger block sizes.

 

André

a.p. Guru User Moderators vExpert 11,728 posts since
May 18, 2007
Currently Being Moderated
3. Mar 5, 2011 9:38 AM in response to: Simon.H
Re: Thin provisioning - size of next block?

From what I read so far, it looks like the fragmentation impact is minimal, since the VMDK increments are not like in the OS itself (4k, 32k, ...) but in MBs. In addition to this, the fragmentation inside the OS's filesystem itself may cause more overhead than the one in the VMFS.

 

André

 

PS: I asked these questions myself in http://communities.vmware.com/message/1484310, however no responses so far

a.p. Guru User Moderators vExpert 11,728 posts since
May 18, 2007
Currently Being Moderated
5. Mar 5, 2011 10:45 AM in response to: Simon.H
Re: Thin provisioning - size of next block?
I am wondering about the 8MB block size for datastores though - it's hard to see any downside

According to different block posts on yellow-bricks and others, there is no downside in using an 8 MB block size.

 

André

mcowger Champion User Moderators vExpert 3,635 posts since
Aug 22, 2007
Currently Being Moderated
6. Mar 5, 2011 7:49 PM in response to: Simon.H
Re: Thin provisioning - size of next block?

Honestly, though, think about how your VMDKs are laid out on disk of your array.  For many arrays (including the 3PAR & EVA systems I'm most familiar with), a more fragmented filesystem will actually result in better performance, due to more physical spindles being used in the servicing of an IO.

--Matt VCDX #52 blog.cowger.us
depping Champion VMware Employees User Moderators vExpert 4,239 posts since
Jan 17, 2005
Currently Being Moderated
9. Mar 6, 2011 7:14 PM in response to: Simon.H
Re: Thin provisioning - size of next block?

I wouldn't nother worrying about fragmentation from a vmdk perspective. that blocksize (1mb is the default) that is used is larger than most blocksizes the OS's use so chances of running into degraded performance are slim. On top of that you will have multiple workloads running on the same Host and accessing the same VMFS volumes and same array. IO will be random anyway.

 

There is no real downside to using 8MB blocks for VMFS, for the OS it won't make difference if you used 1MB blocks or 8MB blocks as the blocksize is used for the allocation of the disk and the size it zeroes out the blocks with but not for actual Guest OS related IO. Even for configuration files and log files it won't make a difference as VMFS uses 64k sub-blocks which will be used for the smaller files.

 

Duncan (VCDX)

Available now on Amazon: vSphere 4.1 HA and DRS technical deepdive

Duncan | Yellow-Bricks.com | Author of the vSphere 5.0 Clustering Deepdive
depping Champion VMware Employees User Moderators vExpert 4,239 posts since
Jan 17, 2005
Currently Being Moderated
10. Mar 6, 2011 7:21 PM in response to: Simon.H
Re: Thin provisioning - size of next block?

Simon H: Also note that a 1MB write from a VMFS perspective only occurs when it does a zero-out of the actual block, for the rest it is the OS which is dictating the sizes of the reads and writes... it is not VMFS which does this.

 

Duncan (VCDX)

Available now on Amazon: vSphere 4.1 HA and DRS technical deepdive

Duncan | Yellow-Bricks.com | Author of the vSphere 5.0 Clustering Deepdive

Bookmarked By (0)

Share This Page

Communities