Renaming Proxmox 4 node?

Michael B

Member
Jan 12, 2016
4
1
6
38
Hi everyone,

Months ago, I got my Proxmox server installed with a default hosting provider hostname, thus used as node name.

I'd like to rename it, and procedures I found online do not work with Proxmox 4. When trying to copy /etc/pve/nodes/<old-node> to /etc/pve/nodes/<new-node> (either with a cp, mv, rsync), I have errors like 'lxc/101.conf file already exists'.

I guess this is about /etc/pve not being a regular folder? How to rename properly my Proxmox node without reinstalling? :)

Thanks!
 
Hi,

you must not reinstall your complete node. You only have to change your hostname in /etc/hostname and /etc/hosts.
Then restart your server. While restarting proxmox should create a new directory with your new hostname /etc/pve/nodes/.
Now you have to move all vm configs from the old folder into the new one.
For example: mv /etc/pve/nodes/<old-node>/lxc /etc/pve/nodes/<new-node>/lxc
 
@VoltStrecker: I did exactly like you stated.
1. Chnaged the hostname. Rebooted.
2. Got following error when I tried to copy the config for nodes:

root@server2:~# mv /etc/pve/nodes/ns2/lxc /etc/pve/nodes/server2/lxc
mv: cannot move ‘/etc/pve/nodes/ns2/lxc’ to ‘/etc/pve/nodes/server2/lxc/lxc’: Directory not empty
[Exit 1]

3. But the directory has nothing in it:

root@server2:~# ls -la /etc/pve/nodes/server2/lxc/
total 0
drwxr-xr-x 2 root www-data 0 Feb 3 19:48 ./
drwxr-xr-x 2 root www-data 0 Feb 19 09:30 ../

4. However, I tried to delete everything forcefully:

root@server2:~# rm -rf /etc/pve/nodes/server2/lxc

5. Yet, the command as in 1 works:
root@server2:~# mv /etc/pve/nodes/ns2/lxc /etc/pve/nodes/server2/
mv: cannot move ‘/etc/pve/nodes/ns2/lxc’ to ‘/etc/pve/nodes/server2/lxc’: Directory not empty
[Exit 1]

Is there anything else that one needs to do to copy the configs for nodes? Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!