Modify properties of existing VM


Can I automate the modification of RAM/CPU/Disk on the VMWare and OpenStack provider?
My goal is to provide a portal to the end user to automate the above task through self-service and avoid requests.


@gmccullough can you review this question from @gpaterno and forward to a SME if necessary.


For VMware you have two possible options for exposing this:

  1. ManageIQ supports a reconfigure operation on VMware VMs that allows for modifying CPU and Memory values. We are currently working on a feature to add/remove disks there as well.

  2. From automate the VMware VM exposes methods for set_number_of_cpus, set_memory and add_disk

Those methods are defined here:

For OpenStack it requires that you use the fog gem to interact with the provider to make these types of changes. There are some useful examples you can work from in this repo:
There are a lot of great examples here for both VMware, OpenStack and other providers.

For example:

I would also suggest checking out which links to repos that contain a lot of the code you are looking for.

Mainly these two:


How can I check if set_number_of_cpus() was successful? It returns true even if vCenter reports an unsuccesful reconfiguration (for example decreasing the number of CPUs). I tried with sync: true but no difference (on a 2 CPU VM):

> vm.set_number_of_cpus(1, :sync => true)
=> true