2.3 Using the kollacli Command

You run the kollacli command on the master node and use it to configure and deploy OpenStack services to the target nodes. To run kollacli commands, you must be a member of the kolla group.

The kollacli command has a set of subcommands, which are organized by the objects that they manage.

To configure the layout of your OpenStack deployment, you perform actions on groups, hosts and services, as follows:

  • The kollacli host commands manage the target nodes in a deployment.

    Example command: kollacli host add adds a host to the list of target nodes.

  • The kollacli group commands manage the associations between target nodes and the OpenStack services they run. Target nodes in the same group run the same services.

    Example command: kollacli group addhost adds a host to a group.

  • The kollacli service commands manage the OpenStack services to add or remove them from deployment groups.

    Example command: kollacli service addgroup adds an OpenStack service to a deployment group.

To configure your OpenStack deployment, you configure values for passwords and properties, as follows:

  • The kollacli password commands manage the passwords for the OpenStack components.

    Example command: kollacli password set sets a value for an individual password.

  • The kollacli property commands manage the configuration settings for OpenStack services.

    Example command: kollacli property set sets a value for a configuration property.

Once you have configured your deployment, you deploy OpenStack services with the kollacli deploy command.

Help on how to use the kollacli command is available, as follows:

  • To list all kollacli commands, use the kollacli help command.

  • To list the related commands for an object, use the kollacli help object for example kollacli help host.

  • To get help for a specific command, use the kollacli help subcommand command, where subcommand is the name of the command, for example kollacli host list or kollacli service listgroups.

For a complete syntax reference for kollacli commands, see Appendix A, kollacli Command-Line Reference.

Bash Command Completion

You can enable Bash command completion for the kollacli command, as follows:

  1. Install the bash-completion package, if it is not already installed:

    # yum install bash-completion
  2. Use the kollacli complete command to generate the command completion function.

    To display the function so you can copy and paste it into a file:

    $ kollacli complete 

    To output the function to a file:

    $ kollacli complete >/etc/bash_completion.d/kollacli 

    You need root privileges to write to the /etc/bash_completion.d directory.

  3. Source the file to enable command completion:

    $ source /etc/bash_completion.d/kollacli

Using the kollacli Shell

The kollacli shell enables you to enter several commands without having to type the kollacli command each time. You start the shell with the kollacli command. When you are in the kollacli shell, the prompt changes to (kollacli). From the shell prompt you can enter kollacli commands in their short form, for example:

$ kollacli
(kollacli) host list
(kollacli) group listhosts

In addition to the help command, the kollacli shell also supports the -h and --help options for obtaining help with kollacli commands.

To exit the kollacli shell and return to the operating system prompt, type exit, quit, or q.

Formatting Command Output

When you use kollacli commands, such as the kollacli property list command, to show what you have configured, these commands have a --format option which enable you to format the output to suit your needs, as shown in the following table.

Option

Format

csv

Comma-separated values.

Use the --quote option with this format to control the use of quotes in the output:

  • all: Quote all values.

  • minimal: Optimized minimal quoting of values.

  • none: No quoting of any values.

  • nonnumeric: Quote only non-numeric values.

The default is nonnumeric.

html

HTML table markup.

json

JavaScript Object Notation.

table

Simple ASCII display table.

This is the default output format.

Use the --max-width option with this format to set the maximum display width for each column. The value for this option must be an integer. The default is 0 (no maximum width).

value

Space separated values with no headers.

This format may be useful to pipe output to an operating system command.

yaml

YAML format.

You can also use the --column option to select the columns that are included in the output. Use multiple --column options to select each column you want. The names of the columns change depending on the kollacli command used and the names are case sensitive. By default, all columns are included.