Edit VS
PUT /virtual_machines/:id.xml PUT /virtual_machines/:id.json
XML Request example
curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<?xml version="1.0" encoding="UTF-8"?><virtual_machine><label>Test_API_Edit</label><memory>512</memory><cpu_shares>40</cpu_shares><cpus>4</cpus><allow_migration>1</allow_migration><allow_cold_resize>1</allow_cold_resize><primary_disk_min_iops>600</primary_disk_min_iops><swap_disk_min_iops>600</swap_disk_min_iops></virtual_machine>' --url http://<span style="background-color: navy; color: white;" /><span style="background-color: navy; color: white;" />cloud.neen.it/virtual_machines/:id.xml
JSON Request example
curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"label":"Test_API_Edit","memory":"512","cpu_shares":"40","cpus":"4","allow_migration":"1","primary_disk_min_iops":"600","swap_disk_min_iops":"600","allow_cold_resize":"1"}}' --url http://<span style="background-color: navy; color: white;" /><span style="background-color: navy; color: white;" />cloud.neen.it/virtual_machines/:id.json
You can edit the following parameters:
label - the VS name
memory - the amount of RAM allocated to this VS in Mb
cpus - the number of CPUs of this VS
cpu_shares* - CPU priority percentage
allow_migration - set 1 to migrate a VS to a hypervisor with sufficient resources if a hypervisor has insufficient space to resize. Otherwise, set 0.
allow_cold_resize – set 1 to switch to cold resize when hot resize failed
primary_disk_min_iops - minimum number of IO operations per second for primary disk (this is a SolidFire related parameter)
swap_disk_min_iops - minimum number of IO operations per second for swap disk (this is a SolidFire related parameter)
If the VS is modified successfully, an HTTP 204 response is returned. If scheduling for changes fails, an HTTP 422 response is returned.