A salt cloud provider that lets you use virtualbox on your machine and act as a cloud.
depends: | vboxapi |
---|
For now this will only clone existing VMs. It's best to create a template from which we will clone.
Followed https://docs.saltstack.com/en/latest/topics/cloud/cloud.html#non-libcloud-based-modules to create this.
salt.cloud.clouds.virtualbox.
__virtual__
()¶This function determines whether or not to make this cloud module available upon execution. Most often, it uses get_configured_provider() to determine
if the necessary configuration has been set up.
It may also check for necessary imports decide whether to load the module. In most cases, it will return a True or False value. If the name of the driver used does not match the filename,
then that name should be returned instead of True.
@return True|False|str
salt.cloud.clouds.virtualbox.
create
(vm_info)¶Creates a virtual machine from the given VM information. This is what is used to request a virtual machine to be created by the cloud provider, wait for it to become available, and then (optionally) log in and install Salt on it.
}
@type vm_info dict @return dict of resulting vm. !!!Passwords can and should be included!!!
salt.cloud.clouds.virtualbox.
destroy
(name, call=None)¶This function irreversibly destroys a virtual machine on the cloud provider. Before doing so, it should fire an event on the Salt event bus.
The tag for this event is salt/cloud/<vm name>/destroying. Once the virtual machine has been destroyed, another event is fired. The tag for that event is salt/cloud/<vm name>/destroyed.
@param name: @type name: str @param call: @type call: @return: True if all went well, otherwise an error message @rtype: bool|str
salt.cloud.clouds.virtualbox.
list_nodes
(kwargs=None, call=None)¶This function returns a list of nodes available on this cloud provider, using the following fields:
id (str) image (str) size (str) state (str) private_ips (list) public_ips (list)
No other fields should be returned in this function, and all of these fields should be returned, even if empty. The private_ips and public_ips fields should always be of a list type, even if empty, and the other fields should always be of a str type. This function is normally called with the -Q option:
salt-cloud -Q
@param kwargs: @type kwargs: @param call: @type call: @return: @rtype:
salt.cloud.clouds.virtualbox.
list_nodes_full
(kwargs=None, call=None)¶All information available about all nodes should be returned in this function. The fields in the list_nodes() function should also be returned, even if they would not normally be provided by the cloud provider.
This is because some functions both within Salt and 3rd party will break if an expected field is not present. This function is normally called with the -F option:
salt-cloud -F
@param kwargs: @type kwargs: @param call: @type call: @return: @rtype:
salt.cloud.clouds.virtualbox.
list_nodes_select
(call=None)¶Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.virtualbox.
map_clonemode
(vm_info)¶Convert the virtualbox config file values for clone_mode into the integers the API requires
salt.cloud.clouds.virtualbox.
show_image
(kwargs, call=None)¶Show the details of an image
salt.cloud.clouds.virtualbox.
start
(name, call=None)¶Start a machine. @param name: Machine to start @type name: str @param call: Must be "action" @type call: str
salt.cloud.clouds.virtualbox.
stop
(name, call=None)¶Stop a running machine. @param name: Machine to stop @type name: str @param call: Must be "action" @type call: str
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2018.3.0