-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FeatureRequest] Cloud-Init support #36
Comments
mkisofs example (this will require mkisofs to be in path): Will need a go library to create iso if we want to do it natively: Example implementation: |
Might also be able to achieve this by starting a web server and serving the contents like Packer. See: |
Hello @taliesins, Is there any chance to get this implemented sooner? Would tipping/sponsoring you help? Happy to do so, I could really use the cloud-init support on Hyper-V for a personal project |
Any news on this? |
After some reserach is seems a lot of people opt to pass the cloud-init files through DVD to hyper-v VMs, i am not too familar with cloud-init but i am unsure if it would work through the http method that packer employs as the configuration happens at a boot level before any networking is active you should be able to provide a list of files from the cloud-init provider to a user-data field under vm-instance and have it generate into an iso and mount to the VM on startup maybe also a toggle if you want this to happen only on first creation or every time an update happens. if i get some time i will try look into this but my go skills are a bit rusty. |
So I had some free time and proved a bit of a PoC I am currently looking into a packer - ansible - terraform - cloud-init setup for hyper-v I've created a small tool with Go to convert a folder of files into an ISO, I believe the provider could benefit from this as we could read a folder from the My process is the following:
The next step is just to add the conversion and mount the iso to the VM into the provider as this would allow you to use the cloud-init providers to incorporate templating so the process would be
You need cloud-init installed in the base image obviously but most OS images have a generic cloud image you can use. |
Hey guys I had some free time over the holidays. Hopefully #235 will enable an avenue for running cloud-init |
I started some work on this myself but my knowledge of go and Terraform modules is limited. it will be interesting to compare the results with my hacky code 👍 |
I make a terraform module to perform an cloud-init required format ISO, the main process is use some example |
@fsdrw08 you have an impressive repo there :>. Do you take requests, I would like to put together a few good demos for the most common use cases. Ubuntu, Windows with cloud init and perhaps a static ip and running maybe Ansible against it (so bootstrapping). The newly added functionality should hopefully get rid of the need for null resource provider:
The most difficult part for me to wrap my head around was the update logic (would not mind anyone else having a look at this): |
Here is an example which might meet your request, https://github.com/fsdrw08/SoloLab/blob/main/TerraformWorkShop/Hyper-V/VM-InfraSvc-CentOS/main.tf What I need is convert the cloud-init module to the hyperv_iso_image resource |
It would be greet bo be able to use cloud-init to automate many stuff inside created vm
Affected Resource(s)
hyperv_machine_instance
Expected Behavior
cloud-init/test.yml:
Actual Behavior
What actually happened?
The text was updated successfully, but these errors were encountered: