Error "Cannot create shadow VM of primary VM" when copying a vApp Template between catalogs on different OrgvDCs in VMware Cloud Director
search cancel

Error "Cannot create shadow VM of primary VM" when copying a vApp Template between catalogs on different OrgvDCs in VMware Cloud Director

book

Article ID: 386069

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Copying a vApp template from a catalog on one organization VDC to a catalog on different organization VDCs fails with an error similar to the following in VMware Cloud Director:

    [ ########-####-####-####-############ ] "Cannot create shadow VM of primary VM [vcId=########-####-####-####-############, moref=vm-#####] in datastore [vcId=########-####-####-####-############, moref=datastore-###]." - com.vmware.vcloud.api.presentation.service.InternalServerErrorException: Internal Server Error - Internal Server Error

    com.vmware.ssdc.library.exceptions.CreateShadowVmException: "Cannot create shadow VM of primary VM [vcId=########-####-####-####-############, moref=vm-#####] in datastore [vcId=########-####-####-####-############, moref=datastore-###]."

  • Uploading the vApp template directly to the source or the destination catalog works without issue.
  • In the VMware Cloud Director logs, errors similar to the following occur:

    2024-11-12 16:28:36,111 | DEBUG    | vim-proxy-activity-pool-140190 | ImportVAppFromOvfActivity      | Exception while attempting OVF import. | requestId=########-####-####-####-############,request=POST https://#########/api/catalog/########-####-####-####-############/action/copy,requestTime=#############,remoteAddress=##.##.##.##:42068,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 39.0.0-alpha vcd=########-####-####-####-############,task=########-####-####-####-############ activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:########-####-####-####-############) activity=(com.vmware.vcloud.vdc.impl.CopyContentsActivity,urn:uuid:########-####-####-####-############) activity=(com.vmware.vcloud.vdc.impl.CreateStoredVmActivity,urn:uuid:########-####-####-####-############) activity=(com.vmware.vcloud.fabric.storage.storedVm.impl.CreateFromExistingStoredVmNonBlockingActivity,urn:########-####-####-####-############) activity=(com.vmware.vcloud.fabric.storage.storedVm.impl.CreateShadowVmActivity,urn:uuid:########-####-####-####-############) activity=(com.vmware.vcloud.fabric.storage.copy.impl.CopyVmActivity,urn:uuid:########-####-####-####-############) activity=(com.vmware.vcloud.val.internal.impl.ImportVAppFromOvfActivity,urn:uuid:########-####-####-####-############)
    com.vmware.ssdc.library.exceptions.VimInvalidArgumentException: The operation could not be performed because the argument is invalid. A specified parameter was not correct: profileId
            at com.vmware.ssdc.library.vim.LmVim.Convert(LmVim.java:262)
            at com.vmware.ssdc.library.vim.LmVim.Convert(LmVim.java:498)
            at com.vmware.vcloud.val.internal.impl.ImportVAppFromOvfActivity$ImportOvfToVcPhase.initiateImportFromOvf(ImportVAppFromOvfActivity.java:854)
            at com.vmware.vcloud.val.internal.impl.ImportVAppFromOvfActivity$ImportOvfToVcPhase.invoke(ImportVAppFromOvfActivity.java:243)
            at com.vmware.vcloud.activity.executors.ActivityRunner.runPhase(ActivityRunner.java:175)
            at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:112)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: (vmodl.fault.InvalidArgument) {
       faultCause = null,
       faultMessage = (vmodl.LocalizableMessage) [
          (vmodl.LocalizableMessage) {
             dynamicType = null,
             dynamicProperty = null,
             key = com.vmware.pbm.pbmFault.locale,
             arg = (vmodl.KeyAnyValue) [
                (vmodl.KeyAnyValue) {
                   dynamicType = null,
                   dynamicProperty = null,
                   key = summary,
                   value = Profile not found. Id: ,
                }
             ],
             message = com.vmware.pbm.pbmFault.locale
          }
       ],
       invalidProperty = profileId
    }
    ...

  • The OVA or OVF contains a StorageGroupSection, similar to the following:

      <vmw:StorageGroupSection ovf:required="false" vmw:id="####" vmw:name="<Storage Policy Name>">
        <Info>Storage policy for group of disks</Info>
        <vmw:Description><Storage Policy Description></vmw:Description>
      </vmw:StorageGroupSection>

  • VMware Cloud Director 10.5.1.1 is the version in use.
  • vCenter 8.0U2 is installed in the underlying vSphere environment.

Environment

VMware Cloud Director 10.x

Cause

There is a known issue introduced in vCenter 8.0U2 that causes OVA and OVF imports to fail, as discussed in the following article:

"The operation could not be performed because the argument is invalid. A specified parameter was not correct: profileId" error when adding an Application from VMware Marketplace in VMware Cloud Director

As noted, VMware Cloud Director 10.4.3 and 10.5.1.1 mitigated this issue for importing templates, but this accommodation is not included in the routines that copy templates between catalogs. Thus, importing into the catalogs is successful, but copying can still fail due to this known limitation.

Resolution

The underlying issue has been corrected in vSphere 8.0U3 and it is recommended to update to this version to remediate the failiures.

If the environment cannot be updated, one of the following options can be used to workaround the behavior:

  1. Upload problematic templates to all catalogs, rather than copying them, or
  2. Remove the StorageGroupSection before uploading them to vCD as detailed in the following document:

    "The operation could not be performed because the argument is invalid. A specified parameter was not correct: profileId" error when adding an Application from VMware Marketplace in VMware Cloud Director