Deploying the VMs or adding/deleting files from Content Library fails after Changing the vCenter GUID
search cancel

Deploying the VMs or adding/deleting files from Content Library fails after Changing the vCenter GUID

book

Article ID: 382015

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • After changing the vCenter GUID from uppercase to lowercase, adding/deleting files from Content Library fails with the below error:

    A general runtime error occurred. An error occurred: vCenter Server AF####E-###B-4###-###1-############ is not available on the server.


  • Unable to deploy VM's from content library template after also fails with the below error:

    A general system error occurred: The export of library item dd######-7###-4###-9###-d########### has failed. Reason: Error transferring files 2######### Reason: 'vc server 58######-E###-4###-A###-1########### is not available on the server.'.

  • Unable to add/delete files in Content Library after changing the vCenter GUID from uppercase to lowercase.

  • Verify whether the vCenter GUID appears in lowercase in the location /etc/vmware-vpx/instance.cfg from the vCenter SSH session using the below command:
    grep instanceUuid /etc/vmware-vpx/instance.cfg

Environment

VMware vCenter Server 8.x

Cause

In VCDB, the content library tables `storageuri` field uses an uppercase vCenter GUID, which is not acceptable in vCenter 8.x.

Resolution

Update the storageuri's in all content library tables within vCenter DB that references to uppercase vCenter GUID.

Steps to follow: -

  1. Take offline snapshot of all vCenter in ELM mode.
  2. Verify the vCenter GUID using the below command from the vCenter SSH session.
    grep instanceUuid /etc/vmware-vpx/instance.cfg
    Sample Output: -
    instanceUuid=af###e-###b-4###-###1-############
  3. Connect to the VCDB by running the below command.
    /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
  4.  Verify if following tables in content library storageuri's in VCDB referencing to lowercase vCenter GUID.
    select * from cl_storage;
    select * from cl_metadata;
    select serverguid from cl_library where serverguid='VC GUID';
  5. For table cl_storage
    1. Sample Output from Table cl_storage:-

                        id                  |                            storageuri                            |   type
      --------------------------------------+------------------------------------------------------------------+-----------
       95####7-5##1-4##9-8###-c########47c | Datastore:datastore-2#####5:AF####E-###B-4###-###1-############ | Datastore
       50####41-0##6-###a-###0-#########f92 | Datastore:datastore-2#####6:AF####E-###B-4###-###1-############  | Datastore
       86####a5-2##2-4##f-8##6-#########eb9 | Datastore:datastore-3#####5:AF####E-###B-4###-###1-############  | Datastore
       51#####b-f##7-4##d-a##5-#########b1f | Datastore:datastore-3#####5:AF####E-###B-4###-###1-############  | Datastore
      (4 rows)

      From the above output, it shows vCenter has 4 content libraries, and AF####E-###B-4###-###1-############ is the vCenter GUID currently displayed in uppercase. This is impacting the content library functionality. We need to change this to lowercase.

    2. Make a backup of cl_storage by running the below command.

      copy cl_storage to '/var/core/cl_storage_backup';
    3. Update the cl_storage file using the below command to change the vCenter GUID from upper case to lower case.

      update cl_storage set storageuri='<storageuri output from Step#4 with lower case vCenter GUID>' where id='<id from step#4>';

      Sample:

      update cl_storage set storageuri='Datastore:datastore-2#####5:af####e-###b-4###-###1-############' where id='95####7-5##1-4##9-8###-c########47c';
  6. For table cl_metadata
    1. Sample Output from Table cl_metadata:-

      VCDB=# select * from cl metadata;
      id | entityid | metadata key | metadata value
      ----+--------+------------+----------------
      (0 rows)

      In this case there was no entry in table, if you find vCenter GUID in uppercase change it to lowercase following below steps.

    2. Make a backup of cl_metadata by running the below command.

      copy cl_metadata to '/var/core/cl_metadata_backup';
    3. Run the following command to update the entry in the table.

      update cl_metadata set metadata_value = replace(metadata_value,'<OLD VC ID>','<VC ID>') where metadata_value like '%<OLD VC ID>';
      
  7. For table cl_library 
    1. Sample Output from Table cl_library:-

      VCDB=# select serverguid from cl_library where serverguid='DC######-####-####-####-#######C3';
                                                              serverguid
      
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      \x444#############################################################333
      (9 rows)

      Note: In this case, vCenter GUID is in hexadecimal format and hence it should be updated with the hexadecimal of the lowercase vCenter GUID.

    2. Make a backup of cl_library by running the below command.

      copy cl_library to '/var/core/cl_library_backup';
    3. Run the following command to update the entry in the table.

      update cl_library set serverguid='\x646############################################################333' where serverguid='\x444############################################################333';
  8. Repeat the above command for all content libraries from Step 4 that points to upper case vCenter GUID.