Troubleshooting clouds

Common issues setting up clouds

juju add-credential

The juju add-credential command supports adding a credential with a YAML file.

The YAML input format is identical to the format Juju uses to store credentials on a user’s filesystem. However, the manually created file can only be used to add one credential at a time, unlike the file generated by Juju which can contain multiple credentials.

The format must also include a root key of “credentials:”.

For example, the following ‘azure.yaml’ file will fail.

azure:
  rickscreds:
      auth-type: service-principal-secret
      application-id: 1234
      application-password: secretpassword
      subscription-id: 12345

Once the root key is added, it will succeed:

credentials:
    azure:
      rickstuff:
          auth-type: service-principal-secret
          ...

Upgrading controllers and models

Controllers and their hosted models need to be upgraded whenever Juju is updated, see Upgrading Juju software for more details.

But as large model deployments can obviously be complex, you may occasionally experience problems during an upgrade. These problems can often be mitigated by restarting the jujud- agents running on the machines within your models.

The following Bash script, for example, connects to each machine in your model and restarts each agent:

for i in {0..NUMBER_OF_MACHINES}; do
  juju ssh $i "for app in $(ls /var/lib/juju/tools); do
    sudo systemctl restart jujud-$app;
  done";
done

For the above example to work, you will need to replace NUMBER_OF_MACHINES with the maximum machine value from juju status, and those machines will also need to be running systemd, rather than running within local LXD containers.

Last updated 1 year, 6 months ago. Help improve this document in the forum.