A. Mikkelsen VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Saturday, March 31, 2007

Error migrating a VM from ESX 2.5.4 to ESX 3.X

Filed under: ESX Migrate/Upgrade — A. Mikkelsen @ 19:51 pm

During an upgrade of an ESX 2.5.4 environment to ESX 3.0.1 I had a problem with one of the VM’s.
Every time I tried to clone or migrate a specific VM I got the same error over and over.
“Host does not support the virtual hardware version of the virtual machine”I realized that the VM originally was build on a GSX server.
I opened the vmx file and saw that the hardware versions were not updated properly.
The 2 hardware parameters in the vmx file is config.version = “x” and virtualHW.version = “x”. Where x is a number based on the host OS.
For a GSX these numbers are 6 and 2.
For an ESX 2.5.x these numbers are 6 and 3.
This meant that when the VM was moved from GSX to ESX 2.5.x the virtual hardware wasn’t upgraded properly.

The resolution was to completely uninstall the VMware Tools in the VM and make a complete reinstallation of the VMware Tools. Here after it is possible to upgrade the Virtual Hardware.
Now the migration of the VM to an ESX 3.0.1 host will run smoothly.

Friday, March 30, 2007

Small script to gather info about a ESX 3.X host.

Filed under: Scripting — A. Mikkelsen @ 20:24 pm

I created this small script to gather some info from a ESX 3.X host.
This script is still in it’s early stage.

Download it here.

Wednesday, March 21, 2007

The easiest way to update an ESX VI 3.x host!

Filed under: Scripting — A. Mikkelsen @ 9:20 am

Together with the danish VMware user forum, we have created at script that helps with the doll task of applying updates to an ESX VI 3.x host.

  1. Download each update from the VMware web site (http://www.vmware.com/download/vi/)
  2. Unpack each TGZ file with WinZip or 7-Zip
  3. Copy all extracted updates to a folder reachable by the ESX VI 3.x host.
  4. Download and extract esx-update.zip to 
    /tmp/
  5. Make the file executable
    chmod 777 /tmp/esx-update.sh
  6. Open the extracted file with vi (vi /tmp/esx-update.sh) and edit the following variables, so they reflect the server environment they will be running on.
    1. update_dir
    2. update_file
    3. log_file

To run the script it is a good idear to put the host in maintenance mode.

  1. Set the host in maintenance mode
    vimsh
    hostsvc/maintenance_mode_enter
  2. Now you can start the script 
    ./tmp/esx-update.sh
  3. Exit the host from maintenance mode
    vimsh
    hostsvc/maintenance_mode_exit

Download the file here.

Sunday, March 18, 2007

List only directories

Filed under: Linux Commands — A. Mikkelsen @ 22:50 pm

To list only the directories in a directory use the following:

ls -v

To only list the directories that starts with ESX use the following

ls -v |grep “ESX”

Powered by WordPress