Hi!
I've recently started playing around with cloud-init, and I've gotten so far as to having a complete template that has my ssh keys preconfigured & rsyslog to my central logging server. But I can't seem to find a way to change the host name of the VM created by cloning the template in the web UI.
My user data snippet (/var/lib/vz/snippets/debian-base.yaml):
When I dump the user data of the template however:
And then the config of the template:
This results in the hostname being "localhost". I would hope that there would be some sort of hostname field in the cloud-init page of the cloned VM?
Any help is appreciated
I've recently started playing around with cloud-init, and I've gotten so far as to having a complete template that has my ssh keys preconfigured & rsyslog to my central logging server. But I can't seem to find a way to change the host name of the VM created by cloning the template in the web UI.
My user data snippet (/var/lib/vz/snippets/debian-base.yaml):
YAML:
#cloud-config
timezone: Europe/Stockholm
locale: en_GB.UTF-8
users:
- name: test
groups: sudo
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
... and more
When I dump the user data of the template however:
YAML:
#cloud-config
hostname: debian-template
manage_etc_hosts: true
fqdn: debian-template
user: test
chpasswd:
expire: False
users:
- default
package_upgrade: true
And then the config of the template:
Code:
agent: enabled=1
boot: c
bootdisk: scsi0
cicustom: user=local:snippets/debian-base.yaml
ciuser: test
cores: 2
cpu: host
ide2: local-lvm:vm-1000-cloudinit,media=cdrom
ipconfig0: ip=dhcp
memory: 2048
meta: creation-qemu=10.1.2,ctime=1772781924
name: debian-template
net0: virtio=BC:24:11:01:0C:B9,bridge=vmbr0
ostype: l26
scsi0: local-lvm:base-1000-disk-0,size=3G
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=c780d650-e16a-4c85-9b80-f603ebd14133
template: 1
vga: serial0
vmgenid: c9cd4d96-439d-4d93-ad61-d428ee5c96a1
This results in the hostname being "localhost". I would hope that there would be some sort of hostname field in the cloud-init page of the cloned VM?
Any help is appreciated