Error: "class.java.lang.NullPointerException" when creating an Org VDCs
search cancel

Error: "class.java.lang.NullPointerException" when creating an Org VDCs

book

Article ID: 446401

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Attempts to create or delete an Organization VDC fails with error,

    Internal Server Error.

  • The /opt/vmware/vcloud-director/logs/vcloud-container-debug.log on the Cloud Director cell displays logs such as:

    java.lang.NullPointerException
            at com.vmware.ssdc.backend.services.impl.ProviderVdcManagerImpl.isRootResourcePoolInYellowState(ProviderVdcManagerImpl.java:1617)
            at com.vmware.ssdc.backend.services.impl.ProviderVdcManagerImpl.isPrimaryRootResourcePoolInYellowState(ProviderVdcManagerImpl.java:1601)
            at com.vmware.vcloud.valc.util.ConfigUtil.validateProviderVdcState(ConfigUtil.java:377)

    WARN | ComputeHubSetImpl | Failed to locate the backing resource [vcId=..., moref=resgroup-####]

    DEBUG | AbstractEventBuilder | Could not find property 'resourcePool.moref' in source object.

Environment

VMware Cloud Director 10.6.x

Cause

This issue occurs if the underlying vCenter Resource Pool (referenced by a specific Managed Object Reference ID or "MoRef") has been deleted, recreated with a different ID, or moved. Cloud Director’s database continues to reference the stale MoRef. When the isRootResourcePoolInYellowState method is called, it fails to resolve the object, resulting in a NullPointerException

Resolution

To resolved the issue, confirm that the resource pool exists in the vCenter Server. Once confirmed that it does exist, perform a reconnect of vCenter Server from Cloud Director in order to synchronize the managed object reference state.  

  1. Inspect the error message from Cloud Director UI and record the 'resgroup' number mentioned in the error. Example: resgroup-12345
  2. Connect to the vCenter Server MOB in a web browser and confirm that the resgroup managed object exists. Insert the resgroup-12345 as the moid reference.

    Example URL format: https://vcenter.example.com/mob/moid=resgroup-####

  3. After accessing the vCenter MOB entry for resgroup-12345, verify the result:
    If the page appears blank, the resource pool does not exist in the vCenter inventory.
    If managed object information is displayed, the resource pool exists and is accessible.

  4. If the resgroup does exist in vCenter Server, perform the steps outlined in Reconnect a vCenter Instance to Your VMware Cloud Director.

    The reconnect operation initiates a comprehensive scan of the vCenter Managed Object References (MoRefs). VCD queries vCenter for all Hosts, Clusters, Resource Pools, Networks, and VMs to ensure that the uuid and moref mapped in the VCD database match the current state in vCenter.

  5. Attempt to deploy a VM in the Tenant to confirm it now works successfully.

If the resource pool does not exist, perform the following remediation steps:

  1. Create a new resource pool in vCenter Server by following the steps in the official documentation: Create a resource pool
  2. Execute the cell management tool to resolve the synchronization issue: Detect and Fix Resource Pool Mismatches between VMware Cloud Director and vCenter