How to use a Manual cloud with Juju
The purpose of the Manual cloud is to cater to the situation where you have machines (of any nature) at your disposal and you want to create a backing cloud out of them. If this collection of machines is composed solely of bare metal you might opt for a MAAS cloud. However, recall that such machines would also require IPMI hardware and a MAAS infrastructure. In contrast, the Manual cloud can make use of a collection of disparate hardware as well as of machines of varying natures (bare metal or virtual), all without any extra overhead/infrastructure.
Contents:
- Limitations
- Prerequisites
- Add a Manual cloud
- Add credentials
- Create a controller
- Add machines to a Manual cloud
- Additional Manual cloud notes
- Additional CentOS notes
Limitations
With any other cloud, the Juju client can trigger the creation of a backing machine (e.g. a cloud instance) as they become necessary. In addition, the client can also cause charmed operators to be deployed automatically onto those newly-created machines. However, with a Manual cloud the machines must pre-exist and they must also be specifically targeted during charmed operator deployment.
A MAAS cloud must also have pre-existing backing machines. However, Juju, by default, can deploy charmed operators onto those machines, or add a machine to its pool of managed machines, without any extra effort.
Prerequisites
The following conditions must be met:
- At least two machines are needed (one for the controller and one where charmed operators will be deployed).
- The machines must have Ubuntu (or CentOS) installed.
- The machines must be contactable over SSH with public key authentication using a user account with root privileges. On Ubuntu,
sudo
rights will suffice if this provides root access. If a password is required forsudo
, juju will ask for it on the command line. - The machines must be able to
ping
each other.
Add a Manual cloud
Use the interactive add-cloud
command to add your Manual cloud to Juju’s list of clouds. You will need to supply a name you wish to call your cloud, the IP address (or hostname) for the machine you intend to use as a controller, and what remote user account to connect to over SSH (prepend ‘user@’ to the address/hostname).
To interactively add a cloud definition to the local client cache, run:
juju add-cloud
An example user session looks as follows:
Cloud Types
lxd
maas
manual
openstack
vsphere
Select cloud type: manual
Enter a name for your manual cloud: manual-cloud
Enter the controller's hostname or IP address: noah@10.143.211.93
Cloud "manual-cloud" successfully added
You may bootstrap with 'juju bootstrap manual-cloud'
We’ve called the new cloud ‘manual-cloud’, used an IP address of 10.143.211.93 for the intended controller, and added a user account of ‘noah’ to connect to.
Add credentials
Credentials should already have been set up via SSH. Nothing to do!
Create a controller
You are now ready to create a Juju controller for the cloud ‘manual-cloud’:
juju bootstrap manual-cloud
The machine that will be allocated to run the controller on is the one specified during the add-cloud
step. In our example it is the machine with address 10.143.211.93.
For a detailed explanation and examples of the bootstrap
command, see Create a controller and Configure a controller.
Add machines to a manual cloud
To add the machine with an IP address (and user) of bob@10.55.60.93 to the ‘default’ model in the Manual cloud (whose controller was named ‘manual-controller’):
juju add-machine ssh:bob@10.55.60.93
Unless you’re using passphraseless public key authentication, you may be prompted for a password a few times. The process takes a couple of minutes.
Once the command has returned, you can check that the machine is available:
juju machines
Sample output:
Machine State DNS Inst id Series AZ Message
0 started 10.55.60.93 manual:10.55.60.93 xenial Manually provisioned machine
Additional Manual cloud notes
The following notes are pertinent to the Manual cloud:
- Juju machines are always managed on a per-model basis. With a Manual cloud the
add-machine
process will need to be repeated if the model hosting those machines is destroyed. - To improve the performance of provisioning newly-added machines consider running an APT proxy or an APT mirror. See Offline mode strategies.
Additional CentOS notes
One of the requirements for the Manual cloud is that SSH is running on the participating machines, but for CentOS this may not be the case. To install SSH, run the following commands as the root user on the CentOS system:
yum install sudo openssh-server redhat-lsb-core
systemctl start sshd
Since you will be connecting to the root account during the add-machine
step, also ensure that there is a root password set on the CentOS machine.
Last updated 9 months ago.