Difference between revisions of "Proxmox Node Management"

From Proxmox VE
Jump to navigation Jump to search
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
[[Category:Reference Documentation]]
 
[[Category:Reference Documentation]]
 
<pvehide>
 
<pvehide>
The Proxmox VE node management tool (pvenode) allows to control node specific
+
The Proxmox VE node management tool (pvenode) allows you to control node specific
 
settings and resources.
 
settings and resources.
Currently pvenode allows to set a node&#8217;s description and to manage
+
Currently pvenode allows you to set a node&#8217;s description, run various
the node&#8217;s SSL certificates used for the API and the web GUI through pveproxy.
+
bulk operations on the node&#8217;s guests, view the node&#8217;s task history, and
EXAMPLES
+
manage the node&#8217;s SSL certificates, which are used for the API and the web GUI
pvenode cert set certificate.crt certificate.key -force
+
through pveproxy.
Install an externally provided certificate. Both files need to be PEM encoded.
 
certificate.key contains the private key and certificate.crt contains the
 
whole certificate chain.
 
pvenode acme account register default mail@example.invalid
 
pvenode config set --acme domains=example.invalid
 
pvenode acme cert order
 
systemctl restart pveproxy
 
Setup ACME account and order a certificate for local node.
 
 
Wake-on-LAN
 
Wake-on-LAN
Wake-on-LAN (WoL) allows to switch on a sleeping computer in the network by
+
Wake-on-LAN (WoL) allows you to switch on a sleeping computer in the network, by
sending a magic packet. At least one NIC must support this feature and the
+
sending a magic packet. At least one NIC must support this feature, and the
respective option needs to be enabled in the computers firmware (BIOS/UEFI)
+
respective option needs to be enabled in the computer&#8217;s firmware (BIOS/UEFI)
 
configuration. The option name can vary from Enable Wake-on-Lan to
 
configuration. The option name can vary from Enable Wake-on-Lan to
Power On By PCIE Device, check your motherboards vendor manual, if unsure.
+
Power On By PCIE Device; check your motherboard&#8217;s vendor manual, if you&#8217;re
ethtool can be used to check the WoL configuration of &lt;interface&gt; by
+
unsure. ethtool can be used to check the WoL configuration of &lt;interface&gt;
running:
+
by running:
 
ethtool &lt;interface&gt; | grep Wake-on
 
ethtool &lt;interface&gt; | grep Wake-on
pvenode allows to wake sleeping members of a cluster via WoL using the
+
pvenode allows you to wake sleeping members of a cluster via WoL, using the
 
command:
 
command:
 
pvenode wakeonlan &lt;node&gt;
 
pvenode wakeonlan &lt;node&gt;
 
This broadcasts the WoL magic packet on UDP port 9, containing the MAC address
 
This broadcasts the WoL magic packet on UDP port 9, containing the MAC address
of &lt;node&gt; obtained from the wakeonlan property. The node specific
+
of &lt;node&gt; obtained from the wakeonlan property. The node-specific
wakeonlan property can be set by the following command:
+
wakeonlan property can be set using the following command:
 
pvenode config set -wakeonlan XX:XX:XX:XX:XX:XX
 
pvenode config set -wakeonlan XX:XX:XX:XX:XX:XX
 +
Task History
 +
When troubleshooting server issues, for example, failed backup jobs, it can
 +
often be helpful to have a log of the previously run tasks. With Proxmox VE, you can
 +
access the nodes&#8217;s task history through the pvenode task command.
 +
You can get a filtered list of a node&#8217;s finished tasks with the list
 +
subcommand. For example, to get a list of tasks related to VM 100
 +
that ended with an error, the command would be:
 +
pvenode task list --errors --vmid 100
 +
The log of a task can then be printed using its UPID:
 +
pvenode task log UPID:pve1:00010D94:001CA6EA:6124E1B9:vzdump:100:root@pam:
 +
Bulk Guest Power Management
 +
In case you have many VMs/containers, starting and stopping guests can be
 +
carried out in bulk operations with the startall and stopall subcommands of
 +
pvenode.  By default, pvenode startall will only start VMs/containers which
 +
have been set to automatically start on boot (see
 +
Automatic Start and Shutdown of Virtual Machines),
 +
however, you can override this behavior with the --force flag. Both commands
 +
also have a --vms option, which limits the stopped/started guests to the
 +
specified VMIDs.
 +
For example, to start VMs 100, 101, and 102, regardless of whether they
 +
have onboot set, you can use:
 +
pvenode startall --vms 100,101,102 --force
 +
To stop these guests (and any other guests that may be running), use the
 +
