Renaming a VM using PowerCLI script reverts the VM name to its original value
search cancel

Renaming a VM using PowerCLI script reverts the VM name to its original value

book

Article ID: 325434

calendar_today

Updated On: 10-15-2024

Products

VMware vCenter Server

Issue/Introduction

Renaming a virtual machine through PowerCLI or any direct vCenter Server API script, and restarting the vCenter Server might revert the virtual machine name to its original value. The issue occurs as the VPX_ENTITY table is not updated, when you rename a virtual machine through PowerCLI.

This is fixed in vCenter Server 6.0 Update 2. If you see the issue even after upgrading to vCenter Server 6.0 Update 2, follow the steps mentioned in the below section.

Environment

VMware vCenter Server 6.0.x

Resolution

Perform the following steps to fix the issue:

  1. Log in to the database.
  2. Run the following queries to compare the virtual machine names in VPX_ENTITY and VPX_VM_CONFIG_INFO tables:
    select id,name from vpx_vm_config_info;
    select id,name from vpx_entity;
  3. If there is a mismatch, then update the virtual machine name in VPX_ENTITY table as the virtual machine name stored in the VPX_VM_CONFIG_INFO table by executing the below command:
    UPDATE VPX_ENTITY
    SET name = "name in vpx_vm_config_info"
    WHERE id = "mismatch_vm_name id";