Changing the Hostname of the node

hoppel118

Well-Known Member
Apr 5, 2012
57
1
48
Hey guys,

is it possible to change the hostname of the proxmox node?

If I edit /etc/hostname and reboot the server I can't connect to the virtual machines anymore. If I change it back to the hostname set while installation everything works again. Changing names of virtual machines via webgui is not the problem. But how to change the node hostname?

regards

Hoppel
 
If change "/etc/hostname" and "/etc/hosts" apache doesn't start:

Code:
root@(none):~# /etc/init.d/apache2 start
Starting web server: apache2Syntax error on line 13 of /etc/apache2/sites-enabled/pve-redirect.conf:
SSLCertificateFile: file '/etc/pve/local/pve-ssl.pem' does not exist or is empty
Action 'start' failed.
The Apache error log may have more information.
 failed!
root@(none):~#
 
Certificate was created by hostname - CN field in cert file.
Try
Code:
dpkg-reconfigure pve-manager
Maybe cert file will be recreated for new hostname.
 
oh, you need to rename the directory in /etc/pve/nodes/,

# mv /etc/pve/nodes/OLDNAME /etc/pve/nodes/NEWNAME

and maybe re-generate the certificates to include correct hostnames

# pvecm updatecerts
 
pve-manager: 2.1-1 (pve-manager/2.1/f9b0f63a)
running kernel: 2.6.32-12-pve
proxmox-ve-2.6.32: 2.1-68
pve-kernel-2.6.32-12-pve: 2.6.32-68


When change hostname and then restart node, hostname not change.
old hostname - test001 (hostname, where install )
new hostname - test002

files changed:
/etc/hostname

/etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.0.1 test002.mydomain.com test002 pvelocalhost
rename the directory in /etc/pve/nodes/ from test001 to test002

# mv /etc/pve/nodes/test001 /etc/pve/nodes/test002 (mv - not work, cp -R test001 test002, rm -fr test001)
#set $HOSTNAME test002; export $HOSTNAME
#dpkg-reconfigure pve-manager
#pvecm updatecerts

Node not start, apache2 not start

SSLCertificateFile: file '/etc/pve/local/pve-ssl.pem' does not exist or is emptyAction 'start' failed.
The Apache error log may have more information. failed!

Then reboot server.

After reboot:
#hostname
(none)
----------
Not access via http, only ssh (apache2 not start).

Rename to test001.
Reboot.

Now all work.

How I'm may change hostname without reboot ?
May be made change hostname via www-console ?
 
Last edited:
Reinstall to old version (Iso-install ):

running kernel: 2.6.32-11-pve
proxmox-ve-2.6.32: 2.0-66
pve-kernel-2.6.32-11-pve: 2.6.32-66
lvm2: 2.02.95-1pve2
clvm: 2.02.95-1pve2
corosync-pve: 1.4.3-1
openais-pve: 1.1.4-2
libqb: 0.10.1-2
redhat-cluster-pve: 3.1.8-3
resource-agents-pve: 3.9.2-3
fence-agents-pve: 3.1.7-2
pve-cluster: 1.0-26
qemu-server: 2.0-39
pve-firmware: 1.0-15
libpve-common-perl: 1.0-27
libpve-access-control: 1.0-21
libpve-storage-perl: 2.0-18
vncterm: 1.0-2
vzctl: 3.0.30-2pve5
vzprocps: 2.0.11-2
vzquota: 3.0.12-3
pve-qemu-kvm: 1.0-9
ksm-control-daemon: 1.1-1

-------
Hostname renamed and after reboot all works.
 

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!