[one-users] I define a hook, want the host to restart the VM will automatically start after , but has not been successful.

clm_tuan at hotmail.com clm_tuan at hotmail.com
Tue Dec 16 18:13:57 PST 2014


Thanks,now it's work.

before reboot:

Wed Dec 17 09:49:32 2014 [Z0][DiM][I]: New VM state is ACTIVE. 
Wed Dec 17 09:49:32 2014 [Z0][LCM][I]: New VM state is BOOT_POWEROFF 
Wed Dec 17 09:49:32 2014 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/1/deployment.1 
Wed Dec 17 09:49:33 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 09:49:33 2014 [Z0][VMM][I]: Successfully execute network driver operation: pre. 
Wed Dec 17 09:49:33 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 09:49:33 2014 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy. 
Wed Dec 17 09:49:33 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 09:49:33 2014 [Z0][VMM][I]: Successfully execute network driver operation: post. 
Wed Dec 17 09:49:33 2014 [Z0][LCM][I]: New VM state is RUNNING

reboot host:

Wed Dec 17 09:51:33 2014 [Z0][DiM][I]: New VM state is POWEROFF 
Wed Dec 17 09:51:33 2014 [Z0][DiM][I]: New VM state is ACTIVE. 
Wed Dec 17 09:51:33 2014 [Z0][LCM][I]: New VM state is BOOT_POWEROFF 
Wed Dec 17 09:51:33 2014 [Z0][HKM][I]: Success executing Hook: autostart_hook: . 
Wed Dec 17 09:51:33 2014 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/1/deployment.2 
Wed Dec 17 09:51:34 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 09:51:34 2014 [Z0][VMM][I]: Successfully execute network driver operation: pre. 
Wed Dec 17 09:51:34 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 09:51:34 2014 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy. 
Wed Dec 17 09:51:34 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 09:51:34 2014 [Z0][VMM][I]: Successfully execute network driver operation: post. 
Wed Dec 17 09:51:34 2014 [Z0][LCM][I]: New VM state is RUNNING

once again reboot host:

Wed Dec 17 10:01:34 2014 [Z0][DiM][I]: New VM state is POWEROFF 
Wed Dec 17 10:01:34 2014 [Z0][DiM][I]: New VM state is ACTIVE. 
Wed Dec 17 10:01:34 2014 [Z0][HKM][I]: Success executing Hook: autostart_hook: . 
Wed Dec 17 10:01:34 2014 [Z0][LCM][I]: New VM state is BOOT_POWEROFF 
Wed Dec 17 10:01:34 2014 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/1/deployment.3 
Wed Dec 17 10:01:35 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 10:01:35 2014 [Z0][VMM][I]: Successfully execute network driver operation: pre. 
Wed Dec 17 10:01:35 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 10:01:35 2014 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy. 
Wed Dec 17 10:01:35 2014 [Z0][VMM][I]: ExitCode: 0 
Wed Dec 17 10:01:35 2014 [Z0][VMM][I]: Successfully execute network driver operation: post. 
Wed Dec 17 10:01:35 2014 [Z0][LCM][I]: New VM state is RUNNING



clm_tuan at hotmail.com
 
From: Carlos Martín Sánchez
Date: 2014-12-16 17:48
To: clm_tuan at hotmail.com
CC: users
Subject: Re: [one-users] I define a hook, want the host to restart the VM will automatically start after , but has not been successful.
Hi,

On Mon, Dec 15, 2014 at 4:18 AM, clm_tuan at hotmail.com <clm_tuan at hotmail.com> wrote:
Hi All

I define a hook, want the host to restart the VM will automatically start after,but has not been successful.

 VM_HOOK = [ 
    name = "autostart_hook", 
    on = "CUSTOM", 
    state = "POWEROFF", 
    lcm_state = "LCM_INIT", 
    command = "/usr/bin/env onevm resume", 
    arguments = "$ID" ]

Do you have any good suggestions, thank you.

The hook definition looks good. Did you restart opennebula after editing oned.conf?

You can look for any errors in the hook execution in the individual VM log, in /var/log/one/<id>.log

Regards.

--
Carlos Martín, MSc
Project Engineer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | cmartin at opennebula.org | @OpenNebula
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20141217/72467017/attachment-0001.htm>


More information about the Users mailing list