I have a requirement to read the input YAML file and resize the servers with the specified configuration like(VCPU, Disk,memory..). Note that the server name is already exist in the environment. I have automated this using python code using the cli command. Reference link for command https://docs.openstack.org/nova/latest/user/resize.html
But the requirement is to implement this via SDK. Please let me know how to implement this logic via python code by invoking openstack SDK?
Operating System: Ubuntu 16.04
Input Yaml: Servername1: test1 VCPU: 2 Disk: 4000 Memory: 200
Servername2: test2 VCPU: 1 Disk: 1000 Memory: 100
According to the SDK API documentation, the Compute
class (doc) has methods called resize_server
, confirm_resize_server
and revert_resize_server
.
Please let me know how to implement this logic via python code by invoking openstack SDK?
The sequence would be:
For more information how to obtain and make calls on the Compute
object, please see "Using OpenStack Compute".
1 - You could also synthesize flavors on the fly, but that is liable to give you a flavor management issue in the long term.