NAME
Net::Proxmox::VE::Nodes - Functions for the 'nodes' portion of the API
VERSION
version 0.38
SYNOPSIS
# assuming $obj is a Net::Proxmox::VE object
METHODS
nodes
Returns the 'Cluster node index'
Note: Accessible by all authententicated users.
get_nodes
Gets a single nodes details
$ok = $obj->get_nodes('node')
node is a string in pve-node format
Note: Accessible by all authententicated users.
get_nodes_aplinfo
Gets a single nodes list of appliances
$ok = $obj->get_nodes_aplinfo('node')
node is a string in pve-node format
Note: Accessible by all authententicated users.
create_nodes_aplinfo
Create (upload) appliance templates.
$ok = $obj->download_nodes_aplinfo('node',\%args)
node is a string in pve-node format
%args may items contain from the following list
- storage
-
String. The storage to be used in pve-storage-id format. Required.
- template
-
Data. The actual template. Required.
Note: required permissions are ["perm","/storage/{storage}",["Datastore.AllocateTemplate"]]
get_nodes_dns
Get DNS settings.
$ok = $obj->get_nodes_dns('node')
node is a string in pve-node format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
update_nodes_dns
Updates (writes) DNS settings.
$ok = $obj->update_nodes_dns('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- search
-
String. Search domain for host-name lookup. Required.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
get_nodes_rrd
Get nodes RRD statistics (returns PNG).
$ok = $obj->get_nodes_rrd('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- ds
-
String. The list of datasources you wish to see, in pve-configid-list format. Required.
- timeframe
-
Enum. Is either hour, day, week, month or year. Required.
- cf
-
Enum. Is either AVERAGE or MAX. Controls the RRD consolidation function. Optional.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
get_nodes_rrddata
Get nodes RRD statistics.
$ok = $obj->get_nodes_rrddata('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- timeframe
-
Enum. Is either hour, day, week, month or year. Required.
- cf
-
Enum. Is either AVERAGE or MAX. Controls the RRD consolidation function. Optional.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
get_nodes_status
Gets node status
$ok = $obj->get_nodes_status('node')
node is a string in pve-node format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
update_nodes_status
Reboot or shutdown a node
$ok = $obj->updates_nodes_status('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- command
-
Enum. Either reboot or shutdown. Specifies the command. Required.
Note: required permissions are ["perm","/nodes/{node}",["Sys.PowerMgmt"]]
get_nodes_subscription
Read nodes subscription info
$ok = $obj->get_nodes_subscription('node')
node is a string in pve-node format
Note: Root only.
create_nodes_subscription
Create/update nodes subscription info
$ok = $obj->create_nodes_subscription('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- force
-
Boolean. Always connect to the server, even if we have up to date info inside local cache. Optional.
Note: Root only.
update_nodes_subscription_key
Updates/sets subscription key
$ok = $obj->update_nodes_subscription_key('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- key
-
Boolean. Proxmox VE subscription key. Required.
Note: Root only.
get_nodes_syslog
Reads system log
$ok = $obj->get_nodes_syslog('node', \%args)
node is a string in pve-node format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Syslog"]]
get_nodes_time
Read server time and time zone settings
$ok = $obj->get_nodes_time('node')
node is a string in pve-node format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
update_nodes_time
Updates time zone
$ok = $obj->update_nodes_time('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- timezone
-
String. Time zone to be used, see '/usr/share/zoneinfo/zone.tab'. Required.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
get_nodes_ubcfailcnt
Get user_beancounters failcnt for all active containers.
$ok = $obj->get_nodes_ubcfailcnt('node')
node is a string in pve-node format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
get_nodes_version
Get user_beancounters failcnt for all active containers.
$ok = $obj->get_nodes_version('node')
node is a string in pve-node format
Note: Accessible by all authententicated users.
create_nodes_vncshell
Creates a VNC Shell proxy.
$ok = $obj->create_nodes_vncshell('node')
node is a string in pve-node format
Note: Restricted to users on realm 'pam'. Required permissions are ["perm","/nodes/{node}",["Sys.Console"]]
create_nodes_vzdump
Create backup.
$ok = $obj->create_nodes_vzdump('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- all
-
Boolean. Backup all known VMs on this host. Optional.
- bwlimit
-
Integer. Limit I/O bandwidth (KBytes per second). Optional.
- compress
-
Enum. Either 0, 1, gzip or lzo. Comress dump file. Optional
- dumpdir
-
String. Store resulting files to specified directory. Optional.
- exclude
-
String. Exclude specified VMs (assumes --all) in pve-vmid-list. Optional.
- exclude-path
-
String. Exclude certain files/directories (regex) in string-alist. Optional.
- ionice
-
Integer. Set CFQ ionice priority. Optional.
- lockwait
-
Integer. Maximal time to wait for the global lock (minutes). Optional.
- mailto
-
String. List of email addresses in string-list format. Optional.
- maxfiles
-
Integer. Maximal number of backup files per vm. Optional.
- mode
-
Enum. A value from snapshot, suspend or stop. Backup mode. Optional.
- quiet
-
Boolean. Be quiet. Optional.
- remove
-
Boolean. Remove old backup files if there are more than 'maxfiles' backup files. Optional.
- script
-
String. Use specified hook script. Optional.
- size
-
Integer. LVM snapshot size in MB. Optional.
- stdexcludes
-
Boolean. Exclude temporary files and logs. Optional.
- stdout
-
Boolean. Write tar to stdout rather than to a file. Optional.
- stopwait
-
Integer. Maximal time to wait until a VM is stopped (minutes). Optional.
- storage
-
String. Store resulting file to this storage, in pve-storage-id format. Optional.
- tmpdir
-
String. Store temporary files to specified directory. Optional.
- vmid
-
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.
nodes_network
List available networks on the node
$ok = $obj->nodes_network('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- type
-
Enum. One of bond, bridge, alias or eth. Only list specific interface types. Optional.
Note: Accessible by all authententicated users.
create_nodes_network
Create network device configuration
$ok = $obj->create_nodes_network('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- iface
-
String. The network interface name in pve-iface format. Required.
- address
-
String. The ipv4 network address. Optional.
- autostart
-
Boolean. Automatically start interface on boot. Optional.
- bond_mode
-
Enum. Either of balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb or balance-alb. Specifies the bonding mode. Optional.
- bridge_ports
-
String. Specify the interfaces you want to add to your bridge in pve-iface-list format. Optional.
- gateway
-
String. Default ipv4 gateway address. Optional.
- netmask
-
String. Network mask for ipv4. Optional.
- slaves
-
String. Specify the interfaces used by the bonding device in pve-iface-list format. Optional.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
revert_nodes_network
Revert network configuration changes.
$ok = $obj->revert_nodes_network('node')
node is a string in pve-node format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
get_nodes_network_iface
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
Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
update_nodes_network_iface
Create network device configuration
$ok = $obj->update_nodes_network_iface('node', 'iface', \%args)
node is a string in pve-node format, iface is a string in pve-iface format
%args may items contain from the following list
- address
-
String. The ipv4 network address. Optional.
- autostart
-
Boolean. Automatically start interface on boot. Optional.
- bond_mode
-
Enum. Either of balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb or balance-alb. Specifies the bonding mode. Optional.
- delete
-
String. Settings you want to delete in pve-configid-list format. Optional.
- bridge_ports
-
String. Specify the interfaces you want to add to your bridge in pve-iface-list format. Optional.
- gateway
-
String. Default ipv4 gateway address. Optional.
- netmask
-
String. Network mask for ipv4. Optional.
- slaves
-
String. Specify the interfaces used by the bonding device in pve-iface-list format. Optional.
Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
delete_nodes_network_iface
Delete network device configuration
$ok = $obj->delete_nodes_network_iface('node', 'iface')
node is a string in pve-node format, iface is a string in pve-iface format
Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
nodes_openvz
OpenVZ container index (per node).
$ok = $obj->nodes_openvz('node')
node is a string in pve-node format
Note: Only lists VMs where you have VM.Audit permissons on /vms/<vmid>.
create_nodes_openvz
Create or restore a container.
$ok = $obj->create_nodes_openvz('node', \%args)
node is a string in pve-node format
%args may items contain from the following list
- ostemplate
-
String. The OS template or backup file. Required.
- vmid
-
Integer. The unique ID of the vm in pve-vmid format. Required.
- cpus
-
Integer. The number of CPUs for this container. Optional.
- cpuunits
-
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.
- description
-
String. Container description. Only used in the web interface. Optional.
- disk
-
Number. Amount of disk space for the VM in GB. A zero indicates no limit. Optional.
- force
-
Boolean. Allow to overwrite existing container. Optional.
- hostname
-
String. Set a host name for the container. Optional.
- ip_address
-
String. Specifies the address the container will be assigned. Optional.
- memory
-
Integer. Amount of RAM for the VM in MB. Optional.
- nameserver
-
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.
- netif
-
String. Specifies network interfaces for the container in pve-openvz-netif format. Optional.
- onboot
-
Boolean. Specifies weather a VM will be started during the system bootup. Optional.
- password
-
String. Sets root password insider the container. Optional.
- pool
-
String. Add the VM to a specified pool in pve-poolid format. Optional.
- quotatime
-
Integer. Set quota grace period (seconds). Optional.
- quotaugidlimit
-
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.
- restore
-
Boolean. Mark this as a restore task. Optional.
- searchdomain
-
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.
- storage
-
String. Target storage in pve-storage-id. Optional.
- swap
-
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"]]
get_nodes_openvz
Gets an openvz nodes details
$ok = $obj->get_nodes_openvz('node','vmid')
node is a string in pve-node format
mvid is an integer in pve-vmid format
Note: Accessible by all authententicated users.
delete_nodes_openvz
Destroy the container (also delete all uses files).
$ok = $obj->delete_nodes_openvz('node','vmid')
node is a string in pve-node format
mvid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.Allocate"]]
get_nodes_openvz_status
Directory index
$ok = $obj->get_nodes_openvz_status('node','vmid')
node is a string in pve-node format
mvid is an integer in pve-vmid format
Note: Accessible by all authententicated users.
get_nodes_openvz_status_current
Get virtual machine status.
$ok = $obj->get_nodes_openvz_status_current('node','vmid')
node is a string in pve-node format
mvid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.Audit"]]
create_nodes_openvz_status_mount
Mounts container private area.
$ok = $obj->create_nodes_openvz_status_mount('node','vmid')
node is a string in pve-node format
mvid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
create_nodes_openvz_status_shutdown
Shutdown the container.
$ok = $obj->create_nodes_openvz_status_shutdown('node','vmid', \%args)
node is a string in pve-node format
vmid is an integer in pve-vmid format
%args may items contain from the following list
- forceStop
-
Boolean. Make sure the container stops. Note the capital S. Optional.
- timeout
-
Integer. Wait maximal timeout seconds
Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
create_nodes_openvz_status_start
Start the container.
$ok = $obj->create_nodes_openvz_status_start('node','vmid')
node is a string in pve-node format
vmid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
create_nodes_openvz_status_stop
Stop the container.
$ok = $obj->create_nodes_openvz_status_stop('node','vmid')
node is a string in pve-node format
vmid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
get_nodes_openvz_status_ubc
Get container user_beancounters.
$ok = $obj->get_nodes_openvz_status_ubc('node','vmid')
node is a string in pve-node format
vmid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.Audit"]]
get_nodes_openvz_status_umount
Unmounts container private area.
$ok = $obj->get_nodes_openvz_status_umount('node','vmid')
node is a string in pve-node format
vmid is an integer in pve-vmid format
Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
SEE ALSO
AUTHOR
Brendan Beveridge <brendan@nodeintegration.com.au>, Dean Hamstead <dean@fragfest.com.au>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2023 by Dean Hamstad.
This is free software, licensed under:
The MIT (X11) License