Power off operation of an individual Virtual Machine in VCD fails with the error "The entity <vm-id> is undergoing maintenance operations"
search cancel

Power off operation of an individual Virtual Machine in VCD fails with the error "The entity <vm-id> is undergoing maintenance operations"

book

Article ID: 392760

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • VM is individual to the Org and is not part of any vAPP
  • From the Actions menu of the virtual machine Reset, Suspend were grayed out for Organization Admin
  • Login as System Admin actions are not grayed out, and power off operation works
  • Attempting to perform actions against the VM as an Organization Admin user from Tenant UI fails with the error 
  • Browser API report "https://vcloud-fqdn/api/vApp/vm-0d4d6496-a7b5-4698-xxxx-3251cfd9b3c4/action/undeploy",

            "text": "<root:UndeployVAppParams xmlns:root=\"http://www.vmware.com/vcloud/v1.5\"><root:UndeployPowerAction>powerOff</root:UndeployPowerAction></root:UndeployVAppParams>"

       "response": {
          "status": 409,
          "statusText": "Conflict",

 

Environment

vCloud director 10.3.3

Cause

When a VM is in maintenance mode, it is read-only at the Organization level and only the System admin can perform any operations on it

Resolution

POST /vApp/{id}/action/exitMaintenanceMode (Take the VM out of maintenance mode)

Steps to exit maintenance mode for the VM

1. Take SSH to the vCloud primary cell and connect to the vCloud DB

sudo -i -u postgres psql vcloud

2. Note down the VM ID from the browser URL and replace the ID in SQL to fetch vapp_id

Example: https://vcloud-fqdn/tenant/<tenant-name>/vdcs/xxxx/vm/vm-0d4d6496-a7b5-4698-xxxx-3251cfd9b3c4/general

3. Execute the statement - select * from vapp_vm where id = '0d4d6496-a7b5-4698-xxxx-3251cfd9b3c4';

id                            | 0d4d6496-a7b5-4698-xxxx-3251cfd9b3c4
vapp_scoped_vm_id             | b8f5bb04-df1e-46b5-xxxx-ad435a21bc14
vapp_id                       | 0234a510-7907-456c-xxxx-deadd16ea93c

4. Send the API call to exit the VM from maintenance mode
POST  https://vcloud.example.com/api/vApp/vapp-0234a510-7907-456c-xxxx-deadd16ea93c/action/exitMaintenanceMode

Status: 204 No Content

5. Once the Virtual Machine is out of Maintenance mode, Organization users should be able to perform VM actions

Additional Information

How to establish an API connection VMware Cloud Director (56948)