I am wanting to setup some VMs for CI builds. At this point I have a "generic" VM for both Ubuntu and Windows setup and ready to go. We use Azure and an Azure Agent to look for PRs and Merges on our GitHub repositories. Each VM needs to register its own unique Azure Agent. This is easy enough by running a few scripts inside of the VM to set things like host name, agent name and get the agent fired up and looking for a build. At the end of the build I need the VM to shutdown (not reboot), any changes to the VM disk are discarded, and then the VM should actually restart itself. My plan on this node was to create a VM (100) and then convert that to a template (101). Now create several clones from the templates (say these are VMs 102 and 103) where those VMs get the needed customizations. At this point I should hand edit the vm conf file for 102 and 103 to add the "args: -snapshot". Inside the VM, the Azure agent script uses the "--once" flag to start which allows the agent to do a single build and then the agent exits at which point you can do "shutdown -h now". The VM turns itself off and all those changes go away.
Great. How do I get the VM to turn itself back on? Is that done with, oddly, a Shutdown hook?
Another question. How do I actually "Update" the VM 101 with new OS updates and such? Seems like I have to convert it back to a full clone, do the update, then make a template back out of it? But I feel like VMs 102 and 103 will not lose their connection to the original VM disk?
Do I just skip the template part and manage this some other way?
I also would like to do this same thing, but on the 5 other Proxmox servers that I have going?
If a kind soul could point me in the right direction that would be fantastic. Yes, YouTube is also my friend for some of this but not finding anything specific to my needs.
Great. How do I get the VM to turn itself back on? Is that done with, oddly, a Shutdown hook?
Another question. How do I actually "Update" the VM 101 with new OS updates and such? Seems like I have to convert it back to a full clone, do the update, then make a template back out of it? But I feel like VMs 102 and 103 will not lose their connection to the original VM disk?
Do I just skip the template part and manage this some other way?
I also would like to do this same thing, but on the 5 other Proxmox servers that I have going?
If a kind soul could point me in the right direction that would be fantastic. Yes, YouTube is also my friend for some of this but not finding anything specific to my needs.