Changing the hostname of a Proxmox 8 VE

kartr

New Member
Aug 9, 2024
5
0
1
I tried changing the hostname using hostnamectl and editing the hostname in /etc/hosts but that broke the node completely and the panel showed up empty upon login. I changed back to the old hostname and rebooted and everything's fine now.

I already read the doc and it says that hostname may only be changed if a node has no VMs but I already do have a few VMs and want to change the hostname of the node, what is the correct/official way to achieve this without breaking anything?
 
Like it says in the doc, there (probably) is no official way for it ;)

That said though, most likely you'll have to change/copy over some of the folders in the /etc/pve folder with the name of the host in the folder-name in it. (for example /etc/pve/nodes, if you look there now you probably have your old and new name in there)
 
Don't do this. And if you do it, take a look at the name of your certs. Even after you change all the rest of the stuff, its still gonna be root@originalmachinename. But don't do this. It's easier to wipe the machine and start over.
Really. This is such a bad idea. When you're done, you think its all ok. It's not.
 
Last edited:

https://www.derekfarr.com/docs/articles/rename-proxmox-node/

Instructions​

Rename a standalone node​

  1. Access the node’s console via SSH or the Proxmox web GUI.
  2. If needed, log in as root:

    $ sudo su<br>
  3. Update the hostname in /etc/hosts and /etc/hostname.
  4. Create a new directory for time series data related to the node:

    $ mkdir /var/lib/rrdcached/db/pve2-node/&lt;new-name&gt;<br>$ cp -p /var/lib/rrdcached/db/pve2-node/&lt;old-name&gt; /var/lib/rrdcached/db/pve2-node/&lt;new-name&gt;<br>
  5. Create a new directory for time series data related to the node’s storage:

    $ mkdir /var/lib/rrdcached/db/pve2-storage/&lt;new-name&gt;<br>$ cp -p /var/lib/rrdcached/db/pve2-storage/&lt;old-name&gt;/* /var/lib/rrdcached/db/pve2-storage/&lt;new-name&gt;<br>
  6. Create a new directory for qemu-server config files:

    $ mkdir -p /etc/pve/nodes/&lt;new-name&gt;/qemu-server<br>$ mv /etc/pve/nodes/&lt;old-name&gt;/qemu-server/* /etc/pve/nodes/&lt;new-name&gt;/qemu-server<br>
  7. Remove the directories that reflect the old node name:

    $ rm -Rf /etc/pve/nodes/&lt;old-name&gt;<br>$ rm -Rf /var/lib/rrdcached/db/pve2-node/&lt;old-name&gt;<br>$ rm -Rf /var/lib/rrdcached/db/pve2-storage/&lt;old-name&gt;<br>
  8. Reboot the node:

    $ reboot
 
Instead of the “short name” (e.g. pve1), how can I display the FQDN (pve1.abc.de) in the GUI?