# API cấu hình lại Disk của VM

## <mark style="color:green;">**Tổng quan**</mark>

Trong hướng dẫn này, bạn sẽ tìm thấy thông tin chi tiết về cách chuẩn bị thông tin, lấy thông tin đĩa của VM và cấu hình lại đĩa của VM.

## <mark style="color:green;">Quy trình</mark>

{% stepper %}
{% step %}
**Bước 1:** Chuẩn bị thông tin

Đăng nhập vào IAM portal -> vCD portal: thu thập thông tin

**{{vcd\_url}}**<br>

<figure><img src="/files/IGhGXJinPkqvIejYDfQL" alt=""><figcaption></figcaption></figure>

&#x20;**{{vm-uuid}}:** chọn VM -> kiểm tra vm uuid trên URL<br>

<figure><img src="/files/aubHVqjechW77VopgpIh" alt=""><figcaption></figcaption></figure>

**{{Bearer Token}}:** Vui lòng tham khảo tài liệu “API đăng nhập bằng Token”.
{% endstep %}

{% step %}
**Bước 2**: Lấy thông tin đĩa của VM

* 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
{% endstep %}

{% step %}
**Bước 3:** Cấu hình lại đĩa của VM

* 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>

```

<figure><img src="/files/xIApvuQ8dhgi43xlHPNM" alt=""><figcaption></figcaption></figure>

* Tìm từ <mark style="color:red;">ns10:capacity</mark> và chỉnh sửa giá trị của nó (đơn vị MB).
* SEND request.
  {% endstep %}

{% step %}
**Bước 4:** Xác minh

* **Lấy thông tin đĩa của VM**

GET https\://{{vcd\_url}}/api/vApp/{{vm-uuid}}/virtualHardwareSection/disks

* **Kiểm tra trên vCD portal:**

Đăng nhập IAM -> vCD portal -> chọn VM -> Hard disk

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.higiocloud.vn/hi-gio-user-guide-vn/compute/4.-hi-gio-api/api-cau-hinh-lai-disk-cua-vm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
