Today I upgraded one of our hosts to a newer version than what was supported by our vCenter so had to find a way of downgrading it. The host was now at “5.5 Patch 10” (which is after “5.5 Update 3”) which our vCenter version only supported versions prior to “5.5 Update 3”. (See this post for a list of build numbers and versions; see this KB article for why vCenter and the host were now incompatible).
I found this blog post and KB article that talked about downgrading and upgrading. Based on those two here’s what I did to downgrade my host.
First, some terminology. Read this blog post on what VIBs are. At a very high level a VIB file is like a zip file with some metadata and verification thrown in. They are the software packages for ESX (think of it like a .deb
or .rpm
file). The VIB file contains the actual files on the host that will be replaced. The metadata tells you more about the VIB file – its dependencies, requirements, issues, etc. And the verification bit lets the host verify that the VIB hasn’t been tampered with, and also allows you to have various “levels” of VIBs – those certified by VMware, those certified by partners of VMware, etc – such that you as a System Admin can decide what level of VIBs you want installed on your host.
You can install/ remove/ update VIBs via the command esxcli
:
1 2 3 4 5 6 7 8 9 10 11 |
# esxcli software vib Usage: esxcli software vib {cmd} [cmd options] Available Commands: get Displays detailed information about one or more installed VIBs install Installs VIB packages from a URL or depot. VIBs may be installed, upgraded, or downgraded. WARNING: If your installation requires a reboot, you need to disable HA first. list Lists the installed VIB packages remove Removes VIB packages from the host. WARNING: If your installation requires a reboot, you need to disable HA first. update Update installed VIBs to newer VIB packages. No new VIBs will be installed, only updates. WARNING: If your installation requires a reboot, you need to disable HA first. |
Here’s a short list of the VIBs installed on my host:
1 2 3 4 5 6 7 8 |
# esxcli software vib list Name Version Vendor Acceptance Level Install Date ----------------------------- ------------------------------------- --------------- ---------------- ------------ net-tg3 3.134e.v55.1-1OEM.550.0.0.1331820 Broadcom VMwareCertified 2015-01-29 scsi-bfa 3.2.3.0-1OEM.550.0.0.1198610 Brocade VMwareCertified 2015-01-29 ima-be2iscsi 4.9.303.0-1OEM.550.0.0.1331820 Emulex VMwareCertified 2015-01-29 lpfc 10.0.725.203-1OEM.550.0.0.1331820 Emulex VMwareCertified 2015-01-29 scsi-be2iscsi 4.9.303.0-1OEM.550.0.0.1331820 Emulex VMwareCertified 2015-01-29 |
Next you have Image Profiles. These are a collection of VIBs. In fact, since any installation of ESXi is a collection of VIBs, an image profile can be thought of as defining an ESXi image. For instance, all the VIBs on my currently installed ESXi server – including 3rd party VIBs – together can be thought of as an image profile. I can then deploy this image profile to other hosts to get the exact configuration on those hosts too.
One thing to keep in mind is that image profiles are not anything tangible. As in they are not files as such, they just define the VIBs that make up the profile.
Lastly you have Software Depots. These are your equivalent of Linux package repositories. They contain VIBs and Image Profiles and are accessible online via HTTP/ HTTPS/ FTP or even offline as a ZIP file (which is a neat thing IMHO). You would point to a software depot – online or offline – and specify an image profile you want, which then pulls in the VIBs you want.
Now back to esxcli
. As we saw above this command can be used to list, update, remove etc VIBs. The cool thing though is that it can work with both VIB files and software depots (either online or a ZIP file containing a bunch of VIB files). Here’s the usage for the software vib install
command which deals with installing VIBs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
Usage: esxcli software vib install [cmd options] Description: install Installs VIB packages from a URL or depot. VIBs may be installed, upgraded, or downgraded. WARNING: If your installation requires a reboot, you need to disable HA first. Cmd options: -d|--depot=[ <str> ... ] Specifies full remote URLs of the depot index.xml or server file path pointing to an offline bundle .zip file. --dry-run Performs a dry-run only. Report the VIB-level operations that would be performed, but do not change anything in the system. -f|--force Bypasses checks for package dependencies, conflicts, obsolescence, and acceptance levels. Really not recommended unless you know what you are doing. Use of this option will result in a warning being displayed in the vSphere Client. --maintenance-mode Pretends that maintenance mode is in effect. Otherwise, installation will stop for live installs that require maintenance mode. This flag has no effect for reboot required remediations. --no-live-install Forces an install to /altbootbank even if the VIBs are eligible for live installation or removal. Will cause installation to be skipped on PXE-booted hosts. --no-sig-check Bypasses acceptance level verification, including signing. Use of this option poses a large security risk and will result in a SECURITY ALERT warning being displayed in the vSphere Client. --proxy=<str> Specifies a proxy server to use for HTTP, FTP, and HTTPS connections. The format is proxy-url:port. -n|--vibname=[ <str> ... ] Specifies VIBs from a depot, using one of the following forms: name, name:version, vendor:name, or vendor:name:version. -v|--viburl=[ <str> ... ] Specifies one or more URLs to VIB packages to install. http:, https:, ftp:, and file: are all supported. |
You have two options:
- The
-d
switch can be used to specify a software depot (online or offline) along with the-n
switch to specify the VIBs to be installed from this depot. - Or the
-v
switch can be used to directly specify VIBs to be installed.
The esxcli
command can also work with image profiles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
Usage: esxcli software profile install [cmd options] Description: install Installs or applies an image profile from a depot to this host. This command completely replaces the installed image with the image defined by the new image profile, and may result in the loss of installed VIBs. The common vibs between host and image profile will be skipped. To preserve installed VIBs, use profile update instead. WARNING: If your installation requires a reboot, you need to disable HA first. Cmd options: -d|--depot=[ <str> ... ] Specifies full remote URLs of the depot index.xml or server file path pointing to an offline bundle .zip file. (required) --dry-run Performs a dry-run only. Report the VIB-level operations that would be performed, but do not change anything in the system. -f|--force Bypasses checks for package dependencies, conflicts, obsolescence, and acceptance levels. Really not recommended unless you know what you are doing. Use of this option will result in a warning being displayed in the vSphere Client. --maintenance-mode Pretends that maintenance mode is in effect. Otherwise, installation will stop for live installs that require maintenance mode. This flag has no effect for reboot required remediations. --no-live-install Forces an install to /altbootbank even if the VIBs are eligible for live installation or removal. Will cause installation to be skipped on PXE-booted hosts. --no-sig-check Bypasses acceptance level verification, including signing. Use of this option poses a large security risk and will result in a SECURITY ALERT warning being displayed in the vSphere Client. --ok-to-remove Allows the removal of installed VIBs as part of applying the image profile. If not specified, esxcli will error out if applying the image profile results in the removal of installed VIBs. -p|--profile=<str> Specifies the name of the image profile to install. (required) --proxy=<str> Specifies a proxy server to use for HTTP, FTP, and HTTPS connections. The format is proxy-url:port. |
Here you have just one option (coz like I said you can’t download something called an image profile – you have to necessarily use a software depot). You use the -d
switch to specify a depot (online or offline) and the -p
switch to specify the image profile you are interested in.
Apart from installing VIBs & image profiles, the esxcli
command can also remove and update these. When it comes to image profiles though, the command can also downgrade profiles via an --allow-downgrades
switch. So that’s what we use to downgrade ESXi versions.
First find the ESXi version you want to downgrade to. In my case it was ESXi 5.5 Update 2. Go to My VMware (login with your account) and find the 5.5 Update 2 product. Download the offline bundle – which is a ZIP file (basically an offline software depot). In my case I got a file named “update-from-esxi5.5-5.5_update02-2068190.zip”. Now open this ZIP file and go to the “metadata.zip\profiles” folder in that. This gives you the list of profiles in this depot.
You can also get the names from a link such as this which gives more info on the release and the image profiles in it. (I came across it by Googling for “ESXi 5.5 Update 2 profile name”).
The profiles with an “s” in them only contain security fixes while the ones without an “s” contain both security and bug fixes. In my case the profile I am looking for is “ESXi-5.5.0-20140902001-standard”. I wasn’t sure if I need to go for the “no-tools” version or not, but figured I’ll stick with the “standard”.
Now, copy the ZIP file you downloaded to the host. Either upload it to the host directly, or to some shared storage, etc.
Then run a command similar to this:
1 |
esxcli software profile update --allow-downgrades -d /path/to/update-from-esxi5.5-5.5_update02.zip -p ESXi-5.5.0-20140902001-standard |
That’s it! Following a host reboot you are now downgraded. Very straight-forward and easy.