diff --git a/docs/api.md b/docs/api.md index 8fc951c72..95118b4d1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -86,6 +86,7 @@ The Cloud Hypervisor API exposes the following actions through its endpoints: | Restore the VM from a snapshot | `/vm.restore` | `/schemas/RestoreConfig` | N/A | The VM is created but not booted | | Add/remove CPUs to/from the VM | `/vm.resize` | `/schemas/VmResize` | N/A | The VM is booted | | Add/remove memory from the VM | `/vm.resize` | `/schemas/VmResize` | N/A | The VM is booted | +| Resize a disk attached to the VM | `/vm.resize-disk` | `/schemas/VmResizeDisk` | N/A | The VM is created | | Add/remove memory from a zone | `/vm.resize-zone` | `/schemas/VmResizeZone` | N/A | The VM is booted | | Dump the VM information | `/vm.info` | N/A | `/schemas/VmInfo` | The VM is created | | Add VFIO PCI device to the VM | `/vm.add-device` | `/schemas/VmAddDevice` | `/schemas/PciDeviceInfo` | The VM is booted | diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index d87573c55..1fa3d9b51 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -163,6 +163,22 @@ paths: 429: description: The VM instance could not be resized because a cpu removal is still pending. + /vm.resize-disk: + put: + summary: Resize a disk + requestBody: + description: Resizes a disk attached to the VM + content: + application/json: + schema: + $ref: "#/components/schemas/VmResizeDisk" + required: true + responses: + 204: + description: The disk was successfully resized. + 500: + description: The disk could not be resized. + /vm.resize-zone: put: summary: Resize a memory zone @@ -1203,6 +1219,17 @@ components: type: integer format: int64 + VmResizeDisk: + type: object + properties: + id: + description: disk identifier + type: string + desired_size: + description: desired disk size in bytes + type: integer + format: int64 + VmResizeZone: type: object properties: