vmware / go-vcloud-director

Golang SDK for VMware Cloud Director
Other
79 stars 76 forks source link

Wrong order in Task structure #431

Closed coudi3bm closed 2 years ago

coudi3bm commented 2 years ago

Describe the bug

I think Task structure have invalid order.

If we change it like in the xml example from the docs.

type Task struct {
    HREF             string `xml:"href,attr,omitempty"`             // The URI of the entity.
    Type             string `xml:"type,attr,omitempty"`             // The MIME type of the entity.
    ID               string `xml:"id,attr,omitempty"`               // The entity identifier, expressed in URN format. The value of this attribute uniquely identifies the entity, persists for the life of the entity, and is never reused.
    OperationKey     string `xml:"operationKey,attr,omitempty"`     // Optional unique identifier to support idempotent semantics for create and delete operations.
    Name             string `xml:"name,attr"`                       // The name of the entity.
    Status           string `xml:"status,attr"`                     // The execution status of the task. One of queued, preRunning, running, success, error, aborted
    Operation        string `xml:"operation,attr,omitempty"`        // A message describing the operation that is tracked by this task.
    OperationName    string `xml:"operationName,attr,omitempty"`    // The short name of the operation that is tracked by this task.
    ServiceNamespace string `xml:"serviceNamespace,attr,omitempty"` // Identifier of the service that created the task. It must not start with com.vmware.vcloud and the length must be between 1 and 128 symbols.
    StartTime        string `xml:"startTime,attr,omitempty"`        // The date and time the system started executing the task. May not be present if the task has not been executed yet.
    EndTime          string `xml:"endTime,attr,omitempty"`          // The date and time that processing of the task was completed. May not be present if the task is still being executed.
    ExpiryTime       string `xml:"expiryTime,attr,omitempty"`       // The date and time at which the task resource will be destroyed and no longer available for retrieval. May not be present if the task has not been executed or is still being executed.
    CancelRequested  bool   `xml:"cancelRequested,attr,omitempty"`  // Whether user has requested this processing to be canceled.

    // Here we change order
    Link         *Link            `xml:"Link,omitempty"`         // A reference to an entity or operation associated with this object.
    Description  string           `xml:"Description,omitempty"`  // Optional description.
    Tasks        *TasksInProgress `xml:"Tasks,omitempty"`        // A list of queued, running, or recently completed tasks associated with this entity.
    Owner        *Reference       `xml:"Owner,omitempty"`        // Reference to the owner of the task. This is typically the object that the task is creating or updating.
    Error        *Error           `xml:"Error,omitempty"`        // Represents error information from a failed task.
    User         *Reference       `xml:"User,omitempty"`         // The user who started the task.
    Organization *Reference       `xml:"Organization,omitempty"` // The organization to which the User belongs.
    Progress     int              `xml:"Progress,omitempty"`     // Read-only indicator of task progress as an approximate percentage between 0 and 100. Not available for all tasks.
    Details      string           `xml:"Details,omitempty"`      // Detailed message about the task. Also contained by the Owner entity when task status is preRunning.

    //
    // TODO: add the following fields
    // Params      anyType        The parameters with which this task was started.
    // Result      ResultType       An optional element that can be used to hold the result of a task.
    // VcTaskList  VcTaskListType List of Virtual Center tasks related to this vCD task.
}

adminVDC.Update() will work how we expected.

Second solution is to set adminVDC.AdminVdc.Vdc.Tasks = nil.

Reproduction steps

I am trying to update VDC description with following code:

adminVDC.AdminVdc.Description = description

_, err := adminVDC.Update()
if err != nil {
    return fmt.Errorf("can't update admin vdc, err: %w", err)
}

and got error:

error updating VDC: API Error: 400: [ bec03637-ebdf-4689-896f-d3cba4a0bd02 ] HTTP 400 Bad Request\n - cvc-complex-type.2.4.a: Invalid content was found starting with element '{\"http://www.vmware.com/vcloud/v1.5\":Error}'. One of '{\"http://www.vmware.com/vcloud/v1.5\":VcTaskList, \"http://www.vmware.com/vcloud/v1.5\":Result}' is expected.

