Upgrading Usage Meter
Existing VMware vCloud Usage Meters must be upgraded to version 9 to integrate with their own access token. The upgrade process for Usage Meter with version 4.8 will involve receiving an access token for your currently registered Usage Meter through the IBM Cloud Usage Meter portal, followed by an in-place upgrade to version 9. You will not need to provide the access token for additional upgrades after the initial upgrade to version 9 or later.
Procedure to upgrade Usage Meter
To upgrade Usage Meter, complete the following steps:
Enabling SSH login
- Log in to the VMware vCloud Usage Meter appliance management console with the usagemeter user through
https://<Usage Meter IP>:5480
. - Click Access from the left navigation panel.
- Under Access settings, click Edit on the upper right.
- In the Edit access settings window, toggle the Enable SSH login switch on.
The SSH login will change to Enabled.
Mounting the upgrade ISO file
-
Download the Usage Meter ISO file from the following link:
https://ibm.biz/BdeSzZ
-
Validate the SHA-2 checksum based on the
62724df42b5cc8979723f6f25bf61b720d8287ec3510fbfd218232be787877a4
SHA-256 value. Open a command prompt on Windows® or a terminal window on Linux® and MacOS and run the following command:- For Windows:
certutil -hashfile <path-to-iso-file> SHA256
- For Linux:
sha256sum <path-to-iso-file>
- For MacOS:
shasum -a 256 <path-to-iso-file>
- For Windows:
-
In the VMware vSphere® Web Client, log in to your vCenter Server instance.
-
Under the Storage menu, select the datastore where your Usage Meter virtual machine (VM) is located.
-
In the VMs tab, click Virtual machines and verify that the Usage Meter is on your target datastore.
-
In the Files tab, click Upload files. The ISO file will start uploading.
You might receive an error about the host certificates. To resolve it, open the specified URL that is shown in the error in another web browser tab and accept the certificate. If it doesn’t load, ensure that the host is in your current desktop DNS and retry the URL.
-
After the upload is complete, the ISO file will appear in the file list.
-
Under the Hosts and clusters menu, locate and right click the Usage Meter VM, and select Edit settings.
-
In the Virtual hardware tab, on CD/DVD drive, select Datastore ISO file, and click OK.
If you do not see the CD/DVD drive option, click Add new device.
-
In the Select file window, locate the datastore where you uploaded the ISO file.
-
Select the ISO file and click OK.
-
In the Edit settings window, under the Virtual hardware tab, ensure that you select the Connected checkbox, then click OK.
Running the upgrade command
Before you run the upgrade commands for your Usage Meter, complete the following steps:
- In the VMware vSphere® Web Client, log in to your vCenter Server instance.
- Under the Hosts and clusters menu, locate and right click the Usage Meter VM, and select Edit settings.
- In the Virtual hardware tab, on CD/DVD drive, clear the Connected checkbox, and click OK.
- Under the Hosts and clusters menu, locate and right click the Usage Meter VM, and select Snapshots > Take snapshot.
- Enter a name for your snapshot and click Create.
For the SSH into the Usage Meter VM, complete the following steps:
-
Open a command prompt on Windows or a terminal window on Linux and MacOS and run the following commands as root user:
mkdir /root/upgrade
mount -o loop /dev/cdrom /root/upgrade
bash /root/upgrade/upgrade-um.sh
You might need to run
umount /root/upgrade
to unmount any previous upgrades before you runmount -o loop /dev/cdrom /root/upgrade
to upgrade the Usage Meter VM. -
Enter the access token that is generated for the Usage Meter in the IBM Cloud® for VMware Solutions console. For more information, see Registering Usage Meter with IBM.
-
Enter y to agree with the VCF Usage Meter appliance be part of IBM's Provider Organization.
-
Enter y to confirm that a snapshot is created to the Usage Meter VM.
An error message about the Usage Meter hostname might appear. Enter y to continue the upgrade path.
-
The upgrade process will start and when it's complete, enter y to restart the Usage Meter VM.
-
After the restart is complete, open the Usage Meter URL in a web browser and log in to verify the upgraded version. Then, confirm the health of the Usage Meter appliance.
After you migrate the Usage Meter VM, you might encounter the error "Connection control operation failed for disk" during the upgrade process. This problem might happen due to an active snapshot that retains a lock on the mounted CD/DVD device. To resolve it, complete one of the following procedures. However, you might need to complete all of them for a successful migration of the VM.
-
Delete any existing snapshots:
- In the VMware vSphere Web Client, log in to your vCenter Server instance as an administrator.
- Under the Hosts and clusters menu, select the Usage Meter VM.
- In the Snapshots tab, select DELETE ALL or specify any of the snapshots that have the CD/DVD drive mounted and select DELETE.
- Click OK.
-
Disconnect the mounted drive:
- In the VMware vSphere Web Client, log in to your vCenter Server instance as an administrator.
- Under the Hosts and clusters menu, locate and right click the Usage Meter VM, and select Edit settings.
- Clear the box in the CD/DVD drive where you mounted the upgrade ISO file.
- Click OK.
-
Disconnect the mounted drive from the hosted ESXi:
- In the VMware vSphere Web Client, log in to your vCenter Server instance as an administrator.
- Under the Hosts and clusters menu, select the Usage Meter VM.
- In the Summary tab, locate Related objects and determine which host the VM is located.
- Log in to the ESXi host as root or an administrator.
- Select Virtual machines and right click the Usage Meter VM in the list.
- Click Edit settings.
- Under CD/DVD drive, clear the Connected checkbox.
- Click Save.
Replacing the VCF Usage Meter certificate
If you cannot access the Usage Meter URL or log in and view the dashboard after the upgrade, complete the following steps to replace the VCF Usage Meter certificate due to an incompatible hostname:
-
Use usagemeter username for the SSH into the Usage Meter VM.
-
Run the command
stop.sh All
to stop all services. -
Under a root user, run the command
hostnamectl hostname <new hostname>
to update the hostname with the correct value. -
Run the commands
export $(grep -v '^#' "/opt/vmware/cloudusagemetering/platform/conf/env.properties" | xargs)
andmv /opt/vmware/cloudusagemetering/platform/security/keystore /opt/vmware/cloudusagemetering/platform/security/keystore.backup
to export the environment variables and backup the existing keystore. -
If FIPS is enabled, run the command
keytool -changealias -alias "usage-meter-platform" -destalias "usage-meter-platform-backup" -keystore /opt/vmware/cloudusagemetering/platform/security/cacerts -storetype BCFKS -providerclass org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider -providerpath /opt/vmware/cloudusagemetering/platform/lib/bc-fips-*.jar -storepass "${TRUST_STORE_PASSWORD}"
. If it is disabled, run the commandkeytool -changealias -alias "usage-meter-platform" -destalias "usage-meter-platform-backup" -keystore /opt/vmware/cloudusagemetering/platform/security/cacerts -storepass "${TRUST_STORE_PASSWORD}"
.If you run the FIPS disabled version while FIPS is enabled, the error
keytool error: java.security.KeyStoreException: Unrecognized keystore format.
is displayed. To resolve it, load it with a specified type. -
Create a temporary directory for the NGINX variable and run the command
export NGINX_FOLDER=$(mktemp -d)
to move it into the cloudusagemetering directory, then runcd /opt/vmware/cloudusagemetering
to access the new directory. -
Run the command
./platform/bin/create-keystore.sh
to create the new keystore. -
Run the commands
rm -rf $NGINX_FOLDER
andrm /opt/vmware/cloudusagemetering/platform/security/keystore.backup
to remove the temporary backup files. -
If FIPS is enabled, run the command
keytool -delete -alias "usage-meter-platform-backup" -keystore /opt/vmware/cloudusagemetering/platform/security/cacerts -storetype BCFKS -providerclass org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider -providerpath /opt/vmware/cloudusagemetering/platform/lib/bc-fips-*.jar -storepass "${TRUST_STORE_PASSWORD}"
to delete the backup keystore. If it is disabled, run the commandkeytool -delete -alias "usage-meter-platform-backup" -keystore /opt/vmware/cloudusagemetering/platform/security/cacerts -storepass "${TRUST_STORE_PASSWORD}"
. -
Run the command
chmod 0640 /opt/vmware/cloudusagemetering/platform/security/keystore
to update the new keystore permissions and restart the Usage Meter VM.Due to the hostname change, you might need to update your DNS entry to the new hostname or add it if it doesn't exist. When you attempt to log in and you are redirected with an OAuth error to the login page, clear any existing DNS entries for the Usage Meter and try to log in again.
-
After the restart is complete, open the Usage Meter URL in a web browser to verify the upgraded version.