Merge lp:~evilnick/maas/1.2-docs-tidyup+preseed into lp:maas/1.2

Proposed by Nick Veitch
Status: Rejected
Rejected by: Gavin Panella
Proposed branch: lp:~evilnick/maas/1.2-docs-tidyup+preseed
Merge into: lp:maas/1.2
Diff against target: 1017 lines (+773/-41) (has conflicts)
5 files modified
INSTALL.txt (+85/-31)
docs/conf.py (+1/-1)
docs/configure.rst (+139/-2)
docs/maascli.rst (+10/-5)
docs/man/maas-cli.8.rst (+538/-2)
Text conflict in docs/configure.rst
To merge this branch: bzr merge lp:~evilnick/maas/1.2-docs-tidyup+preseed
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve
Review via email: mp+135894@code.launchpad.net

Commit message

preseed docs added, html generation fixed

Description of the change

added preseed info
fixed error in HTML generation

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Preliminary review notes follow!

Note the conflict in docs/configure.rst.

Also in that file:

286 +It is possible to choose a specific series from those available in a
287 +number of ways.

This looks like a paragraph but there's no blank line to separate it from the preceding one. Also, it might be more straightforwardly phrased as "There are several ways to [...]"

Right below that: it may be just me but it still looks wrong to me to see the noun "login" used as a verb. Wouldn't "log in" be more natural?

This next paragraph looks a bit dry. I think it's because of the "straightforward task" bit in the opening sentence. The paragraph is supposed to be about selecting an Ubuntu series *in the UI*, but the opening sentence goes in another direction: selecting an Ubuntu series *for individual nodes*.

292 +For individual nodes it is a straightforward task to select the Ubuntu
293 +series to install from the user interface. When either adding a node
294 +manually, or on the node page when the node has been automatically
295 +discovered but before it is accepted, there is a drop down menu to select
296 +the version of Ubuntu you wish to install.

How about just leading with something like "The UI lets you select which Ubuntu series you want to install on an individual node"?

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Typo, still in configure.rst: "avaiability"

Also, unless the document has already introduced the concept, it's probably best to refer to "boot images" instead of just "images."

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Another quick & easy note:

358 +find it better to run an ntp service on the MAAS controller and substitute
359 +`ntp.ubuntu.com` in the last line for something else.

"Substitute x for y" works the other way round, doesn't it? Maybe "replace x with y"?

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

In docs/maascli.rst:

424 + distro_series=<value>
425 + Sets the series of Ubuntu to use.

Maybe "release series" to make this clear, and add an example (e.g. "precise" or "quantal") to take away doubts about spelling?

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Also in docs/maascli.rst:

500 +$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0 AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2

I don't know how clear maas-cli's profiles are to new users... Maybe "maas" is a bit generic as a profile name. Would something more arbitrary like "my-maas" or "testmaas" make it clearer that this is a name that the user can freely assign to a MAAS session?

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Love the cup-of-tea-and-a-biscuit in the refresh_workers explanation. It may be worth knowing that the situation where this comes in is one where a cluster controller inexplicably isn't doing things like updating its DNS zone with new nodes, and there are no errors in the log. As you say though, in principle no human should need to call it.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Hope this quote comes out legibile in the MP. Still in maascli.rst:

787 +:samp:`accept <uuid>`
788 +
789 + Accepts a node-group or number of nodegroups indicated by the
790 + supplied UUID
791 +
792 +:samp:`reject <uuid>`
793 +
794 + Rejects a node-group or number of nodegroups indicated by the
795 + supplied UUID

Don't the :samp: lines need some kind of indication that you can pass multiple uuids? Is there a standard way to indicate it?

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Okay, I got a bit sloppy towards the end but for the rest it all looks good to me. Excellent stuff. Thanks!

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

Attempt to merge into lp:maas/1.2 failed due to conflicts:

text conflict in docs/configure.rst

Revision history for this message
MAAS Lander (maas-lander) wrote :

Attempt to merge into lp:maas/1.2 failed due to conflicts:

