I am using OpenNebula 4.8 and have a lot of templates that are the same
except for the image that they launch and the IP address on which they run.
Obviously I can do a onetemplate clone and then use onetemplate update with vi as
my editor to make the changes by hand. But I am trying to find a way to script it.
In OpenNebula 3.2 you could "onetemplate show > /tmp/template"
and then use sed to make the changes. That doesn’t quite work in open nebula 4.8
because you have to add some stuff from the headers back into the template
(the NAME) to make it a legal template again.
Is there a way from the command line to set the EDITOR variable to some script
with arguments and then use onetemplate update to pipe to that script?
Thanks for the ideas. I am aware of the --append option, I have tried it and it works but I have not used it because I then don’t have any persistent record of how I started each virtual machine… it is easier to have a fully formed template for each VM that other staff can then use to help relaunch it later if necessary.
It is good to know the sed trick works… I was hoping for something like that.
Thank you for all your responses.