Error: "A specified parameter was not correct: relocateSpec.profile" occurs when changing storage policy on VM
search cancel

Error: "A specified parameter was not correct: relocateSpec.profile" occurs when changing storage policy on VM

book

Article ID: 370136

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Error when changing Storage Policy:

    [ <task-id> ] Unable to relocate VM.
    - Task failed, vc-id={<vc-id>}, task-moref={ManagedObjectReference: type = Task, value = task-<task-id>, serverGuid = null},
      error={A specified parameter was not correct: relocateSpec.diskLocator.profile}
    - The operation could not be performed because the argument is invalid.
      A specified parameter was not correct: relocateSpec.diskLocator.profile
  • Moving a Virtual Machine (VM) from NSX-V to NSX-T backed Organization Virtual Data Center (OrgVDC) fails with an error stating:

    Internal Server Error - A specified parameter was not correct: relocateSpec.profile

  • Error such as following can be noticed in VMware Cloud Director (VCD) log files /opt/vmware/vcloud-director/logs/vcloud-container-debug.log

| ERROR    | Backend-activity-pool-### | MoveVAppActivity               | [Activity Execution] Linking VMs to generated vApp failed - Handle: urn:uuid:<handle uuid>, Current Phase: MoveVAppActivity$UndeployOriginalVAppPhase | requestId=<request id>,request=POST https://example.com/api/vdc/<org vdc id>/action/moveVApp,requestTime=<time>,remoteAddress=#.#.#.#:###,userAgent=python-requests/2.26.0,accept=application/*;version 37.1 vcd=<vcd id>,task=<task id> activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:<task id>) activity=(com.vmware.vcloud.vdc.impl.MoveVAppActivity,urn:uuid:<activity id>)
java.util.concurrent.ExecutionException: com.vmware.vcloud.vdc.impl.LinkVMsToTargetVAppActivity$LinkVMsToVAppException: VM <vm name> (<vm id>) failed to update and has been rolled back. null Task failed, vc-id={<vc id>}, task-moref={ManagedObjectReference: type = Task, value = task-###, serverGuid = null}, error={A specified parameter was not correct: relocateSpec.profile}
        at com.vmware.vcloud.activity.toolkit.AbstractToolkitActivity$BasePhase.finish(AbstractToolkitActivity.java:196)
        at com.vmware.vcloud.vdc.impl.LinkVMsToTargetVAppActivity$CleanupAutoManagedVAppsPhase.invoke(LinkVMsToTargetVAppActivity.java:756)
...
...
Caused by: com.vmware.vcloud.vdc.impl.LinkVMsToTargetVAppActivity$LinkVMsToVAppException: VM <vm name> (<vm id>) failed to update and has been rolled back. null Task failed, vc-id={<vc id>}, task-moref={ManagedObjectReference: type = Task, value = task-###, serverGuid = null}, error={A specified parameter was not correct: relocateSpec.profile}

Environment

VMware Cloud Director 10.6.x
VMware vCenter Server

Cause

This Issue happens when either the VM Home storage policy or the Hard Disk storage policy on the concerned VM is set to either None or Datastore Default in vCenter and does not match the Storage Policy set on the VM in VCD.

Resolution

To resolve the Issue change the VM Home/Hard Disk Policy in vCenter to match the Storage Policy from the VCD side.

  1. Confirm the storage policy configuration on the VM in Cloud Director
    1. Login to the Cloud Director Tenant UI. 
    2. Navigate to "Applications > Virtual Machines".
    3. Click the name of the virtual machine being worked on.
    4. On the General page, review and record the name of the VM stored in the "Name in vSphere" row.
    5. On the virtual machine navigate to "Hardware > Hard Disks". 
    6. Review and record the storage policy set on the VM level and on all individual hard disks. 

  2. Confirm the storage policy configuration on the VM in vCenter Server.
    1. Login to the vCenter Server UI.
    2. In the search box at the top of the page enter the name of the VM recorded earlier in step 1d and press return.
    3. On the VM itself click the "Configure" tab.
    4. Select "Policies".
    5. Review and record the storage policy set on the VM Home and on all individual hard disks. 

  3. Compare and contrast the settings identified in step 1 and 2. Where differences are identified, change the storage policy in vCenter Server to match that set in Cloud Director. To change the policy, select the "EDIT VM STORAGE POLICIES" button on the Policies page. Make the required changes and select OK.

Additional Information

Change the Hardware Properties of a Virtual Machine

Change Storage Policy Assignment for Virtual Machine Files and Disks