2.3.2.6. Additional Actions

There are additional action methods, apart from the methods described above. The service that manages a virtual machine has methods to start and stop it.

Starting a Virtual Machine

vm_service.start

Some action methods include parameters that modify the operation. For example, the start method supports a use_cloud_init parameter.

Starting a Virtual Machine with Cloud-Init

vm_service.start(use_cloud_init: true)

Most action methods return nil when they succeed, and raise an Error when they fail. Some action methods, however, return values. For example, the service that manages storage domains has an is_attached action method that checks whether the storage domain is already attached to a data center. The is_attached action method returns a Boolean value:

Checking for Attached Storage Domain

sds_service = system_service.storage_domains_service
sd_service = sds_service.storage_domain_service('123')
if sd_service.is_attached
  ...
end

See the reference documentation of the software development kit to see the action methods supported by each service, their parameters, and return values.