Since we are in the process of adding a boatload of new products to our environment and services, we needed to add our new vCloud Director instances to our vCloud Usage Meter environment. For those that don’t know; VMware vCloud Usage meter is used to measure the license usage for all VMware products that your ‘rent’ from VMware in the so-called VMware Cloud Provider Program. Or just a tool to help you report perpetual license usages. In the VMware Cloud Provider Program this tool is mandatory. It provides reports that need to be delivered to your VMware license aggregator.
Our vCloud Usage Meter version has been 3.6.1 Build 7359407 for quite a while now since there haven’t been any new updates and we haven’t been having any issues. That is, until now!
We wanted to add a couple of vCloud Director instances to Usage Meter. These instances are version 9.1 and above. Apparently in version vCloud Director 9.1 the API communication between these two products changed more than they thought, which gave us the following errors when trying to add an instance:
Quick research showed that we should be compatible though, see the below Interoperability Matrix:
Then we stumbled across the following VMware KB article: https://kb.vmware.com/s/article/53185. This article explained that we needed to upgrade to Usage Meter 3.6.1 HotPatch 1 to regain correct compatibility since something in regards to the API between the two products broke. Since HotPatch 2 was released in January 2019 I figured why not update to that and enjoy even more hotfixes.
With previous version of vCloud Usage Meter you had to install a new appliance, migrate over the measured data and connected environments and decommission the old instance. Starting at this version however you can do an in place update. I don’t think that the next full version upgrade will feature an in place upgrade but one can sure wish right?
Below are the steps to do an in place update from 3.6.1 Build 7359407 to 3.6.1 Build 11832189. Make sure you are on vCloud Usage Meter 3.6.1 build 7359407, 8244445 or 11273621! Any other version does not work with HotPatch 2.
Step 1: Make sure you make a backup or snapshot of your Usage Meter Appliance. Also make sure to remove that once you are done.
Step 2: Verify that SSH is enabled on the appliance. If you need to enable it, access the appliance through the console and execute “service sshd start”. Please be aware that root logins with SSH are not permitted by default. If you want to do that you should edit the SSHD config and allow “PermitRootLogin”.
Step 3: Verify that you have root access to the appliance. See the end of the blog…
Step 4: Download and upload the patch to the appliance through WinSCP or your own favorite SCP program. If you want you can check the SHA before you upload it to check the consistency. You can do this by issuing the following commands and compare the results.
sha1sum vCloudUsageMeter-220.127.116.11-11832189-hot_patch_2.rpm cat vCloudUsageMeter-18.104.22.168-11832189-hot_patch_2.rpm.sha1
Step 5: Switch to the root user to install the update. You can do this by issuing “
Step 6: Apply the patch with the following command:
rpm --install vCloudUsageMeter-22.214.171.124-11832189-hot_patch_2.rpm
Step 7: Check the status and health of the vCloud Usage Meter appliance.
Step 8: Enjoy an updated vCloud Usage Meter that does support vCloud Director 9.1 and higher.
At this point you can add the vCloud Director instances to the vCloud Usage Meter appliance and you will no longer receive the error message posted at the beginning of this post.
Now if you, like me, have thick fingers on the last day before the weekend and type the ‘root’ password wrong to many times, you will have to unlock the root account and/or reset the root password. As far as I know you can only do this in bash, but if you want to get there you will have to reboot the vCloud Usage Meter appliance.
- Reboot the appliance and wait for the GNU GRUB boot menu.
- Select the SLES 12-SP1 and press “e”.
- Go to the line that has “linux” in front and append “
init=/bin/bash”. Press F10 to boot.
- Mount the system with the following commands: “
mount -o remount,rw /“
- Change the password with “
passwd”, or unlock the account with “
pam_tally2 --user=root --reset“.
- This will effectively reset the user account root (failed) unlocks or the password for user root.
The last part for this is a pro tip from Daniel Paluszek, if you can’t run the “pam_tally2” command you should set an environment variable with the following command:
Once you’ve entered this you should be able to run the “pam_tally2” command just fine.
I hope you found this useful! See you in the next blog!