Closed atanasdinov closed 9 months ago
Sorry, I should have put some kind of description. :smile:
Yes, this is exactly what we want. I've researched all different ways of setting up the hostname as well as read through the source code of the different implementations and setting the name in /etc/hostname is enough to set it as a "Static hostname" after a reboot.
Tested the current code in Combustion using the slemicro/create-vm.sh script (dropping the manual hostname setup) and after a reboot we observe the following:
node2:~ # hostnamectl
Static hostname: node2
Icon name: computer-vm
Chassis: vm
Machine ID: a8769599bd8c4125a2b5952e9be48a09
Boot ID: 426f872337d840bfac33f5937fbc477e
Virtualization: qemu
Operating System: SUSE Linux Enterprise Micro 5.4
CPE OS Name: cpe:/o:suse:sle-micro:5.4
Kernel: Linux 5.14.21-150400.24.46-default
Architecture: arm64
Hardware Vendor: QEMU
Hardware Model: QEMU Virtual Machine
If we do need to set the transient hostname, I'll add a call to sethostname in a follow up.
I'm not 100% sure setting the hostname in the file will be enough:
https://www.redhat.com/sysadmin/set-hostname-linux
I've found these https://crates.io/crates/uu_hostname https://crates.io/crates/hostname but![image](https://github.com/suse-edge/nm-configurator/assets/346758/994032b3-9ca2-4d4b-9199-3fd5813849e4)