Design

The core of Arsenal’s functionality consists of gathering data for input, through Scout objects, to send to Arsenal’s caching Strategy objects, which produce directives, which in turn are currently fulfilled by Scout objects.

Therefore, Scouts deal with the outside world, while Strategies provide introspection on data provided by Scouts to direct image caching on nodes in some meaningful way. The Scout and Strategy objects used by arsenal-director can be changed through configuration options.

Arsenal’s design philosophy can be summed up as: “Provide a way to do something, but make it easy to change or swap out.”

Scout

The responsibility of Scouts are to gather data from various outside sources, like Ironic, Nova, and Glance, convert that data to a form suitable for Strategy object consumption, as well as issue directives to endpoints, such as Ironic.

All of Arsenal’s Scout objects are derived from an abstract base class called Scout, which is defined in scout.py.

Tip

If you are thinking about defining your own Scout object, reading scout.py is a good place to start.

A couple of pre-made Scouts are currently included in Arsenal.

Openstack Scout

The Openstack Scout will communicate with Ironic, Nova, and Glance services, and handle fulfilling Strategy actions by talking to Ironic.

Most Scouts hoping to be used with Openstack services will derive from this Scout while passing filtration functions for flavors and images to OpenstackScout via a super() call during __init__.

For more information see, openstack_scout.py.

DevStack Scout

This Scout is designed to be used with the DevStack project, which provides a relatively easy way to setup an Openstack-based environment on a single machine, typically for testing purposes.

See Ironic documentation on how to configure virtual baremetal nodes for use with DevStack.

For more information see, devstack_scout.py.

OnMetal Scouts

The OnMetal Scouts are designed to work with Rackspace’s OnMetal product. While these specific Scouts will probably not be directly useful to anyone outside of Rackspace, it can still be instructive to view fully functional implementations of Openstack Scout with filters.

For more information, see onmetal_scout.py.

Strategy

A Strategy’s role lies in consuming data provided by Scouts, and then emitting directives to manage imaging caching on nodes.

Directives

Currently, two directives are used by Arsenal’s strategies to manage the cache. Cache Node, which adds a node to the cache, and Eject Node, which will remove a node from the cache.

Cache Node

CacheNode instructs the endpoint to cache a specific image onto a specific node. This is the main mechanism used to build a fleet of cached nodes.

Eject Node

The second is EjectNode, which instructs the endpoint to do whatever is necessary to put a previously cached node back into an uncached state. This directive is necessary if an image cached to a node becomes out-of-date.

Tip

If you are thinking about defining your own Strategy object, reading strategy/base.py is a good place to start.

SimpleProportionalStrategy

Currently, SimpleProportionalStrategy is the only Strategy shipping with Arsenal.

This object implements a fairly straight-forward strategy: For each available flavor of node, use a constant proportion of available nodes for caching.

SimpleProportionalStrategy randomly picks available, uncached nodes to cache. The random selection is designed to level wear across nodes.

Image selection is handled by choose_weighted_images_force_distribution found in the arsenal.strategy.base module. This means SimpleProportionalStrategy will pick images by weights pulled from the strategy.image_weights_filename option. See the image_weights_filename option section for more details on how image weighting works in Arsenal.

See the [simple_proportional_strategy] Section for information on how to configure this Strategy.