Expected behavior

It updates VDC description

Additional context

No response

vbauzys commented 2 years ago

Hi @coudi3bm could you share details of which VCD version you use and logs? I couldn't reproduce the issue.

coudi3bm commented 2 years ago

VMware Cloud Director version: 10.3.2.19173133

2022/02/01 14:14:09 [DEBUG] Update call function for version 32.0
2022/02/01 14:14:09 [TRACE] updateVdcV97 called govcd.AdminVdc{AdminVdc:(*types.AdminVdc)(0xc0007a4380), client:(*govcd.Client)(0xc0001a6f00), parent:(*govcd.AdminOrg)(0xc000787230)}
2022/02/01 14:14:09 [TRACE] updateVdcAsyncV97 called govcd.AdminVdc{AdminVdc:(*types.AdminVdc)(0xc0007a4380), client:(*govcd.Client)(0xc0001a6f00), parent:(*govcd.AdminOrg)(0xc000787230)}
2022/02/01 14:14:09 --------------------------------------------------------------------------------
2022/02/01 14:14:09 Request caller: govcd.updateVdcAsyncV97-->govcd.(*Client).executeTaskRequest-->govcd.executeRequestWithApiVersion-->govcd.executeRequestCustomErr-->govcd.(*Client).NewRequestWithApiVersion-->govcd.(*Client).newRequest
2022/02/01 14:14:09 PUT https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46
2022/02/01 14:14:09 --------------------------------------------------------------------------------
2022/02/01 14:14:09 Req header:
2022/02/01 14:14:09     User-Agent: [DATA DELETED]
2022/02/01 14:14:09     X-Vmware-Vcloud-Access-Token: [********]
2022/02/01 14:14:09     Accept: [application/*+xml;version=35.0]
2022/02/01 14:14:09     X-Vmware-Vcloud-Token-Type: [Bearer]
2022/02/01 14:14:09     Authorization: [********]
2022/02/01 14:14:09 Request data: [18067]
<?xml version="1.0" encoding="UTF-8"?>
  <AdminVdc xmlns="http://www.vmware.com/vcloud/v1.5" href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.admin.vdc+xml" id="urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46" name="test-description" status="1">
      <Link href="https://[DATA DELETED]/api/admin/org/db616717-b3c3-4e1f-9261-a6e5ccfbec08" type="application/vnd.vmware.admin.organization+xml" rel="up"></Link>
      <Link href="https://[DATA DELETED]/api/admin/org/db616717-b3c3-4e1f-9261-a6e5ccfbec08" type="application/vnd.vmware.admin.organization+json" rel="up"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/metadata" type="application/vnd.vmware.vcloud.metadata+xml" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/metadata" type="application/vnd.vmware.vcloud.metadata+json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" rel="remove"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.admin.vdc+xml" rel="edit"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.admin.vdc+json" rel="edit"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/action/disable" rel="disable"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/action/registerVApp" type="application/vnd.vmware.admin.registerVAppParams+xml" rel="add"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/action/registerVApp" type="application/vnd.vmware.admin.registerVAppParams+json" rel="add"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/computePolicies" type="application/vnd.vmware.vcloud.vdcComputePolicyReferences+xml" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/computePolicies" type="application/vnd.vmware.vcloud.vdcComputePolicyReferences+json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml" rel="controlAccess"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+json" rel="controlAccess"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/vdcs/urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46/networkProfile" type="application/json" rel="down:vdcNetworkProfile"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/vdcs/urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46/capabilities" type="application/json" rel="vdcCapabilities"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/firewallGroups" type="application/json" rel="down:firewallGroups"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/applicationPortProfiles" type="application/json" rel="down:appPortProfiles"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/vdcs/urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46/maxComputePolicy" type="application/json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/vdcs/urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46/maxComputePolicy" type="application/json" rel="edit"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/vdcs/urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46/computePolicies" type="application/json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/2.0.0/vdcs/urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46/computePolicies" type="application/json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.admin.vdc+xml" rel="alternate"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.admin.vdc+json" rel="alternate"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/vmAffinityRules/" type="application/vnd.vmware.vcloud.vmaffinityrule+xml" rel="add"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/vmAffinityRules/" type="application/vnd.vmware.vcloud.vmaffinityrule+json" rel="add"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/vmAffinityRules/" type="application/vnd.vmware.vcloud.vmaffinityrules+xml" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/vmAffinityRules/" type="application/vnd.vmware.vcloud.vmaffinityrules+json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/cloudapi/1.0.0/edgeGateways" type="application/json" rel="add"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.vcloud.vdc+xml" rel="alternate"></Link>
      <Link href="https://[DATA DELETED]/api/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.vcloud.vdc+json" rel="alternate"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/edgeGateways" type="application/vnd.vmware.vcloud.query.records+xml" rel="edgeGateways"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/edgeGateways" type="application/vnd.vmware.vcloud.query.records+json" rel="edgeGateways"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/networks" type="application/vnd.vmware.vcloud.orgVdcNetwork+xml" rel="add"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/networks" type="application/vnd.vmware.vcloud.orgVdcNetwork+json" rel="add"></Link>
      <Link href="https://[DATA DELETED]/network/orgvdcnetworks/import?orgVdc=fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/*+xml" rel="import:network"></Link>
      <Link href="https://[DATA DELETED]/network/orgvdcnetworks/importableswitches?orgVdc=fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/*+xml" rel="down:importableSwitches"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/networks" type="application/vnd.vmware.vcloud.query.records+xml" rel="orgVdcNetworks"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/networks" type="application/vnd.vmware.vcloud.query.records+json" rel="orgVdcNetworks"></Link>
      <Link href="https://[DATA DELETED]/api/admin/extension/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/resourcePools" type="application/vnd.vmware.admin.OrganizationVdcResourcePoolSet+xml" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/extension/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/resourcePools" type="application/vnd.vmware.admin.OrganizationVdcResourcePoolSet+json" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/vdcStorageProfiles" type="application/vnd.vmware.admin.updateVdcStorageProfiles+xml" rel="edit"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/vdcStorageProfiles" type="application/vnd.vmware.admin.updateVdcStorageProfiles+json" rel="edit"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/extension" type="application/vnd.vmware.admin.extensibility.selectors+xml" rel="down"></Link>
      <Link href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46/extension" type="application/vnd.vmware.admin.extensibility.selectors+json" rel="down"></Link>
      <Description>testing</Description>
      <Tasks>
          <Task href="https://[DATA DELETED]/api/task/24943d7e-2238-4405-ab4a-db394577e453" type="application/vnd.vmware.vcloud.task+xml" id="urn:vcloud:task:24943d7e-2238-4405-ab4a-db394577e453" name="task" status="error" operation="Updated Storage Policies for Virtual Datacenter test-description(fd6b04a3-0fb2-493b-80ab-f58ecece1f46)" operationName="vdcUpdateStorageProfiles" serviceNamespace="com.vmware.vcloud" startTime="2022-02-01T11:12:32.780Z" endTime="2022-02-01T11:12:34.755Z" expiryTime="2022-05-02T11:12:32.780Z">
              <Details>[ 892ca04b-92c8-48c6-959b-12a78fc68304 ] Storage policy &#34;Silver+&#34; cannot be deleted since it is currently in use.</Details>
              <Error message="[ 892ca04b-92c8-48c6-959b-12a78fc68304 ] Storage policy &#34;Silver+&#34; cannot be deleted since it is currently in use." majorErrorCode="400" minorErrorCode="BAD_REQUEST" stackTrace="com.vmware.vcloud.api.presentation.service.BadRequestException: Storage policy &#34;Silver+&#34; cannot be deleted since it is currently in use.&#xA;&#x9;at com.vmware.vcloud.api.presentation.service.impl.VdcServiceAdapterImpl.updateVdcStorageClassesTask(VdcServiceAdapterImpl.java:944)&#xA;&#x9;at com.vmware.vcloud.api.presentation.service.impl.VdcServiceAdapterImpl.executeTask(VdcServiceAdapterImpl.java:3143)&#xA;&#x9;at com.vmware.vcloud.backendbase.management.system.TaskActivity$ExecutePhase$1.doInSecurityContext(TaskActivity.java:828)&#xA;&#x9;at com.vmware.vcloud.backendbase.management.system.TaskActivity$ExecutePhase$1.doInSecurityContext(TaskActivity.java:823)&#xA;&#x9;at com.vmware.vcloud.backendbase.management.system.SecurityContextTemplate.executeForOrgAndUser(SecurityContextTemplate.java:48)&#xA;&#x9;at com.vmware.vcloud.backendbase.management.system.TaskActivity$ExecutePhase.execute(TaskActivity.java:830)&#xA;&#x9;at com.vmware.vcloud.backendbase.management.system.TaskActivity$ExecutePhase.invokeInner(TaskActivity.java:726)&#xA;&#x9;at com.vmware.vcloud.backendbase.management.system.TaskActivity$TaskActivityBasePhase.invoke(TaskActivity.java:342)&#xA;&#x9;at com.vmware.vcloud.activity.executors.ActivityRunner.runPhase(ActivityRunner.java:175)&#xA;&#x9;at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:112)&#xA;&#x9;at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)&#xA;&#x9;at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)&#xA;&#x9;at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)&#xA;&#x9;at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)&#xA;&#x9;at java.base/java.lang.Thread.run(Thread.java:829)&#xA;"></Error>
              <Link href="https://[DATA DELETED]/api/task/24943d7e-2238-4405-ab4a-db394577e453" type="application/vnd.vmware.vcloud.task+json" name="task" rel="edit"></Link>
              <Organization href="https://[DATA DELETED]/api/org/db616717-b3c3-4e1f-9261-a6e5ccfbec08" id="urn:vcloud:org:db616717-b3c3-4e1f-9261-a6e5ccfbec08" type="application/vnd.vmware.vcloud.org+xml" name="test-org"></Organization>
              <Owner href="https://[DATA DELETED]/api/admin/vdc/fd6b04a3-0fb2-493b-80ab-f58ecece1f46" id="urn:vcloud:vdc:fd6b04a3-0fb2-493b-80ab-f58ecece1f46" type="application/vnd.vmware.admin.vdc+xml" name="test-description"></Owner>
              <User href="https://[DATA DELETED]/api/admin/user/97d7f6be-2210-49ca-907f-4334f35af274" id="urn:vcloud:user:97d7f6be-2210-49ca-907f-4334f35af274" type="application/vnd.vmware.admin.user+xml" name="coudi3bm"></User>
          </Task>
      </Tasks>
      <AllocationModel>Flex</AllocationModel>
      <ComputeCapacity>
          <Cpu>
              <Units>MHz</Units>
              <Allocated>0</Allocated>
              <Limit>0</Limit>
              <Used>4000</Used>
          </Cpu>
          <Memory>
              <Units>MB</Units>
              <Allocated>0</Allocated>
              <Limit>0</Limit>
              <Used>8192</Used>
          </Memory>
      </ComputeCapacity>
      <ResourceEntities>
          <ResourceEntity href="https://[DATA DELETED]/api/vAppTemplate/vappTemplate-500b6367-bc63-4110-94fb-8cce810cdfba" id="urn:vcloud:vapptemplate:500b6367-bc63-4110-94fb-8cce810cdfba" type="application/vnd.vmware.vcloud.vAppTemplate+xml" name="test"></ResourceEntity>
          <ResourceEntity href="https://[DATA DELETED]/api/vApp/vapp-42b7cb21-98b0-4703-9cc6-d5768338fd65" id="urn:vcloud:vapp:42b7cb21-98b0-4703-9cc6-d5768338fd65" type="application/vnd.vmware.vcloud.vApp+xml" name="test-b50e6f72-22bb-454b-bfed-cadf115eb6e3"></ResourceEntity>
          <ResourceEntity href="https://[DATA DELETED]/api/vApp/vapp-44f1861b-f275-4f74-88d2-6674e396548d" id="urn:vcloud:vapp:44f1861b-f275-4f74-88d2-6674e396548d" type="application/vnd.vmware.vcloud.vApp+xml" name="test-2-8a42d0cd-d562-4f5d-8800-64d191e0fc41"></ResourceEntity>
          <ResourceEntity href="https://[DATA DELETED]/api/vApp/vapp-64cca0e6-b0b4-472b-836b-556ffe887b54" id="urn:vcloud:vapp:64cca0e6-b0b4-472b-836b-556ffe887b54" type="application/vnd.vmware.vcloud.vApp+xml" name="test-3-edf9116c-11b2-445d-8903-8a9bbd9d28c7"></ResourceEntity>
      </ResourceEntities>
      <AvailableNetworks>
          <Network href="https://[DATA DELETED]/api/admin/network/48c1ea7e-3f03-402d-beae-639e3d7b60b4" id="urn:vcloud:network:48c1ea7e-3f03-402d-beae-639e3d7b60b4" type="application/vnd.vmware.admin.network+xml" name="test-description-network-default"></Network>
      </AvailableNetworks>
      <Capabilities>
          <SupportedHardwareVersions>
              <SupportedHardwareVersion>vmx-04</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-07</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-08</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-09</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-10</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-11</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-12</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-13</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-14</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-15</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-16</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-17</SupportedHardwareVersion>
              <SupportedHardwareVersion>vmx-18</SupportedHardwareVersion>
          </SupportedHardwareVersions>
      </Capabilities>
      <NicQuota>0</NicQuota>
      <NetworkQuota>1000</NetworkQuota>
      <UsedNetworkCount>1</UsedNetworkCount>
      <VmQuota>100</VmQuota>
      <IsEnabled>true</IsEnabled>
      <VdcStorageProfiles>
          <VdcStorageProfile href="https://[DATA DELETED]/api/admin/vdcStorageProfile/9737bc6e-3ae5-4f94-b994-41846c23ff92" id="urn:vcloud:vdcstorageProfile:9737bc6e-3ae5-4f94-b994-41846c23ff92" type="application/vnd.vmware.admin.vdcStorageProfile+xml" name="Silver+"></VdcStorageProfile>
          <VdcStorageProfile href="https://[DATA DELETED]/api/admin/vdcStorageProfile/d3480f28-dc48-49e5-bfc7-c3013da65146" id="urn:vcloud:vdcstorageProfile:d3480f28-dc48-49e5-bfc7-c3013da65146" type="application/vnd.vmware.admin.vdcStorageProfile+xml" name="Silver"></VdcStorageProfile>
      </VdcStorageProfiles>
      <DefaultComputePolicy href="https://[DATA DELETED]/cloudapi/1.0.0/vdcComputePolicies/urn:vcloud:vdcComputePolicy:103059a7-90ab-44b0-8e70-00a5502eb81c" id="urn:vcloud:vdcComputePolicy:103059a7-90ab-44b0-8e70-00a5502eb81c" type="application/json" name="System Default"></DefaultComputePolicy>
      <VCpuInMhz2>1000</VCpuInMhz2>
      <ResourceGuaranteedMemory>0</ResourceGuaranteedMemory>
      <ResourceGuaranteedCpu>0</ResourceGuaranteedCpu>
      <VCpuInMhz>1000</VCpuInMhz>
      <IsThinProvision>false</IsThinProvision>
      <NetworkPoolReference href="https://[DATA DELETED]/api/admin/extension/networkPool/880b1709-a360-42d1-944c-e1f9c8a21084" id="urn:vcloud:networkpool:880b1709-a360-42d1-944c-e1f9c8a21084" type="application/vnd.vmware.admin.networkPool+xml"></NetworkPoolReference>
      <ProviderVdcReference href="https://[DATA DELETED]/api/admin/providervdc/5fcd5e96-d130-46af-9247-28b26c1cbabb" id="urn:vcloud:providervdc:5fcd5e96-d130-46af-9247-28b26c1cbabb" type="application/vnd.vmware.admin.providervdc+xml" name="[DATA DELETED]"></ProviderVdcReference>
      <UsesFastProvisioning>false</UsesFastProvisioning>
      <IsElastic>true</IsElastic>
      <IncludeMemoryOverhead>false</IncludeMemoryOverhead>
  </AdminVdc>
2022/02/01 14:14:09 ################################################################################
2022/02/01 14:14:09 Response caller govcd.updateVdcAsyncV97-->govcd.(*Client).executeTaskRequest-->govcd.executeRequestWithApiVersion-->govcd.executeRequestCustomErr-->govcd.checkRespWithErrType-->govcd.ParseErr-->govcd.decodeBody
2022/02/01 14:14:09 Response status 400 Bad Request
2022/02/01 14:14:09 ################################################################################
2022/02/01 14:14:09 Response header:
2022/02/01 14:14:09     X-Vmware-Vcloud-Ceip-Id: [5386f7e3-256d-43f8-ae94-78a51b7fa877]
2022/02/01 14:14:09     Content-Type: [application/vnd.vmware.vcloud.error+xml;version=35.0]
2022/02/01 14:14:09     X-Vmware-Vcloud-Request-Execution-Time: [15,15]
2022/02/01 14:14:09     Cache-Control: [no-store, must-revalidate]
2022/02/01 14:14:09     Date: [Tue, 01 Feb 2022 11:14:09 GMT]
2022/02/01 14:14:09     X-Vmware-Vcloud-Request-Id: [a499c313-f862-4586-9615-48cfdf57a0b9]
2022/02/01 14:14:09 Response text: [12123]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vmext="http://www.vmware.com/vcloud/extension/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:ns9="http://www.vmware.com/vcloud/versions" stackTrace="javax.ws.rs.BadRequestException: HTTP 400 Bad Request&#10;    at org.apache.cxf.jaxrs.utils.SpecExceptions.toBadRequestException(SpecExceptions.java:84)&#10; at org.apache.cxf.jaxrs.utils.ExceptionUtils.toBadRequestException(ExceptionUtils.java:120)&#10;    at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.handleExceptionEnd(AbstractJAXBProvider.java:727)&#10;    at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.handleJAXBException(AbstractJAXBProvider.java:753)&#10;   at org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementProvider.java:205)&#10;    at org.apache.cxf.jaxrs.provider.JAXBElementTypedProvider.readFrom(JAXBElementTypedProvider.java:41)&#10;   at org.apache.cxf.jaxrs.provider.JAXBElementTypedProvider.readFrom(JAXBElementTypedProvider.java:34)&#10;   at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1500)&#10;   at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1452)&#10; at org.apache.cxf.jaxrs.utils.JAXRSUtils.processRequestBodyParameter(JAXRSUtils.java:950)&#10;  at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:881)&#10;    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:283)&#10; at com.vmware.vcloud.api.rest.jaxrs.ContextClassLoaderInvoker.invoke(ContextClassLoaderInvoker.java:27)&#10;    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)&#10; at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)&#10;   at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)&#10;   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)&#10;  at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)&#10;    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265)&#10;  at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)&#10;    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)&#10;   at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)&#10;   at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225)&#10;   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298)&#10;    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:234)&#10;    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)&#10;    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273)&#10;  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)&#10;  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1780)&#10; at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)&#10;    at com.vmware.vcloud.api.framework.web.ExtensibilityFilter.doFilter(ExtensibilityFilter.java:159)&#10;  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at com.vmware.vcloud.security.filters.ValidityExceptionFilter.doFilterHttp(ValidityExceptionFilter.java:47)&#10;    at com.vmware.vcloud.security.filters.HttpFilterBean.doFilter(HttpFilterBean.java:35)&#10;  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at com.vmware.vcloud.security.web.RestSessionFilter.doFilter(RestSessionFilter.java:235)&#10;   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at com.vmware.vcloud.security.web.CellLivenessCheckFilter.doFilter(CellLivenessCheckFilter.java:54)&#10;    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at com.vmware.vcloud.security.web.SecurityContextCleanerFilter.doFilter(SecurityContextCleanerFilter.java:32)&#10;  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at com.vmware.vcloud.api.rest.versioning.AcceptHeaderFilter.doFilter(AcceptHeaderFilter.java:78)&#10;   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at com.vmware.vcloud.security.filters.ConversationFilter$1.run(ConversationFilter.java:39)&#10; at com.vmware.vcloud.security.filters.ConversationFilter$1.run(ConversationFilter.java:37)&#10; at com.vmware.vcloud.common.persist.ConversationContextExecutor.execute(ConversationContextExecutor.java:67)&#10;   at com.vmware.vcloud.security.filters.ConversationFilter.doFilter(ConversationFilter.java:45)&#10;  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)&#10;    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)&#10;   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)&#10;   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)&#10; at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)&#10;   at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)&#10; at com.vmware.vcloud.common.web.deployment.impl.HostCheckerFilter.doFilter(HostCheckerFilter.java:107)&#10; at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1767)&#10; at com.vmware.vcloud.common.web.deployment.impl.RequestDiagnosticFilter.doFilter(RequestDiagnosticFilter.java:139)&#10; at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1767)&#10; at com.vmware.vcloud.common.web.deployment.impl.ConfigurableSniffyFilter.doFilter(ConfigurableSniffyFilter.java:48)&#10;    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1767)&#10; at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)&#10;  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)&#10;   at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)&#10; at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)&#10;   at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)&#10;  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:513)&#10;   at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)&#10;    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)&#10;   at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)&#10;   at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)&#10; at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)&#10;    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)&#10;   at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:493)&#10;  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)&#10; at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)&#10;    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)&#10; at org.eclipse.jetty.server.Server.handle(Server.java:539)&#10; at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)&#10;   at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)&#10; at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)&#10; at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)&#10;   at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:312)&#10;   at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)&#10; at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)&#10;   at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)&#10; at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)&#10;  at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)&#10; at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)&#10;    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)&#10;    at com.vmware.vcloud.common.threading.ExtendedJettyQueuedThreadPool.runJob(ExtendedJettyQueuedThreadPool.java:40)&#10;  at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)&#10; at java.base/java.lang.Thread.run(Thread.java:829)&#10;Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 15; cvc-complex-type.2.4.a: Invalid content was found starting with element '{&quot;http://www.vmware.com/vcloud/v1.5&quot;:Error}'. One of '{&quot;http://www.vmware.com/vcloud/v1.5&quot;:VcTaskList, &quot;http://www.vmware.com/vcloud/v1.5&quot;:Result}' is expected.&#10; at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)&#10;  at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:135)&#10;    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)&#10;    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)&#10;    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)&#10;    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:511)&#10;    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3587)&#10;  at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1971)&#10; at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:829)&#10;    at java.xml/com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:570)&#10;    at com.sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:101)&#10;   at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:246)&#10;   at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:180)&#10;   at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415)&#10; at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)&#10;  at org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementProvider.java:184)&#10;    ... 86 more&#10;" message="[ a499c313-f862-4586-9615-48cfdf57a0b9 ] HTTP 400 Bad Request&#10; - cvc-complex-type.2.4.a: Invalid content was found starting with element '{&quot;http://www.vmware.com/vcloud/v1.5&quot;:Error}'. One of '{&quot;http://www.vmware.com/vcloud/v1.5&quot;:VcTaskList, &quot;http://www.vmware.com/vcloud/v1.5&quot;:Result}' is expected." majorErrorCode="400" minorErrorCode="BAD_REQUEST"/>
vbauzys commented 2 years ago

Fixed.