0

VDI Base Image: The Missing Step

 2 years ago
source link: https://myvirtualcloud.net/vdi-base-image-the-missing-step/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

VDI Base Image: The Missing Step

  • 04/20/2011

How far can you go when creating the perfect base image for your VDI deployment? I haven’t stopped searching for the Holy Grail, however I have recently figured out that a very critical step in the base image creation was missing, forgotten or had not been discussed yet or enough.

However, before I give you the cooking recipe let’s dig into the semantics of the problem.

During tests with the Linked Cloning technology on VMware View 4.6 (although the example below applies to any version) I noticed that the Replica disks and Linked Clones were using more storage space than they should, or had been provisioned with.

Observing the size of .vmdk’s I noticed that Replica disk sizes were much bigger than Windows NTFS used space was showing.

I won’t explain how Linked Cloning works in this article, but feel free to read my article VMware View 4.5 Linked Cloning explained for a better understanding. If you haven’t catch-up on my previous articles – the size of a replica disk is equal to the disk space consumed in the Parent SOE.

So, if the above is true why does the Replica size doesn’t match the NTFS used space?

Provisioned VM Size: 31.99GB (33,554,430)
Replica Size: 19.10GB (20,033,540)

NTFS Provisioned: 31.99GB
NTFS Used: 14.4GB
NTFS Available: 17.5GB

(Real life example above)

To find out the reason of this disparity I filled up the Windows NTFS partition with data until nothing else would fit, not even a 1KB file. At this point Windows file system had 0KB free space. When I looked at the Delta it was 17.52GB, and that matches with the NTFS free space from above example. Therefore:

Replica (19.10GB) + Delta (17.52GB) = 36.62GB

Discounting additional files like swap and logs, there was an additional 4.63GB if compared to the total provisioned for the VM that was 31.66GB. In Summary, the replica is 4.63GB bigger than the real data in the Windows NTFS partition.

In normal case, a full clone VM’s .vmdk file is always large than the actual NTFS usage. This is because that once a .vmdk file (in Thin format) grows up, it does not shrink back when NTFS released some space, unless the user shrinked the .vmdk files explicitly.

If a replica was created before such "shrinking" was performed, then the size of the copied disk of the replica will be larger than the actual NTFS used space. When a linked clone is created from such a replica attempt to write data into these NTFS free space, the update will be written into the delta disk. These writes could simply have been executed by Windows swap files or Logs.

Consequences

This may not seem like a big issue at first, however in certain situations it could use storage space that was not initially provisioned, costing projects additional money that was not originally accounted for. I used my VDI Calculator to simulate a scenario with 2,000 VMs and a maximum of 2 concurrent snapshots per desktop pool (only 4 pools).

Replica Size: 8GB
Total Storage for Replicas: 2.20TB

Replica Size: 8GB + 4GB (overhead):12GB
Total Storage for Replicas: 3.30TB

Just making sure that Parent VMs have been properly shrunk you could be saving few gigabytes or even terabytes depending on the size and design of the VDI solution.

In a scenario with more desktop pools and more LUNs these numbers could be even bigger.

** The calculations above only reflect deployments NOT using Dedicated Replica Datastores. When using Dedicated Replica Datastore the difference was from 70MB to 100MB.

Solutions

To avoid datastore space to be wasted on unshrinked free space copied by the Replicas disks, always shrink the Parent VM’s virtual disks before taking the snapshot to initiate the linked cloning process.

One of the methods to shrink a .vmdk disk is using vmware-vdiskmanager.exe utility. VMware Virtual Disk Manager is a utility in VMware Workstation that allows you to create, manage and modify virtual disk files from the command line or within scripts.

To shrink a virtual disk, it must be located on a Windows host. Before you can shrink the virtual disk, you need download the virtual disk for shrinking. Then use a command like the following:

vmware-vdiskmanager -k myDisk.vmdk

The easy way is to use VMware Tools installed in the parent VM. Shrinking a virtual disk reclaims unused space in the virtual disk. It means that, if there is empty space in the disk, this process reduces the amount of space the virtual disk occupies on the host drive.

To shrink a virtual disk:

1. Launch the control panel.

Windows guest — double-click the VMware Tools icon in the system tray, or choose Start > Settings > Control Panel, then double-click VMware Tools.

2. Click the Shrink tab.

3. Select the virtual disks you want to shrink, then click Prepare to Shrink.

Be aware that you cannot shrink a virtual disk if

  • You preallocated disk space when you created the disk. Preallocating disk space is the default option for both typical and custom virtual machine creation paths.
  • The virtual machine has any snapshots.
  • The virtual machine contains physical disks.
  • The virtual disk is not an independent disk in persistent mode.
  • The virtual disk is stored on a CD-ROM.

Recommend

  • 10
    • myvirtualcloud.net 3 years ago
    • Cache

    Free VDI options for KVM hypervisor

    Free VDI options for KVM hypervisor 01/01/2016Most VDI deployments in enterprises run with VMware Horizon View, or Citrix XenDesktop, or with smaller or up and coming market players such as Parall...

  • 7

    VDI Calculator v7 Now Available w/ major changes 04/06/2016CHECK OUT THE NEW WEB VDI CALCULATOR HEREToday I am releasing a new...

  • 8
    • myvirtualcloud.net 3 years ago
    • Cache

    New KVM-VDI Open Source Project

    New KVM-VDI Open Source Project 01/01/2016The team at Vilnius University in Lithuania contacted me about an open-source project they have been working on. The university developed a KVM based VDI solut...

  • 6

    VDI Calculator v7.4 Update 12/20/2017Hello,This is a minor update to the VDI Calculator, just adding capability and support for Intel Xeon processors with 20 cores. I’m adding that mostly because...

  • 6
    • myvirtualcloud.net 3 years ago
    • Cache

    VDI USER EXPERIENCE and USER ACCEPTANCE

    VDI USER EXPERIENCE and USER ACCEPTANCE 05/07/2011I have seen a number of failed VDI deployments. Some of them failed because of poor initial technical design or lack of information during initial...

  • 3
    • abcdxyzk.github.io 3 years ago
    • Cache

    VirtualBox压缩vdi

    VirtualBox压缩vdi 2014-10-15 01:15:00 http://blog.csdn.net/zcg1041bolg/article/details/7870170 VirtualBox guest os用久了vd...

  • 2
    • myvirtualcloud.net 3 years ago
    • Cache

    VDI Display Protocol Calculator v1.0

    VDI Display Protocol Calculator v1.0 01/31/2011 I have just made available the first release of my VDI Display Protocol Calculator. This calculator complement the online

  • 0
    • myvirtualcloud.net 3 years ago
    • Cache

    VDI + Windows PageFile Done Right!

    VDI + Windows PageFile Done Right! 02/16/2012Windows pagefile configuration for VDI environments has been a long standing discussion ground. I first wrote about it in 2010 (

  • 2

    VDI Calculator 7.2 Now Available w/ Support for Workspot 06/05/2017Today I am releasing version 7.2 of the VDI Calculator, and the key feature is the addition of support for Workspot.

  • 7

    New VDI Calculator (HTML) debuts today! 09/16/2020 Over the years, the VDI Calculator has been used thousands of times by architects and infrastructure teams to size VDI deployments. Just in 2020...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK