Upgrading ESXi 4.1 with CLI patches

Post Reply
admin
Site Admin
Posts: 473
Joined: 06 Feb 2007, 13:36

Upgrading ESXi 4.1 with CLI patches

Post by admin »

My IBM x346 machine was running ESXi 4.1.0, almost 3 years on build number 320092, with about 10 VM's running on it.
Here I intend to update this to the latest level, build number 988179, an update over ESXi 4.1 U3 info

vSphere Client About info before update:
Image

VM Tools About info before update:
Image

4 of the oldest VM's were converted from GSX server to ESXi 3.5.0 before they were moved to this ESXi 4.1.0 machine. These are maybe 1 of the oldest VM's? Any museum wanna buy? :)

The move from GSX server to ESXi was about memory usage. Within GSX you can NOT give more RAM away to VM's then there is physically in the system.
I bought 16GB RAM for that machine a long time ago but it was not enough to hold more VM's.

The newer machines run ESXi because you can give more memory away to VM's then physically in the system, AND you don't need a Host OS!

My hardware

Actually i have 2 of the same machines, IBM System x346.

Test machine:
1 CPU, 7 GB RAM, different HD setup
Image

Prod machine:
2 CPU, 8GB RAM, 6 x 150GB SCSI 320U RAID5
Image

Image

NOTES:
Both machines actually are NOT supported to run ESXi 4.1.x at all !!
DIY according these instructions is AT YOUR OWN RISK !!


These machines are just hobby objects, but still running fine!
At this moment (feb 2013) it runs 7 VM's with different OS's and hardware.
Due to machine and CPU limitations (HT but no VT) all VM's can only run 32bits.
PROD is running 24 x 7.


What you need to update

The following must all be true. You have:
  • At least a running ESXi 4.0 (any build) machine or higher version.
  • Other PC from with to connect to the ESXi machine with vSphere Client.
  • Installed VMware vSphere CLI on this other PC to use command ‘vihostupdate’.
  • (Not sure if Perl is installed during VMware vSphere CLI install, but IS needed!)
Make sure you download the right packages from VMware patch portal:
http://www.vmware.com/patchmgr/findPatch.portal

In my example i downloaded: ESXi410-201301001.zip
This package contains Build number: 988178, KB 2041332
And can be used to update from ESXi 4.0 any build level to ESXi 4.1 Build: 988178

'VMware vSphere CLI' is used to do the real update process. With 'vSphere Client' open, you can follow the update process on the host.

The update process MUST be run from another PC/Workstation then the Host machine. The tooling MUST be installed on that PC, like: if you wish to follow the update process you must have vSphere Client be running on the PC you use to update the Host. Perl is needed to run the VMware scripts and must be installed on this PC.

Also make sure update (.zip) files are accessible when running these commands.
Of course NOT on the ESXi machine you are working on! (Copy them locally? :) )
The Host must be in maintenance mode before update can take place; all VM's must be shut down on this host.

In single ESXi machine situations, be aware that all VM’s must / will be stopped!
And the Host should be rebooted after patch installation!
(Good idea to check FW levels of your used hardware in your ESXi host machine and update them where possible!!)

After starting VMware vSphere CLI, run the following commands:
(items <...> should be replaced with data from your environment)

1)
Put the Host in maintenance mode with the following VMware vSphere CLI command, or use vSphere Client to bring Host into maintenance mode.
A must before updating and will stop (or auto-move) all VM’s:

Code: Select all

vicfg-hostops.pl --server <ip-server> --username root --password <password> --operation enter
Should be followed by:
Host <system.name> entered into maintenance mode successfully.

2)
Run the actual update script within VMware vSphere CLI:

Code: Select all

vihostupdate.pl --server <ip-server> --username root --password <password> --install --bundle <path+name ex: Z:ESXi410-201301001.zip>
Should be followed by:
Please wait patch installation is in progress ...

During this process these will be a percentage of the update shown in the ‘Recent Tasks’ area of vSphere Client (at the bottom).
The update completed successfully, but the system needs to be rebooted for the changes to be effective.

Any other message should be a warning! Contact other support then me :D as I am just a hobbyist.

3)
Reboot the Host (the hardware FW update time J ) with the following VMware vSphere CLI command, or use vSphere Client to reboot the Host:

Code: Select all

vicfg-hostops.pl --server <ip-server> --username root --password <password> --operation reboot
Should be followed by:
Host <system.name> rebooted successfully.

4)
Put machine into normal working mode:

Code: Select all

vicfg-hostops.pl --server <ip-server> --username root --password <password> --operation exit
Should be followed by:
Host <system.name> exited from maintenance mode successfully.

5)
Check the installed packages:

Code: Select all

vihostupdate.pl --server <ip-server> --username root --password <password> –query
Result of '-query’ command should be something like this:

Code: Select all

---------BulletinID--------- -----Installed----- ----------------Summary-----------------
ESXi410-201101224-UG          2012-08-15T05:28:50 vxge: net driver for VMware ESXi
ESXi410-201101223-UG          2012-08-15T05:28:50 3w-9xxx: scsi driver for VMware ESXi
ESXi410-201301402-BG          2013-02-02T04:03:59 Updates VMware tools
ESXi410-201301401-SG          2013-02-02T04:03:59 Updates Firmware
I had some weird issues with the '-query' command, but it worked finally, don't know what i did wrong. Docs say '--query' but actually '-query' works and '-q' not? ‘--query’ not yet tested : )
Next day had the following error:

Code: Select all

Query operation failed: SOAP request error - possibly a protocol issue: 500 read failed:

SOAP request error - possibly a protocol issue: 500 Connect failed: connect: Unknown error; Unknown error
SOAP request error - possibly a protocol issue: 500 Connect failed: connect: Unknown error; Unknown error

END failed--call queue aborted.
And this one:

Code: Select all

Error connecting to server at 'https://<ip-server> /sdk/webService': Perhaps host is not a vCenter or ESX server
Sollution:
Run the command when there is as less as possible activity on the Host (suspend or powered off all VM’s).

Kinda buggy command if you ask me...

Info here used from:
Upgrading from ESXi 4.0.x to ESXi 4.1 using vihostupdate.pl


Messages

you can receive when running VMware vSphere CLI commands:
  • Error: Cannot complete login due to an incorrect user name or password.
Easy to fix, I guess.
  • Please wait patch installation is in progress...
    Maintenance mode is not enabled or could not be determined.The following VIBs require this host to be in maintenance mode: deb_vmware-esx-firmware_4.1.0-3.33.988178. Please put the host in maintenance mode to proceed.
Also easy to fix, I guess. Most probably started update script without Host in maintenance mode?
  • Please wait patch installation is in progress ...
    Failed to download metadata.Error extracting metadata.zip from /tmp/updatecache/

    Documents: [Errno 22] Invalid argument
This error occurs when trying to downgrade a Host with package lower then current.
See my other docs about downgrading you ... Host .....
  • For the host <system.name> : The enter maintenance mode operation is not allowed in the current state.
Message when trying to enter maintenance mode when Host already in maintenance mode.
  • For the host <system.name> : The operation is not allowed in the current state.
Message when:
- Trying to exit maintenance mode when Host is running normally.
- Trying to reboot Host but it's not in maintenance mode.


Automatical update of vSphere Client, when started on other machine:

When starting an older version of vSphere Client, like below:
Image

The following screens will appear:
Image

I used ‘Run the installer’, you could save it somewhere else, but when running it later, informational message:
Image

After OK:
Image

After extracting:
Image

A regular setup process is started. Make sure to check each screen carefully. Adjust where necessary the options. Most screens are copied below:
Image

Image

Make sure to accept the license agreement:
Image

Installation will continue:
Image

And finish:
Image

Next vSphere Client will start-up as normally.
At first i did not see any changes, except within the 'about' information.


When finished all updates successfully and rebooting the Host, the new Main screen should show something like this part:
Image

New vSphere Client About screen, after updating vSphere Client too! If you see other build number at vSphere Client Version, restart vSphere Client and the update will start automatically:
Image

And, after updating VMware Tools within a VM, the About screen of a Windows XP VM Tools should show something like:
Image

Now the ESXi Host and the vSphere Client have both the updated software levels.
..
Post Reply