I have a Terraform script that is cloning a RedHat 8 VM on vSphere V7.
The VM is successfully cloned, but the user in my userdata is not created when the VM starts. If I reboot the VM after it is cloned, the user specified in the userdata is then created successfully.
I am not sure if this is a problem or feature of cloud-init and RedHat 8, or if there is something I need to do with the VM I am cloning from.
I have tried to clone from a VM and a Template, but I get the same problem with both. I have also run the following on the VM that is being cloned.
cloud-init clean --logs
cloud-init clean --seed
rm -rf /var/lib/cloud
But my users are still not created until the VM is rebooted.