Hostname Change

mattlach

Well-Known Member
Mar 23, 2016
169
17
58
Boston, MA
Hey Everyone,

I set up my first Proxmox server a decade ago, and when I did so, I somewhat naively named the hostname "proxmox".

For obvious reasons this is not ideal.

I upgraded it in place for several years until my recent server rebuild when I decided it was time for a fresh install.

I did the fresh install with the latest PVE, and chose a new hostname, "omniverse" (since it is an all-in-one box), got the server all set up, made sure my storages were all in the same mount points they used to be, and contained all the same data, and then transferred over my config.db.

I was then faced with this:

1703881663432.png

All of my containers and my VM are there, but PVE-cluster seems to believe they are on a different, now disconnected host, proxmox.

If I follow this guide in the Proxmox wiki to change the hostname back to that of the old server, proxmox, then everything works as intended again.

I figured PVE cluster just needed to learn that they were indeed on the same system, so I let it run for a while before attempting to change the hostname again, using the method outlined in the wiki.

Unfortunately this did not work, and resulted in the same state as above, with the system now believing it was a different host, and that all my guests were on a different, now disconnected node.

I guess my question is, is there any way to change the name of my one and only node, such that it brings all of the VM's and containers along with it?

Appreciate any suggestions!

--Matt
 
I am assuming that you have just one node and you do not run it as a cluster with multiple servers.

In this case it might be easier since you are doing a clean install anyway, to just create a backup of all your VMs/Containers and download the backups to your local PC.
Then do a reinstall with the new hostname and restore the backups.

This will have the advantage that it will create the VMs/Containers on the ”new” hostname and associate the new hostname with the VMs/Containers Instead of the VMs/Containers be associated with the old hostname.

Do note that you might need to tell Proxmox to use the new hostname instead of the old hostname when you restore the backup via the GUI menu as if I remember correctly, the backups contain the node info that they where associated with.
 
And guests might not work because they miss the IP sets, aliases and security groups in case you configured your firewalls. For that you could copy the /etc/pve/firewall/datacenter.cfg from a backup of the old installation to the new server.

And don't forget so setup users, token, backup jobs, notifications and so on again.
 
So, I've gone looking in the /etc/pve folder and located both my hostnames there, with a bunch of files under them...

What if, at the same time as I edit /etc/hosts and /etc/hostname, I also wipe out the old /etc/pve/omniverse, and rename /etc/pve/proxmox to /etc/pve/omniverse....

And then restart pve-cluster...

Would that maybe do the trick?
 

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!