[ 
https://issues.apache.org/jira/browse/VCL-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15625662#comment-15625662
 ] 

Andy Kurth commented on VCL-1000:
---------------------------------

I wrote most of the code for this and currently only have hooks for pre_capture 
and post_capture.  This scripts are only executed if the variable table 
contains a _enable\_experimental\_features_ entry whose value is true.

Some things need to be decided before this can be fully implemented.  First, 
the location of the script files.  There is a class variable in OS.pm named 
$MN_STAGE_SCRIPTS_DIRECTORY that determines this.  It is currently set to 
*/usr/local/vcl/tools/mn_stage_scripts*.  I'm not sure if I like this location 
very much.

We have a large number of directories for each OS under tools.  Under each 
there is a *Scripts* subdirectory.  This is where scripts may be stored which 
get executed on the computers at the various stages.  It's necessary to have a 
lot of control over which scripts run for each OS when they are run on the 
loaded computers.  It isn't much of an issue for scripts that run on the 
managment node.

We could either use the tools/<OS>/Scripts structure for scripts that get 
executed on the management node or use an entirely different location.

If we use the same location for both, we'll need to figure out how to 
differentiate scripts intended to be run on computers vs. run on the management 
node.  I don't want to have to add additional directories under each OS for 
each stage.  There are already dozens of them.

We could define a naming convention for the scripts such as anything beginning 
with *mn_* runs on the management node, everything else on the computer.

> Run custom scripts at various stages on the management node
> -----------------------------------------------------------
>
>                 Key: VCL-1000
>                 URL: https://issues.apache.org/jira/browse/VCL-1000
>             Project: VCL
>          Issue Type: New Feature
>          Components: vcld (backend)
>            Reporter: Andy Kurth
>            Assignee: Andy Kurth
>
> There are cases where it would be useful to be able to have scripts executed 
> on the management at various stages of reservations.  For example, a script 
> could be executed to configure an external firewall or provision storage when 
> a computer is reserved. Whatever was configured specifically for the 
> reservation could be reverted when the reservation ends by another script.
> We already have this functionality for scripts that get executed on the 
> computer ([VCL-564|https://issues.apache.org/jira/browse/VCL-564]). However, 
> there are situations where you would need to perform actions from the 
> management node.
> The script would need access to information about the reservation. Since it 
> resides and is executed on the management node, the script could call mysql 
> to query the database. This isn't the safest way of handling things.
> Another option could be to create a text file on the management node prior to 
> executing the script(s). The script could parse the text file to extract the 
> information it requires.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to