nodepool/doc/source/scripts.rst
Attila Fazekas 9cac605d8f Add private ip to /etc/nodepool
The private IPs are more useful for having nodes to
 communicate with each other in multi-node jobs.

This change extends the /etc/nodepool with two new files.
* primary_node_private The private ip of the primary node
* sub_nodes_private The private ip of the sub nodes,
  in the same order as the floating ones.

This change helps in simplify the devstack-gate multi-node change.
This change causes DB schema change, both node and subnode table
extended with an ip_private field.

Change-Id: Ib7b29afbfae877e6edeea6568732c54c3d9e12f1
2014-10-29 21:11:47 +01:00

2.7 KiB

Node Prep Scripts

Nodepool requires the specification of a script directory (script-dir) in its configuration. When Nodepool starts a virtual machine for the purpose of creating a snapshot image, all of the files within this directory will be copied to the virtual machine so they are available for use by the setup script.

At various points in the image and node creation processes, these scripts may be invoked by nodepool. See configuration for details.

Any environment variables present in the nodepool daemon environment that begin with NODEPOOL_ will be set in the calling environment for the script. This is useful during testing to alter script behavior, for instance, to add a local ssh key that would not otherwise be set in production.

Setup script

Each provider can specify a setup script with setup, and that script is expected to exist in script_dir. If it is found, it will be run during image creation. When the script is invoked, the instance hostname will be passed in as the first parameter. This setup script will only be applied when building images using provider snapshots, not using diskimage-builder.

Ready script

Each label can specify a ready script with ready-script. This script can be used to perform any last minute changes to a node after it has been launched but before it is put in the READY state to receive jobs. In particular, it can read the files in /etc/nodepool to perform multi-node related setup.

Those files include:

/etc/nodepool/role

Either the string primary or sub indicating whether this node is the primary (the node added to the target and which will run the job), or a sub-node.

/etc/nodepool/node

The IP address of this node.

/etc/nodepool/node_private

The private IP address of this node.

/etc/nodepool/primary_node

The IP address of the primary node, usable for external access.

/etc/nodepool/primary_node_private

The Private IP address of the primary node, for internal communication.

/etc/nodepool/sub_nodes

The IP addresses of the sub nodes, one on each line, usable for external access.

/etc/nodepool/sub_nodes_private

The Private IP addresses of the sub nodes, one on each line.

/etc/nodepool/id_rsa

An OpenSSH private key generated specifically for this node group.

/etc/nodepool/id_rsa.pub

The corresponding public key.

/etc/nodepool/provider

Information about the provider in a shell-usable form. This includes the following information:

NODEPOOL_PROVIDER

The name of the provider

NODEPOOL_REGION

The name of the region

NODEPOOL_AZ

The name of the availability zone (if available)