node rename failed - 2 nodes displayed and old node has the VMs

Jun 6, 2023
33
5
13
Hi,

So I followed these steps to rename the host and rebooted but now I somehow have 2 nodes. My VMs are on the hostname with the old node.

How can I get them on the new hostname the safest way possible?

Old hostname: pve
New hostname: nas-proxmox

I also wanted to join the nodes after getting this fixed, would that be possible? is that recommended? forget this I just wanna get my VMs back :(

Code:
root@nas-proxmox:~# ls -lh /etc/pve/nodes
total 0
drwxr-xr-x 2 root www-data 0 Oct 15 20:32 nas-proxmox
drwxr-xr-x 2 root www-data 0 May 22 23:36 pve
root@nas-proxmox:~# ls -lh /etc/pve/nodes/pve
total 2.0K
-rw-r----- 1 root www-data   84 Oct 15 20:31 lrm_status
drwxr-xr-x 2 root www-data    0 May 22 23:36 lxc
drwxr-xr-x 2 root www-data    0 May 22 23:36 openvz
drwx------ 2 root www-data    0 May 22 23:36 priv
-rw-r----- 1 root www-data 1.7K May 22 23:36 pve-ssl.key
-rw-r----- 1 root www-data 1.8K May 22 23:36 pve-ssl.pem
drwxr-xr-x 2 root www-data    0 May 22 23:36 qemu-server
-rw-r----- 1 root www-data  556 Oct 14 17:50 ssh_known_hosts
root@nas-proxmox:~# ls -lh /etc/pve/nodes/pve/qemu-server/
total 2.0K
-rw-r----- 1 root www-data 612 Jul  6 12:11 100.conf
-rw-r----- 1 root www-data 500 Oct 10 00:53 101.conf
-rw-r----- 1 root www-data 484 Jun  7 14:37 190.conf
-rw-r----- 1 root www-data 422 Oct  9 17:36 900.conf
 
Last edited:
Forgot to add the output of /etc/hosts and /etc/hostname

Code:
root@nas-proxmox:~# hostnamectl status
 Static hostname: nas-proxmox
       Icon name: computer-desktop
         Chassis: desktop ️
      Machine ID: b81634c81c5844b2b0ed64b992db677e
         Boot ID: 002c91a06f0b41d492d95f38c0ac8738
    Product UUID: 9b006b9c-da91-0000-0000-000000000000
Operating System: Debian GNU/Linux 13 (trixie)
          Kernel: Linux 6.14.11-4-pve
    Architecture: x86-64
 Hardware Vendor: ASRock
  Hardware Model: H510M-HDV/M.2 SE
 Hardware Serial: To Be Filled By O.E.M.
Firmware Version: P1.60
   Firmware Date: Fri 2023-05-05
    Firmware Age: 2y 5month 1w 5d

root@nas-proxmox:~# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.177 nas-proxmox.lan nas-proxmox

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

root@nas-proxmox:~# cat /etc/hostname
nas-proxmox
 
I've never done this on proxmox but have you tried :
Bash:
hostnamectl set-hostname <your new hostname>

Maybe, a simpler solution would be, (If your VMs are on a separate drive, backup or you can move them from local lvm...) try reinstall. It's a pain but at least, would be clean. Then restore your VMs, just suggesting something I'd do to avoid all the hassle.
 
Last edited:
I've never done this on proxmox but have you tried :
Bash:
hostnamectl set-hostname <your new hostname>

Maybe, a simpler solution would be, (If your VMs are on a separate drive, backup or you can move them from local lvm...) try reinstall. It's a pain but at least, would be clean. Then restore your VMs, just suggesting something I'd do to avoid all the hassle.

My thinking is if hostnamectl status shows nas-proxmox, which is correct. Then hostname ctl set-hostmane may not make a difference.

The other problem is I have been doing this hostname clean up to prep for the next step. spinning up Proxmox Backup Server, so I can't make backups right now : ( I have a NAS that I can't power on either since it's one of the VMs with all my data and broke with the hostname change

My thinking right now is:

1. what went wrong with the hostname change, i followed the doc. If I could figure that out might help me figure out the next steps.

2. If I know what to copy over to the next node then maybe that would fix it.
 
Hi,

So I followed these steps to rename the host and rebooted but now I somehow have 2 nodes. My VMs are on the hostname with the old node.
Did you also follow the Cleanup part?
The config files of your vm/lxc have to be manually copied to the folder with new name.
/etc/pve/nodes/pve/qemu-server => /etc/pve/nodes/nas-proxmox/qemu-server
and
/etc/pve/nodes/pve/lxc => /etc/pve/nodes/nas-proxmox/lxc

If everything is transfered you can delete the folder with the old name.
 
Did you also follow the Cleanup part?
The config files of your vm/lxc have to be manually copied to the folder with new name.
/etc/pve/nodes/pve/qemu-server => /etc/pve/nodes/nas-proxmox/qemu-server
and
/etc/pve/nodes/pve/lxc => /etc/pve/nodes/nas-proxmox/lxc

If everything is transfered you can delete the folder with the old name.

Well holy crap I didn't realize it had warnings about changing the node name with VMs "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"

That really should be at the very top of the article :mad:

Essentially I did see The SSH keys don't need to be edited unless you really want to then stopped reading since I didn't care about SSH
 
no issues right now just confused, so the contents of /var/lib/rrdcached/db/pve2-{node,storage}/old-hostname " show as follows

local-lvm.old
local.old

That looks fine, but the /var/lib/rrdcached/db/pve2-{node,storage}/new-hostname this directory just doesn't exist. That said the following does exist but it's not what is described in the documentation

Code:
root@nas-proxmox:/etc/pve/nodes/pve/qemu-server# ls -lh /var/lib/rrdcached/db/pve-storage-9.0/nas-proxmox/

-rw-r--r-- 1 root root 156K Oct 16 14:43 local
-rw-r--r-- 1 root root 156K Oct 16 14:39 local-lvm

I could just move and reboot the server and hopefully that works but at this rather not use trial and error since as I stated I have no backups or backup server setup yet. Can anyone confirm?
 
Last edited:
So mind don't reflect the documentation, my the one pointing to pve2 like the documentation only has one hostname. The one with pve-storage-9.0 has 2 hostnames.

These are the different directories I have

root@nas-proxmox:~# ls -lh /var/lib/rrdcached/db/pve-storage-9.0/
drwxr-x--- 2 root root 4.0K Oct 15 20:32 nas-proxmox
drwxr-xr-x 2 root root 4.0K Oct 14 15:59 pve

root@nas-proxmox:~# ls -lh /var/lib/rrdcached/db/pve-storage-9.0/nas-proxmox/
-rw-r--r-- 1 root root 156K Oct 16 15:03 local
-rw-r--r-- 1 root root 156K Oct 16 15:02 local-lvm

root@nas-proxmox:~# ls -lh /var/lib/rrdcached/db/pve-storage-9.0/pve/
-rw-r--r-- 1 root root 156K Oct 15 20:31 local
-rw-r--r-- 1 root root 156K Oct 15 20:31 local-lvm

root@nas-proxmox:~# ls -lh /var/lib/rrdcached/db/pve2-storage/pve/
-rw-r--r-- 1 root root 15K Oct 13 22:02 local-lvm.old
-rw-r--r-- 1 root root 15K Oct 13 22:02 local.old
root@nas-proxmox:~#
 
I never cared for /var/lib/rrdcached/db/* as it isn't critical to operation. It is for statistics meaning the data shown in the overview/summary in the web GUI.
 
I solved this by moving the files in here root@nas-proxmox:~# ls -lh /var/lib/rrdcached/db/pve2-storage/pve/ to root@nas-proxmox:~# ls -lh /var/lib/rrdcached/db/pve-storage-9.0/nas-proxmox/

no reboot, it just worked