I don't understand the meaning of your question but I know that cloud-init was integrated in the pve since the beginning we use whmcs modul to fill the cloud init directory
Proxmox implements a reduced set of Cloud-Init internally:
https://pve.proxmox.com/pve-docs/qm.1.html#:~:text=Cloud-Init specific Options
You also have an option to use "cicustom" where you can supply a full blown cloud-init file of any supported format.
I dont know what whmcs does, it could be a conditional mixture of both.
I ran a quick test for you using "CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2".
Using integrated cloudinit:
Name set to "vm3000" results in hostname not set properly. You can examine /etc/hosts and notice that vm3000 is there, but not in /etc/hostname
Code:
qm config 3000
cipassword: **********
ciuser: centos
ipconfig0: ip=dhcp
name: vm3000
scsi0: bb-nvme:vm-3000-disk-0,size=10G
scsi1: bb-nvme:vm-3000-cloudinit,media=cdrom
more /etc/hostname
127.0.0.1 localhost vm3000
Setting the name to FQDN results in a more expected config:
Code:
qm config 3000
cipassword: **********
ciuser: centos
ipconfig0: ip=dhcp
name: vm3000.blockbridge.com
scsi0: bb-nvme:vm-3000-disk-0,size=10G
scsi1: bb-nvme:vm-3000-cloudinit,media=cdrom
more /etc/hostname
127.0.0.1 vm3000.blockbridge.com vm3000
However, when using cicustom:
Code:
cicustom: meta=nfs:snippets/cirros.meta.3000,user=nfs:snippets/centos.user
There is no need for FQDN in hostname.
Code:
root@vm3000 centos]# mkdir /mnt/1
[root@vm3000 centos]# mount /dev/sr0 /mnt/1
mount: /mnt/1: WARNING: device write-protected, mounted read-only.
[root@vm3000 centos]# cd /mnt/1
[root@vm3000 1]# ls -al
total 5
drwxr-xr-x. 2 root root 2048 May 15 09:49 .
drwxr-xr-x. 3 root root 15 May 15 09:49 ..
-rw-r--r--. 1 root root 54 May 15 09:49 meta-data
-rw-r--r--. 1 root root 111 May 15 09:49 network-config
-rw-r--r--. 1 root root 1728 May 15 09:49 user-data
-rw-r--r--. 1 root root 0 May 15 09:49 vendor-data
[root@vm3000 1]# more meta-data
{
"instance-id": "3000",
"local-hostname": "vm3000"
}
root@pve7demo1:~# qm config 3000
cicustom: meta=nfs:snippets/cirros.meta.3000,user=nfs:snippets/centos.user
name: vm3000
scsi0: bb-nvme:vm-3000-disk-0,size=10G
scsi1: bb-nvme:vm-3000-cloudinit,media=cdrom
Notice that my custom userdata contained wrong hostname:
Code:
more user-data
#cloud-config
chpasswd:
expire: false
hostname: vm2000
manage_etc_hosts: true
Looking at cloudinit log you can see where hostname is being changed from vm2000, to 3000 (similar messages are present for localhost in non-custom case):
Code:
grep 2000 /var/log/cloud-init*
/var/log/cloud-init.log:2023-05-15 13:49:21,939 - cc_set_hostname.py[DEBUG]: Setting the hostname to vm3000 (vm2000)
/var/log/cloud-init.log:2023-05-15 13:49:21,951 - cc_update_hostname.py[DEBUG]: Updating hostname to vm3000 (vm2000)
At high level the conclusion I make - modern cloud images prefer hostname set in metadata, which is consistent with most major cloud providers using metadata servers, rather than ISO based cloud-init.
Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox