Site Contents
Page Contents
Usher Keyword Argument Filter Plugin
This plugin filters keyword arguments to a VM request. For example, there are often many options supported by a VMM on VM start which cannot all be included in Usher. Likewise, many plugins check for keyword arguments sent along with VM operation requests. This filter allows an Usher administrator to specify which optional (kw) arguments users are allowed to specify.
Filters for all VM requests can be created. Currently, it's an all or nothing for everyone (excluding the 'usher' user). In other words, filters cannot be setup for specific users.
Requirements
- None
Download
- kwargfil (latest nightly snapshot)
- plugin archives
- Mercurial Repository
Installation
Download the kwargfil package onto the machine running your Usher controller and run:
$ tar xvzf kwargfil-latest.tgz $ cd kwargfil-revXXX
Copy the kwargfil.py file found there to your Usher installations 'plugins' directory or another directory specified by the controller's configuration file 'plugin_dir' variable.
Configuration and Registration
Valid options along with their default values are listed below.
- accept: Comma separated list of options accepted for VM operation request
- drop: Comma separated list of options dropped for VM operation request
If an accept list is given for an event, all else is dropped (so no need for a drop list). If only a deny list is given, all else is accepted. If nothing given, all options are accepted.
Note, the controller actually accepts the kw arguments 'ram' and 'ip_addrs' to start requests. Though these are, strictly speaking, VM parameters, they're considered important enough that the controller checks for them. This plugin ignores these options since they can be controlled by the controller's configuration options.
In addition, some controller configuration file options actually get passed as keyword arguments to VM operations (those beginning with 'vm_'). In this case, if the option is accepted and set in the request, it will override the controller's configuration file value. If the option is dropped, the value from the controller's configuration file will be used. (If you don't want the controller's configuration file value to be used, don't set it there.)
Also, you must be aware of any options to any other plugins which are packaged in the kw parameter. These must be accepted for those plugins to recieive their input if they are registered with a higher 'order' than this plugin. Likewise, if you do want to filter options to plugins, this plugin must be registered with a lower 'order' than those.
Add the above options to a [[kwargfil]] subsection of the [plugins] section of the controller's configuration file. This plugin can be registered for the following events: : request, cycle_request, migrate_request, pause_request, poweroff_request, reboot_request, resume_request, shutdown_request, start_request.
Below is a sample [[kwargfil]] subsection. Start by cutting and pasting this into the [plugins] subsection of your controller's configuration file and editing for your environment.
######################## [[kwargfil]] ######################## [[[__allsecs__]]] # Place global accept and drop options here order = 1 # We only need to register for the requests we want to filter [[start_request]] accept = ip_range,vm_fs_uri # Note, options added to ush or any other client which appear in kw must be # added to the appropriate request here if using an accept list.
See the Configuration Files section on the Documentation page for additional details on writing Usher configuration files.
Last Updated: 2007-12-22 by mmcnett
Report problems to: Marvin McNett







