Juju documentation

Manual Provisioning

Introduction

Juju provides a feature called "manual provisioning" that enables you to deploy Juju, and charms, to existing systems. We will describe in this section how to configure an environment using this feature.

Note: Manual provisioning is still in development, and should be considered experimental. There is at least one bug that needs to be solved before we consider this feature ready for end users.

Prerequisites

Manual provisioning enables you to run Juju on systems that have a supported operating system installed. You will need to ensure that you have both SSH access and sudo rights. It is not necessary to have a password-less login, however it will improve the experience by reducing the need for repeated logins.

Configuration

You should start by generating a generic configuration file for Juju and then switching to the "null" provider by using the command:

juju init
juju switch null

This will generate a file, environments.yaml (if it doesn't already exist), which will live in your ~/.juju/ directory (and will create the directory if it doesn't already exist).

Note: If you have an existing configuration, you can use juju generate-config --show to output the new config file, then copy and paste relevant areas in a text editor etc.

The generic configuration sections generated for the null provider will look something like this, though Juju will generate this automatically you usually don't need to edit it:

## https://juju.ubuntu.com/docs/config-manual.html
"null":
    type: "null"
    admin-secret: 772b9471131c6b5883475e3908156d32
    storage-auth-key: 834ralkjszcq34ur2234hjklds
    ## set bootstrap-host to the host where the bootstrap machine agent
    ## should be provisioned.
    bootstrap-host:
    ## set the login user to bootstrap the machine as. If left blank,
    ## juju will connect to the bootstrap machine as the current user.
    # bootstrap-user:
    ## set the IP address for the bootstrap machine to listen on for
    ## storage requests. If left blank, storage will be served on all
    ## network interfaces.
    # storage-listen-ip:
    # storage-port: 8040

Note: The quotes around "null" are required, as null is a reserved identifier in YAML.

When bootstrapped, tools storage will be served from the bootstrap-host on the specified storage-listen-ip and storage-port.

The null provider does not perform automatic machine provisioning like other providers; instead, you must manually provision machines into the environment. Provisioning machines is described in the following sections.

Bootstrapping

To bootstrap a null environment, you must specify the bootstrap-host configuration, and optionally the bootstrap-user configuration. If bootstrap-user is not specified, then Juju will ssh to the bootstrap host as the current user. Once the configuration is specified, you bootstrap as usual:

juju bootstrap

The juju bootstrap command will connect to bootstrap-host via SSH, and copy across and install the Juju agent.

Note: Automated destruction of null environments is currently unimplemented. To remove Juju from the bootstrap-host, you will need to manually stop and remove the upstart jobs (/etc/init/juju*).

Adding machines

To add another machine into a null environment, you must use a variant of the juju add-machine command, such as follows:

juju add-machine ssh:juju.ubuntu.com
juju add-machine ssh:10.1.1.2
juju add-machine ssh:otheruser@10.1.1.3

As with bootstrapping, juju add-machine ssh:... will connect to the machine via SSH to install the Juju agent. Machines added in this way may be removed in the usual manner, with juju destroy-machine.

Considerations and caveats

As is implied by its name, the null provider does not attempt to control all aspects of the environment, and leaves much to the user. There are several additional things to consider:

  • All machines added with juju add-machine ssh:... must be able to address and communicate directly with the bootstrap-host, and vice-versa.
  • Sudo access is required on all manually provisioned machines, to install the Juju upstart services.
  • Manually provisioned machines must be running a supported version of Ubuntu (12.04+).
  • It is not currently possible to manually provision machines into non-null provider environments.