Cleaning Up Tanzu License – CLI Method

Cleaning Up Tanzu License – CLI Method

Cleaning up a (expired) Tanzu license is not possible from the GUI. It’s aesthetic, I know, but I want it out!

I enabled Workload Management on my cluster before, and assigned a license. Now the supervisor cluster is not there anymore, but the license assignment is.

I wouldn’t write this blog post if it were merely a copy and paste from a Knowledge Base article. Anyway, the Broadcom KB article mentions two options :

  1. use JXplorer – I didn’t want to go download and just work through the solution via CLI
  2. CLI

We are going to focus on how to do this from the CLI !

Let’s visualize how the problem looks, this is my view from vCenter:

Tanzu license assigned to the Supervisor cluster

It is standard behaviour that licenses assigned to an Asset, are not available for removal. Because it is Expired, it is just ugly showing there within the overview of my added licenses. I want to get rid of it, but how do I do that?

As mentioned in the Broadcom KB article, one can browse the LDAP database, and throw it out.

First, we need to find the entry for the asset, and license in the LDAP database. Piping it to ‘less’ will give the option to search (type /) through the content. You’ll need it as it returns a lot of values

/opt/likewise/bin/ldapsearch -h localhost -D "cn=Administrator,cn=Users,dc=vsphere,dc=local"  -w 'INSERT_PASSWORD' -b "cn=LicenseService,cn=Services,dc=vsphere,dc=local"| less
ShellSession

In my case, I need to search for the supervisor cluster assignment. So I used words like Asset, Tanzu and wcp. It could be vSAN, or something else as well. I found two relevant entries, one for the license, and one for the asset assigned license. You’ll need the common name (cn) for the asset entity, in my case ‘AssetEntity_wcp-domain-c7-a76334a1-f4fd-4636-a466-e4c753d990ee’

/opt/likewise/bin/ldapdelete -h localhost -D "cn=Administrator,cn=Users,dc=vsphere,dc=local" -w 'INSERT_PASSWORD' "cn=AssetEntity_wcp-domain-c7-a76334a1-f4fd-4636-a466-e4c753d990ee,cn=LicenseService,cn=services,dc=vsphere,dc=local"
ShellSession

Revisit the Assets view. We see that the license is not assigned to the supervisor cluster anymore.

The license is not assigned to the supervisor cluster anymore!
Cleaning the Tanzu license assigned to the Supervisor cluster

When we go and review the Licenses view, we can see that the license is still present, and assigned. I didn’t restart the vCenter vpxd service at this point. If I would have, the license would have probably been available for removal. I went on and removed the license via the CLI. Same as before, find the actual license in the LDAP database, and delete it. I searched for the first part of the license key, and copied the license entity, here ‘LicenseEntity_b056d2ce-b035-42f4-8733-b5d21c094121’

/opt/likewise/bin/ldapdelete -h localhost -D "cn=Administrator,cn=Users,dc=vsphere,dc=local" -w 'INSERT_PASSWORD' "cn=LicenseEntity_b056d2ce-b035-42f4-8733-b5d21c094121,cn=LicenseService,cn=services,dc=vsphere,dc=local"
ShellSession

Restart the vCenter vpxd service. The license view does not refresh without that restart.

service-control --restart vpxd
ShellSession

We see that the Tanzu license is not showing anymore:

Tanzu licence cleaned

That is how we are cleaning up a Tanzu license from vCenter !

NSX Host Transport Nodes upgrade fails

NSX Host Transport Nodes upgrade fails

While going through the latest lab upgrade round, I found myself running into an error when upgrading NSX. The NSX Edge Transport Nodes (ETN) upgrade successfully, however, the NSX Host Transport Nodes (HTN) portion fails.

The upgrade returns the following error:

A general system error occurred: Image is not valid. Component NSX LCP Bundle(NSX LCP Bundle(4.1.0.2.0-8.0.21761693)) has unmet dependency nsx-python-greenlet-esxio because providing component(s) NSX LCP Bundle(NSX LCP Bundle(4.1.0.2.0-8.0.21761693)) are obsoleted.

At the same time the same error is listed on vCenter:

NSX LCP upgrade error on vCenter
NSX LCP upgrade error on vCenter

When analysing the vLCM configuration, there was nothing that pointed to the fact that the NSX LCP Bundle was causing an issue. However, through a reddit post, I landed on the following Broadcom KB: NSX Host Cluster Upgrade on SDDC Manager fails with “Set desired state operation failed. Image is not valid”

