MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / ResizeVMStorage

Method ResizeVMStorage

pkg/api/vm_config.go:97–105  ·  view source on GitHub ↗

ResizeVMStorage resizes a disk for a VM or container.

(vm *VM, disk string, size string)

Source from the content-addressed store, hash-verified

95
96// ResizeVMStorage resizes a disk for a VM or container.
97func (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.
108func (c *Client) UpdateVMResources(vm *VM, cores int, memory int64) error {

Callers 2

TestPVEMockAPIFunction · 0.95
showResizeStorageModalFunction · 0.80

Calls 1

PutMethod · 0.80

Tested by 1

TestPVEMockAPIFunction · 0.76