Issue: Assigning license for VSAN shows 0TB usage
search cancel

Issue: Assigning license for VSAN shows 0TB usage

book

Article ID: 387458

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSAN

Issue/Introduction

  • vSAN disk groups created during 7.x
  • ESXi upgraded to 8.0.x
  • vSAN storage is all flash
  • When assigning license to cluster, the Usage shows 0 TB, but cluster is using more than that. 
  • By using the below script from KB Counting Cores for VMware Cloud Foundation and vSphere Foundation and TiBs for vSAN 'Get-FoundationCoreAndTiBUsage -ClusterName "Cluster_Name" --DeploymentType VCF' for counting Cores, you can get the following error: 
    "The vSAN capacity for cluster vSAN <CLUSTER name> cannot be determined because of the stale PDL devices in this cluster. Contact Global Support team for assistance."

 

  • You can see configstore is empty, not valid or stale entries are there by running the below command on ESXi host.
configstorecli config current get  -c vsan -g system -k host_config

 

Environment

vSphere ESXi 8.x

vCenter 8.x

vSAN 8.x

Cause

During upgrade, the vSAN storage capacity is not updated into configstore to allow usage data to flow to license usage.

Disk capacityFlash tag was introduced to configstore in 7.0.0 release. For pre-7.0.0 ESXi host, the tag information is stored at claim rules. When you upgrade pre-7.0 ESXi host to 7.0.0 or later version, the capacityFlash
tag will be migrated  from disk metadata to configstore.


The capacityFlash tag just takes effect when creating vsan diskgroup. As long as the disk belongs to a diskgroup, the tag in configstore is useless. So if you upgrade the ESXi host from pre7.0.0 to 7.0.1 or later version, capacityFlash tag will not be restored to configstore anymore.

Resolution

Run the attached python script on all hosts in the cluster.

1. Put the ESXi host in Maintenance Mode.

2. Download the script attached to KB and upload to all hosts in the cluster into /tmp.

3. Run the script in an SSH session on all hosts by executing the following on each host: 

python /tmp/remediateLicense-updated.py

4. Stop the vsanmgmt service: 

    esxcli system service stop vsanmgmt

5. Start the vsanmgmt  service:

esxcli system service start vsanmgmt

Perform the above activity on all the ESXi hosts for the cluster you are getting error.


If the python script gives an error when running, for example:

Found capacityFlash disk naa.XXXXXXXXXXXXXXXX
Traceback (most recent call last):
  File "/tmp/remediateLicense.py", line 41, in <module>
    if not found:
NameError: name 'found' is not defined. Did you mean: 'round'?

Restart the vsanmgmt service as stated above and run the script once more

Additional Information

 Example of empty configstore entry:

[root@ESXi_host_name:~] configstorecli config current get  -c vsan -g system -k host_config

{}

 Example of invalid or stale configstore entry:

[root@ESXi_host_name:~] configstorecli config current get  -c vsan -g system -k host_config

{
   "disks": [
      {
         "name": "mpx.vmhba0:C0:T64:L0",
         "tags": [
            "capacityFlash"
         ]
      },

 

 Example of valid configstore entry:

[root@ESXi_host_name:~] configstorecli config current get  -c vsan -g system -k host_config

 "disks": [
      {
         "disk_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
         "name": "mpx.vmhba2:C0:T1:L0",
         "tags": [
            "capacityFlash"
         ],
         "vsan_capacity": 3840755982336
      },

Attachments

remediateLicense-updated.py get_app