Merge lp:~evilnick/clouddocs/maas-tags into lp:~jujudocs/clouddocs/trunk

Proposed by Nick Veitch
Status: Merged
Merged at revision: 11
Proposed branch: lp:~evilnick/clouddocs/maas-tags
Merge into: lp:~jujudocs/clouddocs/trunk
Diff against target: 228 lines (+152/-10)
1 file modified
Installing-MAAS.md (+152/-10)
To merge this branch: bzr merge lp:~evilnick/clouddocs/maas-tags
Reviewer Review Type Date Requested Status
Juju Docs hackers Pending
Review via email: mp+213944@code.launchpad.net

Description of the change

added tags, zones and cli to MAAS

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Installing-MAAS.md'
2--- Installing-MAAS.md 2014-03-31 16:15:07 +0000
3+++ Installing-MAAS.md 2014-04-02 23:25:26 +0000
4@@ -58,13 +58,13 @@
5
6 The configuration for the MAAS controller will automatically run and pop up this config screen:
7
8-![](https://www.filepicker.io/api/file/_images/install_cluster-config.png)
9+![]( install_cluster-config.png)
10
11 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.
12
13 Once the configuration scripts have run you should see this message telling you that the system is ready to use:
14
15-![](https://www.filepicker.io/api/file/_images/install_controller-config.png)
16+![]( install_controller-config.png)
17
18 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 [_Post-Install tasks_](https://www.filepicker.io/api/file/WMGTttJT6aaLnQrEkAPv?signature=a86d0c3b4e25dba2d34633bbdc6873d9d8e6ae3cecc4672f2219fa81ee478502&policy=eyJoYW5kbGUiOiJXTUdUdHRKVDZhYUxuUXJFa0FQdiIsImV4cGlyeSI6MTM5NTE3NDE2MSwiY2FsbCI6WyJyZWFkIl19#post-install)
19
20@@ -84,7 +84,7 @@
21
22 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:
23
24-![](https://www.filepicker.io/api/file/_images/install_web-init.png)
25+![]( install_web-init.png)
26
27 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.
28
29@@ -92,9 +92,9 @@
30
31 Once MAAS is installed, you'll need to create an administrator account:
32
33-'''
34+```
35 sudo maas createadmin --username=root --email=MYEMAIL@EXAMPLE.COM
36-'''
37+```
38
39 Substitute your own email address in the command above. You may also use a different username for your administrator account, but "root" is a common convention and easy to remember. The command will prompt for a password to assign to the new user.
40
41@@ -104,9 +104,9 @@
42
43 MAAS will check for and download new Ubuntu images once a week. However, you'll need to download them manually the first time. To do this you will need to connect to the MAAS API using the maas-cli tool. (see for details). Then you need to run the command:
44
45-'''
46+```
47 maas-cli maas node-groups import-boot-images
48-'''
49+```
50
51 (substitute in a different profile name for 'maas' if you have called yours something else) This will initiate downloading the required image files. Note that this may take some time depending on your network connection.
52
53@@ -115,7 +115,7 @@
54
55 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.
56
57-![](https://www.filepicker.io/api/file/_images/install-login.png)
58+![]( install-login.png)
59 ## Configure switches on the network
60
61 Some switches use Spanning-Tree Protocol (STP) to negotiate a loop-free path through a root bridge. While scanning, it can make each port wait up to 50 seconds before data is allowed to be sent on the port. This delay in turn can cause problems with some applications/protocols such as PXE, DHCP and DNS, of which MAAS makes extensive use.
62@@ -145,7 +145,7 @@
63 When you install your first cluster controller on the same system as the region controller, it will be automatically accepted by default (but not yet configured, see below). Any other cluster controllers you set up will show up in the user interface as “pending,” until you manually accept them into the MAAS.
64
65 To accept a cluster controller, click on the settings “cog” icon at the top right to visit the settings page:
66-![]
67+![]settings.png
68 You can either click on “Accept all” or click on the edit icon to edit the cluster. After clicking on the edit icon, you will see this page:
69
70 ![]cluster-edit.png
71@@ -154,10 +154,46 @@
72 Now that the cluster controller is accepted, you can configure one or more of its network interfaces to be managed by MAAS. This will enable the cluster controller to manage nodes attached to those networks. The next section explains how to do this and what choices are to be made.
73
74 ### Configuration
75+MAAS automatically recognises the network interfaces on each cluster controller. Some of these will be connected to networks where you want to manage nodes. We recommend letting your cluster controller act as a DHCP server for these networks, by configuring those interfaces in the MAAS user interface.
76+
77+As an example, we will configure the cluster controller to manage a network on interface eth0. Click on the edit icon for eth0, which takes us to this page:
78+
79+![]cluster-interface-edit.png
80+Here you can select to what extent you want the cluster controller to manage the network:
81+
82+DHCP only - this will run a DHCP server on your cluster
83+DHCP and DNS - this will run a DHCP server on the cluster and configure the DNS server included with the region controller so that it can be used to look up hosts on this network by name.
84+Note
85+You cannot have DNS management without DHCP management because MAAS relies on its own DHCP server’s leases file to work out the IP address of nodes in the cluster.
86+If you set the interface to be managed, you now need to provide all of the usual DHCP details in the input fields below. Once done, click “Save interface”. The cluster controller will now be able to boot nodes on this network.
87+
88+!!! note:There is also an option to leave the network unmanaged. Use this for networks where you don’t want to manage any nodes. Or, if you do want to manage nodes but don’t want the cluster controller to serve DHCP, you may be able to get by without it. This is explained in Manual DHCP configuration.
89+
90+!!! note: A single cluster controller can manage more than one network, each from a different network interface on the cluster-controller server. This may help you scale your cluster to larger numbers of nodes, or it may be a requirement of your network architecture.
91
92 ## Enlisting nodes
93
94-## Optional - Tagging nodes
95+Now that the MAAS controller is running, we need to make the nodes aware of MAAS and vice-versa. With MAAS controlling DHCP and nodes capable of PXE booting, this is straightforward
96+
97+Automatic Discovery
98+With nodes set to boot from a PXE image, they will start, look for a DHCP server, receive the PXE boot details, boot the image, contact the MAAS server and shut down.
99+
100+During this process, the MAAS server will be passed information about the node, including the architecture, MAC address and other details which will be stored in the database of nodes. You can accept and comission the nodes via the web interface. When the nodes have been accepted the selected series of Ubuntu will be installed.
101+
102+To save time, you can also accept and commission all nodes from the commandline. This requires that you first login with the API key [1], which you can retrieve from the web interface:
103+
104+```
105+maas-cli maas nodes accept-all
106+```
107+
108+### Manually adding nodes
109+
110+If your nodes are not capable of booting from PXE images, they can be manually registered with MAAS. On the Nodes screen:
111+![]add-node.png
112+
113+Select 'Add node' and manually enter details about the node, including its MAC address. This is used to identify the node when it contacts the DHCP server.
114+
115+
116
117 ## Preparing MAAS for Juju using Simplestreams
118
119@@ -322,4 +358,110 @@
120
121 The same comments apply. Run the validation tool without parameters to use details from the Juju environment, or override values as required on the command line. See `juju help metadata validate-tools` for more details.
122
123+##Appendix I - Using Tags
124+##Appendix II - Using the MAAS CLI
125+As well as the web interface, many tasks can be performed by accessing the MAAS API directly through the maas-cli command. This section details how to login with this tool and perform some common operations.
126+
127+###Logging in
128+Before the API will accept any commands from maas-cli, you must first login. To do this, you need the API key which can be found in the user interface.
129+
130+Login to the web interface on your MAAS. Click on the username in the top right corner and select ‘Preferences’ from the menu which appears.
131+
132+![]maascli-prefs.png
133+A new page will load...
134+
135+![]maascli-key.png
136+The very first item is a list of MAAS keys. One will have already been generated when the system was installed. It’s easiest to just select all the text, copy the key (it’s quite long!) and then paste it into the commandline. The format of the login command is:
137+
138+```
139+ maas-cli login <profile-name> <hostname> <key>
140+```
141+
142+The profile created is an easy way of associating your credentials with any subsequent call to the API. So an example login might look like this:
143+
144+```
145+maas-cli login maas http://10.98.0.13/MAAS/api/1.0
146+AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2
147+```
148+which creates the profile ‘maas’ and registers it with the given key at the specified API endpoint. If you omit the credentials, they will be prompted for in the console. It is also possible to use a hyphen, ‘-‘ in place of the credentials. In this case a single line will be read from stdin, stripped of any whitespace and used as the credentials, which can be useful if you are devolping scripts for specific tasks. If an empty string is passed instead of the credentials, the profile will be logged in anonymously (and consequently some of the API calls will not be available)
149+
150+### maas-cli commands
151+The maas-cli command exposes the whole API, so you can do anything you actually can do with MAAS using this command. This leaves us with a vast number of options, which are more fully expressed in the complete [2][MAAS Documentation]
152+
153+list:
154+ lists the details [name url auth-key] of all the currently logged-in profiles.
155+
156+login <profile> <url> <key>:
157+ Logs in to the MAAS controller API at the given URL, using the key provided and
158+ associates this connection with the given profile name.
159+
160+logout <profile>:
161+ Logs out from the given profile, flushing the stored credentials.
162+
163+refresh:
164+ Refreshes the API descriptions of all the current logged in profiles. This may become necessary for example when upgrading the maas packages to ensure the command-line options match with the API.
165+
166+### Useful examples
167+
168+Displays current status of nodes in the commissioning phase:
169+```
170+maas cli maas nodes check-commissioning
171+```
172+
173+Accept and commission all discovered nodes:
174+```
175+maas-cli maas nodes accept-all
176+```
177+
178+List all known nodes:
179+```
180+maas-cli maas nodes list
181+```
182+
183+Filter the list using specific key/value pairs:
184+```
185+maas-cli maas nodes list architecture="i386/generic"
186+```
187+
188+Set the power parameters for an ipmi enabled node:
189+```
190+maas-cli maas node update <system_id> \
191+ power_type="ipmi" \
192+ power_parameters_power_address=192.168.22.33 \
193+ power_parameters_power_user=root \
194+ power_parameters_power_pass=ubuntu;
195+```
196+## Appendix III - Physical Zones
197+
198+To help you maximise fault-tolerance and performance of the services you deploy, MAAS administrators can define _physical zones_ (or just _zones_ for short), and assign nodes to them. When a user requests a node, they can ask for one that is in a specific zone, or one that is not in a specific zone.
199+
200+It's up to you as an administrator to decide what a physical zone should represent: it could be a server rack, a room, a data centre, machines attached to the same UPS, or a portion of your network. Zones are most useful when they represent portions of your infrastructure. But you could also use them simply to keep track of where your systems are located.
201+
202+Each node is in one and only one physical zone. Each MAAS instance ships with a default zone to which nodes are attached by default. If you do not need this feature, you can simply pretend it does not exist.
203+
204+### Applications
205+
206+Since you run your own MAAS, its physical zones give you more flexibility than those of a third-party hosted cloud service. That means that you get to design your zones and define what they mean. Below are some examples of how physical zones can help you get the most out of your MAAS.
207+
208+### Creating a Zone
209+
210+Only administrators can create and manage zones. To create a physical zone in the web user interface, log in as an administrator and browse to the "Zones" section in the top bar. This will takes you to the zones listing page. At the bottom of the page is a button for creating a new zone:
211+
212+![]add-zone.png
213+
214+Or to do it in the [_region-controller API_][#region-controller-api], POST your zone definition to the _"zones"_ endpoint.
215+
216+### Assigning Nodes to a Zone
217+
218+Once you have created one or more physical zones, you can set nodes' zones from the nodes listing page in the UI. Select the nodes for which you wish to set a zone, and choose "Set physical zone" from the "Bulk action" dropdown list near the top. A second dropdown list will appear, to let you select which zone you wish to set. Leave it blank to clear nodes' physical zones. Clicking "Go" will apply the change to the selected nodes.
219+
220+You can also set an individual node's zone on its "Edit node" page. Both ways are available in the API as well: edit an individual node through a request to the node's URI, or set the zone on multiple nodes at once by calling the operation on the endpoint.
221+
222+### Allocating a Node in a Zone
223+
224+To deploy in a particular zone, call the method in the [_region-controller API_][#region-controller-api] as before, but pass the parameter with the name of the zone. The method will allocate a node in that zone, or fail with an HTTP 409 ("conflict") error if the zone has no nodes available that match your request.
225+
226+Alternatively, you may want to request a node that is _not_ in a particular zone, or one that is not in any of several zones. To do that, specify the parameter to . This parameter takes a list of zone names; the allocated node will not be in any of them. Again, if that leaves no nodes available that match your request, the call will return a "conflict" error.
227+
228+It is possible, though not usually useful, to combine the and parameters. If your choice for is also present in , no node will ever match your request. Or if it's not, then the values will not affect the result of the call at all.
229

Subscribers

People subscribed via source and target branches