SQL Statements to resolve “VM Renamed Using PowerCLI Reverts to Original Name After vCenter Restart”

By | June 20, 2016

This is a follow-up to my last blog post.

In the KB, VMware states that the issue is resolved in vCenter 6.0u2 but that if you still see the issue you will need to look at the database tables.

My user informed today that the issue re-occurred after vCenter was patched over the weekend. I cracked open SQL Management Studio and tested the below queries:

 

The problem with these is that you have to manually compare the two lists. I use this query (in SQL Management Studio) to give me the VMs that have a mismatch between the two tables:

This will give you the ID and the “Correct” name of the VM

The KB gives you this sample statement to update the names:

I have 400 VMs to update, I didn’t want to do them one-at-a-time, so I found a statement that will update the VPX_ENTITY entries based on the corresponding vpx_vm_config_info entry if the names do not match

I bounce vCenter after this SQL so that I can see the VMs get loaded in with the expected name.

Leave a Reply

Your email address will not be published. Required fields are marked *