[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-API] [PATCH] add pool join and eject hooks executing /etc/xapi.d/pool-{join, eject}/*

Hi Ian,

> I placed the hooks at the end of each action. I didn't go as far as
> {pre,post}x{join,eject} but could do if that is desirable.

Perhaps we should name the hooks pool_post_{join,eject} just to leave space for 
adding the "pre" ones later?

> diff -r e0955609cb2f -r 3198ac4809a2 ocaml/xapi/xapi_pool.ml
> --- a/ocaml/xapi/xapi_pool.ml Tue May 04 17:54:35 2010 +0100
> +++ b/ocaml/xapi/xapi_pool.ml Tue May 04 18:26:04 2010 +0100
> @@ -686,7 +686,8 @@
>                               Xapi_globs.remote_db_conf_fragment_path
>                               (Xapi_globs.remote_db_conf_fragment_path ^
> ".bak")) ()
>               )
> -             (fun () -> Xapi_fuse.light_fuse_and_reboot_after_eject())
> +             (fun () -> Xapi_fuse.light_fuse_and_reboot_after_eject());
> +             Xapi_hooks.pool_eject_hook ~__context

I think we should run the pool_eject_hook as the last thing before the finally 
(fun () -> light_fuse_and_reboot_after_eject()) since the light_fuse_* 
functions start an async background thread with a timer in it. We run the risk 
of the script hook not quite completing in time before the host reboots.

It's also worth double-checking that a script containing CLI commands actually 
works when run at this point -- this is well after a bunch of important files 
are deleted, such as the pool secret. If this doesn't work then I recommend 
switching over to pool_post_join and pool_pre_eject :-)


xen-api mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.