WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Automating Dead Space Reclamation in ESXi 5.0u1

03.24.2012 by William Lam // 4 Comments

VMware released vSphere 5.0 Update 1 last week, which mainly included bug fixes but it also brought back one very cool feature that was initially introduced with the release of vSphere 5.0 called Thin Provisioning UNMAP primitive for an ESXi host. You can read more about the details in this article by my colleague Cormac Hogan.

As you can see from From Cormac's article, the process of reclaiming of dead space on a thin provisioned LUN is currently a manual process, but does it have to be? The answer is, No of course, we can can definitely automate this!

Disclaimer: This script is not officially supported by VMware, please test this in a development environment before using on production system. This script is provided as an example on you can automate this manual process.

Before you proceed, please understand that the UNMAP operation can potentially take a few minutes up to a few hours depending on the size of your datastore and how your array handles this operation. You should consider performing this operation during a maintenance window or during off peak hours else you could impact VMs residing on the datastore. You should also ensure you have a VAAI-capable storage array before performing running this script.

I wrote a simple shell script called reclaimMyDeadsSace.sh which needs to be executed on the ESXi Shell via SSH. The script will also perform some validation such as ensuring you are running ESXi 5.0 Update 1 and that your host is in maintenance mode as a per-caution to ensure no running VMs are on the host during this process.

You will only need to run the script on one of the hosts connected to all the datastores you wish to reclaim dead space on. You may use scp or WinSCP to transfer the script to your ESXi host and ensure you set the execute permission on the script (chmod +x reclaimMyDeadSpace.sh)

The script can be executed in two ways:

  1. Identify ALL VMFS3 and VMFS5 volumes and perform the reclaim based on the percentage entered by the user
  2. Reclaim on specific datastores specified by the user as well as the percentage to be reclaimed (this is recommended, that way script does not choose all datastores including local ones)

Here is an example of selecting ALL VMFS3 and VMFS5 datastores to reclaim 60% of free space:

Here is an example of selecting just 4 datastores specified in a file and we will be reclaiming 60% of free space:

In this example, we created a file called "datastore_list.txt" (you may name the file anything you want) which contains the following:
iSCSI-1
iSCSI-2
iSCSI-3
iSCSI-4

So if you are using thin provisioned LUNs and would like to reclaim some of that dead space back and have a VAAI-capable storage array, be sure to check out the UNMAP functionality in ESXi 5.0u1.

Categories // Uncategorized Tags // ESXi 5.0, unmap, vaai, vmkfstools, vSphere 5.0

How to Run Windows 8 Consumer Preview & Windows 8 Server on vSphere 5

02.29.2012 by William Lam // 15 Comments

A few weeks back I wrote an article on how to run Windows 8 Developer Preview on ESXi 5, which required a small trick to get working. Today, it looks like Microsoft just released the Windows 8 Consumer Preview and Windows 8 Server. For those looking to give these a try, you can do so by using vSphere 5.

Disclaimer: VMware still does not officially support Windows 8 on vSphere, this is mainly for educational and testing purposes. Do not use this in a production environment

UPDATE (06/02/12): The steps below are the same for the recent release of Windows 8 Release Preview and Windows Server 2008 (Windows 8 Server) RC.

Here are the three easy steps to run Windows 8 on ESXi 5

  1. Download and install ESXi500-201112001 (patch02) from VMware patch repository.
  2. Create either a Windows 7 or Windows 2008 R2 regular VM (You will need to use e1000 network driver, VMXNET3 does not work)
  3. Install Windows 8 Consume Preview or Server using the ISO (tested with 64bit) 