text conflict in docs/configure.rst

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'INSTALL.txt'
2--- INSTALL.txt 2012-10-04 15:14:12 +0000
3+++ INSTALL.txt 2012-11-23 13:08:24 +0000
4@@ -10,7 +10,8 @@
5 * :ref:`As a fresh install from Ubuntu Server install media. <disc-install>`
6
7
8-If you are interested in testing the latest development version you can also check out the very latest source and build MAAS yourself.
9+If you are interested in testing the latest development version you can
10+also check out the very latest source and build MAAS yourself.
11
12
13 .. _pkg-install:
14@@ -18,16 +19,29 @@
15 Installing MAAS from the archive
16 --------------------------------
17
18-Installing MAAS from packages is thankfully straightforward. There are actually several packages that go into making up a working MAAS install, but for convenience, many of these have been gathered into a virtual package called 'maas' which will install the necessary components for a 'seed cloud', that is a single server that will directly control a group of nodes. The main packages are:
19+Installing MAAS from packages is thankfully straightforward. There are
20+actually several packages that go into making up a working MAAS install,
21+but for convenience, many of these have been gathered into a virtual package
22+called 'maas' which will install the necessary components for a 'seed cloud',
23+that is a single server that will directly control a group of nodes. The main packages are:
24
25- * ``maas`` - seed cloud setup, which includes both the region controller and the cluster controller below.
26+ * ``maas`` - seed cloud setup, which includes both the region controller and
27+the cluster controller below.
28 * ``maas-region-controller`` - includes the web UI, API and database.
29 * ``maas-cluster-controller`` - controls a group ("cluster") of nodes including DHCP management.
30 * ``maas-dhcp``/``maas-dns`` - required when managing dhcp/dns.
31
32-If you need to separate these services or want to deploy an additional cluster controller, you should install the corresponding packages individually (see :ref:`the description of a typical setup <setup>` for more background on how a typical hardware setup might be arranged).
33+If you need to separate these services or want to deploy an additional cluster
34+controller, you should install the corresponding packages individually
35+(see :ref:`the description of a typical setup <setup>` for more background
36+on how a typical hardware setup might be arranged).
37
38-There are two suggested additional packages 'maas-dhcp' and 'maas-dns'. These set up MAAS-controlled DHCP and DNS services which greatly simplify deployment if you are running a typical setup where the MAAS controller can run the network (Note: These **must** be installed if you later set the options in the web interface to have MAAS manage DHCP/DNS). If you need to integrate your MAAS setup under an existing DHCP setup, see :ref:`manual-dhcp`
39+There are two suggested additional packages 'maas-dhcp' and 'maas-dns'. These
40+set up MAAS-controlled DHCP and DNS services which greatly simplify deployment
41+if you are running a typical setup where the MAAS controller can run the
42+network (Note: These **must** be installed if you later set the options in
43+the web interface to have MAAS manage DHCP/DNS). If you need to integrate your
44+MAAS setup under an existing DHCP setup, see :ref:`manual-dhcp`
45
46
47 Install packages
48@@ -37,77 +51,104 @@
49
50 $ sudo apt-get install maas maas-dhcp maas-dns
51
52-You will see a list of packages and a confirmation message to proceed. The exact list will obviously depend on what you already have installed on your server, but expect to add about 200MB of files.
53+You will see a list of packages and a confirmation message to proceed. The
54+exact list will obviously depend on what you already have installed on your
55+server, but expect to add about 200MB of files.
56
57-The configuration for the MAAS controller will automatically run and pop up this config screen:
58+The configuration for the MAAS controller will automatically run and pop up
59+this config screen:
60
61 .. image:: media/install_cluster-config.*
62
63-Here you will need to enter the hostname for where the region controller can be contacted. In many scenarios, you may be running the region controller (i.e. the web and API interface) from a different network address, for example where a server has several network interfaces.
64+Here you will need to enter the hostname for where the region controller can
65+be contacted. In many scenarios, you may be running the region controller
66+(i.e. the web and API interface) from a different network address, for example
67+where a server has several network interfaces.
68
69-Once the configuration scripts have run you should see this message telling you that the system is ready to use:
70+Once the configuration scripts have run you should see this message telling
71+you that the system is ready to use:
72
73 .. image:: media/install_controller-config.*
74
75-The web server is started last, so you have to accept this message before the service is run and you can access the Web interface. Then there are just a few more setup steps :ref:`post_install`
76+The web server is started last, so you have to accept this message before the service is run and you can access the Web interface. Then there are just a few
77+more setup steps :ref:`post_install`
78
79 .. _disc-install:
80
81 Installing MAAS from Ubuntu Server boot media
82 ---------------------------------------------
83
84-If you are installing MAAS as part of a fresh install it is easiest to choose the "Multiple Server install with MAAS" option from the installer and have pretty much everything set up for you.
85-Boot from the Ubuntu Server media and you will be greeted with the usual language selection screen:
86+If you are installing MAAS as part of a fresh install it is easiest to choose
87+the "Multiple Server install with MAAS" option from the installer and have
88+pretty much everything set up for you.
89+Boot from the Ubuntu Server media and you will be greeted with the usual
90+language selection screen:
91
92 .. image:: media/install_01.*
93
94-On the next screen, you will see there is an entry in the menu called "Multiple server install with MAAS". Use the cursor keys to select this and then press Enter.
95+On the next screen, you will see there is an entry in the menu called "Multiple
96+server install with MAAS". Use the cursor keys to select this and then press
97+Enter.
98
99 .. image:: media/install_02.*
100
101-The installer then runs through the usual language and keyboard options. Make your selections using Tab/Cursor keys/Enter to proceed through the install.
102+The installer then runs through the usual language and keyboard options. Make
103+your selections using Tab/Cursor keys/Enter to proceed through the install.
104 The installer will then load various drivers, which may take a moment or two.
105
106 .. image:: media/install_03.*
107
108-The next screen asks for the hostname for this server. Choose something appropriate for your network.
109+The next screen asks for the hostname for this server. Choose something
110+appropriate for your network.
111
112
113 .. image:: media/install_04.*
114
115-Finally we get to the MAAS part! Here there are just two options. We want to "Create a new MAAS on this server" so go ahead and choose that one.
116+Finally we get to the MAAS part! Here there are just two options. We want to
117+"Create a new MAAS on this server" so go ahead and choose that one.
118
119 .. image:: media/install_05.*
120
121-The install now continues as usual. Next you will be prompted to enter a username. This will be the admin user for the actual server that MAAS will be running on (not the same as the MAAS admin user!)
122+The install now continues as usual. Next you will be prompted to enter a
123+username. This will be the admin user for the actual server that MAAS will
124+be running on (not the same as the MAAS admin user!)
125
126 .. image:: media/install_06.*
127
128-As usual you will have the chance to encrypt your home directory. Continue to make selections based on whatever settings suit your usage.
129+As usual you will have the chance to encrypt your home directory. Continue
130+to make selections based on whatever settings suit your usage.
131
132 .. image:: media/install_07.*
133
134-After making selections and partitioning storage, the system software will start to be installed. This part should only take a few minutes.
135+After making selections and partitioning storage, the system software will
136+start to be installed. This part should only take a few minutes.
137
138 .. image:: media/install_09.*
139
140-Various packages will now be configured, including the package manager and update manager. It is important to set these up appropriately so you will receive timely updates of the MAAS server software, as well as other essential services that may run on this server.
141+Various packages will now be configured, including the package manager and
142+update manager. It is important to set these up appropriately so you will
143+receive timely updates of the MAAS server software, as well as other essential services that may run on this server.
144
145 .. image:: media/install_10.*
146
147-The configuration for MAAS will ask you to configure the host address of the server. This should be the IP address you will use to connect to the server (you may have additional interfaces e.g. to run node subnets)
148+The configuration for MAAS will ask you to configure the host address of the
149+server. This should be the IP address you will use to connect to the server
150+(you may have additional interfaces e.g. to run node subnets)
151
152 .. image:: media/install_cluster-config.*
153
154-The next screen will confirm the web address that will be used to the web interface.
155+The next screen will confirm the web address that will be used to the web
156+interface.
157
158 .. image:: media/install_controller-config.*
159
160-After configuring any other packages the installer will finally come to and end. At this point you should eject the boot media.
161+After configuring any other packages the installer will finally come to and
162+end. At this point you should eject the boot media.
163
164 .. image:: media/install_14.*
165
166-After restarting, you should be able to login to the new server with the information you supplied during the install. The MAAS software will run automatically.
167+After restarting, you should be able to login to the new server with the
168+information you supplied during the install. The MAAS software will run automatically.
169
170
171 .. image:: media/install_15.*
172@@ -123,11 +164,13 @@
173
174 Post-Install tasks
175 ==================
176-If you now use a web browser to connect to the region controller, you should see that MAAS is running, but there will also be some errors on the screen:
177+If you now use a web browser to connect to the region controller, you should
178+see that MAAS is running, but there will also be some errors on the screen:
179
180 .. image:: media/install_web-init.*
181
182-The on screen messages will tell you that there are no boot images present, and that you can't login because there is no admin user.
183+The on screen messages will tell you that there are no boot images present,
184+and that you can't login because there is no admin user.
185
186 Create a superuser account
187 --------------------------
188@@ -137,7 +180,11 @@
189
190 $ sudo maas createsuperuser
191
192-Follow the prompts to create the account which you will need to login to the web interface. Unless you have a special need, it is best to accept the default login name of `root`, as it is rather annoying if you forget the username (although you can simply run this command again to create a new superuser).
193+Follow the prompts to create the account which you will need to
194+login to the web interface. Unless you have a special need, it is best to
195+accept the default login name of `root`, as it is rather annoying if you
196+forget the username (although you can simply run this command again to create
197+a new superuser).
198
199
200 Import the boot images
201@@ -158,7 +205,10 @@
202 Login to the server
203 -------------------
204
205-To check that everything is working properly, you should try and login to the server now. Both the error messages should have gone (it can take a few minutes for the boot image files to register) and you can see that there are currently 0 nodes attached to this controller.
206+To check that everything is working properly, you should try and login to
207+the server now. Both the error messages should have gone (it can take a
208+few minutes for the boot image files to register) and you can see that
209+there are currently 0 nodes attached to this controller.
210
211 .. image:: media/install-login.*
212
213@@ -166,7 +216,11 @@
214 Configure DHCP
215 --------------
216
217-If you are using MAAS to control DHCP, you need to set this via the web interface.
218-However, if you are manually configuring a DHCP server, you should take a look at :ref:`manual-dhcp`
219+If you are using MAAS to control DHCP, you need to configure this using the
220+commandline interface, first by :ref:`logging on to the server API <api-key>`
221+and then :ref:`setting up the interface <cli-dhcp>`
222+However, if you are manually configuring a DHCP server, you should take a
223+look at :ref:`manual-dhcp`
224
225-Once everything is set up and running, you are ready to :doc:`start enlisting nodes <nodes>`
226+Once everything is set up and running, you are ready to :doc:`start enlisting
227+nodes <nodes>`
228
229=== modified file 'docs/conf.py'
230--- docs/conf.py 2012-11-21 11:55:59 +0000
231+++ docs/conf.py 2012-11-23 13:08:24 +0000
232@@ -74,7 +74,7 @@
233
234 # List of patterns, relative to source directory, that match files and
235 # directories to ignore when looking for source files.
236-exclude_patterns = ['_build', '_templates']
237+exclude_patterns = ['_build', '_templates', 'man']
238
239 # The reST default role (used for this markup: `text`) to use for all documents.
240 #default_role = None
241
242=== modified file 'docs/configure.rst'
243--- docs/configure.rst 2012-11-22 03:24:37 +0000
244+++ docs/configure.rst 2012-11-23 13:08:24 +0000
245@@ -6,9 +6,17 @@
246 Manual DHCP configuration
247 -------------------------
248
249-There are some circumstances under which you may not wish the master MAAS worker to handle DHCP for the network. In these instances, the existing DHCP server for the network will need its configuration altered to allow MAAS to enlist and control nodes automatically.
250+There are some circumstances under which you may not wish the master MAAS
251+worker to handle DHCP for the network. In these instances, the existing DHCP
252+server for the network will need its configuration altered to allow MAAS to
253+enlist and control nodes automatically.
254
255+<<<<<<< TREE
256 At the very least the filename should be set to pxelinux.0.
257+=======
258+At the very least the next-server should point to the MAAS controller host
259+address and the filename should be set to pxelinux.0
260+>>>>>>> MERGE-SOURCE
261
262 The configuration entry may look something like this::
263
264@@ -21,9 +29,9 @@
265 }
266
267 .. _ssl:
268+
269 SSL Support
270 -----------
271-
272 If you want secure access to your MAAS web UI/API, you need to do a few
273 things. First, turn on SSL support in Apache::
274
275@@ -43,3 +51,132 @@
276 edit ``/etc/apache2/conf.d/maas-http.conf`` to set the location of the
277 certificate.
278
279+
280+Choosing a series to install
281+----------------------------
282+
283+You may have some specific reason to choose a particular version of Ubuntu
284+to install on your nodes, perhaps based around package avaiability,
285+hardware support or some other reason.
286+It is possible to choose a specific series from those available in a
287+number of ways.
288+
289+From the user interface
290+^^^^^^^^^^^^^^^^^^^^^^^
291+
292+For individual nodes it is a straightforward task to select the Ubuntu
293+series to install from the user interface. When either adding a node
294+manually, or on the node page when the node has been automatically
295+discovered but before it is accepted, there is a drop down menu to select
296+the version of Ubuntu you wish to install.
297+
298+.. image:: media/series.*
299+
300+The menu will always list all the currently available series according
301+to which images are available.
302+
303+Using the maas-cli command
304+^^^^^^^^^^^^^^^^^^^^^^^^^^
305+
306+It is also possible to select a series using the maas-cli command. This
307+can be done on a per node basis with::
308+
309+ $ maas-cli <profile> node update <system_id> distro_series="<value>"
310+
311+Where the string contains one of the valid, available distro series, or
312+is empty for the default value.
313+
314+
315+.. _preseed:
316+
317+Altering the Preseed file
318+-------------------------
319+
320+.. warning::
321+ Do not try to alter the preseed files if you don't have a good
322+ understanding of what you are doing. Altering the installed version
323+ of Ubuntu can prevent MAAS from working as intended, and may have
324+ security and stability consequences.
325+
326+When MAAS commissions a node it installs a version of Ubuntu. The
327+installation is performed using a 'preseed' file, which is
328+effectively a list of answers to the questions you would get were
329+you to run the installer manually.
330+The preseed file used by MAAS is carefully made so that the
331+target node can be brought up and do all the jobs expected of it.
332+However, in exceptional circumstances, you may wish to alter the
333+pressed file to work around some issue.
334+There are actually two preseed files, stored here::
335+
336+ /usr/share/maas/preseeds/generic
337+ /usr/share/maas/preseeds/preseed-master
338+
339+The generic file actually references the preseed-master file, and is
340+used to set conditional parameters based on the type of series and
341+architecture to install as well as to define the minimum set of install
342+packages and to tidy up the PXE boot process if that has been used for
343+the node. Unless you have a specific need to change where install
344+packages come from, you should not need to edit this file.
345+
346+For the more usual sorts of things you may wish to change, you should
347+edit the preseed-master file. For example, depending on your network
348+you may wish to change the clock settings::
349+
350+ # Local clock (set to UTC and use ntp)
351+ d-i clock-setup/utc boolean true
352+ d-i clock-setup/ntp boolean true
353+ d-i clock-setup/ntp-server string ntp.ubuntu.com
354+
355+Having consistent clocks is very important to the working of your MAAS
356+system overall. If your nodes however cannot freely access the internet,
357+the supplied ntp server is not going to be very useful, and you may
358+find it better to run an ntp service on the MAAS controller and substitute
359+`ntp.ubuntu.com` in the last line for something else.
360+
361+One thing you may wish to alter in the preseed file is the disk
362+partitioning. This is a simple recipe that creates a swap partition and
363+uses the rest of the disk for one large root filesystem::
364+
365+ partman-auto/text/atomic_scheme ::
366+
367+ 500 10000 1000000 ext3
368+ $primary{ }
369+ $bootable{ }
370+ method{ format }
371+ format{ }
372+ use_filesystem{ }
373+ filesystem{ ext3 }
374+ mountpoint{ / } .
375+
376+ 64 512 300% linux-swap
377+ method{ swap }
378+ format{ } .
379+
380+
381+Here the root partition must be at least 500 mb, and has effectively no
382+maximum size. The swap partition ranges from 64 mb to 3 times the system's
383+ram.
384+Adding `$bootable{ }` to make the partition bootable, and $primary{ }
385+marks it as the primary partition. The other specifiers used are:
386+
387+*method{ format }*
388+ Used to make the partition be formatted. For swap partitions,
389+ change it to "swap". To create a new partition but do not
390+ format it, change "format" to "keep" (such a partition can be
391+ used to reserve for future use some disk space).
392+*format{ }*
393+ Also needed to make the partition be formatted.
394+*use_filesystem{ }*
395+ Specifies that the partition has a filesystem on it.
396+*filesystem{ ext3 }*
397+ Specifies the filesystem to put on the partition.
398+*mountpoint{ / }*
399+ Where to mount the partition.
400+
401+For more information on preseed option, you should refer to
402+`the official Ubuntu documentation <https://help.ubuntu.com/12.04/installation-guide/i386/preseed-contents.html>`_
403+
404+.. note::
405+ Future versions of MAAS are likely to replace this type of automatic
406+ installation with a different installer.
407+
408
409=== modified file 'docs/maascli.rst'
410--- docs/maascli.rst 2012-11-13 11:57:31 +0000
411+++ docs/maascli.rst 2012-11-23 13:08:24 +0000
412@@ -21,6 +21,7 @@
413
414 A new page will load...
415
416+.. only:: html
417 .. image:: media/maascli-key.*
418
419 The very first item is a list of MAAS keys. One will have already been
420@@ -189,9 +190,12 @@
421 is a string containing a valid architecture type,
422 e.g. "i386/generic"
423
424+ distro_series=<value>
425+ Sets the series of Ubuntu to use.
426+
427 power_type=<value>
428- Apply the given dotted decimal value as the broadcast IP address
429- for this subnet.
430+ Sets the type of power management used on the node, e.g. "ipmi" or
431+ "virsh".
432
433 power_parameters_{param1}... =<value>
434 Set the given power parameters. Note that the valid options for these
435@@ -351,9 +355,10 @@
436
437 node-group-interface
438 ^^^^^^^^^^^^^^^^^^^^
439-For managing the interfaces. See also :ref:`node_group_interfaces`
440+For managing the interfaces. See also
441+:ref:`node_group_interfaces <node_group_interfaces>`
442
443-Usage: maas-cli *<profile>* node-group-interfaces [-d --debug] [-h
444+Usage: maas-cli *<profile>* node-group-interface [-d --debug] [-h
445 --help] [-k --insecure] read | update | delete [parameters...]
446
447 ..program:: maas-cli node-group-interface
448@@ -418,7 +423,7 @@
449 (manage DHCP) and 2 (manage DHCP and DNS).
450
451
452-.. _node-group-interfaces
453+.. _node-group-interfaces:
454 node-group-interfaces
455 ^^^^^^^^^^^^^^^^^^^^^
456
457
458=== modified file 'docs/man/maas-cli.8.rst'
459--- docs/man/maas-cli.8.rst 2012-11-21 11:55:59 +0000
460+++ docs/man/maas-cli.8.rst 2012-11-23 13:08:24 +0000
461@@ -2,7 +2,6 @@
462 maas-cli
463 --------
464
465-
466 Usage
467 ^^^^^
468
469@@ -15,7 +14,544 @@
470 Description
471 ^^^^^^^^^^^
472
473-.. include:: ../maascli.rst
474+As well as the web interface, many tasks can be performed by accessing
475+the MAAS API directly through the maas-cli command. This section
476+details how to login with this tool and perform some common
477+operations.
478+
479+
480+Logging in
481+----------
482+
483+Before the API will accept any commands from maas-cli, you must first
484+login. To do this, you need the API key which can be found in the user
485+interface.
486+
487+Login to the web interface on your MAAS. Click on the username in the
488+top right corner and select 'Preferences' from the menu which appears.
489+
490+The very first item is a list of MAAS keys. One will have already been
491+generated when the system was installed. It's easiest to just select
492+and copy the key (it's quite long!) and then paste it into the
493+commandline. The format of the login command is::
494+
495+ $ maas-cli login <profile-name> <hostname> <key>
496+
497+The profile created is an easy way of associating your credentials with any
498+subsequent call to the API. So an example login might look like this::
499+
500+$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0 AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2
501+
502+which creates the profile 'maas' and registers it with the given key at the
503+specified API endpoint.
504+If you omit the credentials, they will be prompted for in the console. It is
505+also possible to use a hyphen, '-' in place of the credentials. In this case a
506+single line will be read from stdin, stripped of any whitespace and used as the
507+credentials, which can be useful if you are devolping scripts for specific
508+tasks.
509+If an empty string is passed instead of the credentials, the profile will be
510+logged in anonymously (and consequently some of the API calls will not be
511+available)
512+
513+
514+maas-cli commands
515+-----------------
516+
517+The ``maas-cli`` command exposes the whole API, so you can do anything
518+you actually *can* do with MAAS using this command. Unsurprisingly,
519+this leaves us with a vast number of options.
520+
521+The main maas-cli commands are:
522+
523+.. program:: maas-cli
524+
525+:samp:`list`
526+
527+ lists the details [name url auth-key] of all the currently logged-in
528+ profiles.
529+
530+:samp:`login <profile> <url> <key>`
531+
532+ Logs in to the MAAS controller API at the given URL, using the key
533+ provided and associates this connection with the given profile name.
534+
535+:samp:`logout <profile>`
536+
537+ Logs out from the given profile, flushing the stored credentials.
538+
539+:samp:`refresh`
540+
541+ Refreshes the API descriptions of all the current logged in
542+ profiles. This may become necessary for example when upgrading the
543+ maas packages to ensure the command-line options match with the API.
544+
545+:samp:`<profile> [command] [options] ...`
546+
547+ Using the given profile name instructs ``maas-cli`` to direct the
548+ subsequent commands and options to the relevant MAAS, which for the
549+ current API are detailed below...
550+
551+
552+account
553+^^^^^^^
554+This command is used for creating and destroying the
555+MAAS authorisation tokens associated with a profile.
556+
557+Usage: maas-cli *<profile>* account [-d --debug] [-h --help]
558+create-authorisation-token | delete-authorisation-token [token_key=\
559+*<value>*]
560+
561+.. program:: maas-cli account
562+
563+:samp:`-d, --debug`
564+
565+ Displays debug information listing the API responses.
566+
567+:samp:`-h, --help`
568+
569+ Display usage information.
570+
571+:samp:`-k, --insecure`
572+
573+ Disables the SSL certificate check.
574+
575+:samp:`create-authorisation-token`
576+
577+ Creates a new MAAS authorisation token for the current profile
578+ which can be used to authenticate connections to the API.
579+
580+:samp:`delete-authorisation-token token_key=<value>`
581+
582+ Removes the given key from the list of authorisation tokens.
583+
584+
585+node
586+^^^^
587+
588+API calls which operate on individual nodes. With these commands, the
589+node is always identified by its "system_id" property - a unique tag
590+allocated at the time of enlistment. To discover the value of the
591+system_id, you can use the ``maas-cli <profile> nodes list`` command.
592+
593+USAGE: maas-cli <profile> node [-h] release | start | stop | delete |
594+read | update <system_id>
595+
596+.. program:: maas-cli node
597+
598+:samp:`-h, --help`
599+
600+ Display usage information.
601+
602+:samp:`release <system_id>`
603+
604+ Releases the node given by *<system_id>*
605+
606+:samp:`start <system_id>`
607+
608+ Powers up the node identified by *<system_id>* (where MAAS has
609+ information for power management for this node).
610+
611+:samp:`stop <system_id>`
612+
613+ Powers off the node identified by *<system_id>* (where MAAS has
614+ information for power management for this node).
615+
616+:samp:`delete <system_id>`
617+
618+ Removes the given node from the MAAS database.
619+
620+:samp:`read <system_id>`
621+
622+ Returns all the current known information about the node specified
623+ by *<system_id>*
624+
625+:samp:`update <system_id> [parameters...]`
626+
627+ Used to change or set specific values for the node. The valid
628+ parameters are listed below::
629+
630+ hostname=<value>
631+ The new hostname for this node.
632+
633+ architecture=<value>
634+ Sets the architecture type, where <value>
635+ is a string containing a valid architecture type,
636+ e.g. "i386/generic"
637+
638+ distro_series=<value>
639+ Sets the series of Ubuntu to use.
640+
641+ power_type=<value>
642+ Sets the type of power management used on the node, e.g. "ipmi" or
643+ "virsh".
644+
645+ power_parameters_{param1}... =<value>
646+ Set the given power parameters. Note that the valid options for these
647+ depend on the power type chosen.
648+
649+ power_parameters_skip_check 'true' | 'false'
650+ Whether to sanity check the supplied parameters against this node's
651+ declared power type. The default is 'false'.
652+
653+
654+
655+.. _cli-power:
656+
657+Example: Setting the power parameters for an ipmi enabled node::
658+
659+ maas-cli maas node update <system_id> \
660+ power_type="ipmi" \
661+ power_parameters_power_address=192.168.22.33 \
662+ power_parameters_power_user=root \
663+ power_parameters_power_pass=ubuntu;
664+
665+
666+
667+
668+nodes
669+^^^^^
670+
671+Usage: maas-cli <profile> nodes [-h] is-registered | list-allocated |
672+acquire | list | accept | accept-all | new | check-commissioning
673+
674+.. program:: maas-cli nodes
675+
676+:samp:`-h, --help`
677+
678+ Display usage information.
679+
680+
681+:samp:`accept <system_id>`
682+
683+ Accepts the node referenced by <system_id>.
684+
685+:samp:`accept-all`
686+
687+ Accepts all currently discovered but not previously accepted nodes.
688+
689+:samp:`acquire`
690+
691+ Allocates a node to the profile used to issue the command. Any
692+ ready node may be allocated.
693+
694+:samp:`is-registered mac_address=<address>`
695+
696+ Checks to see whether the specified MAC address is registered to a
697+ node.
698+
699+:samp:`list`
700+
701+ Returns a JSON formatted object listing all the currently known
702+ nodes, their system_id, status and other details.
703+
704+:samp:`list-allocated`
705+
706+ Returns a JSON formatted object listing all the currently allocated
707+ nodes, their system_id, status and other details.
708+
709+:samp:`new architecture=<value> mac_addresses=<value> [parameters]`
710+
711+ Creates a new node entry given the provided key=value information
712+ for the node. A minimum of the MAC address and architecture must be
713+ provided. Other parameters may also be supplied::
714+
715+ architecture="<value>" - The architecture of the node, must be
716+ one of the recognised architecture strings (e.g. "i386/generic")
717+ hostname="<value>" - a name for this node. If not supplied a name
718+ will be generated.
719+ mac_addresses="<value>" - The mac address(es)
720+ allocated to this node.
721+ powertype="<value>" - the power type of
722+ the node (e.g. virsh, ipmi)
723+
724+
725+:samp:`check-commissioning`
726+
727+ Displays current status of nodes in the commissioning phase. Any
728+ that have not returned before the system timeout value are listed
729+ as "failed".
730+
731+Examples:
732+Accept and commission all discovered nodes::
733+
734+ $ maas-cli maas nodes accept-all
735+
736+List all known nodes::
737+
738+ $ maas-cli maas nodes list
739+
740+Filter the list using specific key/value pairs::
741+
742+ $ maas-cli maas nodes list architecture="i386/generic"
743+
744+
745+
746+node-groups
747+^^^^^^^^^^^
748+Usage: maas-cli <profile> node-groups [-d --debug] [-h --help] [-k
749+--insecure] register | list | refresh-workers | accept | reject
750+
751+.. program:: maas-cli node-groups
752+
753+:samp:`-d, --debug`
754+
755+ Displays debug information listing the API responses.
756+
757+:samp:`-h, --help`
758+
759+ Display usage information.
760+
761+:samp:`-k, --insecure`
762+
763+ Disables the SSL certificate check.
764+
765+:samp:`register uuid=<value> name=<value> interfaces=<json_string>`
766+
767+ Registers a new node group with the given name and uuid. The
768+ interfaces parameter must be supplied in the form of a JSON string
769+ comprising the key/value data for the interface to be used, for
770+ example: interface='["ip":"192.168.21.5","interface":"eth1", \
771+ "subnet_mask":"255.255.255.0","broadcast_ip":"192.168.21.255", \
772+ "router_ip":"192.168.21.1", "ip_range_low":"192.168.21.10", \
773+ "ip_range_high":"192.168.21.50"}]'
774+
775+:samp:`list`
776+
777+ Returns a JSON list of all currently defined node groups.
778+
779+:samp:`refresh_workers`
780+
781+ It sounds a bit like they will get a cup of tea and a
782+ biscuit. Actually this just sends each node-group worker an update
783+ of its credentials (API key, node-group name). This command is
784+ usually not needed at a user level, but is often used by worker
785+ nodes.
786+
787+:samp:`accept <uuid>`
788+
789+ Accepts a node-group or number of nodegroups indicated by the
790+ supplied UUID
791+
792+:samp:`reject <uuid>`
793+
794+ Rejects a node-group or number of nodegroups indicated by the
795+ supplied UUID
796+
797+
798+
799+node-group-interface
800+^^^^^^^^^^^^^^^^^^^^
801+For managing the interfaces. See also
802+"node_group_interfaces"
803+
804+Usage: maas-cli *<profile>* node-group-interface [-d --debug] [-h
805+--help] [-k --insecure] read | update | delete [parameters...]
806+
807+..program:: maas-cli node-group-interface
808+
809+:samp:`read <uuid> <interface>`
810+
811+ Returns the current settings for the given UUID and interface
812+
813+:samp:`update [parameters]`
814+
815+ Changes the settings for the interface according to the given
816+ parameters::
817+
818+ management= 0 | 1 | 2
819+ The service to be managed on the interface ( 0= none, 1=DHCP, 2=DHCP
820+ and DNS).
821+
822+ subnet_mask=<value>
823+ Apply the given dotted decimal value as the subnet mask.
824+
825+ broadcast_ip=<value>
826+ Apply the given dotted decimal value as the broadcast IP address for
827+ this subnet.
828+
829+ router_ip=<value>
830+ Apply the given dotted decimal value as the default router address
831+ for this subnet.
832+
833+ ip_range_low=<value>
834+ The lowest value of IP address to allocate via DHCP
835+
836+ ip_range_high=<value>
837+ The highest value of IP address to allocate via DHCP
838+
839+:samp:`delete <uuid> <interface>`
840+
841+ Removes the entry for the given UUID and interface.
842+
843+
844+Example:
845+Configuring DHCP and DNS.
846+
847+To enable MAAS to manage DHCP and DNS, it needs to be supplied with the relevant
848+interface information. To do this we need to first determine the UUID of the
849+node group affected::
850+
851+ $ uuid=$(maas-cli <profile> node-groups list | grep uuid | cut -d\" -f4)
852+
853+Once we have the UUID we can use this to update the node-group-interface for
854+that nodegroup, and pass it the relevant interface details::
855+
856+ $ maas-cli <profile> node-group-interface update $uuid eth0 \
857+ ip_range_high=192.168.123.200 \
858+ ip_range_low=192.168.123.100 \
859+ management=2 \
860+ broadcast_ip=192.168.123.255 \
861+ router_ip=192.168.123.1 \
862+
863+Replacing the example values with those required for this network. The only
864+non-obvious parameter is 'management' which takes the values 0 (no management), 1
865+(manage DHCP) and 2 (manage DHCP and DNS).
866+
867+
868+node-group-interfaces
869+^^^^^^^^^^^^^^^^^^^^^
870+
871+The node-group-interfaces commands are used for configuring the
872+management of DHCP and DNS services where these are managed by MAAS.
873+
874+Usage: maas-cli *<profile>* node-group-interfaces [-d --debug] [-h
875+--help] [-k --insecure] list | new [parameters...]
876+
877+.. program:: maas-cli node-group-interfaces
878+
879+:samp:`-d, --debug`
880+
881+ Displays debug information listing the API responses.
882+
883+:samp:`-h, --help`
884+
885+ Display usage information.
886+
887+:samp:`-k, --insecure`
888+
889+ Disables the SSL certificate check.
890+
891+:samp:`list <label>`
892+
893+ Lists the current stored configurations for the given identifier
894+ <label> in a key:value format which should be easy to decipher.
895+
896+
897+:samp:`new <label> ip=<value> interface=<if_device> [parameters...]`
898+
899+ Creates a new interface group. The required parameters are the IP
900+ address and the network interface this appies to (e.g. eth0). In
901+ order to do anything useful, further parameters are required::
902+
903+ management= 0 | 1 | 2
904+ The service to be managed on the interface
905+ ( 0= none, 1=DHCP, 2=DHCP and DNS).
906+
907+ subnet_mask=<value>
908+ Apply the given dotted decimal value as the subnet mask.
909+
910+ broadcast_ip=<value>
911+ Apply the given dotted decimal value as the
912+ broadcast IP address for this subnet.
913+
914+ router_ip=<value>
915+ Apply the given dotted decimal value as the
916+ default router address for this subnet.
917+
918+ ip_range_low=<value>
919+ The lowest value of IP address to allocate via DHCP
920+
921+ ip_range_high=<value>
922+ The highest value of IP address to allocate via DHCP
923+
924+
925+
926+
927+tag
928+^^^
929+
930+Usage: maas-cli <profile> tag read | update-nodes | rebuild | update |
931+ nodes | delete
932+
933+.. program:: maas-cli tag
934+
935+:samp:`read <tag_name>`
936+
937+ Returns information on the tag specified by <name>
938+
939+:samp:`update-nodes <tag_name> [add=<system_id>] [remove=<system_id>] [nodegroup=<system_id>]`
940+
941+ Applies or removes the given tag from a list of nodes specified by
942+ either or both of add="<system_id>" and remove="<system_id>". The
943+ nodegroup parameter, which restricts the operations to a particular
944+ nodegroup, is optional, but only the superuser can execute this
945+ command without it.
946+
947+:samp:`rebuild`
948+
949+ Triggers a rebuild of the tag to node mapping.
950+
951+:samp:`update <tag_name> [name=<value>] | [comment=<value>]|[definition=<value>]`
952+
953+ Updates the tag identified by tag_name. Any or all of name,comment
954+ and definition may be supplied as parameters. If no parameters are
955+ supplied, this command returns the current values.
956+
957+:samp:`nodes <tag_name>`
958+
959+ Returns a list of nodes which are associated with the given tag.
960+
961+:samp:`delete <tag_name>`
962+
963+ Deletes the given tag.
964+
965+tags
966+^^^^
967+Tags are a really useful way of identifying nodes with particular
968+characteristics.
969+
970+Usage: maas-cli <profile> tag [-d --debug] [-h --help] [-k
971+--insecure] list | new
972+
973+.. program:: maas-cli tag
974+
975+:samp:`-d, --debug`
976+
977+ Displays debug information listing the API responses.
978+
979+:samp:`-h, --help`
980+
981+ Display usage information.
982+
983+:samp:`-k, --insecure`
984+
985+ Disables the SSL certificate check.
986+
987+:samp:`list`
988+
989+ Returns a JSON object listing all the current tags known by the MAAS server
990+
991+:samp:`create name=<value> definition=<value> [comment=<value>]`
992+
993+ Creates a new tag with the given name and definition. A comment is
994+ optional. Names must be unique, obviously - an error will be
995+ returned if the given name already exists. The definition is in the form of
996+ an XPath expression which parses the XML returned by running ``lshw`` on the
997+ node.
998+
999+Example:
1000+Adding a tag to all nodes which have an Intel GPU::
1001+
1002+ $ maas-cli maas tags new name='intel-gpu' \
1003+ comment='Machines which have an Intel display driver' \
1004+ definition='contains(//node[@id="display"]/vendor, "Intel")
1005+
1006+
1007+unused commands
1008+^^^^^^^^^^^^^^^
1009+Because the ``maas-cli`` command exposes all of the API, it also lists
1010+some command options which are not really intended for end users, such
1011+as the "file" and "boot-images" options.
1012
1013 Further Documentation
1014 ^^^^^^^^^^^^^^^^^^^^^
1015
1016=== added file 'docs/media/series.png'
1017Binary files docs/media/series.png 1970-01-01 00:00:00 +0000 and docs/media/series.png 2012-11-23 13:08:24 +0000 differ

Subscribers

People subscribed via source and target branches

to status/vote changes: