1 Reply Latest reply on Mar 10, 2020 10:39 AM by amirwizards

    vCloud director 9.7 API: Create and Attach “independent disks” to VMs fails with Error Internal Server Error

    z001yv0r Novice

      Hi,

       

      Using vCloud director 9.7 when we try to create and attach “independent disks” to VMs which is failing as follows.

       

       

      Command executed:

       

      curl -i -k -H "Accept:application/*+xml;version=32.0" -H "Content-Type:application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml" -H  "x-vcloud-authorization:84259732ee6d48d985ad10935d7ac698" -u z00185xc@vcd0012:***pwd****** -d @attach.xml -X POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach

       

      [root@osboxes /]# cat attach.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <DiskAttachOrDetachParams

         xmlns="http://www.vmware.com/vcloud/v1.5">

         <Disk

      type="application/vnd.vmware.vcloud.disk+xml"

            href="https://vcd03ui.tre.nsn-rdnet.net/api/disk/f1414c3c-8535-43ab-b2aa-be315bfff8bf" >

         </Disk>

         <BusNumber> 0 </BusNumber>

         <UnitNumber> 1 </UnitNumber>

      </DiskAttachOrDetachParams>

       

      result:

       

      HTTP/1.1 202 Accepted

      Date: Fri, 06 Mar 2020 10:44:44 GMT

      X-VMWARE-VCLOUD-REQUEST-ID: 5c21a5df-8256-455b-b118-87f22010437b

      X-VMWARE-VCLOUD-CEIP-ID: 167319ac-ee18-4d16-b01c-9be512f56528

      X-VMWARE-VCLOUD-ACCESS-TOKEN: eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ6MDAxODV4YyIsImlzcyI6IjU0NDg0MTQ0LTgzNDgtNGM3OS04MmFjLTJlN2M1YjE2OTBiYkBjNjJhMGVjYi05MmMwLTQ3NTUtYjZlZS0zNTU3YjkwNWZkZGMiLCJleHAiOjE1ODM1NzY1MjEsInZlcnNpb24iOiJ2Y2xvdWRfMS4wIiwianRpIjoiODQyNTk3MzJlZTZkNDhkOTg1YWQxMDkzNWQ3YWM2OTgifQ.VJlA78XP_x3Y5Z8mB0kaumchJfrVUNCAJlEEUm6hS8A1B-6DT1XFc9rh5pEAUffA_OS_stTiqt35J85XWAJmboYAB0KvhhZc1pUGq6URUl1H7L16xgc-xEa3b1kOga5WADzec6b-lU_9j4yRBQTcYtn1yzMM00i7ThVulCyuHcSKiZHDP9iCVOoF9wP4z7HwR4dVBVhwnJ4KGbC7jTee5kpOgxYJcusKPS1IOnL93h1KrvnEoKS--jUj7YJTxzs5tQtOmOEP_dWtNOnCBHYR6UCihgBHGcDCmqVSHcxByqRY8HLcCXwH2kTHgABVw5AHd7lmS4kKr5JZf_kZ2qqdJg

      X-VMWARE-VCLOUD-TOKEN-TYPE: Bearer

      x-vcloud-authorization: 84259732ee6d48d985ad10935d7ac698

      Location: https://vcd03ui.tre.nsn-rdnet.net/api/task/408c946c-ad4c-46e3-859b-8d8e85ec7b47

      Content-Type: application/vnd.vmware.vcloud.task+xml;version=32.0

      X-VMWARE-VCLOUD-REQUEST-EXECUTION-TIME: 124

      Cache-Control: no-store, must-revalidate

      Vary: Accept-Encoding, User-Agent

      Content-Length: 1803

       

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <Task xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ns9="http://www.vmware.com/vcloud/versions" cancelRequested="false" expiryTime="2020-06-04T10:44:44.190Z" operation="Attaching Disk to Virtual Machine cbam-installer(7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4)" operationName="vappAttachDisk" serviceNamespace="com.vmware.vcloud" startTime="2020-03-06T10:44:44.190Z" status="queued" name="task" id="urn:vcloud:task:408c946c-ad4c-46e3-859b-8d8e85ec7b47" href="https://vcd03ui.tre.nsn-rdnet.net/api/task/408c946c-ad4c-46e3-859b-8d8e85ec7b47" type="application/vnd.vmware.vcloud.task+xml">

          <Owner href="https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4" id="urn:vcloud:vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4" name="cbam-installer" type="application/vnd.vmware.vcloud.vm+xml"/>

          <User href="https://vcd03ui.tre.nsn-rdnet.net/api/admin/user/eb174bd1-452c-4f72-b4a4-a37c9ea543db" id="urn:vcloud:user:eb174bd1-452c-4f72-b4a4-a37c9ea543db" name="z00185xc" type="application/vnd.vmware.admin.user+xml"/>

          <Organization href="https://vcd03ui.tre.nsn-rdnet.net/api/org/54484144-8348-4c79-82ac-2e7c5b1690bb" id="urn:vcloud:org:54484144-8348-4c79-82ac-2e7c5b1690bb" name="VCD0012" type="application/vnd.vmware.vcloud.org+xml"/>

          <Details></Details>

      </Task>

       

      Tried with CLI as well:

      [root@osboxes bin]# ./vcd vapp attach vapptest cbam-installer testdisk

      vappAttachDisk: Attaching Disk to Virtual Machine cbam-installer(7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4)

      task: 6f395f41-8681-4245-96e1-afbc4d534544, result: error, message: [ 29b5e3a2-dd33-4aec-9317-2cb89c036107 ] Unable to perform this action. Contact your cloud administrator.

       

      Errors:

       

      This is the error message from first attach attempt task.

      [ 2ce3f2e7-37ba-4b16-bc40-8ee02d3413bf ] Invalid hard disk parameters specified. The following parameters are invalid or conflict with other configured devices in the virtual machine: [vcId=952a6b3b-2407-4150-b07c-9dff51a28315, moref=vm-816] Adaptor Type: SCSIPARAVIRTUAL, Bus Number: 0, Unit Number: 0

      The three following attempts all failed with Internal Server Error on the task with the below error message on the event.

      {"id":{"id":"ca9af300-a431-4199-a66a-fe2b3accc1a7"},"timestamp":1583491484951,"type":"com/vmware/vcloud/event/task/complete","properties":{"user.taskId":"408c946c-ad4c-46e3-859b-8d8e85ec7b47","currentContext.org.id":{"id":"54484144-8348-4c79-82ac-2e7c5b1690bb","name":"VCD0012","type":"com.vmware.vcloud.entity.org"},"currentContext.login.org.id":{"id":"54484144-8348-4c79-82ac-2e7c5b1690bb","name":null,"type":"com.vmware.vcloud.entity.org"},"currentContext.success":false,"task.name":"VAPP_ATTACH_DISK","currentContext.login.user.id":{"id":"81d94f5e-dcf6-4464-9a67-747125ce940d","name":null,"type":"com.vmware.vcloud.entity.user"},"currentContext.user.clientIpAddress":"","task.ownerType":"com.vmware.vcloud.entity.vm","currentContext.user.name":"z00185xc","currentContext.org.name":"VCD0012","task.ownerId":{"id":"7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4"},"currentContext.login.member.id":{"id":"eb174bd1-452c-4f72-b4a4-a37c9ea543db","name":"z00185xc","type":"com.vmware.vcloud.entity.user"},"user.taskId.cellId":"96d57b54-b61c-419c-a7d0-304d626cd4dd","entity.type":"com.vmware.vcloud.entity.task","currentContext.user.id":{"id":"81d94f5e-dcf6-4464-9a67-747125ce940d","name":"z00185xc","type":"com.vmware.vcloud.entity.user"},"currentContext.cell.uuid":"a9ccc261-d719-4e64-ba0f-27f59e854af3","currentContext.login.user.name":"z00185xc","entity.name":"VAPP_ATTACH_DISK","currentContext.user.proxyAddress":"","entity.id":{"id":"408c946c-ad4c-46e3-859b-8d8e85ec7b47","name":"VAPP_ATTACH_DISK","type":"com.vmware.vcloud.entity.task"}},"serviceName":"com.vmware.vcloud","entity":{"id":"408c946c-ad4c-46e3-859b-8d8e85ec7b47","name":"VAPP_ATTACH_DISK","type":"com.vmware.vcloud.entity.task"},"externalEntity":null,"external":false}

      The Internal Server Error
      and the above events are from your curl call example.

       

       

      vCloud Director log files that have either WARNING or ERROR in them.


      [ /opt/vmware/vcloud-director/logs ]#  grep  f1414c3c-8535-43ab-b2aa-be315bfff8bf * | grep -e WARN -e ERROR
      vcloud-container-debug.log.1:2020-03-06 08:43:31,763 | ERROR | task-service-activity-pool-45 | FutureUtil | Error attaching disk testdisk(com.vmware.vcloud.entity.disk:f1414c3c-8535-43ab-b2aa-be315bfff8bf) to VM cbam-installer(com.vmware.vcloud.entity.vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4) | requestId=2ce3f2e7-37ba-4b16-bc40-8ee02d3413bf,request=POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach,requestTime=1583484186816,remoteAddress=10.10.132.81:53046,userAgent=curl/7.29.0,accept=application/*+xml;version 32.0 vcd=440e6d2e-0958-4920-823e-85ca0b4ff370,task=f94d2fd0-2b80-4098-89cd-67b0e52196c7 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:f94d2fd0-2b80-4098-89cd-67b0e52196c7)
      vcloud-container-debug.log.1:2020-03-06 08:58:50,257 | ERROR | task-service-activity-pool-46 | FutureUtil | Error attaching disk testdisk(com.vmware.vcloud.entity.disk:f1414c3c-8535-43ab-b2aa-be315bfff8bf) to VM cbam-installer(com.vmware.vcloud.entity.vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4) | requestId=29b5e3a2-dd33-4aec-9317-2cb89c036107,request=POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach,requestTime=1583485129460,remoteAddress=10.10.132.81:53640,userAgent=python-requests/2.23.0,accept=application/*+xml;version 32.0 vcd=440e6d2e-0958-4920-823e-85ca0b4ff370,task=6f395f41-8681-4245-96e1-afbc4d534544 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:6f395f41-8681-4245-96e1-afbc4d534544)
      vcloud-container-debug.log.1:2020-03-06 10:44:44,906 | ERROR | task-service-activity-pool-47 | FutureUtil | Error attaching disk testdisk(com.vmware.vcloud.entity.disk:f1414c3c-8535-43ab-b2aa-be315bfff8bf) to VM cbam-installer(com.vmware.vcloud.entity.vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4) | requestId=5c21a5df-8256-455b-b118-87f22010437b,request=POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach,requestTime=1583491484125,remoteAddress=10.10.132.81:27808,userAgent=curl/7.29.0,accept=application/*+xml;version 32.0 vcd=96d57b54-b61c-419c-a7d0-304d626cd4dd,task=408c946c-ad4c-46e3-859b-8d8e85ec7b47 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:408c946c-ad4c-46e3-859b-8d8e85ec7b47)
      vcloud-container-debug.log.2:2020-03-06 08:12:19,554 | WARN     | pc-activity-pool-18005    | VmIdentityResolverImpl         | Cannot find VM [valref=[vcId=952a6b3b-2407-4150-b07c-9dff51a28315, moref=vm-817], instanceuuid=50017589-88c4-7c59-aa57-424242075772, clouduuid=65d844e8-7da5-4dc8-ab09-534bedf86e4d, locationPath=[VCD03CLU01_DS10] testdisk (f1414c3c-8535-43ab-b2aa-be315bfff8bf)/testdisk (f1414c3c-8535-43ab-b2aa-be315bfff8bf).vmx] in model database | activity=(com.vmware.vcloud.vimproxy.internal.impl.PropertyCollectorReader,urn:uuid:7f1c205f-c099-3130-b308-a3c12e1bab20)
      vcloud-container-info.log:2020-03-06 08:12:19,554 | WARN     | pc-activity-pool-18005    | VmIdentityResolverImpl         | Cannot find VM [valref=[vcId=952a6b3b-2407-4150-b07c-9dff51a28315, moref=vm-817], instanceuuid=50017589-88c4-7c59-aa57-424242075772, clouduuid=65d844e8-7da5-4dc8-ab09-534bedf86e4d, locationPath=[VCD03CLU01_DS10] testdisk (f1414c3c-8535-43ab-b2aa-be315bfff8bf)/testdisk (f1414c3c-8535-43ab-b2aa-be315bfff8bf).vmx] in model database | activity=(com.vmware.vcloud.vimproxy.internal.impl.PropertyCollectorReader,urn:uuid:7f1c205f-c099-3130-b308-a3c12e1bab20)
      vcloud-container-info.log:2020-03-06 08:43:31,763 | ERROR    | task-service-activity-pool-45 | FutureUtil | Error attaching disk testdisk(com.vmware.vcloud.entity.disk:f1414c3c-8535-43ab-b2aa-be315bfff8bf) to VM cbam-installer(com.vmware.vcloud.entity.vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4) | requestId=2ce3f2e7-37ba-4b16-bc40-8ee02d3413bf,request=POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach,requestTime=1583484186816,remoteAddress=10.10.132.81:53046,userAgent=curl/7.29.0,accept=application/*+xml;version 32.0 vcd=440e6d2e-0958-4920-823e-85ca0b4ff370,task=f94d2fd0-2b80-4098-89cd-67b0e52196c7 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:f94d2fd0-2b80-4098-89cd-67b0e52196c7)
      vcloud-container-info.log:2020-03-06 08:58:50,257 | ERROR    | task-service-activity-pool-46 | FutureUtil | Error attaching disk testdisk(com.vmware.vcloud.entity.disk:f1414c3c-8535-43ab-b2aa-be315bfff8bf) to VM cbam-installer(com.vmware.vcloud.entity.vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4) | requestId=29b5e3a2-dd33-4aec-9317-2cb89c036107,request=POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach,requestTime=1583485129460,remoteAddress=10.10.132.81:53640,userAgent=python-requests/2.23.0,accept=application/*+xml;version 32.0 vcd=440e6d2e-0958-4920-823e-85ca0b4ff370,task=6f395f41-8681-4245-96e1-afbc4d534544 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:6f395f41-8681-4245-96e1-afbc4d534544)
      vcloud-container-info.log:2020-03-06 10:44:44,906 | ERROR    | task-service-activity-pool-47 | FutureUtil | Error attaching disk testdisk(com.vmware.vcloud.entity.disk:f1414c3c-8535-43ab-b2aa-be315bfff8bf) to VM cbam-installer(com.vmware.vcloud.entity.vm:7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4) | requestId=5c21a5df-8256-455b-b118-87f22010437b,request=POST https://vcd03ui.tre.nsn-rdnet.net/api/vApp/vm-7dbeedf0-d8e2-4467-98d8-2b5bde3c4bf4/disk/action/attach,requestTime=1583491484125,remoteAddress=10.10.132.81:27808,userAgent=curl/7.29.0,accept=application/*+xml;version 32.0 vcd=96d57b54-b61c-419c-a7d0-304d626cd4dd,task=408c946c-ad4c-46e3-859b-8d8e85ec7b47 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:408c946c-ad4c-46e3-859b-8d8e85ec7b47)

      Unfortunately, they do not provide any reason for the Internal Server Error =/.