Api reconfigure VM_disk

Api reconfigure VM’s disks

* Main steps

- Prepare information

- Get VM’s disk information

- Reconfig VM’s disk

1. Preparation

* Login IAM portal -> vCD portal: collect the information

- {{vcd_url}}

- {{vm-uuid}}: select VM -> take a look vm uuid on url

-{{Bearer Token}}: Please follow “Api token login” document

 

2. Get VM’s disk information

Postman:

GET https://{{vcd_url}}/api/vApp/{{vm-uuid}}/virtualHardwareSection/disks

Authorization: {{Bearer Token}}

Headers:

- ‘Accept’: */*;version=37.2

- ‘Content-type’: application/vnd.vmware.vcloud.rasdItem+xml

SEND request.

*** Copy Response Body

 

3. Reconfig VM’s disk

Postman:

PUT https//{{vcd_url}}/api/vApp/{{vm-uuid}}/virtualHardwareSection/disks

Authorization: {{Bearer Token }}

Headers:

- 'Accept’: */*;version=37.2

- ‘Content-type’: application/vnd.vmware.vcloud.rasdItem+xml

Body: {{select raw -> copy and paste response body from Get VM’s disk information }}

Ex:

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

<RasdItemsList 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"

…………………………………………….

………………………………………

       

        <rasd:HostResource xmlns:ns10="http://www.vmware.com/vcloud/v1.5" ns10:storageProfileHref="https://iaas-hcmc02.higiocloud.vn/api/vdcStorageProfile/a7c6c2f7-3c2211e6e7b0" ns10:busType="6" ns10:busSubType="VirtualSCSI" ns10:capacity="15240" ns10:iops="4000" ns10:storageProfileOverrideVmDefault="false"></rasd:HostResource>

        <rasd:InstanceID>2000</rasd:InstanceID>

        <rasd:Limit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

        <rasd:MappingBehavior xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

        <rasd:OtherResourceType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

        <rasd:Parent>2</rasd:Parent>

    </Item>

</RasdItemsList>

 

===============================================================================

Find word ns10:capacity and edit the value in “ ”, it’s the VM’s disk (MB)

SEND request.

4. Verify

* Get VM’s disk information

GET https://{{vcd_url}}/api/vApp/{{vm-uuid}}/virtualHardwareSection/disks

* Check on vCD portal

Login IAM -> vCD portal-> select VM-> Hard disk