Error: "unable to find disk with ID... error retrieving Disk: API Error: 500" when accessing a Named Disk using Terraform
search cancel

Error: "unable to find disk with ID... error retrieving Disk: API Error: 500" when accessing a Named Disk using Terraform

book

Article ID: 436619

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • You will see the below error when Terraform is trying to reference the Named Disks by their URN:

    Error: unable to find disk with ID urn:vcloud:disk:########-####-####-####-####ffe9:
    error retrieving Disk: API Error: 500: [ ##-yyyy-mm-dd-hh-mm-ss-648--########-####-####-####-####5616 ]

  • You might be facing the above issue with Terraform after migrating the datastore from vSAN OSA to vSAN ESA, followed by a VMware Cloud Director(VCD) Storage Policy migration.

Environment

VMware Cloud Director 10.6.1.2

Cause

When you perform Migrate Tenant Storage in VCD it migrates the named disk alongside the Virtual Machine(VM). Even though vCenter consolidates the files in to the VMs folder, VCD code maintains logical separation inside the database. 

The issue occurs in Terraform because of the consolidation and renaming of the named disk at the vCenter level. These changes are purely cosmetic changes at the vCenter filesystem level, but within VCD, the disk remains a fully independent Named Disk.

Resolution

To workaround the issue you can detach the named disks from the respective VMs before using the feature of Migrating VMware Cloud Director Tenant Storage across datastores.
To detach the named disks you can use the following document: Detach a VMware Cloud Director Named Disk to a Virtual Machine.

You can re-attach the named disk once you finish migrating the tenant storage across datastores. To re-attach the named disks you can use the following document: Attach a VMware Cloud Director Named Disk to a Virtual Machine.