[one-users] Avoiding manual restart of (peristent) VMs in case of host reboot

Olivier Berger olivier.berger at it-sudparis.eu
Wed May 23 08:03:44 PDT 2012


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)




More information about the Users mailing list