In part one of this series, we discuss the pros, cons and requirements of installing VMware ESXi on a flash drive.
In this tip, we cover the installation process and additional information on configuring and maintaining an ESXi flash drive.
Creating a bootable flash drive starts with booting from an ESXi installation CD. But instead of installing to a server's hard drive, you will install VMware ESXi on a USB drive.
Installing VMware ESXi to a USB flash drive: Method one
For this process, you can use any server or workstation that supports ESXi. Once you are ready, follow these steps to create an ESXi flash drive.
- Download the ESXi installable ISO file from VMware's website.
- After you've downloaded the ISO file, burn it to a CD or DVD for use in a server or workstation.
- Make sure the flash drive is installed into a server's USB port. Then boot from the CD or DVD that you created, and run the ESXi installer.
- When prompted to select a drive, choose the USB flash drive rather than a local disk partition.
- Once the ESXi installation completes, remove the CD or DVD and reboot. ESXi will then load from the flash drive.
Installing VMware ESXi to a USB drive: Method two
An easier method for installing VMware ESXi on a USB flash drive involves using VMware Workstation, which VMware's Eric Gray about. Here's how.
- Create a new virtual machine (VM) in Workstation, and make sure it has at least 2 GB of memory to run ESXi. Workstation 7 can do so natively, but Workstation 6.5 requires some modification. Next, customize the hardware, and add a USB controller to it.
- Connect your USB flash drive directly to a VM by selecting Removable Devices under the VM drop-down menu. Note that it's removed from the host PC when it's connected to a VM.
- When the ESXi installer loads, go through the screens and select the USB flash drive (rather than of a VM's hard drive) on which to install it.You'll know it's the right one because it's the same size as your flash drive (in this case, 4 GB).
- After the installation completes, power off the VM. Pull out the flash drive, and plug it into a server. Now you're ready to go.
Note: Once you create the ESXi flash drive using VMware Workstation, if you try boot from it with the VM you created, it won't work. Workstation does not support booting from an ESXi-equipped flash drive. There is a workaround, however, that allows you to boot from a thumb drive if you want to test it.
After installing VMware ESXi to your flash drive, if you insert it into a Windows PC, notice that the volume label has been changed to Hypervisor0, and as shown below, there are only four files on it.
Also the size of the drive now shows as 4 MB rather than 4 GB because there is a 4 MB File Allocation Table partition on the disk, and the other partitions are readable only by ESXi. If we examine the layout of the ESXi flash drive using Partition Manager, the following appears:
The 4 MB primary partition on the disk is the boot loader, which runs when the host boots up. There is also an 896 MB extended partition with four logical disks, which are used for the following:
- A 250 MB logical disk, which contains the core hypervisor code (VMkernel). It is packaged into several files, which total up to 60 MB. Any server manufacturer customization (e.g., Hewlett-Packard, Dell and IBM) are also stored here.
- A 250 MB logical disk, which holds a backup copy of the hypervisor code whenever an update is applied to ESXi. This disk is initially empty (except for a150 byte boot.cfg file) until an update is applied to ESXi. After an update, all files from logical disk 1 are copied to logical disk 2 before the new ESXi image is copied to logical disk 1.
- A 110 MB logical disk, which is initially empty. But it can be used to hold diagnostic core dumps.
- A 286 MB logical disk, which contains VMware tool ISO files, the vSphere Client installer, other tools and drivers, and runtime storage. These mostly auxiliary files are not a part of the VMkernel.
Here's a more detailed look at the partitions.
If you ever want to re-use the flash drive with Windows, you must low-level format it to delete all the partitions. You won't be able to do so with the Disk Management utility that comes with Windows, however.
There are a few ways to low-level format a flash drive, but the easiest method uses a freeware utility called HDD Low Level Format Tool. Simply download, install and run it. Then, select your USB flash drive (be sure you choose the correct drive), and click Continue. Next, on the Low-level Format tab, choose Format This Device. Once the format completes, select the drive in Windows Explorer, and format it to its full capacity.
Life expectancy of a USB flash drive
You might wonder how long a flash drive will last and whether you should worry about it wearing out, which could cause your server to stop working. Flash drives usually have a finite number of write cycles, meaning that they can be written on only so many times before they start to fail.
Quality flash drives, however, can last many years and sustain at least 10,000 write cycles before they experience problems. Plus, ESXi mostly reads from flash drives, which does not cause it to wear down. Subsequently, your flash drive should last for many years. Still, it's a good idea to have a backup ESXi flash drive in the event of a flash drive failure.
Creating a backup ESXi flash drive
Creating a backup copy of an ESXi flash drive is easy to do. Unfortunately, you cannot simply copy the contents of the drive over to another one. You have to create a disk image of the flash drive and use that image to write to another flash drive of the same size. But you can use the freeware USB Image Tool to do this.
First, insert your flash drive into a Windows workstation. Run the tool, and select your flash drive. Then click the Backup button.
This process creates an image of the ESXi flash drive in a .img file format. Next remove the flash drive, and insert a new one that is the same size. Then click the Restore button to copy the image to the new drive.
While this method works to periodically back up your ESXi flash drive, you can also use it to quickly make copies of an ESXi flash drive for multiple servers.
Ultimately, installing VMware ESXi on a flash drive is a great way to save money on server hardware and to get new servers running quickly and easily. But if you already use ESXi installed on local disks, it's probably not worth switching. For new servers, however, you should definitely consider it.
And if you're concerned about technical support, VMware fully supports installing ESXi on to a flash drive, which can be found in the ESXi hardware requirements page.
Eric Siebert is a 25-year IT veteran with experience in programming, networking, telecom and systems administration. He is a guru-status moderator on the VMware community VMTN forums and maintains VMware-land.com, a VI3 information site.