Juju, maas and agent-name

While working on a procedure with colleagues, I ran into an issue that I prefer to document somewhere. Since my blog has been sleeping for close to a year, I thought I’d put it here.

I was running a set of tests on a version of juju that will resemble 1.16.4. This version, as each one after 1.16.2 implement the agent-name identifier that is, as I understand it, used to discriminate between multiple bootstrapped environments.

I had a bootstrapped environment on a maas 1.4 server (1.4+bzr1693+dfsg-0ubuntu2~ctools0) with a few services running on two machines. Many hours of testing led us to identify that even though juju was using agent-name, it appeared that maas was not.

After upgrading to the latest and greatest version of maas (1.4+bzr1693+dfsg-0ubuntu2.2~ctools0), I ran a « juju status » and to my dismay I got this :

$ juju status

Please check your credentials or use ‘juju bootstrap’ to create a new environment.

Error details:

no instances found

Using –show log to get a bit more information gave me the following :

$ juju status –show-log

2013-11-28 15:33:05 ERROR juju supercommand.go:282 Unable to connect to environment « maas14″.

Please check your credentials or use ‘juju bootstrap’ to create a new environment.

 

Error details:

no instances found

Going to the maas server to look at a few log, I found that juju was indeed sending the agent-name to maas :

GET /MAAS/api/1.0/files/97fbdbaa-c727-4f19-8710-dbc6d361e8db-provider-state/ HTTP/1.1″ 200 516 « – » « Go 1.1 package http »

192.168.124.1 – – [28/Nov/2013:16:33:32 +0100] « GET /MAAS/api/1.0/nodes/?agent_name=97fbdbaa-c727-4f19-8710-dbc6d361e8db&id=node-17ad8da0-5361-11e3-bd0a-525400fd96d7&op=list HTTP/1.1″ 200 203 « – » « Go 1.1 package http »

Well, it turns out that after the upgrade of the maas packages, maas will start to honour the agent-name, but since the instances were created without any agent-name, it was no longer able to provide the information.

Raphael Badin who works on the maas team suggested to use the following maas shell commands to fix things up :

$ sudo maas shell

>>> from maasserver.models import Node
>>> # This assumes one wants to update *all* the nodes present in this MAAS.
>>> Node.objects.all().update(agent_name="AGENT_NAME_FROM_JUJU")

Be very careful with such a command if your maas environment is in production as this will change all the nodes present in MAAS.

Ce contenu a été publié dans Technical. Vous pouvez le mettre en favoris avec ce permalien.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Vous pouvez utiliser ces balises et attributs HTML : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>