Merge lp:~evilnick/maas/docs-preeseed+man-page-fixes into lp:~maas-committers/maas/trunk

Proposed by Nick Veitch
Status: Rejected
Rejected by: Nick Veitch
Proposed branch: lp:~evilnick/maas/docs-preeseed+man-page-fixes
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 1559 lines (+876/-220)
4 files modified
INSTALL.txt (+104/-121)
docs/configure.rst (+137/-8)
docs/maascli.rst (+92/-83)
docs/man/maas-cli.8.rst (+543/-8)
To merge this branch: bzr merge lp:~evilnick/maas/docs-preeseed+man-page-fixes
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+135891@code.launchpad.net

Commit message

added preseed docs and fixed man page links

Description of the change

added section on editing preseed
fixed man page/html clash for now

To post a comment you must log in.

Unmerged revisions

1369. By Nick Veitch

new preseed, man page fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'INSTALL.txt'
--- INSTALL.txt 2012-11-20 21:46:37 +0000
+++ INSTALL.txt 2012-11-23 13:00:36 +0000
@@ -1,18 +1,17 @@
1.. -*- mode: rst -*-1.. -*- mode: rst -*-
22
33
4Installing MAAS4Installing MAAS
5===============5===============
66
7There are two main ways to install MAAS7There are two main ways to install MAAS
88
9 * :ref:`From Ubuntu's package archive on an existing Ubuntu9 * :ref:`From Ubuntu's package archive on an existing Ubuntu install. <pkg-install>`
10 install. <pkg-install>`10 * :ref:`As a fresh install from Ubuntu Server install media. <disc-install>`
11 * :ref:`As a fresh install from Ubuntu Server install11
12 media. <disc-install>`
1312
14If you are interested in testing the latest development version you13If you are interested in testing the latest development version you can
15can also check out the very latest source and build MAAS yourself.14also check out the very latest source and build MAAS yourself.
1615
1716
18.. _pkg-install:17.. _pkg-install:
@@ -21,33 +20,29 @@
21--------------------------------20--------------------------------
2221
23Installing MAAS from packages is thankfully straightforward. There are22Installing MAAS from packages is thankfully straightforward. There are
24actually several packages that go into making up a working MAAS23actually several packages that go into making up a working MAAS install,
25install, but for convenience, many of these have been gathered into a24but for convenience, many of these have been gathered into a virtual package
26virtual package called 'maas' which will install the necessary25called 'maas' which will install the necessary components for a 'seed cloud',
27components for a 'seed cloud', that is a single server that will26that is a single server that will directly control a group of nodes. The main packages are:
28directly control a group of nodes. The main packages are:
2927
30 * ``maas`` - seed cloud setup, which includes both the region28 * ``maas`` - seed cloud setup, which includes both the region controller and
31 controller and the cluster controller below.29the cluster controller below.
32 * ``maas-region-controller`` - includes the web UI, API and database.30 * ``maas-region-controller`` - includes the web UI, API and database.
33 * ``maas-cluster-controller`` - controls a group ("cluster") of nodes31 * ``maas-cluster-controller`` - controls a group ("cluster") of nodes including DHCP management.
34 including DHCP management.
35 * ``maas-dhcp``/``maas-dns`` - required when managing dhcp/dns.32 * ``maas-dhcp``/``maas-dns`` - required when managing dhcp/dns.
3633
37If you need to separate these services or want to deploy an additional34If you need to separate these services or want to deploy an additional cluster
38cluster controller, you should install the corresponding packages35controller, you should install the corresponding packages individually
39individually (see :ref:`the description of a typical setup <setup>`36(see :ref:`the description of a typical setup <setup>` for more background
40for more background on how a typical hardware setup might be37on how a typical hardware setup might be arranged).
41arranged).38
4239There are two suggested additional packages 'maas-dhcp' and 'maas-dns'. These
43There are two suggested additional packages 'maas-dhcp' and40set up MAAS-controlled DHCP and DNS services which greatly simplify deployment
44'maas-dns'. These set up MAAS-controlled DHCP and DNS services which41if you are running a typical setup where the MAAS controller can run the
45greatly simplify deployment if you are running a typical setup where42network (Note: These **must** be installed if you later set the options in
46the MAAS controller can run the network (Note: These **must** be43the web interface to have MAAS manage DHCP/DNS). If you need to integrate your
47installed if you later set the options in the web interface to have44MAAS setup under an existing DHCP setup, see :ref:`manual-dhcp`
48MAAS manage DHCP/DNS). If you need to integrate your MAAS setup under45
49an existing DHCP setup, see :ref:`manual-dhcp`
50
5146
52Install packages47Install packages
53^^^^^^^^^^^^^^^^48^^^^^^^^^^^^^^^^
@@ -56,118 +51,110 @@
5651
57 $ sudo apt-get install maas maas-dhcp maas-dns52 $ sudo apt-get install maas maas-dhcp maas-dns
5853
59You will see a list of packages and a confirmation message to54You will see a list of packages and a confirmation message to proceed. The
60proceed. The exact list will obviously depend on what you already have55exact list will obviously depend on what you already have installed on your
61installed on your server, but expect to add about 200MB of files.56server, but expect to add about 200MB of files.
6257
63The configuration for the MAAS controller will automatically run and58The configuration for the MAAS controller will automatically run and pop up
64pop up this config screen:59this config screen:
6560
66.. image:: media/install_cluster-config.*61.. image:: media/install_cluster-config.*
6762
68Here you will need to enter the hostname for where the region63Here you will need to enter the hostname for where the region controller can
69controller can be contacted. In many scenarios, you may be running the64be contacted. In many scenarios, you may be running the region controller
70region controller (i.e. the web and API interface) from a different65(i.e. the web and API interface) from a different network address, for example
71network address, for example where a server has several network66where a server has several network interfaces.
72interfaces.
7367
74Once the configuration scripts have run you should see this message68Once the configuration scripts have run you should see this message telling
75telling you that the system is ready to use:69you that the system is ready to use:
7670
77.. image:: media/install_controller-config.*71.. image:: media/install_controller-config.*
7872
79The web server is started last, so you have to accept this message73The 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
80before the service is run and you can access the Web interface. Then74more setup steps :ref:`post_install`
81there are just a few more setup steps :ref:`post_install`
82
8375
84.. _disc-install:76.. _disc-install:
8577
86Installing MAAS from Ubuntu Server boot media78Installing MAAS from Ubuntu Server boot media
87---------------------------------------------79---------------------------------------------
8880
89If you are installing MAAS as part of a fresh install it is easiest to81If you are installing MAAS as part of a fresh install it is easiest to choose
90choose the "Multiple Server install with MAAS" option from the82the "Multiple Server install with MAAS" option from the installer and have
91installer and have pretty much everything set up for you. Boot from83pretty much everything set up for you.
92the Ubuntu Server media and you will be greeted with the usual84Boot from the Ubuntu Server media and you will be greeted with the usual
93language selection screen:85language selection screen:
9486
95.. image:: media/install_01.*87.. image:: media/install_01.*
9688
97On the next screen, you will see there is an entry in the menu called89On the next screen, you will see there is an entry in the menu called "Multiple
98"Multiple server install with MAAS". Use the cursor keys to select90server install with MAAS". Use the cursor keys to select this and then press
99this and then press Enter.91Enter.
10092
101.. image:: media/install_02.*93.. image:: media/install_02.*
10294
103The installer then runs through the usual language and keyboard95The installer then runs through the usual language and keyboard options. Make
104options. Make your selections using Tab/Cursor keys/Enter to proceed96your selections using Tab/Cursor keys/Enter to proceed through the install.
105through the install. The installer will then load various drivers,97The installer will then load various drivers, which may take a moment or two.
106which may take a moment or two.
10798
108.. image:: media/install_03.*99.. image:: media/install_03.*
109100
110The next screen asks for the hostname for this server. Choose101The next screen asks for the hostname for this server. Choose something
111something appropriate for your network.102appropriate for your network.
103
112104
113.. image:: media/install_04.*105.. image:: media/install_04.*
114106
115Finally we get to the MAAS part! Here there are just two options. We107Finally we get to the MAAS part! Here there are just two options. We want to
116want to "Create a new MAAS on this server" so go ahead and choose that108"Create a new MAAS on this server" so go ahead and choose that one.
117one.
118109
119.. image:: media/install_05.*110.. image:: media/install_05.*
120111
121The install now continues as usual. Next you will be prompted to enter112The install now continues as usual. Next you will be prompted to enter a
122a username. This will be the admin user for the actual server that113username. This will be the admin user for the actual server that MAAS will
123MAAS will be running on (not the same as the MAAS admin user!)114be running on (not the same as the MAAS admin user!)
124115
125.. image:: media/install_06.*116.. image:: media/install_06.*
126117
127As usual you will have the chance to encrypt your home118As usual you will have the chance to encrypt your home directory. Continue
128directory. Continue to make selections based on whatever settings suit119to make selections based on whatever settings suit your usage.
129your usage.
130120
131.. image:: media/install_07.*121.. image:: media/install_07.*
132122
133After making selections and partitioning storage, the system software123After making selections and partitioning storage, the system software will
134will start to be installed. This part should only take a few minutes.124start to be installed. This part should only take a few minutes.
135125
136.. image:: media/install_09.*126.. image:: media/install_09.*
137127
138Various packages will now be configured, including the package manager128Various packages will now be configured, including the package manager and
139and update manager. It is important to set these up appropriately so129update manager. It is important to set these up appropriately so you will
140you will receive timely updates of the MAAS server software, as well130receive timely updates of the MAAS server software, as well as other essential services that may run on this server.
141as other essential services that may run on this server.
142131
143.. image:: media/install_10.*132.. image:: media/install_10.*
144133
145The configuration for MAAS will ask you to configure the host address134The configuration for MAAS will ask you to configure the host address of the
146of the server. This should be the IP address you will use to connect135server. This should be the IP address you will use to connect to the server
147to the server (you may have additional interfaces e.g. to run node136(you may have additional interfaces e.g. to run node subnets)
148subnets)
149137
150.. image:: media/install_cluster-config.*138.. image:: media/install_cluster-config.*
151139
152The next screen will confirm the web address that will be used to the140The next screen will confirm the web address that will be used to the web
153web interface.141interface.
154142
155.. image:: media/install_controller-config.*143.. image:: media/install_controller-config.*
156144
157After configuring any other packages the installer will finally come145After configuring any other packages the installer will finally come to and
158to and end. At this point you should eject the boot media.146end. At this point you should eject the boot media.
159147
160.. image:: media/install_14.*148.. image:: media/install_14.*
161149
162After restarting, you should be able to login to the new server with150After restarting, you should be able to login to the new server with the
163the information you supplied during the install. The MAAS software151information you supplied during the install. The MAAS software will run automatically.
164will run automatically.152
165153
166.. image:: media/install_15.*154.. image:: media/install_15.*
167155
168**NOTE:** The maas-dhcp and maas-dns packages are not installed by156
169default. If you want to have MAAS run DHCP and DNS services, you157**NOTE:** The maas-dhcp and maas-dns packages are not installed by default. If you want to have MAAS run DHCP and DNS services, you should install these packages::
170should install these packages::
171158
172 $ sudo apt-get install maas-dhcp maas-dns159 $ sudo apt-get install maas-dhcp maas-dns
173160
@@ -175,19 +162,15 @@
175162
176.. _post_install:163.. _post_install:
177164
178
179Post-Install tasks165Post-Install tasks
180==================166==================
181167If you now use a web browser to connect to the region controller, you should
182If you now use a web browser to connect to the region controller, you168see that MAAS is running, but there will also be some errors on the screen:
183should see that MAAS is running, but there will also be some errors on
184the screen:
185169
186.. image:: media/install_web-init.*170.. image:: media/install_web-init.*
187171
188The on screen messages will tell you that there are no boot images172The on screen messages will tell you that there are no boot images present,
189present, and that you can't login because there is no admin user.173and that you can't login because there is no admin user.
190
191174
192Create a superuser account175Create a superuser account
193--------------------------176--------------------------
@@ -197,37 +180,35 @@
197180
198 $ sudo maas createsuperuser181 $ sudo maas createsuperuser
199182
200Follow the prompts to create the account which you will need to login183Follow the prompts to create the account which you will need to
201to the web interface. Unless you have a special need, it is best to184login to the web interface. Unless you have a special need, it is best to
202accept the default login name of `root`, as it is rather annoying if185accept the default login name of `root`, as it is rather annoying if you
203you forget the username (although you can simply run this command186forget the username (although you can simply run this command again to create
204again to create a new superuser).187a new superuser).
205188
206189
207Import the boot images190Import the boot images
208----------------------191----------------------
209192
210MAAS will check for and download new Ubuntu images once a week.193MAAS will check for and download new Ubuntu images once a week.
211However, you'll need to download them manually the first time. To do194However, you'll need to download them manually the first time::
212this you will need to connect to the MAAS API using the maas-cli195
213tool. (see :ref:`Logging in <api-key>` for details). Then you need to196 $ sudo maas-import-pxe-files
214run the command::197
215198If you are using an HTTP proxy, bear in mind that the "sudo" will not
216 $ maas-cli maas node-groups import-boot-images199pass your http_proxy environment variable on to the script. If that is
217200a problem, pass it on explicitly::
218(substitute in a different profile name for 'maas' if you have called201
219yours something else) This will initiate downloading the required202 $ sudo http_proxy=$http_proxy maas-import-pxe-files
220image files. Note that this may take some time depending on your
221network connection.
222203
223204
224Login to the server205Login to the server
225-------------------206-------------------
226207
227To check that everything is working properly, you should try and login208To check that everything is working properly, you should try and login to
228to the server now. Both the error messages should have gone (it can209the server now. Both the error messages should have gone (it can take a
229take a few minutes for the boot image files to register) and you can210few minutes for the boot image files to register) and you can see that
230see that there are currently 0 nodes attached to this controller.211there are currently 0 nodes attached to this controller.
231212
232.. image:: media/install-login.*213.. image:: media/install-login.*
233214
@@ -235,9 +216,11 @@
235Configure DHCP216Configure DHCP
236--------------217--------------
237218
238If you are using MAAS to control DHCP, you need to set this via the219If you are using MAAS to control DHCP, you need to configure this using the
239web interface. However, if you are manually configuring a DHCP220commandline interface, first by :ref:`logging on to the server API <api-key>`
240server, you should take a look at :ref:`manual-dhcp`221and then :ref:`setting up the interface <cli-dhcp>`
222However, if you are manually configuring a DHCP server, you should take a
223look at :ref:`manual-dhcp`
241224
242Once everything is set up and running, you are ready to :doc:`start225Once everything is set up and running, you are ready to :doc:`start enlisting
243enlisting nodes <nodes>`226nodes <nodes>`
244227
=== modified file 'docs/configure.rst'
--- docs/configure.rst 2012-11-22 03:18:35 +0000
+++ docs/configure.rst 2012-11-23 13:00:36 +0000
@@ -1,22 +1,23 @@
1Additional Configuration1Additional Configuration
2========================2========================
33
4
5.. _manual-dhcp:4.. _manual-dhcp:
65
7Manual DHCP configuration6Manual DHCP configuration
8-------------------------7-------------------------
98
10There are some circumstances under which you may not wish the master9There are some circumstances under which you may not wish the master MAAS
11MAAS worker to handle DHCP for the network. In these instances, the10worker to handle DHCP for the network. In these instances, the existing DHCP
12existing DHCP server for the network will need its configuration11server for the network will need its configuration altered to allow MAAS to
13altered to allow MAAS to enlist and control nodes automatically.12enlist and control nodes automatically.
1413
15At the very least the filename should be set to pxelinux.0.14At the very least the next-server should point to the MAAS controller host
15address and the filename should be set to pxelinux.0
1616
17The configuration entry may look something like this::17The configuration entry may look something like this::
1818
19 subnet 192.168.122.0 netmask 255.255.255.0 {19 subnet 192.168.122.0 netmask 255.255.255.0 {
20 next-server 192.168.122.136;
20 filename "pxelinux.0";21 filename "pxelinux.0";
21 option subnet-mask 255.255.255.0;22 option subnet-mask 255.255.255.0;
22 option broadcast-address 192.168.122.255;23 option broadcast-address 192.168.122.255;
@@ -24,12 +25,10 @@
24 range dynamic-bootp 192.168.122.5 192.168.122.135;25 range dynamic-bootp 192.168.122.5 192.168.122.135;
25 }26 }
2627
27
28.. _ssl:28.. _ssl:
2929
30SSL Support30SSL Support
31-----------31-----------
32
33If you want secure access to your MAAS web UI/API, you need to do a few32If you want secure access to your MAAS web UI/API, you need to do a few
34things. First, turn on SSL support in Apache::33things. First, turn on SSL support in Apache::
3534
@@ -48,3 +47,133 @@
48the default SSL certificate is insecure. Please generate your own and then47the default SSL certificate is insecure. Please generate your own and then
49edit ``/etc/apache2/conf.d/maas-http.conf`` to set the location of the48edit ``/etc/apache2/conf.d/maas-http.conf`` to set the location of the
50certificate.49certificate.
50
51
52Choosing a series to install
53----------------------------
54
55You may have some specific reason to choose a particular version of Ubuntu
56to install on your nodes, perhaps based around package avaiability,
57hardware support or some other reason.
58It is possible to choose a specific series from those available in a
59number of ways.
60
61From the user interface
62^^^^^^^^^^^^^^^^^^^^^^^
63
64For individual nodes it is a straightforward task to select the Ubuntu
65series to install from the user interface. When either adding a node
66manually, or on the node page when the node has been automatically
67discovered but before it is accepted, there is a drop down menu to select
68the version of Ubuntu you wish to install.
69
70.. image:: media/series.*
71
72The menu will always list all the currently available series according
73to which images are available.
74
75Using the maas-cli command
76^^^^^^^^^^^^^^^^^^^^^^^^^^
77
78It is also possible to select a series using the maas-cli command. This
79can be done on a per node basis with::
80
81 $ maas-cli <profile> node update <system_id> distro_series="<value>"
82
83Where the string contains one of the valid, available distro series, or
84is empty for the default value.
85
86
87.. _preseed:
88
89Altering the Preseed file
90-------------------------
91
92.. warning::
93 Do not try to alter the preseed files if you don't have a good
94 understanding of what you are doing. Altering the installed version
95 of Ubuntu can prevent MAAS from working as intended, and may have
96 security and stability consequences.
97
98When MAAS commissions a node it installs a version of Ubuntu. The
99installation is performed using a 'preseed' file, which is
100effectively a list of answers to the questions you would get were
101you to run the installer manually.
102The preseed file used by MAAS is carefully made so that the
103target node can be brought up and do all the jobs expected of it.
104However, in exceptional circumstances, you may wish to alter the
105pressed file to work around some issue.
106There are actually two preseed files, stored here::
107
108 /usr/share/maas/preseeds/generic
109 /usr/share/maas/preseeds/preseed-master
110
111The generic file actually references the preseed-master file, and is
112used to set conditional parameters based on the type of series and
113architecture to install as well as to define the minimum set of install
114packages and to tidy up the PXE boot process if that has been used for
115the node. Unless you have a specific need to change where install
116packages come from, you should not need to edit this file.
117
118For the more usual sorts of things you may wish to change, you should
119edit the preseed-master file. For example, depending on your network
120you may wish to change the clock settings::
121
122 # Local clock (set to UTC and use ntp)
123 d-i clock-setup/utc boolean true
124 d-i clock-setup/ntp boolean true
125 d-i clock-setup/ntp-server string ntp.ubuntu.com
126
127Having consistent clocks is very important to the working of your MAAS
128system overall. If your nodes however cannot freely access the internet,
129the supplied ntp server is not going to be very useful, and you may
130find it better to run an ntp service on the MAAS controller and substitute
131`ntp.ubuntu.com` in the last line for something else.
132
133One thing you may wish to alter in the preseed file is the disk
134partitioning. This is a simple recipe that creates a swap partition and
135uses the rest of the disk for one large root filesystem::
136
137 partman-auto/text/atomic_scheme ::
138
139 500 10000 1000000 ext3
140 $primary{ }
141 $bootable{ }
142 method{ format }
143 format{ }
144 use_filesystem{ }
145 filesystem{ ext3 }
146 mountpoint{ / } .
147
148 64 512 300% linux-swap
149 method{ swap }
150 format{ } .
151
152
153Here the root partition must be at least 500 mb, and has effectively no
154maximum size. The swap partition ranges from 64 mb to 3 times the system's
155ram.
156Adding `$bootable{ }` to make the partition bootable, and $primary{ }
157marks it as the primary partition. The other specifiers used are:
158
159*method{ format }*
160 Used to make the partition be formatted. For swap partitions,
161 change it to "swap". To create a new partition but do not
162 format it, change "format" to "keep" (such a partition can be
163 used to reserve for future use some disk space).
164*format{ }*
165 Also needed to make the partition be formatted.
166*use_filesystem{ }*
167 Specifies that the partition has a filesystem on it.
168*filesystem{ ext3 }*
169 Specifies the filesystem to put on the partition.
170*mountpoint{ / }*
171 Where to mount the partition.
172
173For more information on preseed option, you should refer to
174`the official Ubuntu documentation <https://help.ubuntu.com/12.04/installation-guide/i386/preseed-contents.html>`_
175
176.. note::
177 Future versions of MAAS are likely to replace this type of automatic
178 installation with a different installer.
179
51180
=== modified file 'docs/maascli.rst'
--- docs/maascli.rst 2012-11-20 21:46:37 +0000
+++ docs/maascli.rst 2012-11-23 13:00:36 +0000
@@ -1,9 +1,9 @@
1
1As well as the web interface, many tasks can be performed by accessing2As well as the web interface, many tasks can be performed by accessing
2the MAAS API directly through the maas-cli command. This section3the MAAS API directly through the maas-cli command. This section
3details how to login with this tool and perform some common4details how to login with this tool and perform some common
4operations.5operations.
56
6
7.. _api-key:7.. _api-key:
88
9Logging in9Logging in
@@ -19,7 +19,7 @@
19.. only:: html19.. only:: html
20.. image:: media/maascli-prefs.*20.. image:: media/maascli-prefs.*
2121
22A new page will load...22A new page will load...
2323
24.. only:: html24.. only:: html
25.. image:: media/maascli-key.*25.. image:: media/maascli-key.*
@@ -31,21 +31,21 @@
3131
32 $ maas-cli login <profile-name> <hostname> <key>32 $ maas-cli login <profile-name> <hostname> <key>
3333
34The profile created is an easy way of associating your credentials34The profile created is an easy way of associating your credentials with any
35with any subsequent call to the API. So an example login might look35subsequent call to the API. So an example login might look like this::
36like this::
3736
38$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0 AWSCRMzqMNy:jjk...5e1FenoP82Qm5te237$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0 AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2
3938
40which creates the profile 'maas' and registers it with the given key39which creates the profile 'maas' and registers it with the given key at the
41at the specified API endpoint. If you omit the credentials, they will40specified API endpoint.
42be prompted for in the console. It is also possible to use a hyphen,41If you omit the credentials, they will be prompted for in the console. It is
43'-' in place of the credentials. In this case a single line will be42also possible to use a hyphen, '-' in place of the credentials. In this case a
44read from stdin, stripped of any whitespace and used as the43single line will be read from stdin, stripped of any whitespace and used as the
45credentials, which can be useful if you are devolping scripts for44credentials, which can be useful if you are devolping scripts for specific
46specific tasks. If an empty string is passed instead of the45tasks.
47credentials, the profile will be logged in anonymously (and46If an empty string is passed instead of the credentials, the profile will be
48consequently some of the API calls will not be available)47logged in anonymously (and consequently some of the API calls will not be
48available)
4949
5050
51maas-cli commands51maas-cli commands
@@ -77,7 +77,7 @@
77 Logs in to the MAAS controller API at the given URL, using the key77 Logs in to the MAAS controller API at the given URL, using the key
78 provided and associates this connection with the given profile name.78 provided and associates this connection with the given profile name.
7979
80:samp:`logout <profile>`80:samp:`logout <profile>`
8181
82 Logs out from the given profile, flushing the stored credentials.82 Logs out from the given profile, flushing the stored credentials.
8383
@@ -108,12 +108,12 @@
108:samp:`-d, --debug`108:samp:`-d, --debug`
109109
110 Displays debug information listing the API responses.110 Displays debug information listing the API responses.
111111
112:samp:`-h, --help`112:samp:`-h, --help`
113113
114 Display usage information.114 Display usage information.
115115
116:samp:`-k, --insecure`116:samp:`-k, --insecure`
117117
118 Disables the SSL certificate check.118 Disables the SSL certificate check.
119119
@@ -127,6 +127,8 @@
127 Removes the given key from the list of authorisation tokens.127 Removes the given key from the list of authorisation tokens.
128128
129129
130
131
130.. boot-images - not useful in user context132.. boot-images - not useful in user context
131.. ^^^^^^^^^^^133.. ^^^^^^^^^^^
132134
@@ -157,50 +159,54 @@
157 Releases the node given by *<system_id>*159 Releases the node given by *<system_id>*
158160
159:samp:`start <system_id>`161:samp:`start <system_id>`
160162
161 Powers up the node identified by *<system_id>* (where MAAS has163 Powers up the node identified by *<system_id>* (where MAAS has
162 information for power management for this node).164 information for power management for this node).
163165
164:samp:`stop <system_id>`166:samp:`stop <system_id>`
165167
166 Powers off the node identified by *<system_id>* (where MAAS has168 Powers off the node identified by *<system_id>* (where MAAS has
167 information for power management for this node).169 information for power management for this node).
168170
169:samp:`delete <system_id>`171:samp:`delete <system_id>`
170172
171 Removes the given node from the MAAS database.173 Removes the given node from the MAAS database.
172174
173:samp:`read <system_id>`175:samp:`read <system_id>`
174176
175 Returns all the current known information about the node specified177 Returns all the current known information about the node specified
176 by *<system_id>*178 by *<system_id>*
177179
178:samp:`update <system_id> [parameters...]`180:samp:`update <system_id> [parameters...]`
179181
180 Used to change or set specific values for the node. The valid182 Used to change or set specific values for the node. The valid
181 parameters are listed below::183 parameters are listed below::
182184
183 hostname=<value>185 hostname=<value>
184 The new hostname for this node.186 The new hostname for this node.
185187
186 architecture=<value>188 architecture=<value>
187 Sets the architecture type, where <value>189 Sets the architecture type, where <value>
188 is a string containing a valid architecture type,190 is a string containing a valid architecture type,
189 e.g. "i386/generic"191 e.g. "i386/generic"
190192
191 power_type=<value>193 distro_series=<value>
192 Apply the given dotted decimal value as the broadcast IP address194 Sets the series of Ubuntu to use.
193 for this subnet.195
194196 power_type=<value>
195 power_parameters_{param1}... =<value>197 Sets the type of power management used on the node, e.g. "ipmi" or
196 Set the given power parameters. Note that the valid options for these198 "virsh".
199
200 power_parameters_{param1}... =<value>
201 Set the given power parameters. Note that the valid options for these
197 depend on the power type chosen.202 depend on the power type chosen.
198203
199 power_parameters_skip_check 'true' | 'false'204 power_parameters_skip_check 'true' | 'false'
200 Whether to sanity check the supplied parameters against this node's205 Whether to sanity check the supplied parameters against this node's
201 declared power type. The default is 'false'.206 declared power type. The default is 'false'.
202207
203208
209
204.. _cli-power:210.. _cli-power:
205211
206Example: Setting the power parameters for an ipmi enabled node::212Example: Setting the power parameters for an ipmi enabled node::
@@ -212,6 +218,8 @@
212 power_parameters_power_pass=ubuntu;218 power_parameters_power_pass=ubuntu;
213219
214220
221
222
215nodes223nodes
216^^^^^224^^^^^
217225
@@ -291,6 +299,7 @@
291 $ maas-cli maas nodes list architecture="i386/generic"299 $ maas-cli maas nodes list architecture="i386/generic"
292300
293301
302
294node-groups303node-groups
295^^^^^^^^^^^304^^^^^^^^^^^
296Usage: maas-cli <profile> node-groups [-d --debug] [-h --help] [-k305Usage: maas-cli <profile> node-groups [-d --debug] [-h --help] [-k
@@ -301,7 +310,7 @@
301:samp:`-d, --debug`310:samp:`-d, --debug`
302311
303 Displays debug information listing the API responses.312 Displays debug information listing the API responses.
304313
305:samp:`-h, --help`314:samp:`-h, --help`
306315
307 Display usage information.316 Display usage information.
@@ -311,7 +320,7 @@
311 Disables the SSL certificate check.320 Disables the SSL certificate check.
312321
313:samp:`register uuid=<value> name=<value> interfaces=<json_string>`322:samp:`register uuid=<value> name=<value> interfaces=<json_string>`
314323
315 Registers a new node group with the given name and uuid. The324 Registers a new node group with the given name and uuid. The
316 interfaces parameter must be supplied in the form of a JSON string325 interfaces parameter must be supplied in the form of a JSON string
317 comprising the key/value data for the interface to be used, for326 comprising the key/value data for the interface to be used, for
@@ -322,7 +331,7 @@
322331
323:samp:`list`332:samp:`list`
324333
325 Returns a JSON list of all currently defined node groups.334 Returns a JSON list of all currently defined node groups.
326335
327:samp:`refresh_workers`336:samp:`refresh_workers`
328337
@@ -333,7 +342,7 @@
333 nodes.342 nodes.
334343
335:samp:`accept <uuid>`344:samp:`accept <uuid>`
336345
337 Accepts a node-group or number of nodegroups indicated by the346 Accepts a node-group or number of nodegroups indicated by the
338 supplied UUID347 supplied UUID
339348
@@ -343,60 +352,62 @@
343 supplied UUID352 supplied UUID
344353
345354
355
346node-group-interface356node-group-interface
347^^^^^^^^^^^^^^^^^^^^357^^^^^^^^^^^^^^^^^^^^
348For managing the interfaces. See also :ref:`node-group-interfaces`358For managing the interfaces. See also
359:ref:`node_group_interfaces <node_group_interfaces>`
349360
350Usage: maas-cli *<profile>* node-group-interfaces [-d --debug] [-h361Usage: maas-cli *<profile>* node-group-interface [-d --debug] [-h
351--help] [-k --insecure] read | update | delete [parameters...]362--help] [-k --insecure] read | update | delete [parameters...]
352363
353..program:: maas-cli node-group-interface364..program:: maas-cli node-group-interface
354365
355:samp:`read <uuid> <interface>`366:samp:`read <uuid> <interface>`
356367
357 Returns the current settings for the given UUID and interface368 Returns the current settings for the given UUID and interface
358369
359:samp:`update [parameters]`370:samp:`update [parameters]`
360371
361 Changes the settings for the interface according to the given372 Changes the settings for the interface according to the given
362 parameters::373 parameters::
363374
364 management= 0 | 1 | 2375 management= 0 | 1 | 2
365 The service to be managed on the interface ( 0= none, 1=DHCP, 2=DHCP376 The service to be managed on the interface ( 0= none, 1=DHCP, 2=DHCP
366 and DNS).377 and DNS).
367378
368 subnet_mask=<value>379 subnet_mask=<value>
369 Apply the given dotted decimal value as the subnet mask.380 Apply the given dotted decimal value as the subnet mask.
370381
371 broadcast_ip=<value>382 broadcast_ip=<value>
372 Apply the given dotted decimal value as the broadcast IP address for383 Apply the given dotted decimal value as the broadcast IP address for
373 this subnet.384 this subnet.
374385
375 router_ip=<value>386 router_ip=<value>
376 Apply the given dotted decimal value as the default router address387 Apply the given dotted decimal value as the default router address
377 for this subnet.388 for this subnet.
378389
379 ip_range_low=<value>390 ip_range_low=<value>
380 The lowest value of IP address to allocate via DHCP391 The lowest value of IP address to allocate via DHCP
381392
382 ip_range_high=<value>393 ip_range_high=<value>
383 The highest value of IP address to allocate via DHCP394 The highest value of IP address to allocate via DHCP
384395
385:samp:`delete <uuid> <interface>`396:samp:`delete <uuid> <interface>`
386397
387 Removes the entry for the given UUID and interface.398 Removes the entry for the given UUID and interface.
388399
389.. _cli-dhcp:400.. _cli-dhcp:
390401
391Example:402Example:
392Configuring DHCP and DNS.403Configuring DHCP and DNS.
393404
394To enable MAAS to manage DHCP and DNS, it needs to be supplied with the relevant405To enable MAAS to manage DHCP and DNS, it needs to be supplied with the relevant
395interface information. To do this we need to first determine the UUID of the406interface information. To do this we need to first determine the UUID of the
396node group affected::407node group affected::
397408
398 $ uuid=$(maas-cli <profile> node-groups list | grep uuid | cut -d\" -f4)409 $ uuid=$(maas-cli <profile> node-groups list | grep uuid | cut -d\" -f4)
399410
400Once we have the UUID we can use this to update the node-group-interface for411Once we have the UUID we can use this to update the node-group-interface for
401that nodegroup, and pass it the relevant interface details::412that nodegroup, and pass it the relevant interface details::
402413
@@ -407,13 +418,12 @@
407 broadcast_ip=192.168.123.255 \418 broadcast_ip=192.168.123.255 \
408 router_ip=192.168.123.1 \419 router_ip=192.168.123.1 \
409420
410Replacing the example values with those required for this network. The421Replacing the example values with those required for this network. The only
411only non-obvious parameter is 'management' which takes the values 0422non-obvious parameter is 'management' which takes the values 0 (no management), 1
412(no management), 1 (manage DHCP) and 2 (manage DHCP and DNS).423(manage DHCP) and 2 (manage DHCP and DNS).
413424
414425
415.. _node-group-interfaces:426.. _node-group-interfaces:
416
417node-group-interfaces427node-group-interfaces
418^^^^^^^^^^^^^^^^^^^^^428^^^^^^^^^^^^^^^^^^^^^
419429
@@ -428,7 +438,7 @@
428:samp:`-d, --debug`438:samp:`-d, --debug`
429439
430 Displays debug information listing the API responses.440 Displays debug information listing the API responses.
431441
432:samp:`-h, --help`442:samp:`-h, --help`
433443
434 Display usage information.444 Display usage information.
@@ -442,24 +452,25 @@
442 Lists the current stored configurations for the given identifier452 Lists the current stored configurations for the given identifier
443 <label> in a key:value format which should be easy to decipher.453 <label> in a key:value format which should be easy to decipher.
444454
455
445:samp:`new <label> ip=<value> interface=<if_device> [parameters...]`456:samp:`new <label> ip=<value> interface=<if_device> [parameters...]`
446457
447 Creates a new interface group. The required parameters are the IP458 Creates a new interface group. The required parameters are the IP
448 address and the network interface this appies to (e.g. eth0). In459 address and the network interface this appies to (e.g. eth0). In
449 order to do anything useful, further parameters are required::460 order to do anything useful, further parameters are required::
450461
451 management= 0 | 1 | 2462 management= 0 | 1 | 2
452 The service to be managed on the interface463 The service to be managed on the interface
453 ( 0= none, 1=DHCP, 2=DHCP and DNS).464 ( 0= none, 1=DHCP, 2=DHCP and DNS).
454465
455 subnet_mask=<value>466 subnet_mask=<value>
456 Apply the given dotted decimal value as the subnet mask.467 Apply the given dotted decimal value as the subnet mask.
457468
458 broadcast_ip=<value>469 broadcast_ip=<value>
459 Apply the given dotted decimal value as the470 Apply the given dotted decimal value as the
460 broadcast IP address for this subnet.471 broadcast IP address for this subnet.
461472
462 router_ip=<value>473 router_ip=<value>
463 Apply the given dotted decimal value as the474 Apply the given dotted decimal value as the
464 default router address for this subnet.475 default router address for this subnet.
465476
@@ -470,16 +481,18 @@
470 The highest value of IP address to allocate via DHCP481 The highest value of IP address to allocate via DHCP
471482
472483
473tag484
485
486tag
474^^^487^^^
475488
476Usage: maas-cli <profile> tag read | update-nodes | rebuild | update |489Usage: maas-cli <profile> tag read | update-nodes | rebuild | update |
477 nodes | delete490 nodes | delete
478491
479.. program:: maas-cli tag492.. program:: maas-cli tag
480493
481:samp:`read <tag_name>`494:samp:`read <tag_name>`
482495
483 Returns information on the tag specified by <name>496 Returns information on the tag specified by <name>
484497
485:samp:`update-nodes <tag_name> [add=<system_id>] [remove=<system_id>] [nodegroup=<system_id>]`498:samp:`update-nodes <tag_name> [add=<system_id>] [remove=<system_id>] [nodegroup=<system_id>]`
@@ -492,10 +505,10 @@
492505
493:samp:`rebuild`506:samp:`rebuild`
494507
495 Triggers a rebuild of the tag to node mapping.508 Triggers a rebuild of the tag to node mapping.
496509
497:samp:`update <tag_name> [name=<value>] | [comment=<value>]|[definition=<value>]`510:samp:`update <tag_name> [name=<value>] | [comment=<value>]|[definition=<value>]`
498511
499 Updates the tag identified by tag_name. Any or all of name,comment512 Updates the tag identified by tag_name. Any or all of name,comment
500 and definition may be supplied as parameters. If no parameters are513 and definition may be supplied as parameters. If no parameters are
501 supplied, this command returns the current values.514 supplied, this command returns the current values.
@@ -508,17 +521,12 @@
508521
509 Deletes the given tag.522 Deletes the given tag.
510523
511524tags
512tags525^^^^
513^^^^526Tags are a really useful way of identifying nodes with particular
514527characteristics.
515Tags are a really useful way of identifying nodes with particular528
516characteristics.529.. only:: html For more information on how to use them effectively, please see :ref:`deploy-tags`
517
518.. only:: html
519
520 For more information on how to use them effectively, please see
521 :ref:`deploy-tags`
522530
523Usage: maas-cli <profile> tag [-d --debug] [-h --help] [-k531Usage: maas-cli <profile> tag [-d --debug] [-h --help] [-k
524--insecure] list | new532--insecure] list | new
@@ -528,38 +536,39 @@
528:samp:`-d, --debug`536:samp:`-d, --debug`
529537
530 Displays debug information listing the API responses.538 Displays debug information listing the API responses.
531539
532:samp:`-h, --help`540:samp:`-h, --help`
533541
534 Display usage information.542 Display usage information.
535543
536:samp:`-k, --insecure`544:samp:`-k, --insecure`
537545
538 Disables the SSL certificate check.546 Disables the SSL certificate check.
539547
540:samp:`list`548:samp:`list`
541549
542 Returns a JSON object listing all the current tags known by the MAAS server550 Returns a JSON object listing all the current tags known by the MAAS server
543551
544:samp:`create name=<value> definition=<value> [comment=<value>]`552:samp:`create name=<value> definition=<value> [comment=<value>]`
545553
546 Creates a new tag with the given name and definition. A comment is554 Creates a new tag with the given name and definition. A comment is
547 optional. Names must be unique, obviously - an error will be555 optional. Names must be unique, obviously - an error will be
548 returned if the given name already exists. The definition is in the556 returned if the given name already exists. The definition is in the form of
549 form of an XPath expression which parses the XML returned by557 an XPath expression which parses the XML returned by running ``lshw`` on the
550 running ``lshw`` on the node.558 node.
551559
552Example:560Example:
553Adding a tag to all nodes which have an Intel GPU::561Adding a tag to all nodes which have an Intel GPU::
554562
555 $ maas-cli maas tags new name='intel-gpu' \563 $ maas-cli maas tags new name='intel-gpu' \
556 comment='Machines which have an Intel display driver' \564 comment='Machines which have an Intel display driver' \
557 definition='contains(//node[@id="display"]/vendor, "Intel")565 definition='contains(//node[@id="display"]/vendor, "Intel")
558566
559567
560unused commands568unused commands
561^^^^^^^^^^^^^^^569^^^^^^^^^^^^^^^
562
563Because the ``maas-cli`` command exposes all of the API, it also lists570Because the ``maas-cli`` command exposes all of the API, it also lists
564some command options which are not really intended for end users, such571some command options which are not really intended for end users, such
565as the "file" and "boot-images" options.572as the "file" and "boot-images" options.
573
574
566575
=== modified file 'docs/man/maas-cli.8.rst'
--- docs/man/maas-cli.8.rst 2012-11-20 21:46:37 +0000
+++ docs/man/maas-cli.8.rst 2012-11-23 13:00:36 +0000
@@ -1,29 +1,564 @@
1
1maas-cli2maas-cli
2--------3--------
34
4
5Usage5Usage
6^^^^^6^^^^^
77
8 $ maas-cli <profile> <command> [parameters]8 $ maas-cli <profile> <command> [parameters]
99
10The available commands are dependent on the API you are connecting to and the10The available commands are dependent on the API you are connecting to and the
11profile you use. The currently available options are explained below.11profile you use. The currently available options are explained below.
1212
1313
14Description14Description
15^^^^^^^^^^^15^^^^^^^^^^^
1616
17.. include:: ../maascli.rst17As well as the web interface, many tasks can be performed by accessing
1818the MAAS API directly through the maas-cli command. This section
19details how to login with this tool and perform some common
20operations.
21
22
23Logging in
24----------
25
26Before the API will accept any commands from maas-cli, you must first
27login. To do this, you need the API key which can be found in the user
28interface.
29
30Login to the web interface on your MAAS. Click on the username in the
31top right corner and select 'Preferences' from the menu which appears.
32
33The very first item is a list of MAAS keys. One will have already been
34generated when the system was installed. It's easiest to just select
35and copy the key (it's quite long!) and then paste it into the
36commandline. The format of the login command is::
37
38 $ maas-cli login <profile-name> <hostname> <key>
39
40The profile created is an easy way of associating your credentials with any
41subsequent call to the API. So an example login might look like this::
42
43$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0 AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2
44
45which creates the profile 'maas' and registers it with the given key at the
46specified API endpoint.
47If you omit the credentials, they will be prompted for in the console. It is
48also possible to use a hyphen, '-' in place of the credentials. In this case a
49single line will be read from stdin, stripped of any whitespace and used as the
50credentials, which can be useful if you are devolping scripts for specific
51tasks.
52If an empty string is passed instead of the credentials, the profile will be
53logged in anonymously (and consequently some of the API calls will not be
54available)
55
56
57maas-cli commands
58-----------------
59
60The ``maas-cli`` command exposes the whole API, so you can do anything
61you actually *can* do with MAAS using this command. Unsurprisingly,
62this leaves us with a vast number of options.
63
64The main maas-cli commands are:
65
66.. program:: maas-cli
67
68:samp:`list`
69
70 lists the details [name url auth-key] of all the currently logged-in
71 profiles.
72
73:samp:`login <profile> <url> <key>`
74
75 Logs in to the MAAS controller API at the given URL, using the key
76 provided and associates this connection with the given profile name.
77
78:samp:`logout <profile>`
79
80 Logs out from the given profile, flushing the stored credentials.
81
82:samp:`refresh`
83
84 Refreshes the API descriptions of all the current logged in
85 profiles. This may become necessary for example when upgrading the
86 maas packages to ensure the command-line options match with the API.
87
88:samp:`<profile> [command] [options] ...`
89
90 Using the given profile name instructs ``maas-cli`` to direct the
91 subsequent commands and options to the relevant MAAS, which for the
92 current API are detailed below...
93
94
95account
96^^^^^^^
97This command is used for creating and destroying the
98MAAS authorisation tokens associated with a profile.
99
100Usage: maas-cli *<profile>* account [-d --debug] [-h --help]
101create-authorisation-token | delete-authorisation-token [token_key=\
102*<value>*]
103
104.. program:: maas-cli account
105
106:samp:`-d, --debug`
107
108 Displays debug information listing the API responses.
109
110:samp:`-h, --help`
111
112 Display usage information.
113
114:samp:`-k, --insecure`
115
116 Disables the SSL certificate check.
117
118:samp:`create-authorisation-token`
119
120 Creates a new MAAS authorisation token for the current profile
121 which can be used to authenticate connections to the API.
122
123:samp:`delete-authorisation-token token_key=<value>`
124
125 Removes the given key from the list of authorisation tokens.
126
127
128node
129^^^^
130
131API calls which operate on individual nodes. With these commands, the
132node is always identified by its "system_id" property - a unique tag
133allocated at the time of enlistment. To discover the value of the
134system_id, you can use the ``maas-cli <profile> nodes list`` command.
135
136USAGE: maas-cli <profile> node [-h] release | start | stop | delete |
137read | update <system_id>
138
139.. program:: maas-cli node
140
141:samp:`-h, --help`
142
143 Display usage information.
144
145:samp:`release <system_id>`
146
147 Releases the node given by *<system_id>*
148
149:samp:`start <system_id>`
150
151 Powers up the node identified by *<system_id>* (where MAAS has
152 information for power management for this node).
153
154:samp:`stop <system_id>`
155
156 Powers off the node identified by *<system_id>* (where MAAS has
157 information for power management for this node).
158
159:samp:`delete <system_id>`
160
161 Removes the given node from the MAAS database.
162
163:samp:`read <system_id>`
164
165 Returns all the current known information about the node specified
166 by *<system_id>*
167
168:samp:`update <system_id> [parameters...]`
169
170 Used to change or set specific values for the node. The valid
171 parameters are listed below::
172
173 hostname=<value>
174 The new hostname for this node.
175
176 architecture=<value>
177 Sets the architecture type, where <value>
178 is a string containing a valid architecture type,
179 e.g. "i386/generic"
180
181 distro_series=<value>
182 Sets the series of Ubuntu to use.
183
184 power_type=<value>
185 Sets the type of power management used on the node, e.g. "ipmi" or
186 "virsh".
187
188 power_parameters_{param1}... =<value>
189 Set the given power parameters. Note that the valid options for these
190 depend on the power type chosen.
191
192 power_parameters_skip_check 'true' | 'false'
193 Whether to sanity check the supplied parameters against this node's
194 declared power type. The default is 'false'.
195
196
197
198.. _cli-power:
199
200Example: Setting the power parameters for an ipmi enabled node::
201
202 maas-cli maas node update <system_id> \
203 power_type="ipmi" \
204 power_parameters_power_address=192.168.22.33 \
205 power_parameters_power_user=root \
206 power_parameters_power_pass=ubuntu;
207
208
209
210
211nodes
212^^^^^
213
214Usage: maas-cli <profile> nodes [-h] is-registered | list-allocated |
215acquire | list | accept | accept-all | new | check-commissioning
216
217.. program:: maas-cli nodes
218
219:samp:`-h, --help`
220
221 Display usage information.
222
223
224:samp:`accept <system_id>`
225
226 Accepts the node referenced by <system_id>.
227
228:samp:`accept-all`
229
230 Accepts all currently discovered but not previously accepted nodes.
231
232:samp:`acquire`
233
234 Allocates a node to the profile used to issue the command. Any
235 ready node may be allocated.
236
237:samp:`is-registered mac_address=<address>`
238
239 Checks to see whether the specified MAC address is registered to a
240 node.
241
242:samp:`list`
243
244 Returns a JSON formatted object listing all the currently known
245 nodes, their system_id, status and other details.
246
247:samp:`list-allocated`
248
249 Returns a JSON formatted object listing all the currently allocated
250 nodes, their system_id, status and other details.
251
252:samp:`new architecture=<value> mac_addresses=<value> [parameters]`
253
254 Creates a new node entry given the provided key=value information
255 for the node. A minimum of the MAC address and architecture must be
256 provided. Other parameters may also be supplied::
257
258 architecture="<value>" - The architecture of the node, must be
259 one of the recognised architecture strings (e.g. "i386/generic")
260 hostname="<value>" - a name for this node. If not supplied a name
261 will be generated.
262 mac_addresses="<value>" - The mac address(es)
263 allocated to this node.
264 powertype="<value>" - the power type of
265 the node (e.g. virsh, ipmi)
266
267
268:samp:`check-commissioning`
269
270 Displays current status of nodes in the commissioning phase. Any
271 that have not returned before the system timeout value are listed
272 as "failed".
273
274Examples:
275Accept and commission all discovered nodes::
276
277 $ maas-cli maas nodes accept-all
278
279List all known nodes::
280
281 $ maas-cli maas nodes list
282
283Filter the list using specific key/value pairs::
284
285 $ maas-cli maas nodes list architecture="i386/generic"
286
287
288
289node-groups
290^^^^^^^^^^^
291Usage: maas-cli <profile> node-groups [-d --debug] [-h --help] [-k
292--insecure] register | list | refresh-workers | accept | reject
293
294.. program:: maas-cli node-groups
295
296:samp:`-d, --debug`
297
298 Displays debug information listing the API responses.
299
300:samp:`-h, --help`
301
302 Display usage information.
303
304:samp:`-k, --insecure`
305
306 Disables the SSL certificate check.
307
308:samp:`register uuid=<value> name=<value> interfaces=<json_string>`
309
310 Registers a new node group with the given name and uuid. The
311 interfaces parameter must be supplied in the form of a JSON string
312 comprising the key/value data for the interface to be used, for
313 example: interface='["ip":"192.168.21.5","interface":"eth1", \
314 "subnet_mask":"255.255.255.0","broadcast_ip":"192.168.21.255", \
315 "router_ip":"192.168.21.1", "ip_range_low":"192.168.21.10", \
316 "ip_range_high":"192.168.21.50"}]'
317
318:samp:`list`
319
320 Returns a JSON list of all currently defined node groups.
321
322:samp:`refresh_workers`
323
324 It sounds a bit like they will get a cup of tea and a
325 biscuit. Actually this just sends each node-group worker an update
326 of its credentials (API key, node-group name). This command is
327 usually not needed at a user level, but is often used by worker
328 nodes.
329
330:samp:`accept <uuid>`
331
332 Accepts a node-group or number of nodegroups indicated by the
333 supplied UUID
334
335:samp:`reject <uuid>`
336
337 Rejects a node-group or number of nodegroups indicated by the
338 supplied UUID
339
340
341
342node-group-interface
343^^^^^^^^^^^^^^^^^^^^
344For managing the interfaces. See also
345"node_group_interfaces"
346
347Usage: maas-cli *<profile>* node-group-interface [-d --debug] [-h
348--help] [-k --insecure] read | update | delete [parameters...]
349
350..program:: maas-cli node-group-interface
351
352:samp:`read <uuid> <interface>`
353
354 Returns the current settings for the given UUID and interface
355
356:samp:`update [parameters]`
357
358 Changes the settings for the interface according to the given
359 parameters::
360
361 management= 0 | 1 | 2
362 The service to be managed on the interface ( 0= none, 1=DHCP, 2=DHCP
363 and DNS).
364
365 subnet_mask=<value>
366 Apply the given dotted decimal value as the subnet mask.
367
368 broadcast_ip=<value>
369 Apply the given dotted decimal value as the broadcast IP address for
370 this subnet.
371
372 router_ip=<value>
373 Apply the given dotted decimal value as the default router address
374 for this subnet.
375
376 ip_range_low=<value>
377 The lowest value of IP address to allocate via DHCP
378
379 ip_range_high=<value>
380 The highest value of IP address to allocate via DHCP
381
382:samp:`delete <uuid> <interface>`
383
384 Removes the entry for the given UUID and interface.
385
386
387Example:
388Configuring DHCP and DNS.
389
390To enable MAAS to manage DHCP and DNS, it needs to be supplied with the relevant
391interface information. To do this we need to first determine the UUID of the
392node group affected::
393
394 $ uuid=$(maas-cli <profile> node-groups list | grep uuid | cut -d\" -f4)
395
396Once we have the UUID we can use this to update the node-group-interface for
397that nodegroup, and pass it the relevant interface details::
398
399 $ maas-cli <profile> node-group-interface update $uuid eth0 \
400 ip_range_high=192.168.123.200 \
401 ip_range_low=192.168.123.100 \
402 management=2 \
403 broadcast_ip=192.168.123.255 \
404 router_ip=192.168.123.1 \
405
406Replacing the example values with those required for this network. The only
407non-obvious parameter is 'management' which takes the values 0 (no management), 1
408(manage DHCP) and 2 (manage DHCP and DNS).
409
410
411node-group-interfaces
412^^^^^^^^^^^^^^^^^^^^^
413
414The node-group-interfaces commands are used for configuring the
415management of DHCP and DNS services where these are managed by MAAS.
416
417Usage: maas-cli *<profile>* node-group-interfaces [-d --debug] [-h
418--help] [-k --insecure] list | new [parameters...]
419
420.. program:: maas-cli node-group-interfaces
421
422:samp:`-d, --debug`
423
424 Displays debug information listing the API responses.
425
426:samp:`-h, --help`
427
428 Display usage information.
429
430:samp:`-k, --insecure`
431
432 Disables the SSL certificate check.
433
434:samp:`list <label>`
435
436 Lists the current stored configurations for the given identifier
437 <label> in a key:value format which should be easy to decipher.
438
439
440:samp:`new <label> ip=<value> interface=<if_device> [parameters...]`
441
442 Creates a new interface group. The required parameters are the IP
443 address and the network interface this appies to (e.g. eth0). In
444 order to do anything useful, further parameters are required::
445
446 management= 0 | 1 | 2
447 The service to be managed on the interface
448 ( 0= none, 1=DHCP, 2=DHCP and DNS).
449
450 subnet_mask=<value>
451 Apply the given dotted decimal value as the subnet mask.
452
453 broadcast_ip=<value>
454 Apply the given dotted decimal value as the
455 broadcast IP address for this subnet.
456
457 router_ip=<value>
458 Apply the given dotted decimal value as the
459 default router address for this subnet.
460
461 ip_range_low=<value>
462 The lowest value of IP address to allocate via DHCP
463
464 ip_range_high=<value>
465 The highest value of IP address to allocate via DHCP
466
467
468
469
470tag
471^^^
472
473Usage: maas-cli <profile> tag read | update-nodes | rebuild | update |
474 nodes | delete
475
476.. program:: maas-cli tag
477
478:samp:`read <tag_name>`
479
480 Returns information on the tag specified by <name>
481
482:samp:`update-nodes <tag_name> [add=<system_id>] [remove=<system_id>] [nodegroup=<system_id>]`
483
484 Applies or removes the given tag from a list of nodes specified by
485 either or both of add="<system_id>" and remove="<system_id>". The
486 nodegroup parameter, which restricts the operations to a particular
487 nodegroup, is optional, but only the superuser can execute this
488 command without it.
489
490:samp:`rebuild`
491
492 Triggers a rebuild of the tag to node mapping.
493
494:samp:`update <tag_name> [name=<value>] | [comment=<value>]|[definition=<value>]`
495
496 Updates the tag identified by tag_name. Any or all of name,comment
497 and definition may be supplied as parameters. If no parameters are
498 supplied, this command returns the current values.
499
500:samp:`nodes <tag_name>`
501
502 Returns a list of nodes which are associated with the given tag.
503
504:samp:`delete <tag_name>`
505
506 Deletes the given tag.
507
508tags
509^^^^
510Tags are a really useful way of identifying nodes with particular
511characteristics.
512
513Usage: maas-cli <profile> tag [-d --debug] [-h --help] [-k
514--insecure] list | new
515
516.. program:: maas-cli tag
517
518:samp:`-d, --debug`
519
520 Displays debug information listing the API responses.
521
522:samp:`-h, --help`
523
524 Display usage information.
525
526:samp:`-k, --insecure`
527
528 Disables the SSL certificate check.
529
530:samp:`list`
531
532 Returns a JSON object listing all the current tags known by the MAAS server
533
534:samp:`create name=<value> definition=<value> [comment=<value>]`
535
536 Creates a new tag with the given name and definition. A comment is
537 optional. Names must be unique, obviously - an error will be
538 returned if the given name already exists. The definition is in the form of
539 an XPath expression which parses the XML returned by running ``lshw`` on the
540 node.
541
542Example:
543Adding a tag to all nodes which have an Intel GPU::
544
545 $ maas-cli maas tags new name='intel-gpu' \
546 comment='Machines which have an Intel display driver' \
547 definition='contains(//node[@id="display"]/vendor, "Intel")
548
549
550unused commands
551^^^^^^^^^^^^^^^
552Because the ``maas-cli`` command exposes all of the API, it also lists
553some command options which are not really intended for end users, such
554as the "file" and "boot-images" options.
19555
20Further Documentation556Further Documentation
21^^^^^^^^^^^^^^^^^^^^^557^^^^^^^^^^^^^^^^^^^^^
22
23For more documentation of MAAS, please see https://maas.ubuntu.com/docs558For more documentation of MAAS, please see https://maas.ubuntu.com/docs
24559
25
26See Also560See Also
27^^^^^^^^561^^^^^^^^
28
29`maas`562`maas`
563
564