HOME
Oct 8 2013

Using fastpath installer in MAAS

MAAS 1.4 supports installing images via curtin (fastpath).

To enable fastpath for a node we need to tag it with use-fastpath-installer that is understood by MAAS and fastpath. As far as I can tell this has to be accomplished via maas-cli.

Set your MAAS profile

If you’ve gone through the basic getting started steps with MAAS your profile is most likely maas. Assign MAASNAME to your maas profile.

1
ubuntu@maas:~$ MAASNAME=maas

Login to your MAAS instance via maas-cli

In order to login to your maas instance you’ll need to grab your maas-key. This can be done by visiting the user preferences page (http://maas.ip/MAAS/account/prefs) or clicking the preferences link under your account name (Fig 1).

Fig 1. User preferences

Your maas-key should be located under the MAAS keys section (Fig 2)

Fig 2. MAAS keys

Once you have that key copied, login to your MAAS instance from the command line.

1
2
3
4
5
6
7
8
9
10
ubuntu@maas:~$ maas-cli login maas http://192.168.122.206/MAAS/api/1.0 CNTvmLmstUadGLk4wp:nxcJ9LZnCmksRe2jFS:xAYeYj4yJdJ4ARsfGBxWYSgqzsMtJbcF

You are now logged in to the MAAS server at
http://192.168.122.206/MAAS/api/1.0/ with the profile name 'maas'.

For help with the available commands, try:

    maas-cli maas --help

ubuntu@maas:~$

Apply the tag to a single node

Once logged in we can start tagging nodes. In order to figure out which node you’d like to tag run the following command:

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
ubuntu@maas:~$ maas-cli maas nodes list
    [
        {
            "status": 4,
            "macaddress_set": [
                {
                    "resource_uri": "/MAAS/api/1.0/nodes/node-1a62d358-2f8e-11e3-b5c3-525400a1c422/macs/52:54:00:2a:37:ac/",
                    "mac_address": "52:54:00:2a:37:ac"
                }
            ],
            "hostname": "node1.master",
            "power_type": "virsh",
            "routers": [],
            "netboot": true,
            "cpu_count": 1,
            "storage": 0,
            "system_id": "node-1a62d358-2f8e-11e3-b5c3-525400a1c422",
            "architecture": "amd64/generic",
            "memory": 512,
            "owner": null,
            "tag_names": [
                "virtual"
            ],
            "ip_addresses": [
                "192.168.122.101"
            ],
            "resource_uri": "/MAAS/api/1.0/nodes/node-1a62d358-2f8e-11e3-b5c3-525400a1c422/"
        }
    ]

If you look at system_id this will be what you’ll use when tagging a single node. Go ahead and store that node in a variable

1
ubuntu@maas:~$ node=node-1a62d358-2f8e-11e3-b5c3-525400a1c422

At this point the use-fastpath-installer tag doesn’t exist so we need to create it first

1
2
3
4
5
6
7
8
ubuntu@maas:~$ maas-cli $MAASNAME tags new name='use-fastpath-installer' comment='fp'
    {
        "comment": "fp",
        "definition": "",
        "resource_uri": "/MAAS/api/1.0/tags/use-fastpath-installer/",
        "name": "use-fastpath-installer",
        "kernel_opts": ""
    }

Now we can apply the tag to the node

1
2
3
4
5
ubuntu@maas:~$ maas-cli $MAASNAME tag update-nodes use-fastpath-installer add=$node
    {
        "removed": 0,
        "added": 1
    }

Or you can run the following command and bypass creating the tag and applying it manually to a node with the following

1
ubuntu@maas:~$ maas-cli $MAASNAME tags new name='use-fastpath-installer' comment='fp' "definition=true()"

This will create the use-fastpath-installer tag and apply to all available nodes.

Verify your node(s) are tagged

You can view that the tagging worked by either running the following command:

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
ubuntu@maas:~$ maas-cli $MAASNAME tag nodes use-fastpath-installer
    [
        {
            "status": 4,
            "macaddress_set": [
                {
                    "resource_uri": "/MAAS/api/1.0/nodes/node-1a62d358-2f8e-11e3-b5c3-525400a1c422/macs/52:54:00:2a:37:ac/",
                    "mac_address": "52:54:00:2a:37:ac"
                }
            ],
            "hostname": "node1.master",
            "power_type": "virsh",
            "routers": [],
            "netboot": true,
            "cpu_count": 1,
            "storage": 0,
            "system_id": "node-1a62d358-2f8e-11e3-b5c3-525400a1c422",
            "architecture": "amd64/generic",
            "memory": 512,
            "owner": null,
            "tag_names": [
                "virtual",
                "use-fastpath-installer"
            ],
            "ip_addresses": [
                "192.168.122.101"
            ],
            "resource_uri": "/MAAS/api/1.0/nodes/node-1a62d358-2f8e-11e3-b5c3-525400a1c422/"
        }
    ]

Or through the web-ui and viewing your node properties (Fig. 3)

Fig 3. Node properties

Deploy your node with fastpath installer

Now that the node is tagged simply re-deploy the node and fastpath should take over automatically. Should note that you really won’t see a difference other than speed increase of the installation, but, let’s be honest that’s really what we care about right? :)

Tips

I ran this test on Precise in order to do that you’ll need the cloud-tools pocket in the cloud archive:

1
2
3
4
5
ubuntu@hostmachine:~$ sudo apt-get install -qy ubuntu-cloud-keyring </dev/null
ubuntu@hostmachine:~$ sudo tee /etc/apt/sources.list.d/cloud-tools-precise.list <<EOF
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
EOF
comments powered by Disqus