{"id":1614,"date":"2024-11-11T20:19:26","date_gmt":"2024-11-11T18:19:26","guid":{"rendered":"https:\/\/www.shukko.com\/x3\/?p=1614"},"modified":"2024-11-11T20:27:29","modified_gmt":"2024-11-11T18:27:29","slug":"proxmox-change-ip-of-a-cluster-node","status":"publish","type":"post","link":"https:\/\/www.shukko.com\/x3\/2024\/11\/11\/proxmox-change-ip-of-a-cluster-node\/","title":{"rendered":"Proxmox Change IP of a cluster node"},"content":{"rendered":"\n<p>Ok, I have this figured out and the result is largely why I started this thread &#8211; every procedure I have found is incomplete or has major assumptions that may not be obvious. So, future Googlers, here is the deal. Do this is in this order on the respective nodes.<\/p>\n\n\n\n<p>NODE = the node that is getting the new IP.<br>CLUSTER = all other Proxmox nodes that will maintain quorum and can talk to one another throughout this procedure.<br>ONE CLUSTER = any one single node within CLUSTER<\/p>\n\n\n\n<p>On NODE<\/p>\n\n\n\n<p>1. Edit \/etc\/pve\/corosync.conf.<br>2. Update the IP for NODE.<br>3. Increment<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>config_version:<\/code><\/pre>\n\n\n\n<p>This change should push out a new corosync.conf to all nodes in CLUSTER. Confirm all nodes in CLUSTER have the new \/etc\/pve\/corosync.conf. At this point the cluster will be broken. If you run<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> pvecm status<\/code><\/pre>\n\n\n\n<p>on the NODE, you will see it can&#8217;t find the rest of the nodes in the cluster. If you run<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> pvecm status<\/code><\/pre>\n\n\n\n<p>on CLUSTER you will see they can all see each other but NODE is missing.<\/p>\n\n\n\n<p>Still on NODE<br>1. Edit \/etc\/network\/interfaces and update the IP to the desired IP.<br>2. Edit \/etc\/hosts and update the IP to the new IP.<br>3.<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown vmbr0; ifup vmbr0<\/code><\/pre>\n\n\n\n<p>to get your interface to have the new static IP. Change &#8220;vmbr0&#8221; to the name of your interface.<br>4. Restart corosync and pve-cluster.<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart corosync<\/code><\/pre>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart pve-cluster<\/code><\/pre>\n\n\n\n<p>On CLUSTER<br>1. Restart corosync on EVERY member of CLUSTER.<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart corosync<\/code><\/pre>\n\n\n\n<p>At this point<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pvecm status<\/code><\/pre>\n\n\n\n<p>should show all nodes as being in the cluster, good quorum, and NODE has its proper IP. Be patient as this can take a minute. To be extra sure, run<\/p>\n\n\n\n<p>Code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/pve\/.members<\/code><\/pre>\n\n\n\n<p>on NODE and this should show all the correct IPs.<\/p>\n\n\n\n<p>Additional cleanup.<\/p>\n\n\n\n<p>On NODE:<\/p>\n\n\n\n<p>1. Optional: Edit \/etc\/issue. Update to the new IP on NODE. This ensures the console login screen shows the right IP.<br>2. Edit \/etc\/pve\/storage.cfg and update any references to the old NODE IP &#8211; likely only an issue if you run PVE and PBS next to each other.<br>3. Optional: Edit \/etc\/pve\/priv\/known_hosts and update the IP of NODE.<\/p>\n\n\n\n<p>Other weirdness: In this process I have found sometimes VMs and containers lose their network connection and need to be rebooted. I haven&#8217;t found a good way to avoid this or fix it beyond a VM\/CT reboot. If anyone has an idea to make this 100% zero downtime (or near zero downtime), let me know and I&#8217;ll add that step.<\/p>\n\n\n\n<p>second one<\/p>\n\n\n\n<p>different writer<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Stop the cluster services<\/h1>\n\n\n\n<p>systemctl stop pve-cluster<br>systemctl stop corosync<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Mount the filesystem locally<\/h1>\n\n\n\n<p>pmxcfs -l<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Edit the network interfaces file to have the new IP information<\/h1>\n\n\n\n<p>vi \/etc\/network\/interfaces<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Replace any host entries with the new IP addresses<\/h1>\n\n\n\n<p>vi \/etc\/hosts<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Edit the corosync file and replace the old IPs with the new IPs for any changed hosts<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">BE SURE TO INCREMENT THE config_version: x LINE BY ONE TO ENSURE THE CONFIG IS NOT OVERWRITTEN<\/h1>\n\n\n\n<p>vi \/etc\/pve\/corosync.conf<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Edit the known hosts file to have the new IP(s)<\/h1>\n\n\n\n<p>\/etc\/pve\/priv\/known_hosts<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">If using ceph, edit the ceph configuration file to reflect the new network<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">(thanks u\/FortunatelyLethal)<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">:%s\/192.168.1.\/192.168.2.\/g &lt;- vi command to replace all instances<\/h1>\n\n\n\n<p>vi \/etc\/ceph\/ceph.conf<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">If you want to be granular\u2026 fix the IP in \/etc\/issue<\/h1>\n\n\n\n<p>vi \/etc\/issue<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Verify there aren&#8217;t any stragglers with the old IP hanging around<\/h1>\n\n\n\n<p>cd \/etc<br>grep -R &#8216;192.168.1.&#8217; *<br>cd \/var<br>grep -R &#8216;192.168.1.&#8217; *<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Reboot the system to cleanly restart all the networking and services<\/h1>\n\n\n\n<p>reboot<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Referenced pages:<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; https:\/\/forum.proxmox.com\/threads\/change-cluster-nodes-ip-addresses.33406\/<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; https:\/\/pve.proxmox.com\/wiki\/Cluster_Manager#_remove_a_cluster_node<\/h1>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>third one:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-nodes-ip-address\">Change node\u2019s IP address&nbsp;<a href=\"https:\/\/www.derekfarr.com\/docs\/articles\/change-proxmox-node-ip\/#change-nodes-ip-address\">#<\/a><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Update the node\u2019s IP address in the following files:\n<ul class=\"wp-block-list\">\n<li><code>\/etc\/network\/interfaces<\/code><\/li>\n\n\n\n<li><code>\/etc\/hosts<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Stop the cluster and\u00a0<a href=\"https:\/\/pve.proxmox.com\/pve-docs\/pmxcfs.8.html\">force local mode<\/a>\u00a0so you can update the cluster configuration:<code>systemctl stop pve-cluster systemctl stop corosync pmxcfs -l<\/code><\/li>\n\n\n\n<li>In\u00a0<code>\/etc\/pve\/corosync.conf<\/code>\u00a0update:\n<ul class=\"wp-block-list\">\n<li>The node\u2019s IP address<\/li>\n\n\n\n<li>The IP addresses of other nodes in the cluster (if they\u2019re changing)<\/li>\n\n\n\n<li>The\u00a0<code>config_version<\/code>, incrementing it by 1<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Restart the cluster:<code>killall pmxcfs systemctl start pve-cluster<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-ip-address-on-subsequent-nodes\">Change IP address on subsequent nodes&nbsp;<a href=\"https:\/\/www.derekfarr.com\/docs\/articles\/change-proxmox-node-ip\/#change-ip-address-on-subsequent-nodes\">#<\/a><\/h3>\n\n\n\n<p>If you\u2019re changing the IP address of multiple nodes in a cluster, repeat the instructions in this section for every additional node in the cluster. The process to follow depends on if the cluster\u2019s quorum is still intact.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"intact-quorum\">Intact quorum&nbsp;<a href=\"https:\/\/www.derekfarr.com\/docs\/articles\/change-proxmox-node-ip\/#intact-quorum\">#<\/a><\/h4>\n\n\n\n<p>Update the node\u2019s IP address in the following files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/etc\/network\/interfaces<\/code><\/li>\n\n\n\n<li><code>\/etc\/hosts<\/code><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Ok, I have this figured out and the result is largely why I started this thread &#8211; every procedure I have found is incomplete or has major assumptions that may not be obvious. So, future Googlers, here is the deal. Do this is in this order on the respective nodes. NODE = the node that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1614","post","type-post","status-publish","format-standard","hentry","category-kategerisiz"],"_links":{"self":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/comments?post=1614"}],"version-history":[{"count":3,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1614\/revisions"}],"predecessor-version":[{"id":1617,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1614\/revisions\/1617"}],"wp:attachment":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/media?parent=1614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/categories?post=1614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/tags?post=1614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}