Note: Unlike the Developer Preview, no additional tweaks are needed to install Windows 8 Consumer Preview other than the ESXi 5.0 patch. 

    When you first boot up Windows 8, you should see this fish logo. Be patient and give it a few minutes to load:

     Shortly after, you will be prompted to start the installation:

    Here is a screenshot of Windows 8 Consumer Preview running on ESXi 5.0:

    Here is a screenshot of Windows 8 Server running on ESXi 5.0:

    Here is a screenshot of Windows 8 Server w/Hyper-V role enabled running on ESXi 5.0:

    To enable Hyper-V role, you will need to perform the following changes:

    • Update the guestOS to Windows 8 64bit using the vSphere Client
    • Add the following CPUID bits using the vSphere Client
    • Add the advanced setting using the vSphere Client hypervisor.cpuid.v0 = FALSE as described by this article as well as mce.enabled = TRUE (this is a new parameter introduced in ESXi 5) which is needed to run Hyper-V3 in Windows 8
    • Install Hyper-V role
    • Shutdown host
    • Remove advanced setting using the vSphere Client
    • Host should now boot and you should see the Hyper-V manager interface

    Note: You can install VMware Tools on either Windows 8 releases by right clicking on the VM->Guest->Install VMware Tools. If you install VMware Tools on Windows 8 Server, you may need to enable 3D support if you get a black screen after installation as noted in this article.

    So if you are itching to try out the new Windows 8 Consumer Preview or Server, you can install it and run it on vSphere 5!

    Categories // Uncategorized Tags // ESXi 5.0, vSphere 5.0, windows8

    How to Configure Nested ESXi 5 to Support EVC Clusters

    02.10.2012 by William Lam // 10 Comments

    Dave Hill recently wrote an article about running nested ESXi and a gotcha with EVC (Enhanced vMotion Compatibility). In vSphere 4.x, you could not join a nested ESXi host into a cluster with EVC enabled. With vSphere 5, there's actually a way to connect a nested ESXi 5 host to an EVC enabled cluster AND still power on 64bit nested guestOSes.

    I have to thank my friend and partner in crime Tuan Duong for showing me this trick awhile back. Tuan was performing some tests using both nested and physical ESXi 5 hosts and discovered this method after a bit of tinkering. At the time, I was not sure if others would find this useful and I did not document the process.

    Disclaimer: As usual, this is not officially supported by VMware, use at your own risk. 

    Here are the steps:

    1. You must be running vSphere 5, create a nested ESXi 5 host using this article How to Enable Support for Nested 64bit & Hyper-V VMs in vSphere 5

    2. Create an EVC enabled cluster or use an existing cluster with whatever baseline you would like and click on the "Current CPUID Details" in cluster settings.

    3. Copy down the CPU mask flags for that particular EVC baseline, you will need this in the next step

    4. Shutdown your nested ESXi 5 host and edit the VM's settings and under "Options" tab click on "CPUID Mask->Advanced". You will take the CPU mask from the above step and update the nested ESXi 5 VM to make it match

    5. Go ahead and power on your nested ESXi 5 host and join it to the EVC enabled cluster you created earlier. You should not see any errors when connecting to the cluster and after that you can create a nested 64bit VM within that virtualized ESXi 5 host.

    There you have it, running a nested ESXi 5 host and joined to an EVC enabled cluster! Isn't VMware technology awesome! 🙂

    Categories // Uncategorized Tags // ESXi 5.0, evc, nested, vesxi, vSphere 5.0

    • « Previous Page
    • 1
    • …
    • 4
    • 5
    • 6
    • 7
    • 8
    • …
    • 23
    • Next Page »

    Search

    Thank Author

    Author

    William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

    Connect

    • Bluesky
    • Email
    • GitHub
    • LinkedIn
    • Mastodon
    • Reddit
    • RSS
    • Twitter
    • Vimeo

    Recent

    • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
    • Quick Tip - Validating Broadcom Download Token  05/01/2025
    • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
    • vCenter Identity Federation with Authelia 04/16/2025
    • vCenter Server Identity Federation with Kanidm 04/10/2025

    Advertisment

    Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
    To find out more, including how to control cookies, see here: Cookie Policy

    Copyright WilliamLam.com © 2025