~lutostag/ubuntu/trusty/maas/1.5.4+keystone

« back to all changes in this revision

Viewing changes to docs/juju-quick-start.rst

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-03-27 14:49:56 UTC
  • mto: (20.1.1 quantal) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: package-import@ubuntu.com-20120327144956-z5stunhc83bnnwsi
Tags: upstream-0.1+bzr363+dfsg
ImportĀ upstreamĀ versionĀ 0.1+bzr363+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Juju Quick Start
 
2
================
 
3
 
 
4
These instructions will help you deploy your first charm with Juju to
 
5
a MAAS cluster.
 
6
 
 
7
A few assumptions are made:
 
8
 
 
9
- You have a MAAS cluster set-up, and you have at least 2 nodes
 
10
  enlisted with it.
 
11
 
 
12
- You're running MAAS on your local machine. If not you'll need to
 
13
  adjust some of the URLs mentioned accordingly.
 
14
 
 
15
- You're running Juju from the PPA (``ppa:juju/pkgs``) or from a
 
16
  branch of ``lp:juju``. At the time of writing MAAS support had not
 
17
  made it into the main Ubuntu archives. However, following the
 
18
  release of Ubuntu Precise, all the necessary package revisions will
 
19
  be in main.
 
20
 
 
21
  If you're using a branch, note that you'll need to set
 
22
  ``PYTHONPATH`` carefully to ensure you use the code in the branch.
 
23
 
 
24
 
 
25
Your API key and environments.yaml
 
26
----------------------------------
 
27
 
 
28
You'll need an API key from MAAS so that the Juju client can access
 
29
it. Each user account in MAAS can have as many API keys as desired.
 
30
One hard and fast rule is that you'll need to use a different API key
 
31
for each Juju *environment* you set up within a single MAAS cluster.
 
32
 
 
33
 
 
34
Getting a key
 
35
^^^^^^^^^^^^^
 
36
 
 
37
To get the API key:
 
38
 
 
39
#. Go to your `MAAS preferences page`_, or go to your `MAAS home
 
40
   page`_ and choose *Preferences* from the drop-down menu that
 
41
   appears when clicking your username at the top-right of the page.
 
42
#. Optionally add a new MAAS key. Do this if you're setting up another
 
43
   environment within the same MAAS cluster.
 
44
.. _MAAS preferences page: http://localhost:5240/account/prefs/
 
45
.. _MAAS home page: http://localhost:5240/
 
46
 
 
47
 
 
48
Creating environments.yaml
 
49
^^^^^^^^^^^^^^^^^^^^^^^^^^
 
50
 
 
51
Create or modify ``~/.juju/environments.yaml`` with the following content::
 
52
 
 
53
  juju: environments
 
54
  environments:
 
55
    maas:
 
56
      type: maas
 
57
      maas-server: 'http://localhost:5240'
 
58
      maas-oauth: '${maas-api-key}'
 
59
      admin-secret: 'nothing'
 
60
 
 
61
Substitute the API key from earlier into the ``${maas-api-key}``
 
62
slot. You may need to modify the ``maas-server`` setting too; if
 
63
you're running from the maas package it should be something like
 
64
``http://hostname.example.com/MAAS``.
 
65
 
 
66
 
 
67
Now Juju
 
68
--------
 
69
 
 
70
::
 
71
 
 
72
  $ juju status
 
73
 
 
74
**Note**: if Juju complains that there are multiple environments and
 
75
no explicit default, add ``-e ${environment-name}`` after each
 
76
command, e.g.::
 
77
 
 
78
  $ juju status -e maas
 
79
 
 
80
As you've not bootstrapped you ought to see::
 
81
 
 
82
  $ juju environment not found: is the environment bootstrapped?
 
83
 
 
84
Bootstrap::
 
85
 
 
86
  $ juju bootstrap
 
87
 
 
88
This will return quickly, but the master node may take a *long* time
 
89
to come up. It has to completely install Ubuntu and Zookeeper and
 
90
reboot before it'll be available for use. It's probably worth either
 
91
trying a ``juju status`` once in a while to check on progress, or
 
92
following the install on the node directly.
 
93
 
 
94
  **Beware** of `bug 413415`_ - *console-setup hangs under chroot
 
95
  debootstrap with a console login on ttyX* - when monitoring an
 
96
  installation on the node.
 
97
 
 
98
.. _bug 413415:
 
99
  https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/413415
 
100
 
 
101
If you're using ``vdenv`` (included in ``lp:maas``) then ``virsh``
 
102
makes it easy to follow on progress::
 
103
 
 
104
  $ virsh list
 
105
   Id Name                 State
 
106
  ----------------------------------
 
107
    1 zimmer               running
 
108
    2 odev-node02          running
 
109
 
 
110
  $ gnome-terminal -e 'virsh console odev-node02' &
 
111
 
 
112
..
 
113
 
 
114
  ``zimmer`` is the machine on which MAAS is running. Here
 
115
  ``odev-node02`` is the machine being bootstrapped as the Juju master
 
116
  node.
 
117
 
 
118
Once the master node has been installed a status command should come
 
119
up with something a bit more interesting:
 
120
 
 
121
  **XXX** `Bug 965101
 
122
  <https://bugs.launchpad.net/maas/+bug/965101>`_ - *MAAS provider
 
123
  does not raise an exception when get_machines(...)  does not find
 
124
  the requested machines* - prevented capturing of output here.
 
125
 
 
126
Now it's possible to deploy a charm::
 
127
 
 
128
  $ juju deploy --repository /usr/share/doc/juju/examples local:mysql
 
129
  $ juju status
 
130
 
 
131
If you have another node free you can finish off the canonical and by
 
132
now familiar example::
 
133
 
 
134
  $ juju deploy --repository /usr/share/doc/juju/examples local:wordpress
 
135
  $ juju add-relation wordpress mysql
 
136
  $ juju expose wordpress
 
137
  $ juju status
 
138
 
 
139
Note that each charm runs on its own host, so each deployment will
 
140
actually take as long as it took to bootstrap. Have a beer, drown your
 
141
sorrows in liquor, or, my preference, have another cup of tea.