'Delete from disk' and 'remove from Inventory' options grayed out for Virtual Machines on vSphere Client
search cancel

'Delete from disk' and 'remove from Inventory' options grayed out for Virtual Machines on vSphere Client

book

Article ID: 424037

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • In a vSphere environment integrated with Zerto, the management options for Virtual Machines like 'Delete from disk' and 'Remove from Inventory' are grayed out in the vSphere Client.
  • The same VM can be deleted successfully when logging directly into the ESXi Host Client.

Environment

VMware vCenter Server 8.x

Cause

  • This behavior is caused by entries in the vCenter Server Database (VCDB) table vpx_disabled_methods.
  • When Zerto protects a VM, it registers "Disabled Methods" via the vSphere API to prevent accidental deletion or migration that could lead to replication inconsistency. If a VM is removed from Zerto, sometimes, the entries remain as stale in the vCenter database, preventing the vSphere Client from performing those specific actions.

Resolution

To restore the methods, follow one of the options listed below.

OPTION 1: Using vSphere Client

  1. Navigate to the affected Virtual Machine in the vCenter Inventory . Select Configure -> Disabled Methods.
  2. Select the required method and click on 'Enable' option.

OPTION 2: Using vCenter MOB

  1. Identify the VM's MOB ID:
    1. Select the affected Virtual Machine in the vCenter Inventory.
    2. Check the URL on the browser and look for the string "VirtualMachine:vm-xx".
    3. The vm-xx is the VM's MOB ID.

  2. Enable the required methods:
    1. On a new browser tab, enter the below URL:
      https://ExamplevCenterFQDNorIP/mob/?moid=AuthorizationManager&method=enableMethods
    2. Login using the vCenter Server's Local SSO account. Example: [email protected]
    3. The page loads as below:
    4. For the parameter entity, under value, enter the MOID of the affected Virtual Machine.
      Eg:
      <!-- array start -->
      <entity type="ManagedEntity" xsi:type="ManagedObjectReference">vm-xx</entity>
      <!-- array end -->

    5. For the parameter method, under value, enter the below strings:
      1. <method>Destroy_Task</method>
      2. <method>UnregisterVM</method>

    6. Click on Invoke Method
    7. Refresh the vSphere Client.


OPTION 3: Using vCenter Postgres Database

  1. Stop the vpxd service:
    service-control --stop vpxd

  2. Enter the vCenter Postgres Database:
    /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

  3. Identify the ID for the Virtual Machine:
    select id, file_name from vpx_vm where file_name like '%VM_NAME%';

  4. Query the vpx_disabled_methods to find entries for the affected Virtual Machine:
    select * from vpx_disabled_methods where entity_mo_id_val = 'vm-ID';

  5. Remove the disabled methods for the Virtual Machine:
    DELETE FROM vpx_disabled_methods WHERE entity_mo_id_val = 'vm-ID';

  6. Exit the database:
    \q

  7. Start the vpxd service:
    service-control --start vpxd