/
API reconfigures VM's Disk

API reconfigures VM's Disk

Overview

In this manual, you will find detailed information on how to prepare information, get the VM’s disk information, and reconfigure the VM’s disk.

Procedure

Step 1: Prepare Information

Log in to IAM portal -> vCD portal: collect the information

  • {{vcd_url}}

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

  • {{Bearer Token}}: Please follow the “API token login” document

Step 2: Getting VM’s Disk information

  • GET https://{{vcd_url}}APIi/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

Step 3: Reconfig VM’s disk

  • PUT https//{{vcd_url}}APIi/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.

Step 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

End.

Related pages