I would like deploy one or more charms with juju on MAAS environments (without OpenStack). The environment of the MAAS Controller is Ubuntu 12.10 with 2 NICs. One of the NIC is connected to a external DHCP and the other is holding by the MAAS-dhcp and is connected to a switch with 2 client servers (Ubuntu 12.04 LTS). The settings are as follows

$ sudo vim /etc/network/interfaces

auto em1

iface em1 inet static

address [out-ip]

netmask [out-netmask]

gateway [out-gateway]

dns-nameservers [out-dns]

auto em2

iface em2 inet static

address [inner ip]

network [inner network]

netmask [inner netmask]

broadcast [inner broadcast address]

$sudo vim /etc/sysctl.conf

uncomment net.ipv4.ip_forward=1

$ sudo vim /etc/rc.local

/sbin/iptables -P FORWARD ACCEPT

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

$ sudo iptables -P FORWARD ACCEPT

$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

$ sudo /etc/init.d/networking restart

$ sudo dpkg-reconfigure maas-region-controller

[inner ip]

$ sudo dpkg-reconfigure maas-cluster-controller

http://[inner ip]:80/MAAS

$ sudo vim /etc/maas/ephmeralss

set ARCHES="amd64"

$ sudo maas createsuperuser

$ sudo maas-impoart-pxe-files

open web UI (http://[inner ip]/MAAS) & press setting button & set Cluster controllers

$ sudo vim /var/share/preseeds/preseed-master …

open computer to let clients set to ready status ( DO NOT PRESS 'START NODE' BUTTON )

check if nodes are all in READY status

MAAS clients are all in ready status:

setting juju environments.yaml

juju bootstrap ( check if one of the node -> allocated to *)

open the allocated Server to PXE boot and the setup a Ubuntu

after the installation

juju status

    agent-state: running
    dns-name: node-4487fc70b037
    instance-id: /MAAS/api/1.0/nodes/node-xxx
    instance-state: unknown

When I try to deploy one charm ( for example mysql ), the other client is booted and installed ubuntu. However, after the installation, the charm still wasn't deployed. and I try:

juju status

    agent-state: running
    dns-name: node-4487fc70b037
    instance-id: /MAAS/api/1.0/nodes/node-64248652-6a9b-11e2-9347-842b2b6a17a3/
    instance-state: unknown
    agent-state: not-started
    dns-name: node-0025b31884f5
    instance-id: /MAAS/api/1.0/nodes/node-011c5b14-6a9d-11e2-9c04-842b2b6a17a3/
    instance-state: unknown
    charm: cs:precise/mysql-15
    relations: {}
        agent-state: pending
        machine: 1
        public-address: null

I also checked /var/log/juju/machine-agent.log of machine 1 ( the non-started machine) and it shows that

2013-01-30 01:19:58,444: twisted@ERROR: Unhandled error in Deferred:
2013-01-30 01:19:58,454: twisted@ERROR: Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/juju/agents/base.py", line 238, in startService
    yield self.connect()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/juju/agents/base.py", line 208, in connect
  File "/usr/lib/python2.7/dist-packages/txzookeeper/retry.py", line 302, in connect
    return self.client.connect(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/txzookeeper/client.py", line 468, in connect
    self._servers, callback, self._session_timeout)
zookeeper.ZooKeeperException: Could not internally obtain zookeeper handle

I wait for one day and it keeps pending. The machine 1 is also remaining on not-started. I also checked to ssh two clients that they are quite ok. However, I cannot use juju ssh 1 to connect to the client. I really don't know what to do. Please help me.


3 Answers 3


machine 1 is unable to connect to the ZK process on machine 0. There could be many reasons for this; DNS problems, firewall problems etc.

I would ssh into machine 1 and try to manually connect to the Zookeeper running on machine 0 (using telnet) to see if you can determine the exact problem.

  • I tried using host **machine-0** in machine 1 and got host not found. I also tried telnet *machine-0** 2181 and got nothing. It just stuck in Connected to node-4487fc70b037. Therefore, I still cannot determine what is going on there
    – Arbit
    Feb 1, 2013 at 1:11
  • It seems that you don't have your DNS set up correctly then. You need to configure your DNS server in the DHCP config so that it uses the MAAS one, or at least one that knows how to resolve the machine* addresses.
    – bigjools
    Feb 4, 2013 at 2:53

I think this may have to do with mDNS. I'm also running into this same issue.

With mDNS enabled as is default I can't resolve the machine-0/zk hostname! My DNS however works fine, using dig.

It's only when it goes through the mdns layer that it causes timeouts/hangs. It seems to work when using not FQDNs, when using an FQDN, even a known one, it for some reason looks for avahi first? Need to dig deeper.

Edit: I found the problem is avahi takes precedence over the .local domain, even it's subdomains. I'm looking for a way to make avahi blacklist a domain, we may have to come up with a patch for a blacklist-domain option.

Try changing /etc/nsswitch.conf to not use mDNS with NOTFOUND=return, ie, make the hosts: line: hosts: files dns mdns4

Or edit the generic preseed for MaaS and remove avahi-daemon from the autoinstall list.


After manually add the host name (/etc/hosts) in each of the machines, juju successfully deploy the service on machine 1.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .