<div dir="ltr">Hi,<div><br></div><div style>I think this can be easily done with a hook [1]. You will need to trigger it each time a new VM is created:</div><div style><br></div><div style><font face="courier new, monospace">VM_HOOK = [<br>
name = "default_chmod",<br> on = "CREATE",<br> command = "default_chmod.rb",<br> arguments = "$ID $TEMPLATE" ]</font></div><div style><br></div><div style>
And then create a small script (default_chmod.rb) that looks for the default uid and gid inside the vm template (second argument, it will be the xml base64 enconded); and executes 'onevm chmod'.<br></div><div style>
<br></div><div style><br></div><div style>Let me know if this works for you.</div><div style><br></div><div style>Regards</div><div style><br></div><div style>[1] <a href="http://opennebula.org/documentation:rel3.8:hooks">http://opennebula.org/documentation:rel3.8:hooks</a><br>
</div></div><div class="gmail_extra"><br clear="all"><div>--<br>Carlos Martín, MSc<br>Project Engineer<br>OpenNebula - The Open-source Solution for Data Center Virtualization<div><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a href="http://twitter.com/opennebula" target="_blank">@OpenNebula</a></span><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></span></div>
</div>
<br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 4:40 PM, Gary S. Cuozzo <span dir="ltr"><<a href="mailto:gary@isgsoftware.net" target="_blank">gary@isgsoftware.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif">Hello all,<br>Is there a way to have a VM user/group ownership (and potentially ACL's) be set based on values in the template?<br><br>Here is my use case:<br>
Currently, all of our VM's are one of a kind. Each VM is based on a unique template and uses persistent images. It is the virtual equivalent of colocated servers where each customer has their own dedicated and customized servers. We basically manage the images & templates, but want to give users access to their vm for start/stop/vnc.<br>
<br>What I have right now is I create a user/group for each customer. The I set the ownership of the resources to be their user & group. When we instantiate the VM, we have to remember to set the ownership accordingly or it will not show up as a resource when they login to sunstone.<br>
<br>It would be ideal if there was a way to specify, in the template, the default user and group which should own the VM and the ACL's. It would also be nice if the default name of the VM could be set (Though I think there may already be a feature being added for this). This way, if we had to stop & recreate the VM instance (such as for adding more resources), we could do it without having to remember to set permissions manually.<br>
<br>Let me know what you think.<br><br>Cheers,<br>gary<br><br></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br></div>