- I have a Ubuntu 20.04 LTS Installation on Nutanix AOS which serves as a template
- This Ubuntu Tempate installation is a basic Ubuntu installation (clicked through basic installation, cloud-init installed)
- Now i want users to be able to deploy a new VM as a clone from this Ubuntu template and passing via “Custom Script” option the cloud-init script in Prism GUI
Unfortunatly this does not work - the “Custom Script” cloud-init instructions are not applied during creation of the clone.
Do i possibly have to modify something inside the Ubuntu Template installation (ex. cloud-init datasource or similiar, /etc/cloud/cloud.cfg or whatever)?
Doesnt matter where i look the existing documentation (cloud-init, nutanix, ubuntu) etc. seems to be rather incomplete.
I had a working example in the past with Centos 7 deplyoment with Nutanix,cloud-init and deploying via Custom Script option in Prism element - but i cant get it running with Ubuntu
I’m aware of this article https://portal.nutanix.com/page/documents/kbs/details?targetId=kA00e000000CshJCAS - but this is not what i need - i dont want to give users who create vms access to acli - they shall work only via Prism Element GUI in my environment hence i have to do it with the clone process of a Ubuntu template as described above.
Best answer by BGS
Ok, i got it - it was a pain in the ass and i’m far away from having it finished for production but the part with Nutanix (Custom Script invokation in Clone Dialog) is solved.
Steps that are necessary for Ubuntu 20.04 LTS (*if* you have a Ubuntu 20.04 Basic Installation which you have set up normally as a Guest and which you want to use as a Source for Clones and adjustement via cloud-init) :
- apt purge cloud-init (clean up Template Installation from existing cloud-init)
- rm -rf /etc/cloud (clean up Template Installation from existing cloud-init)
- rm -rf /run/cloud-init (clean up Template Installation from existing cloud-init)
- apt install cloud-init (install cloud-init newly)
- dpkg-reconfigure cloud-init (select ConfigDrive, None as Options)
- systemctl enable cloud-init.service
- shutdown Template VM (and use it as Source VM for Clone in Prism)
- Clone the template VM via “Custom Script” option and pass your cloud-init user-data stuff