VMware Cloud Community
MHANL
Contributor
Contributor

Automated/interactive install ESXi 4.1 to USB storage

Hi there,

I'm afraid I know the answer but just want to double check this:

I have a batch of 24 HP 495 blades and I want to install them all with ESXi 4.1 Update 1 (HP version off course) interactively; not all by hand (I have more work to do Smiley Happy).

Normally I would use the UDA or EDA to deploy this because they work awesome together with kickstart.

But since there are no local disks, just an HP/VMware certified USB key, according to this article: http://kb.vmware.com/kb/1010574 and my experience, this won't work since the kickstart script does not recognize the local USB storage.

Does anybody have a supported alternative (so not the VMware Deployment Appliance streaming the ISO; which is very cool, but not supported) ?

I can imagine something like duping the USB disks somehow but not sure if that get's me happy. Just something that prevents me from doing the install and config 24 times manually ...

I think it is really weird by the way that VMware recommends installing it on USB/SD storage but does not deliver an enterprise solution for scripting/automating it...

0 Kudos
3 Replies
krishnaprasad
Hot Shot
Hot Shot

I dont think thre are any VMware supported ways to do the same. Kickstart can't see the USB storage devices connected to the system.

But there are lots of ways for automating writing hypervisor image to a USB key. I use a simple script and PXE --> linux live CD ( or a thin client using netboot ) for the same.

The script just need to do the following taks

- Mouting the ISO image  located in a share which can be access after booting from a live CD booted from PXE.

- do a bunzip2 to the imagedd.bz2 to a read-write file system ( prob. a temp folder created in the share )

- Identify the USB storage key connected to the system.

- Write the image using dd command ( dd if=<path to the folder>/imagedd of=/dev/sdx bs=1M ) where /dev/sdx is the USB key and 'bs' is the block size

- cleanup the files and unmount share.

I am sure you will be well versed with this information already. But just thought of sharing it so that it may help others.

MHANL
Contributor
Contributor

Hi Krishnaprasad,

Thank you for your reply; I actually hadn't thought of this scenario yet; it seems pretty useful !

I do have 3 questions:

1. I don't have PXE boot in place yet so I'm considering using that live CD via a bootable USB stick or by mounting it through a hardware remote console (mounting virtual media); can you imagine any downsides of this (besides more manual work mounting the ISO ?).

2. How do you do your config on the installed servers ?

3. I'm no script hero so could you give me some detailed examples of what you use ?

Thanks a million !

Matt

0 Kudos
krishnaprasad
Hot Shot
Hot Shot

Hello, Good to hear that this idea seems to be useful Smiley Happy.. Here are the answers to your questions.

1) I dont see any downsides in using a live CD via USB key. The difficult part of using this solution is you need to have a local access to the server if you use this method ( to connect the USB key ). BTW, it's very easy to create a PXE environment if you have an additional Linux machine. I would advise to create one so that it will be very useful for deploying various images on different servers parallelly. For the Live CDs, you can refer http://www.knoppix.net/wiki/Knoppix_Remastering_Howto

2) I didn't get this question. can you elaborate?

3) I am also not an expert in scripting .But still i believe the below might be useful for you. Once you boot from the image either via PXE/USB key, you need to have a script running ( invoked from /etc/rc.local ). The script should do the below things as i had mentioned before

   -  Mount the share where the ISO image (OR) dd image resides

   -  Mount the iso image to a temp folder, copy imagedd.bz2, bunzip2 imagedd.bz2,

   -  Identify your usb storage device. I use the below function for identifying a USB key. I am sure there are other other than this. But this also work for me.

          function find_usb_device

          {
                  for udi in `/usr/bin/hal-find-by-capability --capability storage | grep -v Virtual | grep -v DVD | grep -v CD`
                  do
                       device=`hal-get-property --udi $udi --key block.device`
                       if [[ `hal-get-property --udi $udi --key storage.bus` = "usb" ]]
                       then
                            echo "$device"  # This will be the USB device connected to the system.
                       fi
                  done
          }

   - Once the USB storage key is identified, write the image to the USB key using dd command ( dd if=<temp location>/imagedd of=/dev/sdx bs=1M )

   - Cleanup the temp location and it's contents.

The above can be easily achieved via a simple shell script and add the script to the end of /etc/rc.local so that it can be invoked automatically at the time of image bootup from PXE/USB key. if you have a PXE server, you need not even move from your chair Smiley Happy

Thanks,

Krishnaprasad

0 Kudos