Anybody Seen My Memory Stick?

I got a call from a client today that is running a VMware ESXi server as a proof of concept in their SMB environment. The admin that setup the VMware ESXi Server configured the ESXi server to boot and run ESXi from a USB memory stick.  Things have been running fine but the company and the administrator that setup the server had a falling out, so to speak, and the administrator left the company and took the USB memory stick with him.  The server continues to run fine as ESXi basically runs from memory but, rebooting this host is now not an option since there are no files available for the host to boot from.  So what is the best way to recover and get things back to normal?  I did a little research and the information that I have found will work will both ESXi 3.x as well as vSphere ESXi.

The first question that needed to be answered was how to recreate the USB memory stick. I came across a great guide from Duncan Epping on his blog www.yellow-brick.com.  Although this was originally written for ESXi 3.5 Update 2, the same rules apply and this will work for vSphere. Duncan was also nice enough to have a pdf version of the guide with screen shots.

  1. First get the following tools: 7-Zip(Free), WinImage(Demo)
  2. Download the ESXi ISO
  3. Open the ISO with 7-Zip
  4. Extract “install.tgz”
  5. Open “install.tgz” with 7-Zip
  6. Click on “install.tar”
  7. Browse to “usrlibvmwareinstaller”
  8. Open “VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd.bz2″
  9. Extract “VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd”
  10. Open WinImage and go to Disk, click on “Restore Virtual Harddisk Image on physical drive”
  11. Select a physical drive
  12. Select “VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd”
  13. And click “yes” to write the DD image to the USB Disk

Now with VMware vSphere ESXi we now have the option to install directly to the USB memory stick from the install CD.  The installation process is pretty straight forward compared to the process above.  To make life even easier we can take advantage of using VMware Workstation to install ESXi to the USB drive and have everything setup from the comfort of our desk.

One thing that I have been told with both options is to make sure to boot the newly installed ESXi from the memory stick once before taking the stick to the physical server itself. So if you install ESXi nested from within workstation let the ESXi virtual machine boot once after the install.  If you followed the steps above for the ESXi 3.5 version create the ESXi virtual machine in VMware workstation and let the virtual machine complete its first boot.

In my particular situation, the metadata or post configuration will be gone once the physical host has been rebooted and I will need to reconfigure these settings again as well as register the virtual machines again but the new ESXi image will be able to find and detect the current VMFS partition as well as the virtual machines on the partition. Not a total loss and it should not take to much time to recover and get things back to where it was.

Steve Beaver (149 Posts)

Stephen Beaver is the co-author of VMware ESX Essentials in the Virtual Data Center and Scripting VMware Power Tools: Automating Virtual Infrastructure Administration as well as being contributing author of Mastering VMware vSphere 4 and How to Cheat at Configuring VMware ESX Server. Stephen is an IT Veteran with over 15 years experience in the industry. Stephen is a moderator on the VMware Communities Forum and was elected vExpert for 2009 and 2010. Stephen can also be seen regularly presenting on different topics at national and international virtualization conferences.

Connect with Steve Beaver:

Tags: , ,

2 Responses to Anybody Seen My Memory Stick?

  1. November 4, 2010 at 10:04 AM

    Hi Stephen,

    “…the metadata or post configuration will be gone once the physical host has been rebooted…”
    You can avoid that! You could backup the config of the running ESXi then once the physical server is rebooted, restore the config…

    Here is the backup command:
    Get-VMHost MyESXiHost | Set-VMHostFirmware -BackupConfiguration -DestinationPath C:\Temp

    Here is the restore command:
    Get-VMHost MyESXiHost | Set-VMHostFirmware -Restore -SourcePath C:\Temp\configBundle-MyESXiHost.tgz

    You can eventually add the -Force if the bundle is mismatched, that is when you restore to a different ESXi build.

    More at http://deinoscloud.wordpress.com/2010/02/17/esxi-automatic-backups/

    Rgds,
    Didier

  2. sbeaver
    November 4, 2010 at 10:17 AM

    Didier,

    Thanks for the comment and the great tip. I knew a cron job ran every hour getting the backup information but in this specific case the PowerShell code is a great tool to get things back to the way it should be.

    Thanks for sharing and I hope my post and your code can help others in the future.

    Cheers

    Steve

Leave a Reply

Your email address will not be published. Required fields are marked *

Please Share

Featured Solutions