Net::Proxmox::VE::Nodes - Functions for the 'nodes' portion of the API
version 0.38
# assuming $obj is a Net::Proxmox::VE object
Returns the 'Cluster node index'
Note: Accessible by all authententicated users.
Gets a single nodes details
$ok = $obj->get_nodes('node')
node is a string in pve-node format
Gets a single nodes list of appliances
$ok = $obj->get_nodes_aplinfo('node')
Create (upload) appliance templates.
$ok = $obj->download_nodes_aplinfo('node',\%args)
%args may items contain from the following list
String. The storage to be used in pve-storage-id format. Required.
Data. The actual template. Required.
Note: required permissions are ["perm","/storage/{storage}",["Datastore.AllocateTemplate"]]
Get DNS settings.
$ok = $obj->get_nodes_dns('node')
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
Updates (writes) DNS settings.
$ok = $obj->update_nodes_dns('node', \%args)
String. Search domain for host-name lookup. Required.
Get nodes RRD statistics (returns PNG).
$ok = $obj->get_nodes_rrd('node', \%args)
String. The list of datasources you wish to see, in pve-configid-list format. Required.
Enum. Is either hour, day, week, month or year. Required.
Enum. Is either AVERAGE or MAX. Controls the RRD consolidation function. Optional.
Get nodes RRD statistics.
$ok = $obj->get_nodes_rrddata('node', \%args)
Gets node status
$ok = $obj->get_nodes_status('node')
Reboot or shutdown a node
$ok = $obj->updates_nodes_status('node', \%args)
Enum. Either reboot or shutdown. Specifies the command. Required.
Note: required permissions are ["perm","/nodes/{node}",["Sys.PowerMgmt"]]
Read nodes subscription info
$ok = $obj->get_nodes_subscription('node')
Note: Root only.
Create/update nodes subscription info
$ok = $obj->create_nodes_subscription('node', \%args)
Boolean. Always connect to the server, even if we have up to date info inside local cache. Optional.
Updates/sets subscription key
$ok = $obj->update_nodes_subscription_key('node', \%args)
Boolean. Proxmox VE subscription key. Required.
Reads system log
$ok = $obj->get_nodes_syslog('node', \%args)
Note: required permissions are ["perm","/nodes/{node}",["Sys.Syslog"]]
Read server time and time zone settings
$ok = $obj->get_nodes_time('node')
Updates time zone
$ok = $obj->update_nodes_time('node', \%args)
String. Time zone to be used, see '/usr/share/zoneinfo/zone.tab'. Required.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
Get user_beancounters failcnt for all active containers.
$ok = $obj->get_nodes_ubcfailcnt('node')
$ok = $obj->get_nodes_version('node')
Creates a VNC Shell proxy.
$ok = $obj->create_nodes_vncshell('node')
Note: Restricted to users on realm 'pam'. Required permissions are ["perm","/nodes/{node}",["Sys.Console"]]
Create backup.
$ok = $obj->create_nodes_vzdump('node', \%args)
Boolean. Backup all known VMs on this host. Optional.
Integer. Limit I/O bandwidth (KBytes per second). Optional.
Enum. Either 0, 1, gzip or lzo. Comress dump file. Optional
String. Store resulting files to specified directory. Optional.
String. Exclude specified VMs (assumes --all) in pve-vmid-list. Optional.
String. Exclude certain files/directories (regex) in string-alist. Optional.
Integer. Set CFQ ionice priority. Optional.
Integer. Maximal time to wait for the global lock (minutes). Optional.
String. List of email addresses in string-list format. Optional.
Integer. Maximal number of backup files per vm. Optional.
Enum. A value from snapshot, suspend or stop. Backup mode. Optional.
Boolean. Be quiet. Optional.
Boolean. Remove old backup files if there are more than 'maxfiles' backup files. Optional.
String. Use specified hook script. Optional.
Integer. LVM snapshot size in MB. Optional.
Boolean. Exclude temporary files and logs. Optional.
Boolean. Write tar to stdout rather than to a file. Optional.
Integer. Maximal time to wait until a VM is stopped (minutes). Optional.
String. Store resulting file to this storage, in pve-storage-id format. Optional.
String. Store temporary files to specified directory. Optional.
String. The ID of the VM you want to backup in pve-vm-list format. Optional.
Note: The user needs 'VM.Backup' permissions on any VM, and 'Datastore.AllocateSpace' on the backup storage.
List available networks on the node
$ok = $obj->nodes_network('node', \%args)
Enum. One of bond, bridge, alias or eth. Only list specific interface types. Optional.
Create network device configuration
$ok = $obj->create_nodes_network('node', \%args)
String. The network interface name in pve-iface format. Required.
String. The ipv4 network address. Optional.
Boolean. Automatically start interface on boot. Optional.
Enum. Either of balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb or balance-alb. Specifies the bonding mode. Optional.
String. Specify the interfaces you want to add to your bridge in pve-iface-list format. Optional.
String. Default ipv4 gateway address. Optional.
String. Network mask for ipv4. Optional.
String. Specify the interfaces used by the bonding device in pve-iface-list format. Optional.
Revert network configuration changes.
$ok = $obj->revert_nodes_network('node')
Read network device configuration
$ok = $obj->get_nodes_network_iface('node', 'iface')
node is a string in pve-node format, iface is a string in pve-iface format
$ok = $obj->update_nodes_network_iface('node', 'iface', \%args)
String. Settings you want to delete in pve-configid-list format. Optional.
Delete network device configuration
$ok = $obj->delete_nodes_network_iface('node', 'iface')
OpenVZ container index (per node).
$ok = $obj->nodes_openvz('node')
Note: Only lists VMs where you have VM.Audit permissons on /vms/<vmid>.
Create or restore a container.
$ok = $obj->create_nodes_openvz('node', \%args)
String. The OS template or backup file. Required.
Integer. The unique ID of the vm in pve-vmid format. Required.
Integer. The number of CPUs for this container. Optional.
Integer. CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.\n\nNOTE: You can disable fair-scheduler configuration by setting this to 0. Optional.
String. Container description. Only used in the web interface. Optional.
Number. Amount of disk space for the VM in GB. A zero indicates no limit. Optional.
Boolean. Allow to overwrite existing container. Optional.
String. Set a host name for the container. Optional.
String. Specifies the address the container will be assigned. Optional.
Integer. Amount of RAM for the VM in MB. Optional.
String. Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain or nameserver. Optional.
String. Specifies network interfaces for the container in pve-openvz-netif format. Optional.
Boolean. Specifies weather a VM will be started during the system bootup. Optional.
String. Sets root password insider the container. Optional.
String. Add the VM to a specified pool in pve-poolid format. Optional.
Integer. Set quota grace period (seconds). Optional.
Integer. Set maximum number of user/group IDs in a container for which disk quota inside the container will be accounted. If this value is set to 0, user and group quotas inside the container will not. Optional.
Boolean. Mark this as a restore task. Optional.
String. Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain or nameserver. Optional.
String. Target storage in pve-storage-id. Optional.
Integer. Amount of SWAP for the VM in MB. Optional
Note: You need 'VM.Allocate' permissions on /vms/{vmid} or on the VM pool /pool/{pool}, and 'Datastore.AllocateSpace' on the storage.
required permissions are ["or",["perm","/vms/{vmid}",["VM.Allocate"]],["perm","/pool/{pool}",["VM.Allocate"],"require_param","pool"]]
Gets an openvz nodes details
$ok = $obj->get_nodes_openvz('node','vmid')
mvid is an integer in pve-vmid format
Destroy the container (also delete all uses files).
$ok = $obj->delete_nodes_openvz('node','vmid')
Note: required permissions are ["perm","/vms/{vmid}",["VM.Allocate"]]
Directory index
$ok = $obj->get_nodes_openvz_status('node','vmid')
Get virtual machine status.
$ok = $obj->get_nodes_openvz_status_current('node','vmid')
Note: required permissions are ["perm","/vms/{vmid}",["VM.Audit"]]
Mounts container private area.
$ok = $obj->create_nodes_openvz_status_mount('node','vmid')
Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
Shutdown the container.
$ok = $obj->create_nodes_openvz_status_shutdown('node','vmid', \%args)
vmid is an integer in pve-vmid format
Boolean. Make sure the container stops. Note the capital S. Optional.
Integer. Wait maximal timeout seconds
Start the container.
$ok = $obj->create_nodes_openvz_status_start('node','vmid')
Stop the container.
$ok = $obj->create_nodes_openvz_status_stop('node','vmid')
Get container user_beancounters.
$ok = $obj->get_nodes_openvz_status_ubc('node','vmid')
Unmounts container private area.
$ok = $obj->get_nodes_openvz_status_umount('node','vmid')
Net::Proxmox::VE
Brendan Beveridge <brendan@nodeintegration.com.au>, Dean Hamstead <dean@fragfest.com.au>
This software is Copyright (c) 2023 by Dean Hamstad.
This is free software, licensed under:
The MIT (X11) License
To install Net::Proxmox::VE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Proxmox::VE
CPAN shell
perl -MCPAN -e shell install Net::Proxmox::VE
For more information on module installation, please visit the detailed CPAN module installation guide.