A model is an environment associated with a controller. When a controller is created two models are provisioned along with it. These initial models are named ‘controller’ and ‘default’. The ‘controller’ model is for internal Juju management and is not intended for general workloads. The ‘default’ model, however, is ready for immediate use. Further workload models can be added at any time.
Add a model
Models can be added easily to a controller. The Adding a model page provides a full explanation and includes examples.
switch command to change from one model to another. Running the command with no arguments will return the currently active controller and model.
Here are different ways to change to a model:
juju switch foo
Selects the last used model in controller ‘foo’ (if the latter exists), otherwise model ‘foo’ in the current controller.
juju switch :foo
Selects model ‘foo’ in the current controller.
juju switch foo:bar
Selects model ‘bar’ in controller ‘foo’.
juju switch foo:
Selects the last used model in controller ‘foo’.
Compare a bundle to a model
An operator can compare a model with a charm bundle. This is useful for determining what has changed since the bundle was deployed or just how a model differs from a bundle that was not yet used. This topic is covered on the Charm bundles page.
Configure a model
Configuration can occur at the model level. This will affect all Juju machines in the model. For instance, a logging level and API port can be stipulated. See the Configuring models page for explanations.
Cross model relations
Traditionally, when adding a relation between two applications (see Managing relations) the applications reside within the same model and controller. It is possible to overcome this limitation by employing cross model relations. This topic is covered on the Cross model relations page.
Destroy a model
When a model is destroyed all associated applications and machines are also destroyed. It is a very destructive process. See page Removing things for details.
It is possible to curtail command use for Juju users on a per-model basis. The Disabling commands page gives more information.
Examine a model
show-model command to examine a specific model.
List all models
models command to list all models for a controller.
Manage user access
If you’re using multiple Juju users you will need to manage access to your models. See page Working with multiple users for a full explanation.
Model can be migrated from one controller to another. Model migration is useful when upgrading a controller and for load balancing. For a complete explanation see the Migrating models page.
SSH access can be provided to all machines, present and future, on a per-model basis. For in-depth coverage see page Machine authentication.
Set constraints for a model
Charm constraints can be managed at the model level. This will affect all charms used in the model unless overridden. Constraints are used to select minimum requirements for any future machines Juju may create. This subject is covered on page Setting constraints for a model.
Upgrade a model
Juju software is upgraded at the model level with the
upgrade-model command. This affects the Juju agents running on every machine Juju creates. This does not pertain to the Juju software package installed on a client system. See Upgrading models for complete coverage.
debug-log command to examine logs on a per-model basis. This allows inspection of activities occurring on multiple Juju machines simultaneously. Due to the expected large volume of data, advanced filtering is available. A full explanation is provided on the Juju logs page.
View model status
status command to view the status of a model. Tutorial Basic client usage gives an overview of the various elements of this command’s output.