<div>Hello Olivier</div><div><br></div>You're right.<div><br><div>Try this deploy script. It works for me: <a href="https://gist.github.com/2776202" target="_blank">https://gist.github.com/2776202</a></div>
<div><br></div><div>You'll also need to tweak the shutdown and cancel scripts to 'undefine' the domain after successfully shutting down the VM</div><div><br></div><div>Cheers,<br>Jaime<br><br><div class="gmail_quote">


On Wed, May 23, 2012 at 5:03 PM, Olivier Berger <span dir="ltr"><<a href="mailto:olivier.berger@it-sudparis.eu" target="_blank">olivier.berger@it-sudparis.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi.<br>
<div><br>
On Wed, 23 May 2012 16:09:20 +0200, Jaime Melis <<a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>> wrote:<br>
><br>
> You could do two things:<br>
> 1) Write a hook [1] on the event of running vm to do "virsh autostart<br>
> one-<VM_ID>" [2]<br>
> 2) Add a line in the deployment script [3] to execute "virsh autostart<br>
> one-<VM_ID>" ( after line 29 of the script for example)<br>
><br>
> [1] <a href="http://libvirt.org/sources/virshcmdref/html/sect-autostart.html" target="_blank">http://libvirt.org/sources/virshcmdref/html/sect-autostart.html</a><br>
> [2]<br>
> <a href="http://opennebula.org/documentation:rel3.4:hooks#hooks_for_virtualmachines" target="_blank">http://opennebula.org/documentation:rel3.4:hooks#hooks_for_virtualmachines</a><br>
> [3]<br>
> <a href="https://github.com/OpenNebula/one/blob/one-3.2/src/vmm_mad/remotes/kvm/deploy#L29" target="_blank">https://github.com/OpenNebula/one/blob/one-3.2/src/vmm_mad/remotes/kvm/deploy#L29</a><br>
><br>
<br>
</div>Hmmm... I've tried this, but :<br>
<br>
# virsh autostart one-42<br>
error: Failed to mark domain one-42 as autostarted<br>
error: Requested operation is not valid: cannot set autostart for transient domain<br>
<br>
Maybe the result would be different if run from the hook / script, but<br>
I'm not sure...<br>
<br>
>From reading <a href="http://remoteoutpost.nl/?page_id=71" target="_blank">http://remoteoutpost.nl/?page_id=71</a> I've understood that<br>
the virsh define command was needed, so I've tried adding that deployment<br>
script (which I believe is /var/lib/one/remotes/vmm/kvm/deploy), doing :<br>
<br>
 virsh --connect $LIBVIRT_URI define $domain<br>
<br>
just before the :<br>
<br>
 data=`virsh --connect $LIBVIRT_URI create $domain`<br>
<br>
However, it doesn't seem to be executed :-/<br>
<br>
Also, I've looked at the hooks, but I'm not sure there's a possible hook<br>
for doing this needed virsh define just before the creation, as the "on<br>
CREATE" would be too late, apparently.<br>
<br>
Would you be so kind to try and investigate this and suggest something ?<br>
<br>
Thanks in advance.<br>
<br>
Best regards,<br>
<div><div>--<br>
Olivier BERGER<br>
<a href="http://www-public.it-sudparis.eu/~berger_o/" target="_blank">http://www-public.it-sudparis.eu/~berger_o/</a> - OpenPGP-Id: 2048R/5819D7E8<br>
Ingenieur Recherche - Dept INF<br>
Institut Mines-Telecom, Telecom SudParis, Evry (France)<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jaime Melis<br>Project Engineer<br>OpenNebula - The Open Source Toolkit for Cloud Computing<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a><br>



</div>
</div>