command:
 +
pvenode stopall
 +
First Guest Boot Delay
 +
In case your VMs/containers rely on slow-to-start external resources, for
 +
example an NFS server, you can also set a per-node delay between the time Proxmox VE
 +
boots and the time the first VM/container that is configured to autostart boots
 +
(see Automatic Start and Shutdown of Virtual Machines).
 +
You can achieve this by setting the following (where 10 represents the delay
 +
in seconds):
 +
pvenode config set --startall-onboot-delay 10
 +
Bulk Guest Migration
 +
In case an upgrade situation requires you to migrate all of your guests from one
 +
node to another, pvenode also offers the migrateall subcommand for bulk
 +
migration. By default, this command will migrate every guest on the system to
 +
the target node. It can however be set to only migrate a set of guests.
 +
For example, to migrate VMs 100, 101, and 102, to the node pve2, with
 +
live-migration for local disks enabled, you can run:
 +
pvenode migrateall pve2 --vms 100,101,102 --with-local-disks
 
</pvehide>
 
</pvehide>
 
<!--PVE_IMPORT_END_MARKER-->
 
<!--PVE_IMPORT_END_MARKER-->

Revision as of 09:27, 17 November 2021

The Proxmox VE node management tool (pvenode) allows you to control node specific settings and resources.

Currently pvenode allows you to set a node’s description, run various bulk operations on the node’s guests, view the node’s task history, and manage the node’s SSL certificates, which are used for the API and the web GUI through pveproxy.

Wake-on-LAN

Wake-on-LAN (WoL) allows you to switch on a sleeping computer in the network, by sending a magic packet. At least one NIC must support this feature, and the respective option needs to be enabled in the computer’s firmware (BIOS/UEFI) configuration. The option name can vary from Enable Wake-on-Lan to Power On By PCIE Device; check your motherboard’s vendor manual, if you’re unsure. ethtool can be used to check the WoL configuration of <interface> by running:

ethtool <interface> | grep Wake-on

pvenode allows you to wake sleeping members of a cluster via WoL, using the command:

pvenode wakeonlan <node>

This broadcasts the WoL magic packet on UDP port 9, containing the MAC address of <node> obtained from the wakeonlan property. The node-specific wakeonlan property can be set using the following command:

pvenode config set -wakeonlan XX:XX:XX:XX:XX:XX

Task History

When troubleshooting server issues, for example, failed backup jobs, it can often be helpful to have a log of the previously run tasks. With Proxmox VE, you can access the nodes’s task history through the pvenode task command.

You can get a filtered list of a node’s finished tasks with the list subcommand. For example, to get a list of tasks related to VM 100 that ended with an error, the command would be:

pvenode task list --errors --vmid 100

The log of a task can then be printed using its UPID:

pvenode task log UPID:pve1:00010D94:001CA6EA:6124E1B9:vzdump:100:root@pam:

Bulk Guest Power Management

In case you have many VMs/containers, starting and stopping guests can be carried out in bulk operations with the startall and stopall subcommands of pvenode. By default, pvenode startall will only start VMs/containers which have been set to automatically start on boot (see Automatic Start and Shutdown of Virtual Machines), however, you can override this behavior with the --force flag. Both commands also have a --vms option, which limits the stopped/started guests to the specified VMIDs.

For example, to start VMs 100, 101, and 102, regardless of whether they have onboot set, you can use:

pvenode startall --vms 100,101,102 --force

To stop these guests (and any other guests that may be running), use the command:

pvenode stopall
Note The stopall command first attempts to perform a clean shutdown and then waits until either all guests have successfully shut down or an overridable timeout (3 minutes by default) has expired. Once that happens and the force-stop parameter is not explicitly set to 0 (false), all virtual guests that are still running are hard stopped.

First Guest Boot Delay

In case your VMs/containers rely on slow-to-start external resources, for example an NFS server, you can also set a per-node delay between the time Proxmox VE boots and the time the first VM/container that is configured to autostart boots (see Automatic Start and Shutdown of Virtual Machines).

You can achieve this by setting the following (where 10 represents the delay in seconds):

pvenode config set --startall-onboot-delay 10

Bulk Guest Migration

In case an upgrade situation requires you to migrate all of your guests from one node to another, pvenode also offers the migrateall subcommand for bulk migration. By default, this command will migrate every guest on the system to the target node. It can however be set to only migrate a set of guests.

For example, to migrate VMs 100, 101, and 102, to the node pve2, with live-migration for local disks enabled, you can run:

pvenode migrateall pve2 --vms 100,101,102 --with-local-disks