We have purchased additional hardware for our test and development environment. We have been using VMware server for our other dev/test hardware but wanted to try VMware ESXi.
The software you will need is:
- VMware ESXi 4.0 (to run on the new hardware)
- VMware vSphere Client with vSphere Host Update Utility (to run on the client which will manage the ESXi)
- VMware vSphere Command-Line Interface – Windows Installer (to run on the client which will manage the ESXi)
Command-line tools to manage your vSphere infrastructure. - VMware vCenter Converter Standalone (to convert VMware server guests to ESXi)
We wanted to install VMware ESXi on a USB stick. This gives the advantage of easily creating copies of the USB stick (using Linux dd command) in case ESXi did not want to boot. It also allows us to create a clone of the whole ESXi server.
Moving from VMware server to ESXi requires quite a different approach as you no longer are running a full OS on the host. All the things you take for granted by having a full OS are no longer there and this takes a bit of getting used to. You are also no longer as flexible because simple OS command backups do not work or are limited in their features.
The setup of ESXi is very straightforward and easy. However we quickly found one of the short comings to ESXi. Our USB had decided not to work anymore and as we were still in setup phase we had not created a backup yet.
To fix it, we rebooted the server with the ESXi CD and this allowed us the repair the USB stick and bring back ESXi. However all the meta data had gone. The VMware guests where still on the disk, but the vSphere Client did not pickup any of the existing VMware guests or resource pools that we had created. There is no quick refresh button.
This would be a major blow if this was a production server.
However we did find a way to re-register an existing VMware guest using the vSphere CLI tool. This tool is a collection of Perl scripts that are installed on your local machine (can be Windows or Linux) and connects to ESXi to run certain commands.
To re-register a VMware guest, run the following command:
perl vmware-cmd -U <myuser> -P <mypassword> -H HostABC
-s register /vmfs/volumes/datastore1/MyVM/MyVM.vmx
It helps to know the path of the vmx. This can be found out by logging onto the console of the ESXi server. Typing ALT-F1 and then typing “unsupported”. This brings you to the console of the ESXi server and you can use use find and ls commands to find the location of the vmx file.
This brings back the VMware guests but does not bring back the resource pools. However in the vSphere Client you can re-create the same resource pools and move the VMware guests under the resource pools.
Before we deploy our server we want to make a backup of its configuration so that if something similar happened we can restore the configuration. To do this run the following command from CLI client:
C:\Program Files\VMware\VMware vSphere CLI\bin>perl vicfg-cfgbackup.pl --username root --password xxxx --server xxxx -s C:\backup\server_esxi_config.dat Saving firmware configuration to c:\backup\server_esxi_config.dat ...
Other handy commands to run under VMware ESXi console:
View disks with:
fdisk -l
View current disk paths with:
esxcfg-mpath -l
Other handy commands to run under vSphere CLI:
To identify the working directory of the virtual machine from ESXi and the vSphere CLI, run the command:
vmware-cmd.pl -H <host> -U <username> -P <password> -l
To create a folder for the copy of the virtual machine from ESXi and the vSphere CLI, run the command:
vifs.pl -H <host> -U <username> -P <password> --mkdir '[datastore] dir'
where datastore is the name of the datastore, and dir is the name of the new directory



