中国网络水泥 发表于 2015-10-9 10:08:04

Install ESXi from USB stick

  

  from http://www.jonathanmedd.net/2011/01/install-esxi-4-1-from-a-usb-stick.html
  

  
Install ESXi 4.1 from a USB stick
Postedon January 24th, 2011 JonathanMedd 18comments  
Depending on your environment you may find the ability to install ESXi from a USB stick, particularly if you do not have access to a PXE based deployment solution.
With ESXi 4.0 I had used a USB stick with the install ISO on the stick. Whilst starting to test 4.1 I thought it would be a simple case of replacing the 4.0 ISO with 4.1. However, when I did this I was able to boot to the install, but when it got to the partof copying the files I received the error:
“Unable to find the system image to install. This is due to the image not being mounted correctly, or the CD-Rom drive not supported”
A bit of googling revealed that there seems to be a change between 4.0 and 4.1 where the install is hard-coded to look for the files on the CD-Rom drive. Consequently it looks like you need to take a slightly different approach and use the new Scripted Installfeature of ESXi in 4.1
So this post will detail the three steps you need to take to get this working:

[*]Creating the bootable USB stick including the installation files
[*]Adding the Kickstart script
[*]Add a custom mod.tgz file
Creating the bootable USB stick including the installation files
There are many posts on the web detailing how to create a bootable USB stick with syslinux. One I have found particularly useful for this scenario is UNetbootin.This is a GUI based tool that allows you to create bootable USB drives for Ubuntu, Fedora and other Linux distributions by pointing the tool at the install ISO and hitting Go! I found this from DanielBuonocore’s post over at blogs.vmpros.nl
Download the execuatble from UNetbootin andpoint it at the ESXi 4.1 ISO file.


Hit OK and the creation will begin:


You will be prompted to overwrite the file menu.c32 , answer Yes that you wish to do this.


This part is then complete. There is no need to reboot


Adding the Kickstart script
As mentioned earlier we need to specify that the ESXi install files are not on the CD-Rom; we do this by modifying the syslinux.cfg file to include a reference to a Kickstart file on the USB stick. So modifysyslinux.cfg toinclude ks=usb to the append line. Whilst we are here also add - – -mod.tgz at the end of the same line – more on this in the next section. The resulting file will now look like this:
01defaultmenu.c3202menutitle VMware VMvisor Boot Menu03timeout8004 05labelESXi Installer06menulabel ^ESXi Installer07kernelmboot.c3208appendvmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- mod.tgz09 10label^Boot from local disk11menulabel ^Boot from local disk12localboot0x80We now need to add a Kickstart script to the USB stick. The ESXiInstallable and vCenter Server Setup Guide for 4.1 contains details of the options for this file. For my very simple requirements I have used the following to create a ks.cfg file:
1vmaccepteula2rootpwpassword3autopart--firstdisk --overwritevmfs4installusb5network--bootproto=dhcp--device=vmnic0Add a custom mod.tgz file
At this point you are pretty much there, however if you boot of the stick now you will get the following error on the console constantly repeating:
Totalnumber of sectors not a multiple of sectors per track! Add mtools_skip_check=1 to your .mtoolsrc file to skip this test”
It is possible to temporarily get round this via the following method detailed in the VMwarecommunites:
ALT + F1
Log in (root + no password)
echo “mtools_skip_check=1″ >> .mtoolsrc
ALT + F2 to return to original Console window
Press Enter or wait to continue
However, you don’t really want to have to do that everytime. So very helpfully Ivo Beerens over ativobeerens.nl has createda custom mod.tgz file which will automate this part for us.
Download the mod.tgz file and copy it to the USB stick. (Make sure you have modified the syslinux.cfgfile as mentioned earlier in this post to reference the mod.tgz file)
The contents of the USB stick should now look like:


The USB stick is now complete and ready to be boot from. The following three posts were highly useful in helping put this USB stick together.

[*]Howto create a bootable ESXi USB Stick with UNetbootin
[*]CreatingUSB key to install VMware ESXi 4.1
[*]InstallVMware ESXi 4.1 from bootable USB stick
Update 18/02/2001:
The release notes of ESXi 4.1 U1 contain details of the above issue where the additional mod.tgz file is required:
Unable to install ESXi 4.1 using scripted installation from a USB drive
When you try to install ESXi 4.1 by using script saved on a USB drive or if the installation media is on a USB drive, the ESXi 4.1 installation stops and displays the following message:
Total number of sectors not a multiple of sectors per track!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test.
The issue is resolved in this release.
I tested this and it works fine, so the mod.tgz file is no longer required. Don’t forget to update yoursyslinux.cfg file to remove the reference to – mod.tgz .
页: [1]
查看完整版本: Install ESXi from USB stick