[SOLVED] Changing hostname and IP of (non empty) PVE host

pgis

New Member
Jun 11, 2021
27
4
3
123
I'm currently pretty concerned as I attempted to change the hostname on a host after finding this wiki page:
https://pve.proxmox.com/wiki/Renaming_a_PVE_node

thing is... I missed one very important statement on this page.
This must be done on a empty node.

I have since changed it back and am back to a functioning node.

I am tasked with changing the hostname and IP of this node before it is moved into production.

Some googling leads me to a number of posts where folks are having quite a difficult time trying to change hostname on a used/populated node.

https://forum.proxmox.com/threads/c...-after-installing-proxmox.111035/#post-480247

I'm assuming that the hostname is used in more places than just the filepath under /etc/pve/nodes ?

Is there a correct way to change the hostname?


I found enough links through google that detail changing the IP just through editing the interfaces and hosts files it gives me the impression that it's not as impactful as changing the hostname - are there cautions that I should be aware of?

Thanks for reading
 
First, make a copy of /etc/pve just to be safe.

Then rename according to that wiki article and before rebooting, rename the old node directory to the new one:
mv /etc/pve/nodes/<old-node-name> /etc/pve/nodes/<new-node-name>
This should be enough to handle renaming of nodes.

Once that is done, reboot and see if everything is still working.
 
  • Like
Reactions: pgis
You can also try this on a virtual PVE installation. All you need is at least one configured guest.
 
  • Like
Reactions: pgis
First, make a copy of /etc/pve just to be safe.

Then rename according to that wiki article and before rebooting, rename the old node directory to the new one:
mv /etc/pve/nodes/<old-node-name> /etc/pve/nodes/<new-node-name>
Thanks! I'll give this a shot...
 
well it worked on one host beautifully... but on another I have this very strange issue that I cannot work around

old hostname in red (ends with a 2)
new hostname in green (ends with a 1)

1657558350552.png

I cant even create a new file there named 100.conf with nano... I'm stumped... I tried with some other cp flags (and the mv cmd) as well... no luck

(maybe I'll try rsync next?)

thanks

EDIT: https://serverfault.com/questions/5...ut-cannot-be-touched-with-message-file-exists
could this have anything to do with it? The host is not in any cluster with another node though...

EDIT2: same error ocurrs if the other node that hosts some VMs as a secondary (that it is not clustered with) is shutdown...

EDIT3: No idea why, but for some reason the remote explorer of VS Code was able to move the conf files

I really hate it when things dont work, then they work, and I dont even get to learn why...
 
Last edited:
pmxcfs, the cluster file system backing /etc/pve, is an sqlite database mounted via FUSE. It doesn't allow the same file (name) twice.
So instead of copying, you have to move the files.
 
  • Like
Reactions: pgis and leesteken
pmxcfs, the cluster file system backing /etc/pve, is an sqlite database mounted via FUSE. It doesn't allow the same file (name) twice.
So instead of copying, you have to move the files.
Thanks!! info much appreciated, I suspect the reason my cp cmd worked on the first host was because I copied the conf files to an intermediary folder... that was misleading.
 

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!