Wile not exactly mentioning the solution, it got me thinking it could be similar. The procedure instructs to download, and work with the JSON export of the vLCM configuration:

{
    "add_on": {
        "name": "DEL-ESXi",
        "version": "802.22380479-A04"
    },
    "alternative_images": null,
    "base_image": {
        "version": "8.0.2-0.40.23825572"
    },
    "components": {
        "Intel-i40en": "2.5.11.0-1OEM.700.1.0.15843807",
        "Synology-syno-nfs-vaai-plugin": "2.0-1109",
        "nsx-lcp-bundle": "4.1.0.2.0-8.0.21761693"
    },
    "hardware_support": null,
    "removed_components": null,
    "solutions": null
}
ShellSession

I removed the highlighted nsx-lcp-bundle line, saved and imported the JSON again to vLCM. Hereafter I retried the upgrade on NSX and could progress now!

Quick Tip: VCD cell-management-tool without using credentials

Quick Tip: VCD cell-management-tool without using credentials

Are you tired of constantly typing the password when executing cell-management-tool commands on VCD cells? Here is a quick tip on how to use the cell-management-tool without using credentials.

There is an option -i that allows you to execute commands using the pid (process id) instead of providing the system-administrator credentials.

How does it work?

  • first you retrieve the pid number
  • the -i option allows you to use the pid number to bypass the authentication (you were logged on with a user with administrative permissions anyway)

The following will display the activity (-t, or –status) on the VCD cell. If not using the pid method, one would use -u for the username, and then be prompted for the password.

You can find the cell-management-tool command line reference here (VCD 10.4).

Let’s take a look how it would normally work:

  • retrieve the pid number
cat /var/run/vmware-vcd-cell.pid
24663
ShellSession

Now we will use the pid number as a parameter to execute the command:

cd /opt/vmware/vcloud-director/bin
./cell-management-tool cell -i 24663 -t
ShellSession

Let’s do some small optimization now. We will combine the two command into a one-liner. This will retrieve the pid at execution time.

cd /opt/vmware/vcloud-director/bin
./cell-management-tool cell -i $(cat /var/run/vmware-vcd-cell.pid) -t
ShellSession

Happy to share this quick tip. Now you can also execute the cell-management-tool without using credentials, and maybe be a less frustrated, having to type that password over and over again 😀 !

Quick Update: NSX ALB documentation

Quick Update: NSX ALB documentation

To be honest, I have been complaining somewhat over the last year, or so, about the NSX Advanced Load Balancer documentation. Mostly that it was not easy to be found, and one was having to fall back on the avinetworks.com site, which was not great either.

On docs.vmware.com the navigation links were not existing. However, if and when you knew the page titles, you could search for them through search engines. That showed that a lot of those documentation pages were there, in fact, but only not visible with non-existing links.

However, since a couple weeks, there is a banner on the avinetworks.com site that 22.1.4 is the latest release that was documented on avinetworks.com.

NSX ALB documentation deprecation on avinetworks.com
NSX ALB documentation deprecation on avinetworks.com

This means that the single source of truth will be on the NSX Advanced Load Balancer page on docs.vmware.com (the link does redirect you to that location 😀).

Quick Tip: Setting up TrueSSO?

Quick Tip: Setting up TrueSSO?

Are you setting up TrueSSO? Are you looking to use signed certificates to secure the communication between the Connection Server and the Enrollment Server?

Try to find the documentation on using signed certificates to secure that communication. I challenge you, you will not find it easily.

What and why?

You are allowing access to the Unified Access Gateway from the internet. You will want those services to have signed certificates to secure the communication, which will turn that icon in the Horizon client green. To enable end-to-end signed communication, you will need to make sure that you have certs all the way. In the end you are creating tunnels to backend services.

On top of that you want to add TrueSSO in the equation as you want a seamless sign-on experience. This means more certificates. You follow the guides (and all the blog posts that are built using this information), so you are almost there.

However, one step is exporting the ‘vdm.ec’ certificate from the Connection Server and import it on the Enrollment Server. That is exactly where the information is missing or at least hard to be found. None of them actually talk about CA signed certificates for this. You are doing this kind of effort to get all those components (Microsoft) CA signed. Don’t you think that you should use signed certificates here as well, if . I think so!

Where can I find the documentation

Here is the documentation on the VMware websites on setting up TrueSSO:

… and also some great blogs articles out there:

Search no more, you can find it here on the docs.vmware.com site, it is just in another section and a bit hard to find.