How to fix corrupt image profile issues on an ESXi host?
Recently I happen to deal with such an issue while installing the patches on an ESXi host using vSphere Update Manager. This issue is rare and will occur if you interrupt the patches remediation task abruptly, in my case thanks to one of my colleague.
I will mention the steps which helped me to recover the image profile for the ESXi host.
Issue: No image profile is found on the host or image profile is empty. In my case image profile shows Unknown – no profile defined
Resolution:
This issue has been seen on systems where the image database file, imgdb.tgz, is corrupt. An image profile is required to install or remove VIBs.
How to confirm if you are proceed with the mentioned solution:
To confirm that the imgdb.tgz file is corrupt:
Connect to the ESXi host via an SSH session.
Change directory to /vmfs/volumes by cd /vmfs/volumes
Search for the imgdb.tgz file: find * | grep imgdb.tgz
Note: This command normally results in two matches. For example:
0ca01e7f-cc1ea1af-bda0-1fe646c5ceea/imgdb.tgz
edbf587b-da2add08-3185-3113649d5262/imgdb.tgz
Run this command on each match:
ls -l match_result
For example:
ls -l 0ca01e7f-cc1ea1af-bda0-1fe646c5ceea/imgdb.tgz
-rwx—— 1 root root 26393 Jul 20 19:28 0ca01e7f-cc1ea1af-bda0-1fe646c5ceea/imgdb.tgz
The default size for the imgdb.tgz file is approximately 26 KB. If one of the files is only a couple of bytes, it indicates that the file is corrupt.
There are 2 ways you can fix this issue. To work around this issue, perform one of these options:
1. Rebuild the ESXi host
OR
2. Copy an imgdb.tgz file from a known good ESXi host to the host having the issue
You may rebuilt if you want but that is not what you are looking for!
Now let us see how we can proceed with the second option:
To copy the imgdb.tgz file from a known good ESXi host perform the following:
On the working ESXi host, copy a good copy of imgdb.tgz by perform the following
cp /bootbank/imgdb.tgz /vmfs/volumes/<shared-LUN>
On the corrupt host, copy the good copy of the imgdb.tgz to /tmp:
cp /vmfs/volumes/<shared LUN>/imgdb.tgz /tmp
cd /tmp
tar -xzf imgdb.tgz
Copy the good profile files to the profile directory:
cp /tmp/var/db/esximg/profiles/* /var/db/esximg/profiles/
Copy the good VIBs to the VIB repository:
cp /tmp/var/db/esximg/vibs/* /var/db/esximg/vibs/
Remove the corrupt imgdb.tgz from the bootbank:
rm /bootbank/imgdb.tgz
Move the good copy of imgdb.tgz into the bootbank:
cp /tmp/imgdb.tgz /bootbank/
Backup configuration changes made:
/sbin/auto-backup.sh
Restart the ESXi host, Attempt to install or patch the host again using vSphere Update Manager.
September 29, 2016 at 1:42 pm
It fixed my problem, that I could not install the updates. But after the update from build 1157734, to 5.1 update 2 build: 2000251. I found out the build number is not updated. Not even after a reboot.
LikeLike
September 29, 2016 at 8:47 pm
Hi Bas, you can use the vib profile update command to update the build number.
LikeLike
September 30, 2016 at 3:09 pm
The update via command line in DCUI did not result in an updated build number. If I use Update manager it shows that the updates are installed. Even the command: “esxcli software profile get” shows the vib’s are installed.
LikeLike
October 1, 2016 at 2:11 am
Hi Bas, might be you missed to specify the image profile name using the -p option, example: esxcli software sources profile get -d /vmfs/volumes/datastore1/ESXi510-2000251.zip -p ESXi-5.1.0-2000251
LikeLike
October 4, 2016 at 7:22 pm
Since I was not able to update this host correctly I eventually rebuild the host and updated to the correct build.
LikeLike