A salt cloud provider that lets you use virtualbox on your machine and act as a cloud.
vboxapi
For now this will only clone existing VMs. It's best to create a template from which we will clone.
Followed https://docs.saltproject.io/en/latest/topics/cloud/cloud.html#non-libcloud-based-modules to create this.
as well as a set of configuration and environment variables
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.
Events fired:
This function fires the event salt/cloud/vm_name/creating
, with the
payload containing the names of the VM, profile, and provider.
@param vm_info
{
name: <str>
profile: <dict>
driver: <provider>:<profile>
clonefrom: <vm_name>
clonemode: <mode> (default: state, choices: state, child, all)
}
@type vm_info dict @return dict of resulting vm. !!!Passwords can and should be included!!!
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.
list_nodes
@param name: @type name: str @param call: @type call: @return: True if all went well, otherwise an error message @rtype: bool|str
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:
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:
Return a list of the VMs that are on the provider, with select fields
Convert the virtualbox config file values for clone_mode into the integers the API requires