salt.cloud.clouds.proxmox

Proxmox Cloud Module

New in version 2014.7.0.

The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC).

Set up the cloud configuration at /etc/salt/cloud.providers or
/etc/salt/cloud.providers.d/proxmox.conf:
my-proxmox-config:
  # Proxmox account information
  user: myuser@pam or myuser@pve
  password: mypassword
  url: hypervisor.domain.tld
  driver: proxmox
  verify_ssl: True
maintainer:Frank Klaassen <frank@cloudright.nl>
depends:requests >= 2.2.1
depends:IPy >= 0.81
salt.cloud.clouds.proxmox.avail_images(call=None, location=u'local')

Return a list of the images that are on the provider

CLI Example:

salt-cloud --list-images my-proxmox-config
salt.cloud.clouds.proxmox.avail_locations(call=None)

Return a list of the hypervisors (nodes) which this Proxmox PVE machine manages

CLI Example:

salt-cloud --list-locations my-proxmox-config
salt.cloud.clouds.proxmox.create(vm_)

Create a single VM from a data dict

CLI Example:

salt-cloud -p proxmox-ubuntu vmhostname
salt.cloud.clouds.proxmox.create_node(vm_, newid)

Build and submit the requestdata to create a new node

salt.cloud.clouds.proxmox.destroy(name, call=None)

Destroy a node.

CLI Example:

salt-cloud --destroy mymachine
salt.cloud.clouds.proxmox.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.proxmox.get_dependencies()

Warn if dependencies aren't met.

salt.cloud.clouds.proxmox.get_resources_nodes(call=None, resFilter=None)

Retrieve all hypervisors (nodes) available on this environment CLI Example:

salt-cloud -f get_resources_nodes my-proxmox-config
salt.cloud.clouds.proxmox.get_resources_vms(call=None, resFilter=None, includeConfig=True)

Retrieve all VMs available on this environment

CLI Example:

salt-cloud -f get_resources_vms my-proxmox-config
salt.cloud.clouds.proxmox.get_vm_status(vmid=None, name=None)

Get the status for a VM, either via the ID or the hostname

salt.cloud.clouds.proxmox.get_vmconfig(vmid, node=None, node_type=u'openvz')

Get VM configuration

salt.cloud.clouds.proxmox.list_nodes(call=None)

Return a list of the VMs that are managed by the provider

CLI Example:

salt-cloud -Q my-proxmox-config
salt.cloud.clouds.proxmox.list_nodes_full(call=None)

Return a list of the VMs that are on the provider

CLI Example:

salt-cloud -F my-proxmox-config
salt.cloud.clouds.proxmox.list_nodes_select(call=None)

Return a list of the VMs that are on the provider, with select fields

CLI Example:

salt-cloud -S my-proxmox-config
salt.cloud.clouds.proxmox.query(conn_type, option, post_data=None)

Execute the HTTP request to the API

salt.cloud.clouds.proxmox.script(vm_)

Return the script deployment object

salt.cloud.clouds.proxmox.set_vm_status(status, name=None, vmid=None)

Convenience function for setting VM status

salt.cloud.clouds.proxmox.show_instance(name, call=None)

Show the details from Proxmox concerning an instance

salt.cloud.clouds.proxmox.shutdown(name=None, vmid=None, call=None)

Shutdown a node via ACPI.

CLI Example:

salt-cloud -a shutdown mymachine
salt.cloud.clouds.proxmox.start(name, vmid=None, call=None)

Start a node.

CLI Example:

salt-cloud -a start mymachine
salt.cloud.clouds.proxmox.stop(name, vmid=None, call=None)

Stop a node ("pulling the plug").

CLI Example:

salt-cloud -a stop mymachine
salt.cloud.clouds.proxmox.wait_for_created(upid, timeout=300)

Wait until a the vm has been created successfully

salt.cloud.clouds.proxmox.wait_for_state(vmid, state, timeout=300)

Wait until a specific state has been reached on a node

salt.cloud.clouds.proxmox.wait_for_task(upid, timeout=300)

Wait until a the task has been finished successfully