I want a software inside my Virtual Machine(VM) to be installed before the user starts using the VM. One way could be running start scripts, but what if I can provide a snapshot with the softwares installed, as a VM template for a new VM. Can we do this with opennebula VM templates?
I believe it’s possible to use a snapshot of the VM, but you may need to uncontextualized the image before (e.g. remove unwanted SSH access keys). There are 2 ways how to achieve it:
Use can go via general admin/user view, snapshot the particular disk and export it into a brand new image https://docs.opennebula.org/5.4/operation/vm_management/vm_instances.html#exporting-disk-images-with-disk-saveas. Then, you have to create a suitable template, and share both template and image to the user.
Use can switch to the cloud view, there is the functionality to save the instance state as a new template-image pair. See here
https://docs.opennebula.org/5.4/operation/sunstone_enduser/cloud_view.html#make-the-vm-changes-persistent, for the general reusable template you’ll most likely want to have it non-persistent. Then, share the template+image to the user.