~blake-rouse/maas/is-importing-2.1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Adding nodes to the system
==========================

Now that the MAAS controller is running, we need to make the nodes
aware of MAAS and vice-versa. If you have set up DHCP correctly, and
your nodes can boot via PXE_ then things really couldn't be much easier
and you can use :ref:`the automatic discovery procedure <auto-enlist>`.
You do not need to install Ubuntu on nodes that you wish to add to MAAS
prior to enlistment.

To learn more about setting up DHCP, read the :ref:`cluster configuration
documentation <rack-configuration>`.

.. _PXE: http://en.wikipedia.org/wiki/Preboot_Execution_Environment

.. _auto-enlist:

Automatic Discovery
-------------------

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.

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
commission the nodes via the web interface.  When the nodes have been
accepted the selected series of Ubuntu will be installed.

To save time, you can also accept and commission all nodes from the
commandline. This requires that you first log in with the API key,
which :ref:`you can retrieve from the web interface <api-key>`::

   $ maas maas nodes accept-all


.. _enlist-via-boot-media:


Manually add nodes
------------------

If you know the MAC address of a node, you can manually enter details
about the node through the web interface. Click the ``Add Node`` button
to be taken to the "Add Node" form:

.. image:: media/add-node.png


Virtual machine nodes
---------------------

If you're setting up virtual machines to use as nodes with MAAS, you need
to configure the power type as ``virsh``.  For MAAS to be able to use
virsh, make sure you have the ``libvirt-bin`` package installed.

.. note::

  If you are assembling a set of VMs for testing or development, make
  sure they have at least 512 MB (768 MB If you are deploying 15.10)
  to avoid failures during deployment.

The virsh power type takes two parameters:

Power ID
    The Power ID is the name of the virtual machine shown by
    ``sudo virsh list --all``

Address
    This is a libvirt connection string, such as
    ``qemu+ssh://ubuntu@10.0.0.2/system`` or ``qemu:///system``

.. image:: media/virsh-config.png

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

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

Add a login shell for the maas user::

    $ sudo chsh -s /bin/bash maas

Become the maas user and generate a SSH keypair::

    $ sudo su - maas
    $ ssh-keygen -f ~/.ssh/id_rsa -N ''

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

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

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

    $ virsh -c qemu+ssh://ubuntu@10.0.0.2/system list --all