WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

RE: [Xen-API] [PATCH] add pool join and eject hooks executing /etc/xapi.

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-API] [PATCH] add pool join and eject hooks executing /etc/xapi.d/pool-{join, eject}/*
From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Date: Wed, 5 May 2010 16:23:41 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Delivery-date: Wed, 05 May 2010 08:26:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <3198ac4809a2170a27e5.1272993996@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <3198ac4809a2170a27e5.1272993996@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrrrviERdtk6PUhSsGZdBw35i3piAAtz1sQ
Thread-topic: [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 :-)

Cheers,
Dave

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>