Error: "java.lang.NullPointerException at com.vmware.ssdc.library.types.DatastoreURL.hashCode(DatastoreURL.java:20)" when deploying or editing a Virtual Machine
search cancel

Error: "java.lang.NullPointerException at com.vmware.ssdc.library.types.DatastoreURL.hashCode(DatastoreURL.java:20)" when deploying or editing a Virtual Machine

book

Article ID: 370415

calendar_today

Updated On: 02-25-2025

Products

VMware Cloud Director

Issue/Introduction

  • You are deploying or editing a Virtual Machine (VM) in VMware Cloud Director (VCD).
  • In the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log, entries as below are logged:

java.lang.NullPointerException
        at com.vmware.ssdc.library.types.DatastoreURL.hashCode(DatastoreURL.java:20)
        at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
        at java.base/java.util.Objects.hash(Objects.java:146)
        at com.vmware.vcloud.fabric.storage.placement.filters.DatastoreData.hashCode(DatastoreData.java:180)

  • VCD was recently upgraded from an earlier release.
  • In the VCD Provider Portal under Resources > Infrastructure Resources > vCenter Server Instances there are vCenter Servers with Usage equal to None.

Environment

VMware Cloud Director 10.5.1.1

Cause

This issue can occur if there are missing URLs in the datastore_inv table of the VCD database associated with an unused vCenter instance with Usage equal to None.

Resolution

To resolve the issue, you can remove any vCenter instance that is not being used in the VCD environment with a Usage status of None.

Refer the document for removal of the vCenter instance from VCD: Unregister a vCenter Server Instance From Your VMware Cloud Director.

Alternatively if the vCenter Server is to be retained it can be utilised to change its Usage from None to a valid option.

  1. To set the Usage to IaaS, create a Provider VDC using resources from this vCenter Server.
  2. To set the Usage to SDDC, enable Tenant Access to this vCenter Server.