Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Trusty : 14.04

Trying to bootstrap JUJU using maas environment using juju -v --debug bootstrap -e maas but the process gets stuck in the lines shown below and finally times out.

My maas nodes are in ready state. When I tried to execute the ssh command in the system shell of the MAAS host and I was able to connect successfully.

I do not understand why juju does not proceed even if the ssh is successful. I have tried this with juju 1.18.x [stable] as well as 1.19.x [devel]

The following is the log trace..

Lot of logs....

2014-06-30 13:29:44 DEBUG juju.utils.ssh ssh_openssh.go:122 running: ssh -o "StrictHostKeyChecking no" -o "PasswordAuthentication no" -i /home/dcadmin/.juju/ssh/juju_id_rsa -i /home/dcadmin/.ssh/id_rsa ubuntu@dc1dt8.maas /bin/bash
2014-06-30 13:29:46 DEBUG juju.utils.ssh ssh_openssh.go:122 running: ssh -o "StrictHostKeyChecking no" -o "PasswordAuthentication no" -i /home/dcadmin/.juju/ssh/juju_id_rsa -i /home/dcadmin/.ssh/id_rsa ubuntu@192.168.35.29 /bin/bash

Can anyone please help.

Thanks, Prasanna

share|improve this question
    
To add: Firewall is off at both ends. –  user299188 Jun 30 at 13:52

3 Answers 3

Found this post as I just happen to have had the same symptoms. Maybe you have after all the same problem then.

When bootstrapping Juju I got the same ssh login attempt displayed as you. Then I had a look at my virt-manager and noticed that the machine was not start. I then tried to start the machine by using MAAS GUI. Although, within the MAAS GUI, it stated to be allocated to the user, in actual fact it didn't get started in the KVM (by checking it through virt-manager).

This confirmed to me that there is a configuration problem with MAAS rather than with Juju. I checked a couple of things and then noticed that I didn't create a user directory and SSH key for the MAAS user as outlined with https://maas.ubuntu.com/docs/nodes.html.

After having done so, MAAS could successfully start and stop my KVM machines and Juju did so likewise.

Below are the relevant lines copied from https://maas.ubuntu.com/docs/nodes.html which resolved the problem for me.

If you want to use ssh you’ll need to generate a ssh key pair for the maas user. By default there is no home directory created for the maas user:

sudo mkdir /home/maas
sudo chown maas:maas /home/maas

Add a login shell for the maas user:

sudo chsh -s /bin/bash maas

Become the maas user and generate a SSH keypair:

ssh-keygen

Then add the public key to /ubuntu/.ssh/authorized_keys on the vm server so virsh can use ssh without a password:

ssh-copy-id -i ~/.ssh/id_rsa ubuntu@10.0.0.2

As the maas user, test virsh commands against libvirt at 10.0.0.2:

virsh -c qemu+ssh://ubuntu@10.0.0.2/system list --all
share|improve this answer
    
I think the issue you faced is different. I have not done any virtualization yet. I have a master [MAAS] and 7 nodes in a default cluster in maas. All the nodes are in ready state and i am trying to bootstrap juju on one of the nodes. –  user299188 Jun 30 at 20:58
    
looks like a bug : bugs.launchpad.net/juju-core/+bug/1314682 –  user299188 Jun 30 at 21:08

Looks like Juju is unable to resolve the nodes' names. You need to make sure the system where you run Juju uses MAAS' DNS server as its resolver (check that it works by running host <name of my MAAS node> on the server where you want to run Juju).

share|improve this answer
    
Thought of that but if you checks the logs in detail it retries with the IP if connection using DNS fails. –  user299188 Jun 30 at 16:58
up vote 0 down vote accepted

This issue is fixed if we put a hack. I found it while searching for this problem and it actually worked.

But seriously would never advice to use this in production.

The get around this issue follow the following steps:

  1. First check if you can log into each of the MAAS child nodes using password less ssh.
  2. Create directory /var/lib/juju
  3. Change the ownership of the directory to ubuntu:ubuntu
  4. Create a text file /var/lib/juju/nonce.txt with content - user-admin:bootstrap

Start bootstrap again.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.