proxmox
change node hostname
to change the node hostname:
- poweroff all VMs and containers
- ssh on node
- change the hostname on
/etc/hostnameand/etc/hosts - reboot
- after reboot, the web interface will show the old name as "disconnected", and the new name appears
- ssh on node again and go to
/etc/pve/nodes- here you will see a folder with the new name, and a folder with the old one.
- inside each one, there's a
lxcandqemu-serverfolder - move the contents of
lxcfrom the old folder to the new folder - move the contents of
qemu-serverfrom the old folder to the new folder
- remove the folder with the old name
- start the VMs and containers again
if you have lvm disks in use, you need to associate them to the new hostname:
- in the web interface, go to datacenter > storage
- double click in your lvm disk
- on nodes, select the new hostname
- click ok
enable /dev/net/tun on container hosts
edit the container configuration file, usually located at /etc/pve/lxc/<container_id>.conf, and add this content:
txt
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=fileafter that, restart the container.