[one-users] Avoiding manual restart of (peristent) VMs in case of host reboot
Jaime Melis
jmelis at opennebula.org
Wed May 23 09:26:52 PDT 2012
Hello Olivier
You're right.
Try this deploy script. It works for me: https://gist.github.com/2776202
You'll also need to tweak the shutdown and cancel scripts to 'undefine' the
domain after successfully shutting down the VM
Cheers,
Jaime
On Wed, May 23, 2012 at 5:03 PM, Olivier Berger <
olivier.berger at it-sudparis.eu> wrote:
> Hi.
>
> On Wed, 23 May 2012 16:09:20 +0200, Jaime Melis <jmelis at opennebula.org>
> wrote:
> >
> > You could do two things:
> > 1) Write a hook [1] on the event of running vm to do "virsh autostart
> > one-<VM_ID>" [2]
> > 2) Add a line in the deployment script [3] to execute "virsh autostart
> > one-<VM_ID>" ( after line 29 of the script for example)
> >
> > [1] http://libvirt.org/sources/virshcmdref/html/sect-autostart.html
> > [2]
> >
> http://opennebula.org/documentation:rel3.4:hooks#hooks_for_virtualmachines
> > [3]
> >
> https://github.com/OpenNebula/one/blob/one-3.2/src/vmm_mad/remotes/kvm/deploy#L29
> >
>
> Hmmm... I've tried this, but :
>
> # virsh autostart one-42
> error: Failed to mark domain one-42 as autostarted
> error: Requested operation is not valid: cannot set autostart for
> transient domain
>
> Maybe the result would be different if run from the hook / script, but
> I'm not sure...
>
> From reading http://remoteoutpost.nl/?page_id=71 I've understood that
> the virsh define command was needed, so I've tried adding that deployment
> script (which I believe is /var/lib/one/remotes/vmm/kvm/deploy), doing :
>
> virsh --connect $LIBVIRT_URI define $domain
>
> just before the :
>
> data=`virsh --connect $LIBVIRT_URI create $domain`
>
> However, it doesn't seem to be executed :-/
>
> Also, I've looked at the hooks, but I'm not sure there's a possible hook
> for doing this needed virsh define just before the creation, as the "on
> CREATE" would be too late, apparently.
>
> Would you be so kind to try and investigate this and suggest something ?
>
> Thanks in advance.
>
> Best regards,
> --
> Olivier BERGER
> http://www-public.it-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8
> Ingenieur Recherche - Dept INF
> Institut Mines-Telecom, Telecom SudParis, Evry (France)
>
>
--
Jaime Melis
Project Engineer
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org | jmelis at opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120523/8d7bceaf/attachment-0002.htm>
More information about the Users
mailing list