VCF – Modify SDDC Manager Database to Rename Objects

Have you even wanted to change the name of an object in the vCenter inventory that is managed by VCF? For example, you have just deployed a new VI Workload Domain and the vDS name created during the installation does not match your naming standard? Unfortunately, the only way to do this is to dive deep into the SDDC Manager PostgreSQL database and manually change table entries to reflect the truth you want in vCenter.

This is a totally unsupported change by VMware and is not recommended for anyone not comfortable with database manipulation. In all cases you should make a backup and/or a snapshot of your vCenter and SDDC Manager VMs to be able to roll-back if things go awry!

So, lets look at some examples…

Change vDS Name

I have just deployed a new Workload Domain in my second tenant (T02) called WD02-CL01. Everything looks OK in vCenter in the Hosts and Clusters view.

vCenter Hosts and Clusters view

When looking at the vDS however, I see the name that was created automatically by SDDC Manager and this does not match my naming standard.

vDS Initial name

You don’t see this anywhere in the SDDC Manager GUI, you have to dive into the PostgreSQL database. So let’s do that:

1. Backup and/or Snapshot your vCenter and SDDC Manager VMs

2. SSH to the SDDC Manager VM and log in using the SDDC Manager Super User credential (should be vcf)

3. Switch to the root user entering the virtual appliance root user password when prompted:

SDDC Manager login

4. Connect to the local Postgres database:

psql -h localhost -U postgres

5. Connect to the database “platform”:

\c platform

6. Display a list of the database tables:

\dt
postgres database tables

7. Next comes the tricky part. You need to view the contents of the vds table to retrieve the ID of the vDS you wish to rename by typing:

select id, name from vds;
select id from vcenter

8. Change the name value for the ID of the desired vDS. In my case I want the vDS to be named WD02-CSD-VDS-01

update vds SET name = 'WD02-CSD-VDS-01' WHERE id = '60b2d872-4afb-4cd7-9716-f0da9413fb42';

9. Check that the name has been changed by executing the select id command again:

Verify new vDS name

10. Rename the vDS in the vSphere Web Client manually to reflect the new name:

rename vDS

Hopefully everything has worked and the vCenter inventory now matches the SDDC Manager database!

Final vDS names

Well, that was not too difficult, let’s change the vSAN datastore name now…

Change vSAN Datastore Name

As we can see, SDDC Manager chose a name for our new vSAN datastore that also does not match our standard:

Initial vSAN datastore name

1. Repeat steps 1 – 6 above to log in to the SDDC Manager VM and Postgres database

2. Display the vSAN datastore names in the cluster table:

select id, primary_datastore_name from cluster;
Display datastore names

3. Now to change the name. I want it to be “DS-WD02-CSD-VSAN”:

update cluster SET primary_datastore_name = 'DS-WD02-CSD-VSAN' WHERE id = '1f6e3e8f-4ef9-4e84-8d9f-af08d1abf210';

4. Check that the new name has taken by executing the select id command again

Verify new name

5. Rename the vSAN datastore in the vSphere Web Client manually to reflect the new name

Rename datastore in Web Client

6. Hopefully everything has worked and the vCenter inventory now matches the SDDC Manager database!

Final datastore name

Closing Note

I hope this blog post was useful – The same method can be used for other resources in the SDDC Manager database but as always, use extreme caution and do not expect any support from VMware (or me😉) if it all goes wrong!.

Feel free to share if you found this article useful and leave your feedback in the comments.

Until the next time!

Leave a Reply

Discover more from The Cloud Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading