After hostname change no webgui or started containers

Forssux

Member
Mar 27, 2022
57
4
13
root@peters:~# pveversion -v
proxmox-ve: not correctly installed (running kernel: 6.2.16-19-pve)
pve-manager: 8.1.3 (running version: 8.1.3/b46aac3b42da5d15)
proxmox-kernel-helper: 8.0.9
pve-kernel-6.2: 8.0.5
pve-kernel-5.15: 7.4-4
proxmox-kernel-6.2.16-19-pve: 6.2.16-19
proxmox-kernel-6.2: 6.2.16-19
proxmox-kernel-6.2.16-18-pve: 6.2.16-18
pve-kernel-5.15.108-1-pve: 5.15.108-1
pve-kernel-5.15.30-2-pve: 5.15.30-3
ceph-fuse: 16.2.11+ds-2
corosync: 3.1.7-pve3
criu: 3.17.1-2
glusterfs-client: 10.3-5
ifupdown2: 3.2.0-1+pmx7
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-4
libknet1: 1.28-pve1
libproxmox-acme-perl: 1.5.0
libproxmox-backup-qemu0: 1.4.0
libproxmox-rs-perl: 0.3.1
libpve-access-control: 8.0.7
libpve-apiclient-perl: 3.3.1
libpve-common-perl: 8.1.0
libpve-guest-common-perl: 5.0.6
libpve-http-server-perl: 5.0.5
libpve-network-perl: 0.9.4
libpve-rs-perl: 0.8.7
libpve-storage-perl: 8.0.5
libspice-server1: 0.15.1-1
lvm2: 2.03.16-2
lxc-pve: 5.0.2-4
lxcfs: 5.0.3-pve3
novnc-pve: 1.4.0-3
proxmox-backup-client: 3.0.4-1
proxmox-backup-file-restore: 3.0.4-1
proxmox-kernel-helper: 8.0.9
proxmox-mail-forward: 0.2.2
proxmox-mini-journalreader: 1.4.0
proxmox-offline-mirror-helper: 0.6.2
proxmox-widget-toolkit: 4.1.3
pve-cluster: 8.0.5
pve-container: 5.0.8
pve-docs: 8.1.3
pve-edk2-firmware: 4.2023.08-2
pve-firewall: 5.0.3
pve-firmware: 3.9-1
pve-ha-manager: 4.0.3
pve-i18n: 3.1.2
pve-qemu-kvm: 8.1.2-4
pve-xtermjs: 5.3.0-2
qemu-server: 8.0.10
smartmontools: 7.3-pve1
spiceterm: 3.3.0
swtpm: 0.8.0+pve1
vncterm: 1.8.0
zfsutils-linux: 2.2.0-pve3

I wanted to change my hostname from pve.dorpspartijdurf.net to pve.peters.net

I changed /etc/hosts to this
Code:
127.0.0.1 localhost.localdomain localhost
192.168.1.5 pve.lan pve
192.168.1.5 pve.peters.net pve
# 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

I also changed /etc/hostname
dorpspartijdurf.net
to
peters.net

and did a
hostnamectl set-hostname peters.net

I rebooted and noticed in the webgui 2 nodes nls pve and peters.net
all containers and vm where under pve and storage was under peters.net
The error 500: proxy loop deteced was there and after checking the /etc/hostname and /etc/host I rebooted

This time no webgui whatsover I have access to the machine via SSH or going to the basement.

I noticed that this time my /etc/pve was empty?

Can somebody please advice..
 
Last edited:
Hi,
Proxmox uses the hostname as the node name, changing it without some precautions can have some serious consequences [0].
To remedy the situation, you could try to set the hostname back to its original value.
I'm not sure why pve-cluster hasn't started correctly, could you post the output of journalctl -efu pve-cluster?
pve-cluster is the service that would normally fill /etc/pve/

[0] https://pve.proxmox.com/wiki/Renaming_a_PVE_node
 
  • Like
Reactions: Forssux
Thank you for your fast reply!
I indeed resolved the situation by going back to the old name.

This is my
root@pve:~# journalctl -efu pve-cluster
Jan 16 14:20:54 pve.dorpspartijdurf.net systemd[1]: Starting pve-cluster.service - The Proxmox VE cluster filesystem...
Jan 16 14:20:54 pve.dorpspartijdurf.net pmxcfs[3008]: [main] notice: resolved node name 'pve' to '192.168.1.5' for default node IP address
Jan 16 14:20:54 pve.dorpspartijdurf.net pmxcfs[3008]: [main] notice: resolved node name 'pve' to '192.168.1.5' for default node IP address
Jan 16 14:20:55 pve.dorpspartijdurf.net systemd[1]: Started pve-cluster.service - The Proxmox VE cluster filesystem.

Now this name dorpspartijdurf.net doesn't exist anymore..
I thought changing
Code:
nano /etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.1.5 proxmox.lan proxmox
192.168.1.5 proxmox.peters.net 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


and /etc/hostname
Code:
nano /etc/hostname
peters.net

and hostnamectl set-hostname peters.net would be sufficient, isn't that so?
 
If no guests are present on a node and it's not part of a cluster, you would be correct, but the docs explicitly state This must be done on a empty node.

While storage is not necessarily dependent on the node name, the vm configuration is. This leaves pve in a limbo state, where nodes are part of a node that is unknown to it. Currently, there is no smooth way to transition a hostname if the node already has vms running on it.

A note to the changes you posted in your last message, the entries in /etc/hostname and /etc/hosts have to be the same, when the hostname is peters.net, the hosts file has to contain 192.168.1.5 peters.net or proxmox can't resolve its own name. This might also be the reason why it didn't initialize correctly after the reboot
 
  • Like
Reactions: Forssux
After thinking about it a bit more, you probably should be fine if you keep the pve. part of the hostname, since only the short version is used by proxmox. The biggest mistake was probably the mismatch between the hosts and the hostname file.
I've only done a very simple test on this though, there might be edge cases I'm not seeing atm.
 
  • Like
Reactions: Forssux
I ran into a similar problem when changing the hostname in /etc/hostname and /etc/hosts but the change was in the pve. part. Changing it back reenabled the web gui. Is it feasable to make a feature request for this to get a script or command that changes the hostname on these two files and in the node/database and whatever else is needed?
 

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!