Rancher ssh key not reflecting in Ubuntu 20.04 vmware template

Hello there,

We’re trying to provision a k8s cluster in rancher using Vmware with ubuntu20.04,
During the creation of cluster the provisioning fails with ssh error
# Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded

The installation user is docker.

For troubleshooting, we 've mounted the default rancher cloud-config file at /dev/sr0 in /mnt and copied over the generated ssh key to the home directory of the docker user
When this is done, cluster provisioning will go through. The ssh key generation and copying is not performed at the first place.

Also checked the cloudinit file at /var/lib/cloud, cleared the cloud folder prior to converting the vm to template as per rancher documentation.
Still whilst provisioning the cluster ,new rancher cloudconfig is not been applied to the machine, which is causing the ssh issue.
The old cloud-init configuration is again present in /var/lib/cloud instead of the rancher cloud config.

My guess, the issue is related to cloud-init config, can anyone kindly suggest a workaround to fix the issue so that cluster provisioning is performed without manual intervention.

Thanks in advance