ResizeVMStorage resizes a disk for a VM or container.
(vm *VM, disk string, size string)
| 95 | |
| 96 | // ResizeVMStorage resizes a disk for a VM or container. |
| 97 | func (c *Client) ResizeVMStorage(vm *VM, disk string, size string) error { |
| 98 | endpoint := fmt.Sprintf("/nodes/%s/%s/%d/resize", vm.Node, vm.Type, vm.ID) |
| 99 | data := map[string]interface{}{ |
| 100 | "disk": disk, |
| 101 | "size": size, // Proxmox expects size as string (e.g., "+10G") |
| 102 | } |
| 103 | |
| 104 | return c.httpClient.Put(context.Background(), endpoint, data, nil) |
| 105 | } |
| 106 | |
| 107 | // UpdateVMResources updates CPU and memory for a VM or container. |
| 108 | func (c *Client) UpdateVMResources(vm *VM, cores int, memory int64) error { |