Error : "Index 0 out of bounds for length 0" when editing a Cloud Director VM
search cancel

Error : "Index 0 out of bounds for length 0" when editing a Cloud Director VM

book

Article ID: 324408

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Adding a hard disk, adding a network adapter, editing Guest OS Customization, or editing other settings of a Cloud Director Virtual Machine (VM) from the Tenant Portal UI fails with an error of the form:

    [ ########-####-####-####-############ ] Index 0 out of bounds for length 0

  • The /opt/vmware/vcloud-director/logs/vcloud-container-debug.log file on the Cloud Director Cells shows entries similar to:

    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:659)
    at java.util.ArrayList.get(ArrayList.java:435)
    at com.vmware.ssdc.backend.dao.impl.VAppVirtualMachineDaoImpl.getStorageContainerValRefForVappVm(VAppVirtualMachineDaoImpl.java:127)

  • Move operations for VMs between vApps failed with error:

    Caused by: java.lang.NullPointerException: identifier
            at com.vmware.ssdc.val.types.VALRef.<init>(VALRef.java:85)
            at com.vmware.ssdc.val.types.StorageContainerVALRef.<init>(StorageContainerVALRef.java:19)
            at com.vmware.ssdc.val.types.DatastoreVALRef.<init>(DatastoreVALRef.java:13)
            at com.vmware.vcloud.fabric.storage.storedVm.impl.StoredVmUtils.isConsolidateOnRelocateNeeded(StoredVmUtils.java:873)
            at com.vmware.vcloud.fabric.storage.storedVm.impl.RelocateStoredVmByDatastoreActivity$MigratePoweredOnVmAcrossRpAndDsPhase.baseInvoke(RelocateStoredVmByDatastoreActivity.java:27

Environment

  • VMware Cloud Director 10.6.0.x
  • VMware Cloud Director 10.5.x
  • VMware Cloud Director 10.4.x

Cause

This issue can occur if there are missing or incorrect "dstore_moref" value for the VM entry in the Cloud Director database. For example if the entry is NULL or the VM entry in the database has the wrong datastore reference, i.e. VM resides on another datastore in vCenter.

Resolution

This issue has been fixed in Cloud Director 10.6.1, see Release Notes.

Additional Information