2014.7.0 新版功能.
The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC).
/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='local')¶返回在服务商的镜像列表
命令行接口CLI 范例:
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 范例:
salt-cloud --list-locations my-proxmox-config
salt.cloud.clouds.proxmox.
create
(vm_)¶从一个字典数据中创建单一的VM
命令行接口CLI 范例:
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 范例:
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 范例:
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='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 范例:
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 范例:
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 范例:
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 范例:
salt-cloud -a shutdown mymachine
salt.cloud.clouds.proxmox.
start
(name, vmid=None, call=None)¶Start a node.
命令行接口CLI 范例:
salt-cloud -a start mymachine
salt.cloud.clouds.proxmox.
stop
(name, vmid=None, call=None)¶Stop a node ("pulling the plug").
命令行接口CLI 范例:
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