Difference between revisions of "Renaming a PVE node"

From Proxmox VE
Jump to navigation Jump to search
(categorize article as HOWTO and WIP as its not bad or wrong but lacking information.)
(Try to extend page a bit; state that its only recommended to change empty nodes name; explain why a rename of the old /etc/pve node folder does not work.)
Line 1: Line 1:
= Work in progress =
+
Proxmox VE uses the ''hostname'' as a nodes name, so changing it works similar to changing the host name.
 +
This must be done on a empty node.
  
Quick notes gathered from various other places including the forum:
+
= Change Hostname =
  
To rename a standalone PVE host, you need to edit:
+
To rename a standalone PVE host, you '''need''' to edit:
 
* /etc/hosts
 
* /etc/hosts
 
* /etc/hostname
 
* /etc/hostname
 +
 +
There replace all occurrences of the old name with the new one. Ensure that /etc/hosts has an entry with the local nodes IP address with the pvelocalhost name.
 +
As this is used to decide to which network interface Proxmox VE's web UI will bind to.
 +
 +
There are other files which you may want to edit, they are not important for the functions of Proxmox VE itself.
 
* /etc/mailname
 
* /etc/mailname
 
* /etc/postfix/main.cf
 
* /etc/postfix/main.cf
 +
 +
If your node is in a cluster, where it is not recommended to change its name, adapt /etc/pve/corosync.conf so that the nodes name is changed also there.
 +
 +
= Cleanup =
  
 
The SSH keys don't need to be edited unless you really want to (and if you do, make sure you make the corresponding change on every other machine that SSH public key appears on).
 
The SSH keys don't need to be edited unless you really want to (and if you do, make sure you make the corresponding change on every other machine that SSH public key appears on).
It appears that /etc/motd gets regenerated automatically.
 
  
Then copy the contents of /etc/pve/nodes/''old-hostname'' to /etc/pve/nodes/''new-hostname'' (apparently renaming doesn't work).
+
Now move the configuration files, as the pmxcfs has a few restrictions to ensure consistency you cannot rename non empty folders. Thus if you have VMs or Containers on the node, which is not recommended when changing a nodes name, you have to recreate the folder structure and copy files per folder level.
 +
 
 
Also copy the contents of /var/lib/rrdcache/db/pve2-{node,storage}/''old-hostname'' to /var/lib/rrdcache/db/pve2-{node,storage}/''new-hostname'' and remove the old directory.
 
Also copy the contents of /var/lib/rrdcache/db/pve2-{node,storage}/''old-hostname'' to /var/lib/rrdcache/db/pve2-{node,storage}/''new-hostname'' and remove the old directory.
 
  
 
[[Category: HOWTO]]
 
[[Category: HOWTO]]
 
[[Category: WIP]]
 
[[Category: WIP]]

Revision as of 13:56, 3 October 2016

Proxmox VE uses the hostname as a nodes name, so changing it works similar to changing the host name. This must be done on a empty node.

Change Hostname

To rename a standalone PVE host, you need to edit:

  • /etc/hosts
  • /etc/hostname

There replace all occurrences of the old name with the new one. Ensure that /etc/hosts has an entry with the local nodes IP address with the pvelocalhost name. As this is used to decide to which network interface Proxmox VE's web UI will bind to.

There are other files which you may want to edit, they are not important for the functions of Proxmox VE itself.

  • /etc/mailname
  • /etc/postfix/main.cf

If your node is in a cluster, where it is not recommended to change its name, adapt /etc/pve/corosync.conf so that the nodes name is changed also there.

Cleanup

The SSH keys don't need to be edited unless you really want to (and if you do, make sure you make the corresponding change on every other machine that SSH public key appears on).

Now move the configuration files, as the pmxcfs has a few restrictions to ensure consistency you cannot rename non empty folders. Thus if you have VMs or Containers on the node, which is not recommended when changing a nodes name, you have to recreate the folder structure and copy files per folder level.

Also copy the contents of /var/lib/rrdcache/db/pve2-{node,storage}/old-hostname to /var/lib/rrdcache/db/pve2-{node,storage}/new-hostname and remove the old directory.