10 pvecm - Proxmox VE Cluster Manager
15 include::pvecm.1-synopsis.adoc[]
27 The {pve} cluster manager `pvecm` is a tool to create a group of
28 physical servers. Such a group is called a *cluster*. We use the
29 http://www.corosync.org[Corosync Cluster Engine] for reliable group
30 communication. There's no explicit limit for the number of nodes in a cluster.
31 In practice, the actual possible node count may be limited by the host and
32 network performance. Currently (2021), there are reports of clusters (using
33 high-end enterprise hardware) with over 50 nodes in production.
35 `pvecm` can be used to create a new cluster, join nodes to a cluster,
36 leave the cluster, get status information, and do various other cluster-related
37 tasks. The **P**rox**m**o**x** **C**luster **F**ile **S**ystem (``pmxcfs'')
38 is used to transparently distribute the cluster configuration to all cluster
41 Grouping nodes into a cluster has the following advantages:
43 * Centralized, web-based management
45 * Multi-master clusters: each node can do all management tasks
47 * Use of `pmxcfs`, a database-driven file system, for storing configuration
48 files, replicated in real-time on all nodes using `corosync`
50 * Easy migration of virtual machines and containers between physical
55 * Cluster-wide services like firewall and HA
61 * All nodes must be able to connect to each other via UDP ports 5404 and 5405
64 * Date and time must be synchronized.
66 * An SSH tunnel on TCP port 22 between nodes is required.
68 * If you are interested in High Availability, you need to have at
69 least three nodes for reliable quorum. All nodes should have the
72 * We recommend a dedicated NIC for the cluster traffic, especially if
73 you use shared storage.
75 * The root password of a cluster node is required for adding nodes.
77 NOTE: It is not possible to mix {pve} 3.x and earlier with {pve} 4.X cluster
80 NOTE: While it's possible to mix {pve} 4.4 and {pve} 5.0 nodes, doing so is
81 not supported as a production configuration and should only be done temporarily,
82 during an upgrade of the whole cluster from one major version to another.
84 NOTE: Running a cluster of {pve} 6.x with earlier versions is not possible. The
85 cluster protocol (corosync) between {pve} 6.x and earlier versions changed
86 fundamentally. The corosync 3 packages for {pve} 5.4 are only intended for the
87 upgrade procedure to {pve} 6.0.
93 First, install {pve} on all nodes. Make sure that each node is
94 installed with the final hostname and IP configuration. Changing the
95 hostname and IP is not possible after cluster creation.
97 While it's common to reference all node names and their IPs in `/etc/hosts` (or
98 make their names resolvable through other means), this is not necessary for a
99 cluster to work. It may be useful however, as you can then connect from one node
100 to another via SSH, using the easier to remember node name (see also
101 xref:pvecm_corosync_addresses[Link Address Types]). Note that we always
102 recommend referencing nodes by their IP addresses in the cluster configuration.
105 [[pvecm_create_cluster]]
109 You can either create a cluster on the console (login via `ssh`), or through
110 the API using the {pve} web interface (__Datacenter -> Cluster__).
112 NOTE: Use a unique name for your cluster. This name cannot be changed later.
113 The cluster name follows the same rules as node names.
115 [[pvecm_cluster_create_via_gui]]
119 [thumbnail="screenshot/gui-cluster-create.png"]
121 Under __Datacenter -> Cluster__, click on *Create Cluster*. Enter the cluster
122 name and select a network connection from the drop-down list to serve as the
123 main cluster network (Link 0). It defaults to the IP resolved via the node's
126 As of {pve} 6.2, up to 8 fallback links can be added to a cluster. To add a
127 redundant link, click the 'Add' button and select a link number and IP address
128 from the respective fields. Prior to {pve} 6.2, to add a second link as
129 fallback, you can select the 'Advanced' checkbox and choose an additional
130 network interface (Link 1, see also xref:pvecm_redundancy[Corosync Redundancy]).
132 NOTE: Ensure that the network selected for cluster communication is not used for
133 any high traffic purposes, like network storage or live-migration.
134 While the cluster network itself produces small amounts of data, it is very
135 sensitive to latency. Check out full
136 xref:pvecm_cluster_network_requirements[cluster network requirements].
138 [[pvecm_cluster_create_via_cli]]
139 Create via the Command Line
140 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
142 Login via `ssh` to the first {pve} node and run the following command:
145 hp1# pvecm create CLUSTERNAME
148 To check the state of the new cluster use:
154 Multiple Clusters in the Same Network
155 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157 It is possible to create multiple clusters in the same physical or logical
158 network. In this case, each cluster must have a unique name to avoid possible
159 clashes in the cluster communication stack. Furthermore, this helps avoid human
160 confusion by making clusters clearly distinguishable.
162 While the bandwidth requirement of a corosync cluster is relatively low, the
163 latency of packages and the package per second (PPS) rate is the limiting
164 factor. Different clusters in the same network can compete with each other for
165 these resources, so it may still make sense to use separate physical network
166 infrastructure for bigger clusters.
168 [[pvecm_join_node_to_cluster]]
169 Adding Nodes to the Cluster
170 ---------------------------
172 CAUTION: A node that is about to be added to the cluster cannot hold any guests.
173 All existing configuration in `/etc/pve` is overwritten when joining a cluster,
174 since guest IDs could otherwise conflict. As a workaround, you can create a
175 backup of the guest (`vzdump`) and restore it under a different ID, after the
176 node has been added to the cluster.
178 Join Node to Cluster via GUI
179 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181 [thumbnail="screenshot/gui-cluster-join-information.png"]
183 Log in to the web interface on an existing cluster node. Under __Datacenter ->
184 Cluster__, click the *Join Information* button at the top. Then, click on the
185 button *Copy Information*. Alternatively, copy the string from the 'Information'
188 [thumbnail="screenshot/gui-cluster-join.png"]
190 Next, log in to the web interface on the node you want to add.
191 Under __Datacenter -> Cluster__, click on *Join Cluster*. Fill in the
192 'Information' field with the 'Join Information' text you copied earlier.
193 Most settings required for joining the cluster will be filled out
194 automatically. For security reasons, the cluster password has to be entered
197 NOTE: To enter all required data manually, you can disable the 'Assisted Join'
200 After clicking the *Join* button, the cluster join process will start
201 immediately. After the node has joined the cluster, its current node certificate
202 will be replaced by one signed from the cluster certificate authority (CA).
203 This means that the current session will stop working after a few seconds. You
204 then might need to force-reload the web interface and log in again with the
207 Now your node should be visible under __Datacenter -> Cluster__.
209 Join Node to Cluster via Command Line
210 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212 Log in to the node you want to join into an existing cluster via `ssh`.
215 # pvecm add IP-ADDRESS-CLUSTER
218 For `IP-ADDRESS-CLUSTER`, use the IP or hostname of an existing cluster node.
219 An IP address is recommended (see xref:pvecm_corosync_addresses[Link Address Types]).
222 To check the state of the cluster use:
228 .Cluster status after adding 4 nodes
240 Date: Tue Sep 14 11:06:47 2021
241 Quorum provider: corosync_votequorum
247 Votequorum information
248 ~~~~~~~~~~~~~~~~~~~~~~
255 Membership information
256 ~~~~~~~~~~~~~~~~~~~~~~
258 0x00000001 1 192.168.15.91
259 0x00000002 1 192.168.15.92 (local)
260 0x00000003 1 192.168.15.93
261 0x00000004 1 192.168.15.94
264 If you only want a list of all nodes, use:
270 .List nodes in a cluster
274 Membership information
275 ~~~~~~~~~~~~~~~~~~~~~~
283 [[pvecm_adding_nodes_with_separated_cluster_network]]
284 Adding Nodes with Separated Cluster Network
285 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287 When adding a node to a cluster with a separated cluster network, you need to
288 use the 'link0' parameter to set the nodes address on that network:
292 pvecm add IP-ADDRESS-CLUSTER -link0 LOCAL-IP-ADDRESS-LINK0
295 If you want to use the built-in xref:pvecm_redundancy[redundancy] of the
296 Kronosnet transport layer, also use the 'link1' parameter.
298 Using the GUI, you can select the correct interface from the corresponding
299 'Link X' fields in the *Cluster Join* dialog.
301 Remove a Cluster Node
302 ---------------------
304 CAUTION: Read the procedure carefully before proceeding, as it may
305 not be what you want or need.
307 Move all virtual machines from the node. Make sure you have made copies of any
308 local data or backups that you want to keep. In the following example, we will
309 remove the node hp4 from the cluster.
311 Log in to a *different* cluster node (not hp4), and issue a `pvecm nodes`
312 command to identify the node ID to remove:
317 Membership information
318 ~~~~~~~~~~~~~~~~~~~~~~
327 At this point, you must power off hp4 and ensure that it will not power on
328 again (in the network) with its current configuration.
330 IMPORTANT: As mentioned above, it is critical to power off the node
331 *before* removal, and make sure that it will *not* power on again
332 (in the existing cluster network) with its current configuration.
333 If you power on the node as it is, the cluster could end up broken,
334 and it could be difficult to restore it to a functioning state.
336 After powering off the node hp4, we can safely remove it from the cluster.
339 hp1# pvecm delnode hp4
343 Use `pvecm nodes` or `pvecm status` to check the node list again. It should
351 Votequorum information
352 ~~~~~~~~~~~~~~~~~~~~~~
359 Membership information
360 ~~~~~~~~~~~~~~~~~~~~~~
362 0x00000001 1 192.168.15.90 (local)
363 0x00000002 1 192.168.15.91
364 0x00000003 1 192.168.15.92
367 If, for whatever reason, you want this server to join the same cluster again,
370 * do a fresh install of {pve} on it,
372 * then join it, as explained in the previous section.
374 NOTE: After removal of the node, its SSH fingerprint will still reside in the
375 'known_hosts' of the other nodes. If you receive an SSH error after rejoining
376 a node with the same IP or hostname, run `pvecm updatecerts` once on the
377 re-added node to update its fingerprint cluster wide.
379 [[pvecm_separate_node_without_reinstall]]
380 Separate a Node Without Reinstalling
381 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383 CAUTION: This is *not* the recommended method, proceed with caution. Use the
384 previous method if you're unsure.
386 You can also separate a node from a cluster without reinstalling it from
387 scratch. But after removing the node from the cluster, it will still have
388 access to any shared storage. This must be resolved before you start removing
389 the node from the cluster. A {pve} cluster cannot share the exact same
390 storage with another cluster, as storage locking doesn't work over the cluster
391 boundary. Furthermore, it may also lead to VMID conflicts.
393 It's suggested that you create a new storage, where only the node which you want
394 to separate has access. This can be a new export on your NFS or a new Ceph
395 pool, to name a few examples. It's just important that the exact same storage
396 does not get accessed by multiple clusters. After setting up this storage, move
397 all data and VMs from the node to it. Then you are ready to separate the
398 node from the cluster.
400 WARNING: Ensure that all shared resources are cleanly separated! Otherwise you
401 will run into conflicts and problems.
403 First, stop the corosync and pve-cluster services on the node:
406 systemctl stop pve-cluster
407 systemctl stop corosync
410 Start the cluster file system again in local mode:
416 Delete the corosync configuration files:
419 rm /etc/pve/corosync.conf
420 rm -r /etc/corosync/*
423 You can now start the file system again as a normal service:
427 systemctl start pve-cluster
430 The node is now separated from the cluster. You can deleted it from any
431 remaining node of the cluster with:
434 pvecm delnode oldnode
437 If the command fails due to a loss of quorum in the remaining node, you can set
438 the expected votes to 1 as a workaround:
444 And then repeat the 'pvecm delnode' command.
446 Now switch back to the separated node and delete all the remaining cluster
447 files on it. This ensures that the node can be added to another cluster again
452 rm /var/lib/corosync/*
455 As the configuration files from the other nodes are still in the cluster
456 file system, you may want to clean those up too. After making absolutely sure
457 that you have the correct node name, you can simply remove the entire
458 directory recursively from '/etc/pve/nodes/NODENAME'.
460 CAUTION: The node's SSH keys will remain in the 'authorized_key' file. This
461 means that the nodes can still connect to each other with public key
462 authentication. You should fix this by removing the respective keys from the
463 '/etc/pve/priv/authorized_keys' file.
469 {pve} use a quorum-based technique to provide a consistent state among
472 [quote, from Wikipedia, Quorum (distributed computing)]
474 A quorum is the minimum number of votes that a distributed transaction
475 has to obtain in order to be allowed to perform an operation in a
479 In case of network partitioning, state changes requires that a
480 majority of nodes are online. The cluster switches to read-only mode
483 NOTE: {pve} assigns a single vote to each node by default.
489 The cluster network is the core of a cluster. All messages sent over it have to
490 be delivered reliably to all nodes in their respective order. In {pve} this
491 part is done by corosync, an implementation of a high performance, low overhead,
492 high availability development toolkit. It serves our decentralized configuration
493 file system (`pmxcfs`).
495 [[pvecm_cluster_network_requirements]]
498 This needs a reliable network with latencies under 2 milliseconds (LAN
499 performance) to work properly. The network should not be used heavily by other
500 members; ideally corosync runs on its own network. Do not use a shared network
501 for corosync and storage (except as a potential low-priority fallback in a
502 xref:pvecm_redundancy[redundant] configuration).
504 Before setting up a cluster, it is good practice to check if the network is fit
505 for that purpose. To ensure that the nodes can connect to each other on the
506 cluster network, you can test the connectivity between them with the `ping`
509 If the {pve} firewall is enabled, ACCEPT rules for corosync will automatically
510 be generated - no manual action is required.
512 NOTE: Corosync used Multicast before version 3.0 (introduced in {pve} 6.0).
513 Modern versions rely on https://kronosnet.org/[Kronosnet] for cluster
514 communication, which, for now, only supports regular UDP unicast.
516 CAUTION: You can still enable Multicast or legacy unicast by setting your
517 transport to `udp` or `udpu` in your xref:pvecm_edit_corosync_conf[corosync.conf],
518 but keep in mind that this will disable all cryptography and redundancy support.
519 This is therefore not recommended.
521 Separate Cluster Network
522 ~~~~~~~~~~~~~~~~~~~~~~~~
524 When creating a cluster without any parameters, the corosync cluster network is
525 generally shared with the web interface and the VMs' network. Depending on
526 your setup, even storage traffic may get sent over the same network. It's
527 recommended to change that, as corosync is a time-critical, real-time
530 Setting Up a New Network
531 ^^^^^^^^^^^^^^^^^^^^^^^^
533 First, you have to set up a new network interface. It should be on a physically
534 separate network. Ensure that your network fulfills the
535 xref:pvecm_cluster_network_requirements[cluster network requirements].
537 Separate On Cluster Creation
538 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
540 This is possible via the 'linkX' parameters of the 'pvecm create'
541 command, used for creating a new cluster.
543 If you have set up an additional NIC with a static address on 10.10.10.1/25,
544 and want to send and receive all cluster communication over this interface,
549 pvecm create test --link0 10.10.10.1
552 To check if everything is working properly, execute:
555 systemctl status corosync
558 Afterwards, proceed as described above to
559 xref:pvecm_adding_nodes_with_separated_cluster_network[add nodes with a separated cluster network].
561 [[pvecm_separate_cluster_net_after_creation]]
562 Separate After Cluster Creation
563 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
565 You can do this if you have already created a cluster and want to switch
566 its communication to another network, without rebuilding the whole cluster.
567 This change may lead to short periods of quorum loss in the cluster, as nodes
568 have to restart corosync and come up one after the other on the new network.
570 Check how to xref:pvecm_edit_corosync_conf[edit the corosync.conf file] first.
571 Then, open it and you should see a file similar to:
605 provider: corosync_votequorum
609 cluster_name: testcluster
621 NOTE: `ringX_addr` actually specifies a corosync *link address*. The name "ring"
622 is a remnant of older corosync versions that is kept for backwards
625 The first thing you want to do is add the 'name' properties in the node entries,
626 if you do not see them already. Those *must* match the node name.
628 Then replace all addresses from the 'ring0_addr' properties of all nodes with
629 the new addresses. You may use plain IP addresses or hostnames here. If you use
630 hostnames, ensure that they are resolvable from all nodes (see also
631 xref:pvecm_corosync_addresses[Link Address Types]).
633 In this example, we want to switch cluster communication to the
634 10.10.10.1/25 network, so we change the 'ring0_addr' of each node respectively.
636 NOTE: The exact same procedure can be used to change other 'ringX_addr' values
637 as well. However, we recommend only changing one link address at a time, so
638 that it's easier to recover if something goes wrong.
640 After we increase the 'config_version' property, the new configuration file
655 ring0_addr: 10.10.10.2
662 ring0_addr: 10.10.10.3
669 ring0_addr: 10.10.10.1
675 provider: corosync_votequorum
679 cluster_name: testcluster
691 Then, after a final check to see that all changed information is correct, we
692 save it and once again follow the
693 xref:pvecm_edit_corosync_conf[edit corosync.conf file] section to bring it into
696 The changes will be applied live, so restarting corosync is not strictly
697 necessary. If you changed other settings as well, or notice corosync
698 complaining, you can optionally trigger a restart.
700 On a single node execute:
704 systemctl restart corosync
707 Now check if everything is okay:
711 systemctl status corosync
714 If corosync begins to work again, restart it on all other nodes too.
715 They will then join the cluster membership one by one on the new network.
717 [[pvecm_corosync_addresses]]
721 A corosync link address (for backwards compatibility denoted by 'ringX_addr' in
722 `corosync.conf`) can be specified in two ways:
724 * **IPv4/v6 addresses** can be used directly. They are recommended, since they
725 are static and usually not changed carelessly.
727 * **Hostnames** will be resolved using `getaddrinfo`, which means that by
728 default, IPv6 addresses will be used first, if available (see also
729 `man gai.conf`). Keep this in mind, especially when upgrading an existing
732 CAUTION: Hostnames should be used with care, since the addresses they
733 resolve to can be changed without touching corosync or the node it runs on -
734 which may lead to a situation where an address is changed without thinking
735 about implications for corosync.
737 A separate, static hostname specifically for corosync is recommended, if
738 hostnames are preferred. Also, make sure that every node in the cluster can
739 resolve all hostnames correctly.
741 Since {pve} 5.1, while supported, hostnames will be resolved at the time of
742 entry. Only the resolved IP is saved to the configuration.
744 Nodes that joined the cluster on earlier versions likely still use their
745 unresolved hostname in `corosync.conf`. It might be a good idea to replace
746 them with IPs or a separate hostname, as mentioned above.
753 Corosync supports redundant networking via its integrated Kronosnet layer by
754 default (it is not supported on the legacy udp/udpu transports). It can be
755 enabled by specifying more than one link address, either via the '--linkX'
756 parameters of `pvecm`, in the GUI as **Link 1** (while creating a cluster or
757 adding a new node) or by specifying more than one 'ringX_addr' in
760 NOTE: To provide useful failover, every link should be on its own
761 physical network connection.
763 Links are used according to a priority setting. You can configure this priority
764 by setting 'knet_link_priority' in the corresponding interface section in
765 `corosync.conf`, or, preferably, using the 'priority' parameter when creating
766 your cluster with `pvecm`:
769 # pvecm create CLUSTERNAME --link0 10.10.10.1,priority=15 --link1 10.20.20.1,priority=20
772 This would cause 'link1' to be used first, since it has the higher priority.
774 If no priorities are configured manually (or two links have the same priority),
775 links will be used in order of their number, with the lower number having higher
778 Even if all links are working, only the one with the highest priority will see
779 corosync traffic. Link priorities cannot be mixed, meaning that links with
780 different priorities will not be able to communicate with each other.
782 Since lower priority links will not see traffic unless all higher priorities
783 have failed, it becomes a useful strategy to specify networks used for
784 other tasks (VMs, storage, etc.) as low-priority links. If worst comes to
785 worst, a higher latency or more congested connection might be better than no
788 Adding Redundant Links To An Existing Cluster
789 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
791 To add a new link to a running configuration, first check how to
792 xref:pvecm_edit_corosync_conf[edit the corosync.conf file].
794 Then, add a new 'ringX_addr' to every node in the `nodelist` section. Make
795 sure that your 'X' is the same for every node you add it to, and that it is
796 unique for each node.
798 Lastly, add a new 'interface', as shown below, to your `totem`
799 section, replacing 'X' with the link number chosen above.
801 Assuming you added a link with number 1, the new configuration file could look
816 ring0_addr: 10.10.10.2
817 ring1_addr: 10.20.20.2
824 ring0_addr: 10.10.10.3
825 ring1_addr: 10.20.20.3
832 ring0_addr: 10.10.10.1
833 ring1_addr: 10.20.20.1
839 provider: corosync_votequorum
843 cluster_name: testcluster
857 The new link will be enabled as soon as you follow the last steps to
858 xref:pvecm_edit_corosync_conf[edit the corosync.conf file]. A restart should not
859 be necessary. You can check that corosync loaded the new link using:
862 journalctl -b -u corosync
865 It might be a good idea to test the new link by temporarily disconnecting the
866 old link on one node and making sure that its status remains online while
873 If you see a healthy cluster state, it means that your new link is being used.
876 Role of SSH in {pve} Clusters
877 -----------------------------
879 {pve} utilizes SSH tunnels for various features.
881 * Proxying console/shell sessions (node and guests)
883 When using the shell for node B while being connected to node A, connects to a
884 terminal proxy on node A, which is in turn connected to the login shell on node
885 B via a non-interactive SSH tunnel.
887 * VM and CT memory and local-storage migration in 'secure' mode.
889 During the migration, one or more SSH tunnel(s) are established between the
890 source and target nodes, in order to exchange migration information and
891 transfer memory and disk contents.
893 * Storage replication
895 .Pitfalls due to automatic execution of `.bashrc` and siblings
898 In case you have a custom `.bashrc`, or similar files that get executed on
899 login by the configured shell, `ssh` will automatically run it once the session
900 is established successfully. This can cause some unexpected behavior, as those
901 commands may be executed with root permissions on any of the operations
902 described above. This can cause possible problematic side-effects!
904 In order to avoid such complications, it's recommended to add a check in
905 `/root/.bashrc` to make sure the session is interactive, and only then run
908 You can add this snippet at the beginning of your `.bashrc` file:
911 # Early exit if not running interactively to avoid side-effects!
920 Corosync External Vote Support
921 ------------------------------
923 This section describes a way to deploy an external voter in a {pve} cluster.
924 When configured, the cluster can sustain more node failures without
925 violating safety properties of the cluster communication.
927 For this to work, there are two services involved:
929 * A QDevice daemon which runs on each {pve} node
931 * An external vote daemon which runs on an independent server
933 As a result, you can achieve higher availability, even in smaller setups (for
936 QDevice Technical Overview
937 ~~~~~~~~~~~~~~~~~~~~~~~~~~
939 The Corosync Quorum Device (QDevice) is a daemon which runs on each cluster
940 node. It provides a configured number of votes to the cluster's quorum
941 subsystem, based on an externally running third-party arbitrator's decision.
942 Its primary use is to allow a cluster to sustain more node failures than
943 standard quorum rules allow. This can be done safely as the external device
944 can see all nodes and thus choose only one set of nodes to give its vote.
945 This will only be done if said set of nodes can have quorum (again) after
946 receiving the third-party vote.
948 Currently, only 'QDevice Net' is supported as a third-party arbitrator. This is
949 a daemon which provides a vote to a cluster partition, if it can reach the
950 partition members over the network. It will only give votes to one partition
951 of a cluster at any time.
952 It's designed to support multiple clusters and is almost configuration and
953 state free. New clusters are handled dynamically and no configuration file
954 is needed on the host running a QDevice.
956 The only requirements for the external host are that it needs network access to
957 the cluster and to have a corosync-qnetd package available. We provide a package
958 for Debian based hosts, and other Linux distributions should also have a package
959 available through their respective package manager.
961 NOTE: In contrast to corosync itself, a QDevice connects to the cluster over
962 TCP/IP. The daemon may even run outside of the cluster's LAN and can have longer
968 We support QDevices for clusters with an even number of nodes and recommend
969 it for 2 node clusters, if they should provide higher availability.
970 For clusters with an odd node count, we currently discourage the use of
971 QDevices. The reason for this is the difference in the votes which the QDevice
972 provides for each cluster type. Even numbered clusters get a single additional
973 vote, which only increases availability, because if the QDevice
974 itself fails, you are in the same position as with no QDevice at all.
976 On the other hand, with an odd numbered cluster size, the QDevice provides
977 '(N-1)' votes -- where 'N' corresponds to the cluster node count. This
978 alternative behavior makes sense; if it had only one additional vote, the
979 cluster could get into a split-brain situation. This algorithm allows for all
980 nodes but one (and naturally the QDevice itself) to fail. However, there are two
983 * If the QNet daemon itself fails, no other node may fail or the cluster
984 immediately loses quorum. For example, in a cluster with 15 nodes, 7
985 could fail before the cluster becomes inquorate. But, if a QDevice is
986 configured here and it itself fails, **no single node** of the 15 may fail.
987 The QDevice acts almost as a single point of failure in this case.
989 * The fact that all but one node plus QDevice may fail sounds promising at
990 first, but this may result in a mass recovery of HA services, which could
991 overload the single remaining node. Furthermore, a Ceph server will stop
992 providing services if only '((N-1)/2)' nodes or less remain online.
994 If you understand the drawbacks and implications, you can decide yourself if
995 you want to use this technology in an odd numbered cluster setup.
1000 We recommend running any daemon which provides votes to corosync-qdevice as an
1001 unprivileged user. {pve} and Debian provide a package which is already
1002 configured to do so.
1003 The traffic between the daemon and the cluster must be encrypted to ensure a
1004 safe and secure integration of the QDevice in {pve}.
1006 First, install the 'corosync-qnetd' package on your external server
1009 external# apt install corosync-qnetd
1012 and the 'corosync-qdevice' package on all cluster nodes
1015 pve# apt install corosync-qdevice
1018 After doing this, ensure that all the nodes in the cluster are online.
1020 You can now set up your QDevice by running the following command on one
1024 pve# pvecm qdevice setup <QDEVICE-IP>
1027 The SSH key from the cluster will be automatically copied to the QDevice.
1029 NOTE: Make sure that the SSH configuration on your external server allows root
1030 login via password, if you are asked for a password during this step.
1032 After you enter the password and all the steps have successfully completed, you
1033 will see "Done". You can verify that the QDevice has been set up with:
1040 Votequorum information
1041 ~~~~~~~~~~~~~~~~~~~~~
1046 Flags: Quorate Qdevice
1048 Membership information
1049 ~~~~~~~~~~~~~~~~~~~~~~
1050 Nodeid Votes Qdevice Name
1051 0x00000001 1 A,V,NMW 192.168.22.180 (local)
1052 0x00000002 1 A,V,NMW 192.168.22.181
1053 0x00000000 1 Qdevice
1058 Frequently Asked Questions
1059 ~~~~~~~~~~~~~~~~~~~~~~~~~~
1064 In case of a tie, where two same-sized cluster partitions cannot see each other
1065 but can see the QDevice, the QDevice chooses one of those partitions randomly
1066 and provides a vote to it.
1068 Possible Negative Implications
1069 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1071 For clusters with an even node count, there are no negative implications when
1072 using a QDevice. If it fails to work, it is the same as not having a QDevice
1075 Adding/Deleting Nodes After QDevice Setup
1076 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1078 If you want to add a new node or remove an existing one from a cluster with a
1079 QDevice setup, you need to remove the QDevice first. After that, you can add or
1080 remove nodes normally. Once you have a cluster with an even node count again,
1081 you can set up the QDevice again as described previously.
1083 Removing the QDevice
1084 ^^^^^^^^^^^^^^^^^^^^
1086 If you used the official `pvecm` tool to add the QDevice, you can remove it
1090 pve# pvecm qdevice remove
1095 //There is still stuff to add here
1098 Corosync Configuration
1099 ----------------------
1101 The `/etc/pve/corosync.conf` file plays a central role in a {pve} cluster. It
1102 controls the cluster membership and its network.
1103 For further information about it, check the corosync.conf man page:
1109 For node membership, you should always use the `pvecm` tool provided by {pve}.
1110 You may have to edit the configuration file manually for other changes.
1111 Here are a few best practice tips for doing this.
1113 [[pvecm_edit_corosync_conf]]
1117 Editing the corosync.conf file is not always very straightforward. There are
1118 two on each cluster node, one in `/etc/pve/corosync.conf` and the other in
1119 `/etc/corosync/corosync.conf`. Editing the one in our cluster file system will
1120 propagate the changes to the local one, but not vice versa.
1122 The configuration will get updated automatically, as soon as the file changes.
1123 This means that changes which can be integrated in a running corosync will take
1124 effect immediately. Thus, you should always make a copy and edit that instead,
1125 to avoid triggering unintended changes when saving the file while editing.
1129 cp /etc/pve/corosync.conf /etc/pve/corosync.conf.new
1132 Then, open the config file with your favorite editor, such as `nano` or
1133 `vim.tiny`, which come pre-installed on every {pve} node.
1135 NOTE: Always increment the 'config_version' number after configuration changes;
1136 omitting this can lead to problems.
1138 After making the necessary changes, create another copy of the current working
1139 configuration file. This serves as a backup if the new configuration fails to
1140 apply or causes other issues.
1144 cp /etc/pve/corosync.conf /etc/pve/corosync.conf.bak
1147 Then replace the old configuration file with the new one:
1150 mv /etc/pve/corosync.conf.new /etc/pve/corosync.conf
1153 You can check if the changes could be applied automatically, using the following
1157 systemctl status corosync
1158 journalctl -b -u corosync
1161 If the changes could not be applied automatically, you may have to restart the
1162 corosync service via:
1165 systemctl restart corosync
1168 On errors, check the troubleshooting section below.
1173 Issue: 'quorum.expected_votes must be configured'
1174 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1176 When corosync starts to fail and you get the following message in the system log:
1180 corosync[1647]: [QUORUM] Quorum provider: corosync_votequorum failed to initialize.
1181 corosync[1647]: [SERV ] Service engine 'corosync_quorum' failed to load for reason
1182 'configuration error: nodelist or quorum.expected_votes must be configured!'
1186 It means that the hostname you set for a corosync 'ringX_addr' in the
1187 configuration could not be resolved.
1189 Write Configuration When Not Quorate
1190 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1192 If you need to change '/etc/pve/corosync.conf' on a node with no quorum, and you
1193 understand what you are doing, use:
1199 This sets the expected vote count to 1 and makes the cluster quorate. You can
1200 then fix your configuration, or revert it back to the last working backup.
1202 This is not enough if corosync cannot start anymore. In that case, it is best to
1203 edit the local copy of the corosync configuration in
1204 '/etc/corosync/corosync.conf', so that corosync can start again. Ensure that on
1205 all nodes, this configuration has the same content to avoid split-brain
1209 [[pvecm_corosync_conf_glossary]]
1210 Corosync Configuration Glossary
1211 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1214 This names the different link addresses for the Kronosnet connections between
1221 It is obvious that a cluster is not quorate when all nodes are
1222 offline. This is a common case after a power failure.
1224 NOTE: It is always a good idea to use an uninterruptible power supply
1225 (``UPS'', also called ``battery backup'') to avoid this state, especially if
1228 On node startup, the `pve-guests` service is started and waits for
1229 quorum. Once quorate, it starts all guests which have the `onboot`
1232 When you turn on nodes, or when power comes back after power failure,
1233 it is likely that some nodes will boot faster than others. Please keep in
1234 mind that guest startup is delayed until you reach quorum.
1240 Migrating virtual guests to other nodes is a useful feature in a
1241 cluster. There are settings to control the behavior of such
1242 migrations. This can be done via the configuration file
1243 `datacenter.cfg` or for a specific migration via API or command line
1246 It makes a difference if a guest is online or offline, or if it has
1247 local resources (like a local disk).
1249 For details about virtual machine migration, see the
1250 xref:qm_migration[QEMU/KVM Migration Chapter].
1252 For details about container migration, see the
1253 xref:pct_migration[Container Migration Chapter].
1258 The migration type defines if the migration data should be sent over an
1259 encrypted (`secure`) channel or an unencrypted (`insecure`) one.
1260 Setting the migration type to insecure means that the RAM content of a
1261 virtual guest is also transferred unencrypted, which can lead to
1262 information disclosure of critical data from inside the guest (for
1263 example, passwords or encryption keys).
1265 Therefore, we strongly recommend using the secure channel if you do
1266 not have full control over the network and can not guarantee that no
1267 one is eavesdropping on it.
1269 NOTE: Storage migration does not follow this setting. Currently, it
1270 always sends the storage content over a secure channel.
1272 Encryption requires a lot of computing power, so this setting is often
1273 changed to "unsafe" to achieve better performance. The impact on
1274 modern systems is lower because they implement AES encryption in
1275 hardware. The performance impact is particularly evident in fast
1276 networks, where you can transfer 10 Gbps or more.
1281 By default, {pve} uses the network in which cluster communication
1282 takes place to send the migration traffic. This is not optimal both because
1283 sensitive cluster traffic can be disrupted and this network may not
1284 have the best bandwidth available on the node.
1286 Setting the migration network parameter allows the use of a dedicated
1287 network for all migration traffic. In addition to the memory,
1288 this also affects the storage traffic for offline migrations.
1290 The migration network is set as a network using CIDR notation. This
1291 has the advantage that you don't have to set individual IP addresses
1292 for each node. {pve} can determine the real address on the
1293 destination node from the network specified in the CIDR form. To
1294 enable this, the network must be specified so that each node has exactly one
1295 IP in the respective network.
1300 We assume that we have a three-node setup, with three separate
1301 networks. One for public communication with the Internet, one for
1302 cluster communication, and a very fast one, which we want to use as a
1303 dedicated network for migration.
1305 A network configuration for such a setup might look as follows:
1308 iface eno1 inet manual
1312 iface vmbr0 inet static
1313 address 192.X.Y.57/24
1321 iface eno2 inet static
1326 iface eno3 inet static
1330 Here, we will use the network 10.1.2.0/24 as a migration network. For
1331 a single migration, you can do this using the `migration_network`
1332 parameter of the command line tool:
1335 # qm migrate 106 tre --online --migration_network 10.1.2.0/24
1338 To configure this as the default network for all migrations in the
1339 cluster, set the `migration` property of the `/etc/pve/datacenter.cfg`
1343 # use dedicated migration network
1344 migration: secure,network=10.1.2.0/24
1347 NOTE: The migration type must always be set when the migration network
1348 is set in `/etc/pve/datacenter.cfg`.
1352 include::pve-copyright.adoc[]