Ref: https://github.com/harvester/harvester/issues/2342
Verify Steps:
- Install Harvester with any nodes
- Create Image for VM creation
- Create VM with following CloudConfig
## template: jinja
#cloud-config
package_update: true
password: password
chpasswd: { expire: False }
sshpwauth: True
write_files:
- content: |
#!/bin/bash
vmName=$1
echo "VM Name is: $vmName" > /home/cloudinitscript.log
path: /home/exec_initscript.sh
permissions: '0755'
runcmd:
- - systemctl
- enable
- --now
- qemu-guest-agent.service
- - echo
- "{{ ds.meta_data.local_hostname }}"
- - /home/exec_initscript.sh
- "{{ ds.meta_data.local_hostname }}"
packages:
- qemu-guest-agent
- login to the VM
- file
/home/exec_initscript.sh
should exists - file
/home/cloudinitscript.log
should exists - execute
cat /home/cloudinitscript.log
, VM name should be the same as the VM.
- file