tag:blogger.com,1999:blog-10113432198016145252024-03-12T20:55:30.556-07:00/var/log/lifelog Michael's log of lifeMichael Davieshttp://www.blogger.com/profile/00273052548165190651noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1011343219801614525.post-79296533011814138982016-11-10T14:26:00.001-08:002016-11-10T16:29:38.032-08:00Speaking at the OpenStack Summit in BarcelonaLast month I had the wonderful opportunity to visit Barcelona, Spain to attend the OpenStack <a href="https://releases.openstack.org/" target="_blank">Ocata</a> Summit where I was able to speak about the work we've been doing <a href="https://github.com/openstack/openstack-ansible-os_ironic" target="_blank">integrating</a> <a href="https://github.com/openstack/ironic" target="_blank">Ironic</a> into <a href="https://github.com/openstack/openstack-ansible" target="_blank">OpenStack-Ansible</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/taAtFJ7_4qE/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/taAtFJ7_4qE?feature=player_embedded" width="320"></iframe></div>
<div style="text-align: center;">
(Video link: <a href="https://youtu.be/taAtFJ7_4qE">https://youtu.be/taAtFJ7_4qE</a>)</div>
<div style="text-align: center;">
<br /></div>
I really enjoyed the experience, and very much enjoyed co-presenting with <a href="https://twitter.com/andymccrae" target="_blank">Andy McCrae</a> - a great guy and an very clever and hard-working developer. If I ever make it to the UK (and see more than the inside of <a href="http://www.heathrow.com/" target="_blank">LHR</a>), I'm sure going to go visit!<br />
<br />
And here's a few happy snaps from Barcelona - lovely place, wish I could've stayed more than 6 days :-)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNaRVbAPXEk6auWJPCfRg1w_BwGxky59ZIsWbQiqPcls3GtxtYRilnkqLYe3xLnWIijThNGCMlnD-VQ-dBGTmrn8E57uJOGN3FMLd3Ksq7cgzlVRvpoJnDb6ZC9HhyTFCm3srEllfUNzHr/s1600/FullSizeRender+%25281%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNaRVbAPXEk6auWJPCfRg1w_BwGxky59ZIsWbQiqPcls3GtxtYRilnkqLYe3xLnWIijThNGCMlnD-VQ-dBGTmrn8E57uJOGN3FMLd3Ksq7cgzlVRvpoJnDb6ZC9HhyTFCm3srEllfUNzHr/s320/FullSizeRender+%25281%2529.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioy5P48R6kC7GFOpTJGMuhpJDUA9WjUdCkLo4NH4dOpv0wj6r4XDje5VrACuZlWjTQ9bWfR1D3TxdnrQcOnkjhpVA5kDgEvW2IFG5L5_FEQI0waB8WW7cuwBQEpjKnvTEwEpEHLp9XrdvR/s1600/FullSizeRender+%25282%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioy5P48R6kC7GFOpTJGMuhpJDUA9WjUdCkLo4NH4dOpv0wj6r4XDje5VrACuZlWjTQ9bWfR1D3TxdnrQcOnkjhpVA5kDgEvW2IFG5L5_FEQI0waB8WW7cuwBQEpjKnvTEwEpEHLp9XrdvR/s320/FullSizeRender+%25282%2529.jpg" width="195" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUj2HrF-zEjalgkT4zR3JCwk6563qg4XmoX-nfUfwMw2cV1gFRgEA18zJJJpToD9qyhIhh0Km7Q7Ympv5m0nM5UFJ3C0hqFhHmBdcA9N4y31_ALP_eMrx0YqdCEd24WC9G6LPvVUxK7HlX/s1600/FullSizeRender+%25283%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUj2HrF-zEjalgkT4zR3JCwk6563qg4XmoX-nfUfwMw2cV1gFRgEA18zJJJpToD9qyhIhh0Km7Q7Ympv5m0nM5UFJ3C0hqFhHmBdcA9N4y31_ALP_eMrx0YqdCEd24WC9G6LPvVUxK7HlX/s320/FullSizeRender+%25283%2529.jpg" width="213" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ_JmL0zHy8WNeqwb7WGPXfhiEgJ1W0c681Rf24V8QDCp7kTauO_K_phZHh-JMCLgfmgmINxubUi9IagTfr4lV3a9N7eg2uYD7Ebygmd0zNtGp5tVV855xxk6JONPv3sCRTekafmvYHGLt/s1600/FullSizeRender+%25284%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ_JmL0zHy8WNeqwb7WGPXfhiEgJ1W0c681Rf24V8QDCp7kTauO_K_phZHh-JMCLgfmgmINxubUi9IagTfr4lV3a9N7eg2uYD7Ebygmd0zNtGp5tVV855xxk6JONPv3sCRTekafmvYHGLt/s320/FullSizeRender+%25284%2529.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsLFGgblFDqLMA4YBuJ2qiWrhyphenhyphen38Q-E_JA4XxFVdmEOKNIKumlathfF-IBpxIVkKChRf9f27bkx-NlLQfOOrlhLUXbdnQ8mUzmzfHJxbvo9ZdUuIceo7gHXq17QBgB2TUCc-cXRVrryT7l/s1600/FullSizeRender.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsLFGgblFDqLMA4YBuJ2qiWrhyphenhyphen38Q-E_JA4XxFVdmEOKNIKumlathfF-IBpxIVkKChRf9f27bkx-NlLQfOOrlhLUXbdnQ8mUzmzfHJxbvo9ZdUuIceo7gHXq17QBgB2TUCc-cXRVrryT7l/s320/FullSizeRender.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh48-ElpmwoKrLX8n7YQLdVPZTtbvGf1pz3crAPcK89NYk9iBw3sgZ3wvQ9-97Hz5rx6hTW3kbHs9Djbpx1JeEW8xW9vr1JiO_DefvHVUtsxU6I3lt4QUMvp1AlTRbKOCgGZ05NByWUZbot/s1600/IMG_6941.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh48-ElpmwoKrLX8n7YQLdVPZTtbvGf1pz3crAPcK89NYk9iBw3sgZ3wvQ9-97Hz5rx6hTW3kbHs9Djbpx1JeEW8xW9vr1JiO_DefvHVUtsxU6I3lt4QUMvp1AlTRbKOCgGZ05NByWUZbot/s320/IMG_6941.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVJdT8Y82zb-ooKUo7Lc8IZALA0xGUfGfXjB8Au5HEKzp4cr8V2BAovZ_fKJeIkk2LIjF8IatFbremKut_awI3Dpq13B0huL3-FwRG1k1twaX9J6va3sI-EYnDR7ujQkkzOz4vaJstYKsi/s1600/IMG_6947.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVJdT8Y82zb-ooKUo7Lc8IZALA0xGUfGfXjB8Au5HEKzp4cr8V2BAovZ_fKJeIkk2LIjF8IatFbremKut_awI3Dpq13B0huL3-FwRG1k1twaX9J6va3sI-EYnDR7ujQkkzOz4vaJstYKsi/s320/IMG_6947.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2gDEGL-bUCQn5eZz40TruJzM8qT_BSNKfXTaU_uqEsQjxXgnxcToyih5mz6D1NyLsp41NIs9ts2EHHxmX_r630PrsGgoEzlZWfnaqV5Jt9mDH-aHzUbcbeKuWTiuOcHB1R2ZsGpWUZOL/s1600/IMG_6954.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2gDEGL-bUCQn5eZz40TruJzM8qT_BSNKfXTaU_uqEsQjxXgnxcToyih5mz6D1NyLsp41NIs9ts2EHHxmX_r630PrsGgoEzlZWfnaqV5Jt9mDH-aHzUbcbeKuWTiuOcHB1R2ZsGpWUZOL/s320/IMG_6954.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8sd0l8GmpxnwnXxty3ljDOHrrA84yUFamSa_ppEWK-5zYAUYYbYUSj_QsD_Tk-_kHdWZCjubinZpuG_xhpNDigbze-UR5CSkov82qoKtzQVWe460rhbz5fLZw5ml7_hogEt-3WVXhvmXV/s1600/IMG_6965.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8sd0l8GmpxnwnXxty3ljDOHrrA84yUFamSa_ppEWK-5zYAUYYbYUSj_QsD_Tk-_kHdWZCjubinZpuG_xhpNDigbze-UR5CSkov82qoKtzQVWe460rhbz5fLZw5ml7_hogEt-3WVXhvmXV/s320/IMG_6965.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc2XkaKMdXehpjMl9-Zsd391WmmmT9R8pPI8B228EHbLxutMx9MldZQsWcXOvsbbS1NKxK8bxSvk0WUhwW34GkVcx5LguDCRL7nBCmOeG56gNTUQp6EIK5BnSuyInxr5-KA8RhV_riP-aa/s1600/IMG_6992.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc2XkaKMdXehpjMl9-Zsd391WmmmT9R8pPI8B228EHbLxutMx9MldZQsWcXOvsbbS1NKxK8bxSvk0WUhwW34GkVcx5LguDCRL7nBCmOeG56gNTUQp6EIK5BnSuyInxr5-KA8RhV_riP-aa/s320/IMG_6992.JPG" width="240" /></a></div>
<br />Michael Davieshttp://www.blogger.com/profile/00273052548165190651noreply@blogger.com0tag:blogger.com,1999:blog-1011343219801614525.post-88240793442253443412015-09-10T14:31:00.004-07:002015-09-10T19:11:14.885-07:00Ironic on a NUC - part 2 - Running services, building and deploying images, and testingThis is a continuation of the <a href="http://lifelog.michaeldavies.org/2015/09/ironic-on-nuc-part-1-setting-things-up.html" target="_blank">previous post</a> on Ironic on a NUC - setting things up. If you're following along at home, read that first.<br />
<br />
<h3>
Creating disk images for deployment</h3>
Now let's build some images for use with Ironic. First off, we'll need a deploy ramdisk image for the initial load, and we'll also need the image that we want to deploy to the hardware. We can build these using diskimage builder, part of the triple-o effort.<br />
<br />
So let's do that in a virtual environment:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src$ mkvirtualenv dib</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src$ pip install diskimage-builder six</span><br />
<div>
<br /></div>
<div>
And because we want to use some of the triple-o elements, we'll refer to these as we do the build. Once the images are built we'll put them in a place where tftpd-hpa can serve them.</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src$ export ELEMENTS_PATH=~/src/tripleo-image-elements/elements</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src$ mkdir images</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src$ cd images</span></div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src/images$ disk-image-create ubuntu baremetal localboot dhcp-all-interfaces local-config -o my-image</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src/images$ ramdisk-image-create ubuntu deploy-ironic -o deploy-ramdisk</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src/images$ cp -rp * /tftpboot</span><br />
<div>
<br /></div>
<h3>
Starting Ironic services</h3>
I like to do my development in virtualenvs, so we'll run our services there. Let's start with ironic-api.<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(dib)mrda@irony:~/src/images$ deactivate</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/images$ cd ~/src/ironic/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ tox -evenv --notest</span><br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ source .tox/venv/bin/activate</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/ironic (master)$ ironic-api -v -d --config-file etc/ironic/ironic.conf.local</span></div>
</div>
<div>
<br /></div>
<div>
Now in a new terminal window for our VM, let's run ironic-conductor:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/images$ cd ~/src/ironic/</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ source .tox/venv/bin/activate</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">(venv)mrda@krypton:~/src/ironic (master)$ </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">python setup.py develop</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">(venv)mrda@krypton:~/src/ironic (master)$ ironic-conductor -v -d --config-file etc/ironic/ironic.conf.local</span></div>
<div>
<br /></div>
<div>
(If you get an error about unable to load the pywsman library, follow the workaround over here in a <a href="http://lifelog.michaeldavies.org/2015/07/virtualenv-and-library-fun.html" target="_blank">previous blog post</a>)</div>
<div>
<br /></div>
<h3>
Running Ironic Client</h3>
Let's open a new window on the VM for running an ironic command-line client to exercise what we've built:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ cd src/python-ironicclient/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/python-ironicclient (master)$ tox -evenv --notest</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/python-ironicclient (master)$ source .tox/venv/bin/activate</span><br />
<br />
Now we need to fudge authentication, and point at our running ironic-api:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ export OS_AUTH_TOKEN=fake-token</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ export IRONIC_URL=http://localhost:6385/</span><br />
<div>
<br /></div>
<div>
Let's try it out and see what happens, eh?</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br class="Apple-interchange-newline" />(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic driver-list</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+---------------------+----------------+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| Supported driver(s) | Active host(s) |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+---------------------+----------------+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| pxe_amt | test-host |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+---------------------+----------------+</span><br />
<div>
<br /></div>
<div>
Looking good! Let's try registering the NUC as an Ironic node, specifying the deployment ramdisk:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-create -d pxe_amt -i amt_password='<the-nuc-amin-password>' -i amt_username='admin' -i amt_address='10.0.0.251' -i deploy_ramdisk='file:///tftpboot/deploy-ramdisk.initramfs' -i deploy_kernel='file:///tftpboot/deploy-ramdisk.kernel' -n thenuc</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+--------------+--------------------------------------------------------------------------+</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| Property | Value |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+--------------+--------------------------------------------------------------------------+</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| uuid | 924a5447-930e-4d27-837e-6dd5d5f10e16 |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| driver_info | {u'amt_username': u'admin', u'deploy_kernel': u'file:///tftpboot/deploy- |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | ramdisk.kernel', u'amt_address': u'10.0.0.251', u'deploy_ramdisk': |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | u'file:///tftpboot/deploy-ramdisk.initramfs', u'amt_password': |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | u'******'} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| extra | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| driver | pxe_amt |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| chassis_uuid | |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| properties | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| name | thenuc |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+--------------+--------------------------------------------------------------------------+</span></div>
</div>
<div>
<br /></div>
<div>
Again more success! Since we're not using Nova to manage or kick-off the deploy, we need to tell ironic where the instance we want deployed is, along with some of the instance information:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-update thenuc add instance_info/image_source='file:///tftpboot/my-image.qcow2' instance_info/kernel='file:///tftpboot/my-image.vmlinuz' instance_info/ramdisk='file:///tftpboot/my-image.initrd' instance_info/root_gb=10</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+------------------------+-------------------------------------------------------------------------+</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| Property | Value |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+------------------------+-------------------------------------------------------------------------+</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| target_power_state | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| extra | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| last_error | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| updated_at | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| maintenance_reason | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| provision_state | available |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| clean_step | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| uuid | 924a5447-930e-4d27-837e-6dd5d5f10e16 |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| console_enabled | False |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| target_provision_state | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| provision_updated_at | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| maintenance | False |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| inspection_started_at | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| inspection_finished_at | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| power_state | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| driver | pxe_amt |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| reservation | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| properties | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| instance_uuid | None |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| name | thenuc |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| driver_info | {u'amt_username': u'admin', u'amt_password': u'******', u'amt_address': |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | u'10.0.0.251', u'deploy_ramdisk': u'file:///tftpboot/deploy- |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | ramdisk.initramfs', u'deploy_kernel': u'file:///tftpboot/deploy- |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | ramdisk.kernel'} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| created_at | 2015-09-10T00:55:27+00:00 |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| driver_internal_info | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| chassis_uuid | |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| instance_info | {u'ramdisk': u'file:///tftpboot/my-image.initrd', u'kernel': |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | u'file:///tftpboot/my-image.vmlinuz', u'root_gb': 10, u'image_source': |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| | u'file:///tftpboot/my-image.qcow2'} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+------------------------+-------------------------------------------------------------------------+</span></div>
</div>
<div>
<br />
Let's see what we've got:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-list</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+--------------------------------------+--------+---------------+-------------+--------------------+-------------+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+--------------------------------------+--------+---------------+-------------+--------------------+-------------+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| f8af4d4e-e3da-4a04-9596-8e4fef15e4eb | thenuc | None | None | available | False |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+--------------------------------------+--------+---------------+-------------+--------------------+-------------+</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<br /></div>
<div>
We now need to create a network port in ironic, and associate it with the mac address of the NUC. But I'm lazy, so let's extract the node UUID first:<br />
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ NODEUUID=$(ironic node-list | tail -n +4 | head -n -1 | awk -F "| " '{print $2}')</span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic port-create -n $NODEUUID -a <nuc-mac-address></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+-----------+--------------------------------------+</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| Property | Value |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+-----------+--------------------------------------+</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| node_uuid | 924a5447-930e-4d27-837e-6dd5d5f10e16 |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| extra | {} |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| uuid | c6dddc3d-b9b4-4fbc-99e3-18b8017c7b01 |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| address | <nuc-mac-address> |</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+-----------+--------------------------------------+</span></div>
</div>
<div>
<br /></div>
<br />
<div>
</div>
So let's validate everything we've done, before we try this out in anger:</div>
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-validate thenuc</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+------------+--------+---------------+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| Interface | Result | Reason |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+------------+--------+---------------+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| boot | True | |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| console | None | not supported |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| deploy | True | |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| inspect | None | not supported |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| management | True | |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| power | True | |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">| raid | None | not supported |</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+------------+--------+---------------+</span><br />
<div>
<br /></div>
<div>
And one more thing to do before we really start things rolling - ensure the NUC is listening to us:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ telnet 10.0.0.251 16992</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Trying 10.0.0.251...</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Connected to 10.0.0.251.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Escape character is '^]'.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">^]close</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">telnet> close</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Connection closed.</span></div>
</div>
<div>
<br /></div>
<div>
You might have to try that a couple of times to wake up the AMT interface, but it's important that you do to ensure you don't get a failed deploy.</div>
<div>
<br /></div>
And then we take the node active, which will DHCP the deploy ramdisk, which will in turn write the user image to the disk - if everything goes well. This will also take quite a long time, so time to go make that cup of tea :-)<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-set-provision-state thenuc active</span><br />
<br />
Your NUC should have just booted into your user image and should be ready for you to use!<br />
<br />
<h4>
Postscript #1:</h4>
Actually, that's not what really happened. It's what I would have <i>liked</i> to happen.<br />
<br />
But there were some issues. Firstly, ironic-conductor complained about not being able to find 'ironic-rootwrap'. And then once I symlinked that into place, it couldn't find the config for rootwrap, so I symlinked that into place. Then it complained that <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">iscsiadm</span> didn't have the correct permissions in rootwrap to do it's thing...<br />
<br />
So I gave up, and did the thing I didn't want to. Back on the VM I ended up doing a "<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo python setup.py install</span>" in the ironic directory so everything got installed into the correct system place and then I could restart ironic-conductor.<br />
<br />
It should all work in <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">develop</span> mode, but clearly it doesn't, so in the interests of getting something up and going (and finish this blog post :) I did the quick solution and installed system-wide. Perhaps I'll circle back and work out why someday :)<br />
<br />
<h4>
Postscript #2:</h4>
When doing this, the deployment can fail for a number of reasons. To recover, you need to delete the enrolled node and start again once you've worked out what the problem is, and worked out how to fix it. To do that you need to do:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-set-maintenance thenuc on</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(venv)mrda@irony:~/src/python-ironicclient (master)$ ironic node-delete thenuc</span><br />
<div>
<br /></div>
Isn't it great that we can use names for nodes instead of UUIDs for most operations :)<br />
<br />
<h3>
</h3>
Michael Davieshttp://www.blogger.com/profile/00273052548165190651noreply@blogger.com2tag:blogger.com,1999:blog-1011343219801614525.post-6411750211180253722015-09-10T00:35:00.000-07:002015-09-17T21:56:12.749-07:00Ironic on a NUC - part 1 - Setting things upJust because a few people have asked, here is what I did to get a standalone <a href="https://wiki.openstack.org/wiki/Ironic" target="_blank">Ironic</a> installation going and running in an Intel NUC. <br />
<br />
Why a NUC? Well, the Intel NUC is a cute little piece of hardware that is well suited as a test lab machine that can sit on my desk. I'm using a <a href="http://www.intel.com/content/www/us/en/nuc/nuc-kit-dc53427hye-board-d53427rke.html" target="_blank">DC53427HYE</a>, which is an i5 with vPro. vPro is a summary term for a bunch of Intel technologies, including AMT (Active Management Technology). This allows us to remotely manage this desktop for things like power management - think of this as an analogy to IPMI for servers.<br />
<br />
<h3>
Getting the VM ready</h3>
I like to do my development in VMs, after all, isn't that what the cloud is for? :-) So first off using your virtualisation technology of choice, build a VM with Ubuntu 14.04.2 server on it. I've allocated 2Gb RAM and 30Gb disk. The reason for the larger than average disk is so that I have room for building ramdisk and deployment disk images. I've called this box '<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">irony</span>'.<br />
<br />
On the VM you'll need a few extra things installed once you've got the base OS installed:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ sudo apt-get install python-openwsman ack-grep python-dev python-pip libmysqlclient-dev libxml2-dev git rabbitmq-server mysql-server isc-dhcp-server tftpd-hpa syslinux syslinux-common libxslt1-dev qemu-utils libpq-dev python-yaml open-iscsi</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~$ </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo pip install virtualenvwrapper six tox mysql-python</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<br />
<h3>
Thinking about the network</h3>
<h3>
<div style="font-size: medium; font-weight: normal;">
For this set up, I'm going to run separate networks for the control plane and data plane. I've added a <a href="http://www.amazon.com/gp/product/B00484IEJS" target="_blank">USB NIC</a> to the NUC so I can separate the networks. My public net connection to the internet will be on the 192.168.1.X network, whereas the service net control plane will be on 10.x.x.x. To do this I've added a new network interface to the VM, changed the networking to bridging for both NICs, and assigned eth0 and eth1 appropriately, and updated /etc/network/interfaces in the VM, so the right adapter is on the right network. It ended up looking like this in <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/etc/network/interfaces</span>:</div>
<div style="font-size: medium; font-weight: normal;">
<br /></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"># The loopback network interface</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">auto lo</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">iface lo inet loopback</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"># The primary (public) network interface</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">auto eth0</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">iface eth0 inet dhcp</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> gateway 192.168.1.1</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"># Control plane</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">auto eth1</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">iface eth1 inet static</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> address 10.0.0.5</span></div>
<div style="font-size: medium; font-weight: normal;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> netmask 255.255.255.0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<br /></div>
<div>
Setting up DHCP </div>
</h3>
We need to make sure we're listening for DHCP requests on the right interface<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ sudo sed -i 's/INTERFACES=""/INTERFACES="eth1"/' /etc/default/isc-dhcp-server</span><br />
<br />
Now configure your DHCP server to hand out an address to the NUC, accounting for some of the uniqueness of the device :) The tail of my <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/etc/dhcp/dhcpd.conf</span> looks a bit like this:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">allow duplicates;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ignore-client-uids true;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">authoritative;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">subnet 10.0.0.0 netmask 255.255.255.0 {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> group {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> host nuc {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> hardware ethernet <your-nucs-mac-address>;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> fixed-address 10.0.0.251; # NUC's IP address</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> allow booting;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> allow bootp;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> next-server <this-servers-ip-address>;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> filename "pxelinux.0";</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<div>
<br /></div>
<div>
There some more background on this in a <a href="http://lifelog.michaeldavies.org/2015/07/dhcp-and-nucs.html" target="_blank">previous blog post</a>.</div>
<br />
<h3>
Setting up TFTP</h3>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ sudo mkdir /tftpboot</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ sudo chmod a+rwx /tftpboot/</span><br />
<br />
We'll need to configure tftpd-hpa rather specifically, so<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> /etc/default/tftpd-hpa</span> looks like this:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">TFTP_USERNAME="tftp"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">TFTP_DIRECTORY="/tftpboot"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">TFTP_ADDRESS="[::]:69"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">TFTP_OPTIONS="-vvvv --map-file /tftpboot/map-file"</span><br />
<div>
<br /></div>
<div>
We'll also need to create <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/tftpboot/map-file</span> which will need to look like this:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">re ^(/tftpboot/) /tftpboot/\2</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">re ^/tftpboot/ /tftpboot/</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">re ^(^/) /tftpboot/\1</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">re ^([^/]) /tftpboot/\1</span></div>
</div>
<div>
<br /></div>
<div>
This is because of a weird combination of the feature sets of tftpd-hpa, isc-dhcp-server, ironic and diskimage-builder. Basically the combination of relative and dynamic paths are incompatible, and we need to work around the limitations by setting up a map-file. This would be a nice little patch one-day to send upstream to one or more of these projects. Of course, if you're deploying ironic in a production Openstacky way where you use neutron and dnsmasq, you don't need the map file - it's only when you configure all these things handrolicly that you face this problem.</div>
<br />
And we'll want to make sure the PXE boot stuff is all in place ready to be served over TFTP.<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ sudo cp /usr/lib/syslinux/chain.c32 /tftpboot/</span><br />
<div>
<br /></div>
And now let's start these services<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ service tftpd-hpa restart</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ service isc-dhcp-server restart</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<br />
<h3>
Installing Ironic</h3>
Just install straight from github (HEAD is always installable, right?)<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ mkdir ~/src; cd ~/src</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src$ git clone https://github.com/openstack/ironic.git </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src$ git clone https://github.com/openstack/python-ironicclient.git </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src$ git clone https://github.com/openstack/tripleo-image-elements.git</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<br />
<h3>
Configuring Ironic</h3>
Now we'll need to configure ironic to work standalone. There's a few config options that'll need to be changed from the default including changing the authentication policy, setting the right driver for AMT, setting a hostname and turning off that pesky power state syncing task.<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~$ cd src/ironic/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ cp etc/ironic/ironic.conf.sample etc/ironic/ironic.conf.local</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s/#auth_strategy=keystone/auth_strategy=noauth/" etc/ironic/ironic.conf.local</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s/#enabled_drivers=pxe_ipmitool/enabled_drivers=pxe_amt/" etc/ironic/ironic.conf.local</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s/#host=.*/host=test-host/" etc/ironic/ironic.conf.local</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s/#sync_power_state_interval=60/sync_power_state_interval=-1/" etc/ironic/ironic.conf.local</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s%#api_url=<None>%api_url=http://10.0.0.5:6385/%" etc/ironic/ironic.conf.local</span>
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s/#dhcp_provider=neutron/dhcp_provider=none/" </span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">etc/ironic/ironic.conf.local</span><br />
<br />
There's also the little matter of making sure the image directories are ready:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sudo mkdir -p /var/lib/ironic/images</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sudo mkdir -p /var/lib/ironic/master_images</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sudo chmod a+rwx /var/lib/ironic/images</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sudo chmod a+rwx /var/lib/ironic/master_images</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"></span><br />
<br />
<h3>
Initialising the database</h3>
<div>
Since we've decided to use MySQL instead of SQLite, we'll need to setup the schema and update the database connection string.</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ mysql -u root -p -e "create schema ironic"</span></div>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ sed -i "s/#connection=.*/connection=mysql:\/\/root:<database-password>@localhost\/ironic/" etc/ironic/ironic.conf.local</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">mrda@irony:~/src/ironic (master)$ </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ironic-dbsync --config-file etc/ironic/ironic.conf.local create_schema</span></div>
<div>
<br />
And that's everything that needs to be done to prepare the VM for running ironic. The next post will cover starting the ironic services, building images for deployment, and poking ironic from the command line.</div>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
<br />Michael Davieshttp://www.blogger.com/profile/00273052548165190651noreply@blogger.com1tag:blogger.com,1999:blog-1011343219801614525.post-82625428960771809052015-04-28T19:08:00.000-07:002015-04-28T19:11:20.372-07:00OpenStack Hint of the Day: Wed Apr 29When running <span style="font-family: Courier New, Courier, monospace;">tox</span> and you get something like this:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">mrda@garner:~/src/python-ironicclient (review/michael_davies/file-caching)$ tox -e py34</span><br />
<span style="font-family: Courier New, Courier, monospace;">py34 runtests: PYTHONHASHSEED='3098345924'</span><br />
<span style="font-family: Courier New, Courier, monospace;">py34 runtests: commands[0] | python setup.py testr --slowest --testr-args=</span><br />
<span style="font-family: Courier New, Courier, monospace;">running testr</span><br />
<span style="font-family: Courier New, Courier, monospace;">running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./ironicclient/tests/unit} --list </span><br />
<span style="background-color: yellow; font-family: Courier New, Courier, monospace;">db type could not be determined</span><br />
<span style="font-family: Courier New, Courier, monospace;">error: testr failed (3)</span><br />
<span style="font-family: Courier New, Courier, monospace;">ERROR: InvocationError: '/home/mrda/src/python-ironicclient/.tox/py34/bin/python setup.py testr --slowest --testr-args='</span><br />
<span style="font-family: Courier New, Courier, monospace;">________________________________________________________________________________________________ summary _________________________________________________________________________________________________</span><br />
<span style="font-family: Courier New, Courier, monospace;">ERROR: py34: commands failed</span><br />
<div>
<br /></div>
<div>
The solution is to "<span style="font-family: Courier New, Courier, monospace;">rm -rf .testrepository/</span>" and try again.<br />
<br />
(Thanks to this little reference hidden away <a href="https://wiki.openstack.org/wiki/Python3#tox.2Ftestr_error:_db_type_could_not_be_determined">https://wiki.openstack.org/wiki/Python3#tox.2Ftestr_error:_db_type_could_not_be_determined</a>)</div>
Michael Davieshttp://www.blogger.com/profile/00273052548165190651noreply@blogger.com0tag:blogger.com,1999:blog-1011343219801614525.post-80348020845861794882014-05-25T19:02:00.002-07:002014-05-25T19:05:14.603-07:00OpenStack Summit KeysigningIt's been a while since I've gone to a <a href="https://www.gnupg.org/" target="_blank">GPG</a> <a href="http://keysigning.org/methods/sassaman-efficient" target="_blank">keysigning</a>, but at the Juno <a href="https://www.openstack.org/summit/openstack-summit-atlanta-2014/" target="_blank">OpenStack Summit in Atlanta</a> I joined in. After all, it was my first summit and getting some id authentication is worthwhile.<br />
<br />
After the keysigning party I made use of <a href="http://bloc.eurion.net/archives/2010/gpg-key-signing-with-caff/" target="_blank">caff</a> to sign all those keys. But of course I needed to configure SMTP first in my development VM. There's a nice guide to <a href="http://blog.bobbyallen.me/2013/12/30/using-gmail-with-postfix-as-an-smtp-relay/" target="_blank">getting postfix working with gmail</a> which helped that go quickly. Just remember that <a href="https://support.google.com/mail/answer/1173270?hl=en" target="_blank">gmail likes Application-specific passwords</a> nowadays.<br />
<br />
Oh, and another thing. GPG has awful error messages. When you receive your key signed by a third-party and you try to <span style="font-family: Courier New, Courier, monospace;">gpg --import</span> it and you get the dreaded:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$ gpg --import your-signed-key.asc </span><br />
<span style="font-family: Courier New, Courier, monospace;">gpg: no valid OpenPGP data found.</span><br />
<span style="font-family: Courier New, Courier, monospace;">gpg: Total number processed: 0</span><br />
<span style="font-family: Courier New, Courier, monospace;">$ file your-signed-key.asc </span><br />
<span style="font-family: Courier New, Courier, monospace;">your-signed-key.asc: PGP message</span><br />
<div>
<br /></div>
<div>
...remember that the key has probably been encrypted with your public key so only you can read it. The way around this is a simple:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">$ gpg --decrypt your-signed-key.asc | gpg --import</span></div>
<div>
<br /></div>
<div>
Things would be mush easier if gnupg provided suggestions, but life often isn't that easy :)</div>
<div>
<br /></div>
Michael Davieshttp://www.blogger.com/profile/00273052548165190651noreply@blogger.com0