[Users] adding scripts

Vojtech Szocs vszocs at redhat.com
Fri Mar 21 11:35:57 EDT 2014



----- Original Message -----
> From: "Alexander Wels" <awels at redhat.com>
> To: "R P Herrold" <herrold at owlriver.com>
> Cc: "aditya mamidwar" <aditya.mamidwar at gmail.com>, "oVirt Users ML" <users at ovirt.org>
> Sent: Friday, March 21, 2014 3:58:20 PM
> Subject: Re: [Users] adding scripts
> 
> On Friday, March 21, 2014 10:43:27 AM R P Herrold wrote:
> > the threading is not clear to me, and I hope I have the
> > attributions correct
> > 
> > On Fri, 21 Mar 2014, Greg Sheremeta wrote:
> > >> From: "aditya mamidwar" <aditya.mamidwar at gmail.com>
> > >> 
> > >> To: awels at redhat.com, engine-devel at ovirt.org, users at ovirt.org
> > >> Sent: Friday, March 21, 2014 6:14:01 AM
> > >> Subject: Re: [Users] [Engine-devel] adding scripts
> > >> 
> > >> am thus facing following difficulties:
> > >> 
> > >> 1 : i wrote the required code using in bash scripting,
> > >> which i wish to invoke after a click of button in the
> > >> ovirt-portal. (which does not seem to be possible). can you
> > >> help on that? which programming language should i use, and
> > >> how that file should be invoked.
> > 
> > [I think Greg said:]
> > 
> > > This needs to be done in Java. You'll need to read up on
> > > oVirt's UI Plugin infrastructure, which Einav and others
> > > mentioned below. No, you cannot write a bash script and have
> > > a button click in oVirt invoke that.
> > 
> > Reading this:
> > 	http://www.ovirt.org/VDSM-Hooks
> > it states as a pull quote:
> > 
> > 	The hooks reside on every host in
> > 	/usr/libexec/vdsm/hooks/ A hook can be any executable
> > 	(bash/python/perl/binary/etc).
> > 
> > and then at:
> > 	http://www.ovirt.org/Features/UIPlugins
> > 
> > 	UI plugins integrate with WebAdmin directly on the
> > 	client (web browser) using JavaScript programming language.
> > 	Plugin invocation is driven by WebAdmin and happens right
> > 	within the context of browser's JavaScript runtime, using
> > 	JavaScript language as the lowest common denominator between
> > 	WebAdmin (GWT) and individual plugins. UI plugins can take
> > 	full advantage of JavaScript language and its rich ecosystem
> > 	of libraries. There are no specific rules on how to implement
> > 	UI plugins, plugin API is designed to be simple and not to get
> > 	in developer's way, regardless of how a developer chooses to
> > 	write the plugin
> > 
> > ============
> > 
> > I thought I understood the model, but have gotten confused.
> > Iam left with two questions:
> > 
> > 1. is the plugin to be Java or JavaScript? (I think the answer
> > is the latter)
> > 
> 
> Javascript. But remember the UI plugins are running javascript in your
> browser, and don't directly communicate with VDSM.

Yes, this is an important point. Typically, you invoke operations on hosts through Engine's REST API.

As Alex mentioned below, you can also install custom VDSM hooks, these are invoked at certain points of VM lifecycle: http://www.ovirt.org/VDSM-Hooks

> 
> > 2. is there a constraint as to implementation language, or
> > not. I think a JS wrapper can call whatever it wishes, but
> > this is not clear to me
> > 
> > Thank you
> > 
> > -- Russ herrold
> 
> Note the VDSM hooks have nothing to do with the UI plugins. The VDSM hooks
> alter the way VDSM works. The UI plugins alter the way the UI works. The
> engine sits in between the UI and VDSM. Basically the UI issues a command to
> the engine, then the engine issues a command to VDSM.
> 
> For UI plugins it is easiest to communicate with the engine using the REST
> api. So your instance your UI plugin has a button, which when you click it
> issues a REST api call. The REST api call is part of the engine. The engine
> creates a command based on the URL and parameters of the REST call and uses
> that command to make a call to VDSM. Once the call reaches VDSM then the VDSM
> hooks come into play.
> 
> So I don't entirely understand what you are trying to do, but you might have
> to write some code in the engine to create the appropriate command to pass to
> VDSM. In addition to the UI plugin and the VDSM hook.
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 


More information about the Users mailing list