How to RESIZE through API?

kotakomputer

Renowned Member
May 14, 2012
450
14
83
Jakarta, Indonesia
www.komputerindo.com
This code doesn't work, unfortunately the API documentation not yet complete. Don't know if array name of 'disk' and 'size' are the corrects one.
Code:
$svr_hostname = 'dsi-094114';
$vmid = 100;

$hdd_settings = array();
$hdd_settings['disk'] = 'ide0';
$hdd_settings['size'] = '+25';
$pve2->put("/nodes/$svr_hostname/qemu/$vmid/resize", $hdd_settings);

Any idea?
 
To be able to do what you want you need to json encode $hdd_settings.

For a test try this:

$pve2->put("/nodes/$svr_hostname/qemu/$vmid/resize", '{"disk":"ide0","size":"+25"}');