2013-05-29 11:02:04 -07:00
|
|
|
.. _dev-quickstart:
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2013-05-29 11:02:04 -07:00
|
|
|
=====================
|
|
|
|
Developer Quick-Start
|
|
|
|
=====================
|
2013-05-25 18:26:02 -07:00
|
|
|
|
|
|
|
This is a quick walkthrough to get you started developing code for Ironic.
|
2014-02-06 12:00:14 -08:00
|
|
|
This assumes you are already familiar with submitting code reviews to
|
2013-05-29 11:02:04 -07:00
|
|
|
an OpenStack project.
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2017-03-06 12:48:58 -06:00
|
|
|
The gate currently runs the unit tests under Python 2.7 and Python 3.5. It
|
|
|
|
is strongly encouraged to run the unit tests locally prior to submitting a
|
|
|
|
patch.
|
2015-05-27 09:40:37 -04:00
|
|
|
|
2015-11-16 12:40:39 +01:00
|
|
|
.. note::
|
|
|
|
Do not run unit tests on the same environment as devstack due to
|
|
|
|
conflicting configuration with system dependencies.
|
2015-09-22 12:39:16 -05:00
|
|
|
|
2016-07-25 15:31:50 +00:00
|
|
|
.. note::
|
2017-04-12 10:49:28 -07:00
|
|
|
This document is compatible with Python (3.5), Ubuntu (16.04) and Fedora (24).
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
When referring to different versions of Python and OS distributions, this
|
|
|
|
is explicitly stated.
|
2016-07-25 15:31:50 +00:00
|
|
|
|
2013-05-29 11:02:04 -07:00
|
|
|
.. seealso::
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2017-08-22 14:43:44 -04:00
|
|
|
https://docs.openstack.org/infra/manual/developers.html#development-workflow
|
2013-05-25 18:26:02 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
Prepare Development System
|
|
|
|
==========================
|
|
|
|
|
|
|
|
System Prerequisites
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
The following packages cover the prerequisites for a local development
|
|
|
|
environment on most current distributions. Instructions for getting set up with
|
|
|
|
non-default versions of Python and on older distributions are included below as
|
|
|
|
well.
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2015-05-04 20:32:56 +00:00
|
|
|
- Ubuntu/Debian::
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2016-07-20 14:45:30 -07:00
|
|
|
sudo apt-get install build-essential python-dev libssl-dev python-pip libmysqlclient-dev libxml2-dev libxslt-dev libpq-dev git git-review libffi-dev gettext ipmitool psmisc graphviz libjpeg-dev
|
2015-05-04 20:32:56 +00:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
- RHEL7/CentOS7::
|
2015-05-04 20:32:56 +00:00
|
|
|
|
2015-11-16 23:15:14 +02:00
|
|
|
sudo yum install python-devel openssl-devel python-pip mysql-devel libxml2-devel libxslt-devel postgresql-devel git git-review libffi-devel gettext ipmitool psmisc graphviz gcc libjpeg-turbo-devel
|
2015-05-04 20:32:56 +00:00
|
|
|
|
2015-12-18 13:59:58 +00:00
|
|
|
If using RHEL and yum reports "No package python-pip available" and "No
|
|
|
|
package git-review available", use the EPEL software repository.
|
2016-04-21 04:44:44 -03:00
|
|
|
Instructions can be found at `<https://fedoraproject.org/wiki/EPEL/FAQ#howtouse>`_.
|
2015-12-18 13:59:58 +00:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
- Fedora::
|
2015-08-04 10:14:23 +01:00
|
|
|
|
2015-11-16 23:15:14 +02:00
|
|
|
sudo dnf install python-devel openssl-devel python-pip mysql-devel libxml2-devel libxslt-devel postgresql-devel git git-review libffi-devel gettext ipmitool psmisc graphviz gcc libjpeg-turbo-devel
|
2015-08-04 10:14:23 +01:00
|
|
|
|
2015-12-18 13:59:58 +00:00
|
|
|
Additionally, if using Fedora 23, ``redhat-rpm-config`` package should be
|
|
|
|
installed so that development virtualenv can be built successfully.
|
2015-05-04 20:32:56 +00:00
|
|
|
|
|
|
|
- openSUSE/SLE 12::
|
2014-11-14 08:00:23 -08:00
|
|
|
|
2015-01-13 10:44:13 -08:00
|
|
|
sudo zypper install git git-review libffi-devel libmysqlclient-devel libopenssl-devel libxml2-devel libxslt-devel postgresql-devel python-devel python-nose python-pip gettext-runtime psmisc
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2015-05-04 20:32:56 +00:00
|
|
|
Graphviz is only needed for generating the state machine diagram. To install it
|
|
|
|
on openSUSE or SLE 12, see
|
2016-04-21 04:44:44 -03:00
|
|
|
`<https://software.opensuse.org/download.html?project=graphics&package=graphviz-plugins>`_.
|
2015-05-04 20:32:56 +00:00
|
|
|
|
2018-07-31 10:33:54 +01:00
|
|
|
To run the tests locally, it is a requirement that your terminal emulator
|
|
|
|
supports unicode with the ``en_US.UTF8`` locale. If you use locale-gen to
|
|
|
|
manage your locales, make sure you have enabled ``en_US.UTF8`` in
|
|
|
|
``/etc/locale.gen`` and rerun ``locale-gen``.
|
2015-05-27 09:40:37 -04:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
Python Prerequisites
|
|
|
|
--------------------
|
2016-07-25 15:31:50 +00:00
|
|
|
|
2015-11-16 12:40:39 +01:00
|
|
|
If your distro has at least tox 1.8, use similar command to install
|
|
|
|
``python-tox`` package. Otherwise install this on all distros::
|
2015-05-04 20:32:56 +00:00
|
|
|
|
2015-11-16 12:40:39 +01:00
|
|
|
sudo pip install -U tox
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
You may need to explicitly upgrade virtualenv if you've installed the one
|
|
|
|
from your OS distribution and it is too old (tox will complain). You can
|
|
|
|
upgrade it individually, if you need to::
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
sudo pip install -U virtualenv
|
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
|
|
|
|
Running Unit Tests Locally
|
|
|
|
==========================
|
|
|
|
|
|
|
|
If you haven't already, Ironic source code should be pulled directly from git::
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# from your home or source directory
|
|
|
|
cd ~
|
|
|
|
git clone https://git.openstack.org/openstack/ironic
|
|
|
|
cd ironic
|
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
Running Unit and Style Tests
|
|
|
|
----------------------------
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
All unit tests should be run using tox. To run Ironic's entire test suite::
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2017-03-06 12:48:58 -06:00
|
|
|
# to run the py27, py35 unit tests, and the style tests
|
2014-02-19 19:05:05 -08:00
|
|
|
tox
|
2013-05-25 18:26:02 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
To run a specific test or tests, use the "-e" option followed by the tox target
|
|
|
|
name. For example::
|
2016-08-05 09:09:21 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
# run the unit tests under py27 and also run the pep8 tests
|
2016-08-05 09:09:21 -07:00
|
|
|
tox -epy27 -epep8
|
|
|
|
|
2015-10-05 19:57:17 +00:00
|
|
|
You may pass options to the test programs using positional arguments.
|
2018-06-18 12:06:16 +09:00
|
|
|
To run a specific unit test, this passes the desired test
|
|
|
|
(regex string) to `stestr <https://pypi.org/project/stestr>`_::
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2014-11-13 22:38:33 +09:00
|
|
|
# run a specific test for Python 2.7
|
2018-06-18 12:06:16 +09:00
|
|
|
tox -epy27 -- test_conductor
|
2013-05-25 18:26:02 -07:00
|
|
|
|
2016-06-03 10:21:33 +01:00
|
|
|
Debugging unit tests
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
In order to break into the debugger from a unit test we need to insert
|
|
|
|
a breaking point to the code:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
import pdb; pdb.set_trace()
|
|
|
|
|
|
|
|
Then run ``tox`` with the debug environment as one of the following::
|
|
|
|
|
|
|
|
tox -e debug
|
|
|
|
tox -e debug test_file_name
|
|
|
|
tox -e debug test_file_name.TestClass
|
|
|
|
tox -e debug test_file_name.TestClass.test_name
|
|
|
|
|
|
|
|
For more information see the `oslotest documentation
|
2017-08-18 09:40:08 +08:00
|
|
|
<https://docs.openstack.org/oslotest/latest/user/features.html#debugging-with-oslo-debug-helper>`_.
|
2016-06-03 10:21:33 +01:00
|
|
|
|
2017-02-03 20:18:01 +01:00
|
|
|
Database Setup
|
|
|
|
--------------
|
|
|
|
|
|
|
|
The unit tests need a local database setup, you can use
|
|
|
|
``tools/test-setup.sh`` to set up the database the same way as setup
|
|
|
|
in the OpenStack test systems.
|
|
|
|
|
2016-08-24 09:27:17 -07:00
|
|
|
Additional Tox Targets
|
|
|
|
----------------------
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
|
|
|
|
There are several additional tox targets not included in the default list, such
|
|
|
|
as the target which builds the documentation site. See the ``tox.ini`` file
|
|
|
|
for a complete listing of tox targets. These can be run directly by specifying
|
|
|
|
the target name::
|
|
|
|
|
|
|
|
# generate the documentation pages locally
|
|
|
|
tox -edocs
|
|
|
|
|
|
|
|
# generate the sample configuration file
|
|
|
|
tox -egenconfig
|
|
|
|
|
|
|
|
|
2014-02-06 12:00:14 -08:00
|
|
|
Exercising the Services Locally
|
|
|
|
===============================
|
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
In addition to running automated tests, sometimes it can be helpful to actually
|
|
|
|
run the services locally, without needing a server in a remote datacenter.
|
|
|
|
|
|
|
|
If you would like to exercise the Ironic services in isolation within your local
|
|
|
|
environment, you can do this without starting any other OpenStack services. For
|
|
|
|
example, this is useful for rapidly prototyping and debugging interactions over
|
|
|
|
the RPC channel, testing database migrations, and so forth.
|
|
|
|
|
|
|
|
Here we describe two ways to install and configure the dependencies, either run
|
|
|
|
directly on your local machine or encapsulated in a virtual machine or
|
|
|
|
container.
|
|
|
|
|
|
|
|
Step 1: Create a Python virtualenv
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
#. If you haven't already downloaded the source code, do that first::
|
|
|
|
|
|
|
|
cd ~
|
|
|
|
git clone https://git.openstack.org/openstack/ironic
|
|
|
|
cd ironic
|
|
|
|
|
|
|
|
#. Create the Python virtualenv::
|
|
|
|
|
|
|
|
tox -evenv --notest --develop -r
|
|
|
|
|
|
|
|
#. Activate the virtual environment::
|
|
|
|
|
2017-08-26 17:36:24 -07:00
|
|
|
. .tox/venv/bin/activate
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
|
2018-05-08 14:33:36 -07:00
|
|
|
#. Install the `openstack` client command utility::
|
|
|
|
|
|
|
|
pip install python-openstackclient
|
|
|
|
|
|
|
|
|
|
|
|
#. Install the `openstack baremetal` client::
|
2016-08-24 09:27:17 -07:00
|
|
|
|
|
|
|
pip install python-ironicclient
|
|
|
|
|
2016-10-05 22:32:25 +09:00
|
|
|
.. note:: You can install python-ironicclient from source by cloning the git
|
|
|
|
repository and running `pip install .` while in the root of the
|
|
|
|
cloned repository.
|
2016-08-24 09:27:17 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
#. Export some ENV vars so the client will connect to the local services
|
|
|
|
that you'll start in the next section::
|
|
|
|
|
2017-08-29 18:57:31 -04:00
|
|
|
export OS_TOKEN=fake-token
|
|
|
|
export OS_URL=http://localhost:6385/
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
|
2018-10-16 15:09:58 +02:00
|
|
|
Next, install and configure system dependencies.
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
|
2018-10-16 15:09:58 +02:00
|
|
|
Step 2: Install System Dependencies Locally
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
--------------------------------------------
|
2015-03-24 12:56:50 -07:00
|
|
|
|
2018-10-22 14:14:03 +00:00
|
|
|
This step will install RabbitMQ and MySQL on your local system. This may not
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
be desirable in some situations (eg, you're developing from a laptop and do not
|
|
|
|
want to run a MySQL server on it all the time).
|
2015-03-24 12:56:50 -07:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
#. Install rabbitmq-server:
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
Ubuntu/Debian::
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
sudo apt-get install rabbitmq-server
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
RHEL7/CentOS7::
|
2015-08-04 10:14:23 +01:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
sudo yum install rabbitmq-server
|
|
|
|
sudo systemctl start rabbitmq-server.service
|
2014-09-26 14:58:46 +02:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
Fedora::
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
sudo dnf install rabbitmq-server
|
|
|
|
sudo systemctl start rabbitmq-server.service
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
openSUSE/SLE 12::
|
2014-02-19 19:05:05 -08:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
sudo zypper install rabbitmq-server
|
|
|
|
sudo systemctl start rabbitmq-server.service
|
2015-08-04 10:14:23 +01:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
#. Install mysql-server:
|
2014-09-26 14:58:46 +02:00
|
|
|
|
2018-08-09 13:51:00 +08:00
|
|
|
Ubuntu/Debian::
|
|
|
|
|
|
|
|
sudo apt-get install mysql-server
|
|
|
|
|
|
|
|
RHEL7/CentOS7::
|
|
|
|
|
|
|
|
sudo yum install mariadb mariadb-server
|
|
|
|
sudo systemctl start mariadb.service
|
|
|
|
|
|
|
|
Fedora::
|
|
|
|
|
|
|
|
sudo dnf install mariadb mariadb-server
|
|
|
|
sudo systemctl start mariadb.service
|
|
|
|
|
|
|
|
openSUSE/SLE 12::
|
|
|
|
|
|
|
|
sudo zypper install mariadb
|
|
|
|
sudo systemctl start mysql.service
|
|
|
|
|
|
|
|
If using MySQL, you need to create the initial database::
|
|
|
|
|
|
|
|
mysql -u root -pMYSQL_ROOT_PWD -e "create schema ironic"
|
2014-02-14 16:23:58 +00:00
|
|
|
|
2016-10-05 22:32:25 +09:00
|
|
|
.. note:: if you choose not to install mysql-server, ironic will default to
|
|
|
|
using a local sqlite database.
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2015-03-24 12:56:50 -07:00
|
|
|
#. Create a configuration file within the ironic source directory::
|
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
# generate a sample config
|
|
|
|
tox -egenconfig
|
|
|
|
|
2014-02-06 12:00:14 -08:00
|
|
|
# copy sample config and modify it as necessary
|
|
|
|
cp etc/ironic/ironic.conf.sample etc/ironic/ironic.conf.local
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# disable auth since we are not running keystone here
|
2016-06-09 17:22:28 -04:00
|
|
|
sed -i "s/#auth_strategy = keystone/auth_strategy = noauth/" etc/ironic/ironic.conf.local
|
2014-02-19 19:05:05 -08:00
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
# use the 'fake-hardware' test hardware type
|
|
|
|
sed -i "s/#enabled_hardware_types = .*/enabled_hardware_types = fake-hardware/" etc/ironic/ironic.conf.local
|
|
|
|
|
|
|
|
# use the 'fake' deploy and boot interfaces
|
|
|
|
sed -i "s/#enabled_deploy_interfaces = .*/enabled_deploy_interfaces = fake/" etc/ironic/ironic.conf.local
|
|
|
|
sed -i "s/#enabled_boot_interfaces = .*/enabled_boot_interfaces = fake/" etc/ironic/ironic.conf.local
|
|
|
|
|
|
|
|
# enable both fake and ipmitool management and power interfaces
|
|
|
|
sed -i "s/#enabled_management_interfaces = .*/enabled_management_interfaces = fake,ipmitool/" etc/ironic/ironic.conf.local
|
|
|
|
sed -i "s/#enabled_power_interfaces = .*/enabled_power_interfaces = fake,ipmitool/" etc/ironic/ironic.conf.local
|
2014-06-17 14:46:38 +00:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
# set a fake host name [useful if you want to test multiple services on the same host]
|
2016-06-09 17:22:28 -04:00
|
|
|
sed -i "s/#host = .*/host = test-host/" etc/ironic/ironic.conf.local
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2016-12-22 12:39:15 -05:00
|
|
|
# change the periodic sync_power_state_interval to a week, to avoid getting NodeLocked exceptions
|
|
|
|
sed -i "s/#sync_power_state_interval = 60/sync_power_state_interval = 604800/" etc/ironic/ironic.conf.local
|
2014-06-17 14:46:38 +00:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
# if you opted to install mysql-server, switch the DB connection from sqlite to mysql
|
2016-06-09 17:22:28 -04:00
|
|
|
sed -i "s/#connection = .*/connection = mysql\+pymysql:\/\/root:MYSQL_ROOT_PWD@localhost\/ironic/" etc/ironic/ironic.conf.local
|
2014-02-19 19:05:05 -08:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
Step 3: Start the Services
|
|
|
|
--------------------------
|
2015-03-24 12:56:50 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
From within the python virtualenv, run the following command to prepare the
|
|
|
|
database before you start the ironic services::
|
2015-03-24 12:56:50 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
# initialize the database for ironic
|
2014-09-19 13:24:05 -04:00
|
|
|
ironic-dbsync --config-file etc/ironic/ironic.conf.local create_schema
|
2014-02-19 19:05:05 -08:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
Next, open two new terminals for this section, and run each of the examples
|
|
|
|
here in a separate terminal. In this way, the services will *not* be run as
|
|
|
|
daemons; you can observe their output and stop them with Ctrl-C at any time.
|
2014-02-19 19:05:05 -08:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
#. Start the API service in debug mode and watch its output::
|
2015-03-24 12:56:50 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
cd ~/ironic
|
2017-08-26 17:36:24 -07:00
|
|
|
. .tox/venv/bin/activate
|
2017-07-04 19:13:05 +02:00
|
|
|
ironic-api -d --config-file etc/ironic/ironic.conf.local
|
2015-03-24 12:56:50 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
#. Start the Conductor service in debug mode and watch its output::
|
2015-03-24 12:56:50 -07:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
cd ~/ironic
|
2017-08-26 17:36:24 -07:00
|
|
|
. .tox/venv/bin/activate
|
2017-07-04 19:13:05 +02:00
|
|
|
ironic-conductor -d --config-file etc/ironic/ironic.conf.local
|
2014-02-06 12:00:14 -08:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
Step 4: Interact with the running services
|
|
|
|
------------------------------------------
|
|
|
|
|
|
|
|
You should now be able to interact with ironic via the python client, which is
|
|
|
|
present in the python virtualenv, and observe both services' debug outputs in
|
|
|
|
the other two windows. This is a good way to test new features or play with the
|
|
|
|
functionality without necessarily starting DevStack.
|
2014-02-19 19:05:05 -08:00
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
To get started, export the following variables to point the client at the
|
|
|
|
local instance of ironic and disable the authentication::
|
|
|
|
|
|
|
|
export OS_AUTH_TYPE=token_endpoint
|
|
|
|
export OS_TOKEN=fake
|
|
|
|
export OS_ENDPOINT=http://127.0.0.1:6385
|
|
|
|
|
|
|
|
Then list the available commands and resources::
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# get a list of available commands
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack help baremetal
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
# get the list of drivers currently supported by the available conductor(s)
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal driver list
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
# get a list of nodes (should be empty at this point)
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal node list
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
Here is an example walkthrough of creating a node::
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
MAC="aa:bb:cc:dd:ee:ff" # replace with the MAC of a data port on your node
|
|
|
|
IPMI_ADDR="1.2.3.4" # replace with a real IP of the node BMC
|
|
|
|
IPMI_USER="admin" # replace with the BMC's user name
|
|
|
|
IPMI_PASS="pass" # replace with the BMC's password
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
# enroll the node with the fake hardware type and IPMI-based power and
|
|
|
|
# management interfaces. Note that driver info may be added at node
|
|
|
|
# creation time with "--driver-info"
|
2017-08-29 18:57:31 -04:00
|
|
|
NODE=$(openstack baremetal node create \
|
2018-01-25 10:08:07 +01:00
|
|
|
--driver fake-hardware \
|
|
|
|
--management-interface ipmitool \
|
|
|
|
--power-interface ipmitool \
|
2017-08-29 18:57:31 -04:00
|
|
|
--driver-info ipmi_address=$IPMI_ADDR \
|
|
|
|
--driver-info ipmi_username=$IPMI_USER \
|
|
|
|
-f value -c uuid)
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# driver info may also be added or updated later on
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal node set $NODE --driver-info ipmi_password=$IPMI_PASS
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# add a network port
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal port create $MAC --node $NODE
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# view the information for the node
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal node show $NODE
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
# request that the node's driver validate the supplied information
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal node validate $NODE
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
# you have now enrolled a node sufficiently to be able to control
|
|
|
|
# its power state from ironic!
|
2017-08-29 18:57:31 -04:00
|
|
|
openstack baremetal node power on $NODE
|
2014-02-06 12:00:14 -08:00
|
|
|
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
If you make some code changes and want to test their effects, simply stop the
|
|
|
|
services with Ctrl-C and restart them.
|
|
|
|
|
|
|
|
Step 5: Fixing your test environment
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
If you are testing changes that add or remove python entrypoints, or making
|
|
|
|
significant changes to ironic's python modules, or simply keep the virtualenv
|
|
|
|
around for a long time, your development environment may reach an inconsistent
|
|
|
|
state. It may help to delete cached ".pyc" files, update dependencies,
|
|
|
|
reinstall ironic, or even recreate the virtualenv. The following commands may
|
2016-10-17 14:40:01 +08:00
|
|
|
help with that, but are not an exhaustive troubleshooting guide::
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
|
|
|
|
# clear cached pyc files
|
|
|
|
cd ~/ironic/ironic
|
|
|
|
find ./ -name '*.pyc' | xargs rm
|
|
|
|
|
|
|
|
# reinstall ironic modules
|
|
|
|
cd ~/ironic
|
2017-08-26 17:36:24 -07:00
|
|
|
. .tox/venv/bin/activate
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
pip uninstall ironic
|
|
|
|
pip install -e .
|
|
|
|
|
|
|
|
# install and upgrade ironic and all python dependencies
|
|
|
|
cd ~/ironic
|
2017-08-26 17:36:24 -07:00
|
|
|
. .tox/venv/bin/activate
|
Documentation update
This patch contains several changes to the documentation which
were brought about by, initially, removing the webapi/v1 page and
replacing it with a link to the /api-ref/ page.
As I did that, I saw that our front page (index.html) needed to
be updated as well, and decided that the front page needed to
actually be completely rerwitten -- while preserving all the links.
Some of the TOC links from the front page were malformed because
subpages included more than one H1 heading, so I had to make small
changes in the api-audit-support and code-contribution-guide and
dev-quickstart pages, in order for the front page to render properly.
As I corrected the headings on dev-quickstart, I realized the page
was not comprehensively organized, and so decided to reorganize the
sections and make it easier to navigate.
Here is a bullet-point summary of this change:
* Major changes to content and organization of index page
* Moved the version history from webapi/v1 to dev/webapi-version-history
* Added API conceptual guide at dev/webapi
* Replaced webapi/v1 with a link to dev/webapi, in case anyone
bookmarked it
* Removed doc references to webapi/v1
* Merged the pages dev/contributing and dev/code-contribution-guide
* Removed duplicate H1 headers in deploy/api-audit-support
* Reorganized and renamed section headers in dev/dev-quickstart,
and made some substantive corrections and changes as well
* Updated wording at the top of the index and deploy/user-guide pages.
Change-Id: Ib418e1d4fdfab4f0e15560270f39922e33df3f12
2016-08-17 15:20:50 -07:00
|
|
|
pip install -U -e .
|
|
|
|
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2017-05-22 11:25:15 +09:00
|
|
|
.. _`deploy_devstack`:
|
|
|
|
|
2014-03-17 16:58:32 -07:00
|
|
|
Deploying Ironic with DevStack
|
2015-12-24 17:04:35 +02:00
|
|
|
==============================
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
DevStack may be configured to deploy Ironic, setup Nova to use the Ironic
|
|
|
|
driver and provide hardware resources (network, baremetal compute nodes)
|
|
|
|
using a combination of OpenVSwitch and libvirt. It is highly recommended
|
|
|
|
to deploy on an expendable virtual machine and not on your personal work
|
2017-04-12 10:49:28 -07:00
|
|
|
station. Deploying Ironic with DevStack requires a machine running Ubuntu
|
|
|
|
16.04 (or later) or Fedora 24 (or later). Make sure your machine is fully
|
2016-08-11 14:48:25 +00:00
|
|
|
up to date and has the latest packages installed before beginning this process.
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2017-08-18 09:40:08 +08:00
|
|
|
https://docs.openstack.org/devstack/latest/
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
.. note::
|
|
|
|
The devstack "demo" tenant is now granted the "baremetal_observer" role
|
|
|
|
and thereby has read-only access to ironic's API. This is sufficient for
|
|
|
|
all the examples below. Should you want to create or modify bare metal
|
|
|
|
resources directly (ie. through ironic rather than through nova) you will
|
|
|
|
need to use the devstack "admin" tenant.
|
|
|
|
|
2016-08-11 14:48:25 +00:00
|
|
|
|
2014-07-03 02:48:21 -05:00
|
|
|
Devstack will no longer create the user 'stack' with the desired
|
|
|
|
permissions, but does provide a script to perform the task::
|
|
|
|
|
2016-05-26 07:44:37 -04:00
|
|
|
git clone https://git.openstack.org/openstack-dev/devstack.git devstack
|
2014-07-03 02:48:21 -05:00
|
|
|
sudo ./devstack/tools/create-stack-user.sh
|
|
|
|
|
|
|
|
Switch to the stack user and clone DevStack::
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2015-10-14 14:24:44 +01:00
|
|
|
sudo su - stack
|
2016-05-26 07:44:37 -04:00
|
|
|
git clone https://git.openstack.org/openstack-dev/devstack.git devstack
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2015-01-15 12:57:25 -03:00
|
|
|
Create devstack/local.conf with minimal settings required to enable Ironic.
|
2018-01-25 10:08:07 +01:00
|
|
|
An example local.conf that enables both ``direct`` and ``iscsi``
|
|
|
|
:doc:`deploy interfaces </admin/interfaces/deploy>` and uses the ``ipmi``
|
|
|
|
hardware type by default::
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
cd devstack
|
2015-01-15 12:57:25 -03:00
|
|
|
cat >local.conf <<END
|
|
|
|
[[local|localrc]]
|
2014-07-03 02:48:21 -05:00
|
|
|
# Credentials
|
|
|
|
ADMIN_PASSWORD=password
|
|
|
|
DATABASE_PASSWORD=password
|
|
|
|
RABBIT_PASSWORD=password
|
|
|
|
SERVICE_PASSWORD=password
|
|
|
|
SERVICE_TOKEN=password
|
2015-10-16 15:05:04 +02:00
|
|
|
SWIFT_HASH=password
|
|
|
|
SWIFT_TEMPURL_KEY=password
|
2014-07-03 02:48:21 -05:00
|
|
|
|
2015-12-24 17:04:35 +02:00
|
|
|
# Enable Ironic plugin
|
|
|
|
enable_plugin ironic git://git.openstack.org/openstack/ironic
|
|
|
|
|
2018-02-07 13:10:07 -08:00
|
|
|
# Disable nova novnc service, ironic does not support it anyway.
|
2015-02-23 15:00:10 +00:00
|
|
|
disable_service n-novnc
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
# Enable Swift for the direct deploy interface.
|
2015-10-16 15:05:04 +02:00
|
|
|
enable_service s-proxy
|
|
|
|
enable_service s-object
|
|
|
|
enable_service s-container
|
|
|
|
enable_service s-account
|
|
|
|
|
2015-02-23 15:00:10 +00:00
|
|
|
# Disable Horizon
|
|
|
|
disable_service horizon
|
|
|
|
|
|
|
|
# Disable Cinder
|
|
|
|
disable_service cinder c-sch c-api c-vol
|
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
# Swift temp URL's are required for the direct deploy interface
|
2015-10-16 15:05:04 +02:00
|
|
|
SWIFT_ENABLE_TEMPURLS=True
|
|
|
|
|
2014-07-03 02:48:21 -05:00
|
|
|
# Create 3 virtual machines to pose as Ironic's baremetal nodes.
|
2014-03-17 16:58:32 -07:00
|
|
|
IRONIC_VM_COUNT=3
|
2014-07-03 02:48:21 -05:00
|
|
|
IRONIC_BAREMETAL_BASIC_OPS=True
|
2016-03-07 16:54:14 +02:00
|
|
|
DEFAULT_INSTANCE_TYPE=baremetal
|
2015-10-16 15:05:04 +02:00
|
|
|
|
2018-01-25 10:08:07 +01:00
|
|
|
# Enable additional hardware types, if needed.
|
|
|
|
#IRONIC_ENABLED_HARDWARE_TYPES=ipmi,fake-hardware
|
|
|
|
# Don't forget that many hardware types require enabling of additional
|
|
|
|
# interfaces, most often power and management:
|
|
|
|
#IRONIC_ENABLED_MANAGEMENT_INTERFACES=ipmitool,fake
|
|
|
|
#IRONIC_ENABLED_POWER_INTERFACES=ipmitool,fake
|
|
|
|
# The 'ipmi' hardware type's default deploy interface is 'iscsi'.
|
|
|
|
# This would change the default to 'direct':
|
|
|
|
#IRONIC_DEFAULT_DEPLOY_INTERFACE=direct
|
2015-10-16 15:05:04 +02:00
|
|
|
|
|
|
|
# Change this to alter the default driver for nodes created by devstack.
|
|
|
|
# This driver should be in the enabled list above.
|
2018-01-25 10:08:07 +01:00
|
|
|
IRONIC_DEPLOY_DRIVER=ipmi
|
2014-07-03 02:48:21 -05:00
|
|
|
|
|
|
|
# The parameters below represent the minimum possible values to create
|
|
|
|
# functional nodes.
|
2016-08-10 14:34:20 +01:00
|
|
|
IRONIC_VM_SPECS_RAM=1280
|
2014-07-03 02:48:21 -05:00
|
|
|
IRONIC_VM_SPECS_DISK=10
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2014-05-05 08:34:52 -04:00
|
|
|
# Size of the ephemeral partition in GB. Use 0 for no ephemeral partition.
|
|
|
|
IRONIC_VM_EPHEMERAL_DISK=0
|
|
|
|
|
2015-10-16 15:05:04 +02:00
|
|
|
# To build your own IPA ramdisk from source, set this to True
|
|
|
|
IRONIC_BUILD_DEPLOY_RAMDISK=False
|
|
|
|
|
2014-03-17 16:58:32 -07:00
|
|
|
VIRT_DRIVER=ironic
|
|
|
|
|
|
|
|
# By default, DevStack creates a 10.0.0.0/24 network for instances.
|
|
|
|
# If this overlaps with the hosts network, you may adjust with the
|
|
|
|
# following.
|
|
|
|
NETWORK_GATEWAY=10.1.0.1
|
|
|
|
FIXED_RANGE=10.1.0.0/24
|
|
|
|
FIXED_NETWORK_SIZE=256
|
|
|
|
|
2014-07-03 02:48:21 -05:00
|
|
|
# Log all output to files
|
2014-03-17 16:58:32 -07:00
|
|
|
LOGFILE=$HOME/devstack.log
|
2015-06-23 15:44:26 +03:00
|
|
|
LOGDIR=$HOME/logs
|
2014-07-03 02:48:21 -05:00
|
|
|
IRONIC_VM_LOG_DIR=$HOME/ironic-bm-logs
|
|
|
|
|
2014-09-24 14:44:52 +01:00
|
|
|
END
|
|
|
|
|
2016-07-20 15:23:59 +00:00
|
|
|
.. note::
|
|
|
|
Git protocol requires access to port 9418, which is not a standard port that
|
|
|
|
corporate firewalls always allow. If you are behind a firewall or on a proxy that
|
|
|
|
blocks Git protocol, modify the ``enable_plugin`` line to use ``https://`` instead
|
|
|
|
of ``git://`` and add ``GIT_BASE=https://git.openstack.org`` to the credentials::
|
|
|
|
|
|
|
|
GIT_BASE=https://git.openstack.org
|
|
|
|
|
|
|
|
# Enable Ironic plugin
|
|
|
|
enable_plugin ironic https://git.openstack.org/openstack/ironic
|
|
|
|
|
2016-07-12 18:13:11 -07:00
|
|
|
.. note::
|
2018-01-25 10:08:07 +01:00
|
|
|
When the ``ipmi`` hardware type is used and IRONIC_IS_HARDWARE variable is
|
|
|
|
``false`` devstack will automatically set up `VirtualBMC
|
|
|
|
<https://github.com/openstack/virtualbmc>`_ to control the power state of
|
|
|
|
the virtual baremetal nodes.
|
2016-07-12 18:13:11 -07:00
|
|
|
|
2016-02-10 22:28:36 +01:00
|
|
|
.. note::
|
|
|
|
When running QEMU as non-root user (e.g. ``qemu`` on Fedora or ``libvirt-qemu`` on Ubuntu),
|
|
|
|
make sure ``IRONIC_VM_LOG_DIR`` points to a directory where QEMU will be able to write.
|
|
|
|
You can verify this with, for example::
|
|
|
|
|
|
|
|
# on Fedora
|
|
|
|
sudo -u qemu touch $HOME/ironic-bm-logs/test.log
|
|
|
|
# on Ubuntu
|
|
|
|
sudo -u libvirt-qemu touch $HOME/ironic-bm-logs/test.log
|
|
|
|
|
2016-06-15 13:03:07 +01:00
|
|
|
.. note::
|
|
|
|
To check out an in-progress patch for testing, you can add a Git ref to the ``enable_plugin`` line. For instance::
|
|
|
|
|
|
|
|
enable_plugin ironic git://git.openstack.org/openstack/ironic refs/changes/46/295946/15
|
|
|
|
|
|
|
|
For a patch in review, you can find the ref to use by clicking the
|
|
|
|
"Download" button in Gerrit. You can also specify a different git repo, or
|
|
|
|
a branch or tag::
|
|
|
|
|
|
|
|
enable_plugin ironic https://github.com/openstack/ironic stable/kilo
|
|
|
|
|
|
|
|
For more details, see the
|
|
|
|
`devstack plugin interface documentation
|
2017-08-18 09:40:08 +08:00
|
|
|
<https://docs.openstack.org/devstack/latest/plugins.html#plugin-interface>`_.
|
2016-06-15 13:03:07 +01:00
|
|
|
|
2014-03-17 16:58:32 -07:00
|
|
|
Run stack.sh::
|
|
|
|
|
|
|
|
./stack.sh
|
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
Source credentials, create a key, and spawn an instance as the ``demo`` user::
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2017-08-26 17:36:24 -07:00
|
|
|
. ~/devstack/openrc
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2014-08-05 20:40:57 +00:00
|
|
|
# query the image id of the default cirros image
|
2016-05-16 13:35:22 +01:00
|
|
|
image=$(openstack image show $DEFAULT_IMAGE_NAME -f value -c id)
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
# create keypair
|
|
|
|
ssh-keygen
|
2016-07-21 09:18:12 -07:00
|
|
|
openstack keypair create --public-key ~/.ssh/id_rsa.pub default
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
# spawn instance
|
2016-07-21 09:18:12 -07:00
|
|
|
openstack server create --flavor baremetal --image $image --key-name default testing
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2015-02-21 21:45:16 +08:00
|
|
|
.. note::
|
|
|
|
Because devstack create multiple networks, we need to pass an additional parameter
|
2015-04-07 13:45:50 -07:00
|
|
|
``--nic net-id`` to the nova boot command when using the admin account, for example::
|
2015-02-21 21:45:16 +08:00
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
net_id=$(openstack network list | egrep "$PRIVATE_NETWORK_NAME"'[^-]' | awk '{ print $2 }')
|
2015-02-21 21:45:16 +08:00
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
openstack server create --flavor baremetal --nic net-id=$net_id --image $image --key-name default testing
|
2015-02-21 21:45:16 +08:00
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
You should now see a Nova instance building::
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2017-03-28 15:08:41 -04:00
|
|
|
openstack server list --long
|
|
|
|
+----------+---------+--------+------------+-------------+----------+------------+----------+-------------------+------+------------+
|
|
|
|
| ID | Name | Status | Task State | Power State | Networks | Image Name | Image ID | Availability Zone | Host | Properties |
|
|
|
|
+----------+---------+--------+------------+-------------+----------+------------+----------+-------------------+------+------------+
|
|
|
|
| a2c7f812 | testing | BUILD | spawning | NOSTATE | | cirros-0.3 | 44d4092a | nova | | |
|
|
|
|
| -e386-4a | | | | | | .5-x86_64- | -51ac-47 | | | |
|
|
|
|
| 22-b393- | | | | | | disk | 51-9c50- | | | |
|
|
|
|
| fe1802ab | | | | | | | fd6e2050 | | | |
|
|
|
|
| d56e | | | | | | | faa1 | | | |
|
|
|
|
+----------+---------+--------+------------+-------------+----------+------------+----------+-------------------+------+------------+
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
Nova will be interfacing with Ironic conductor to spawn the node. On the
|
|
|
|
Ironic side, you should see an Ironic node associated with this Nova instance.
|
|
|
|
It should be powered on and in a 'wait call-back' provisioning state::
|
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
openstack baremetal node list
|
2017-03-28 15:08:41 -04:00
|
|
|
+--------------------------------------+--------+--------------------------------------+-------------+--------------------+-------------+
|
|
|
|
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
|
|
|
|
+--------------------------------------+--------+--------------------------------------+-------------+--------------------+-------------+
|
|
|
|
| 9e592cbe-e492-4e4f-bf8f-4c9e0ad1868f | node-0 | None | power off | None | False |
|
|
|
|
| ec0c6384-cc3a-4edf-b7db-abde1998be96 | node-1 | None | power off | None | False |
|
|
|
|
| 4099e31c-576c-48f8-b460-75e1b14e497f | node-2 | a2c7f812-e386-4a22-b393-fe1802abd56e | power on | wait call-back | False |
|
|
|
|
+--------------------------------------+--------+--------------------------------------+-------------+--------------------+-------------+
|
2014-03-17 16:58:32 -07:00
|
|
|
|
2017-07-07 18:23:02 +03:00
|
|
|
At this point, Ironic conductor has called to libvirt (via virtualbmc) to
|
|
|
|
power on a virtual machine, which will PXE + TFTP boot from the conductor node and
|
2014-03-17 16:58:32 -07:00
|
|
|
progress through the Ironic provisioning workflow. One libvirt domain should
|
|
|
|
be active now::
|
|
|
|
|
|
|
|
sudo virsh list --all
|
|
|
|
Id Name State
|
|
|
|
----------------------------------------------------
|
2017-03-28 15:08:41 -04:00
|
|
|
2 node-2 running
|
|
|
|
- node-0 shut off
|
|
|
|
- node-1 shut off
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
This provisioning process may take some time depending on the performance of
|
|
|
|
the host system, but Ironic should eventually show the node as having an
|
|
|
|
'active' provisioning state::
|
|
|
|
|
2016-07-21 09:18:12 -07:00
|
|
|
openstack baremetal node list
|
2017-03-28 15:08:41 -04:00
|
|
|
+--------------------------------------+--------+--------------------------------------+-------------+--------------------+-------------+
|
|
|
|
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
|
|
|
|
+--------------------------------------+--------+--------------------------------------+-------------+--------------------+-------------+
|
|
|
|
| 9e592cbe-e492-4e4f-bf8f-4c9e0ad1868f | node-0 | None | power off | None | False |
|
|
|
|
| ec0c6384-cc3a-4edf-b7db-abde1998be96 | node-1 | None | power off | None | False |
|
|
|
|
| 4099e31c-576c-48f8-b460-75e1b14e497f | node-2 | a2c7f812-e386-4a22-b393-fe1802abd56e | power on | active | False |
|
|
|
|
+--------------------------------------+--------+--------------------------------------+-------------+--------------------+-------------+
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
This should also be reflected in the Nova instance state, which at this point
|
|
|
|
should be ACTIVE, Running and an associated private IP::
|
|
|
|
|
2017-03-28 15:08:41 -04:00
|
|
|
openstack server list --long
|
|
|
|
+----------+---------+--------+------------+-------------+---------------+------------+----------+-------------------+------+------------+
|
|
|
|
| ID | Name | Status | Task State | Power State | Networks | Image Name | Image ID | Availability Zone | Host | Properties |
|
|
|
|
+----------+---------+--------+------------+-------------+---------------+------------+----------+-------------------+------+------------+
|
|
|
|
| a2c7f812 | testing | ACTIVE | none | Running | private=10.1. | cirros-0.3 | 44d4092a | nova | | |
|
|
|
|
| -e386-4a | | | | | 0.4, fd7d:1f3 | .5-x86_64- | -51ac-47 | | | |
|
|
|
|
| 22-b393- | | | | | c:4bf1:0:f816 | disk | 51-9c50- | | | |
|
|
|
|
| fe1802ab | | | | | :3eff:f39d:6d | | fd6e2050 | | | |
|
|
|
|
| d56e | | | | | 94 | | faa1 | | | |
|
|
|
|
+----------+---------+--------+------------+-------------+---------------+------------+----------+-------------------+------+------------+
|
2014-03-17 16:58:32 -07:00
|
|
|
|
|
|
|
The server should now be accessible via SSH::
|
|
|
|
|
|
|
|
ssh cirros@10.1.0.4
|
|
|
|
$
|
|
|
|
|
2016-04-19 11:26:01 +01:00
|
|
|
Running Tempest tests
|
|
|
|
=====================
|
|
|
|
|
|
|
|
After `Deploying Ironic with DevStack`_ one might want to run integration
|
|
|
|
tests against the running cloud. The Tempest project is the project that
|
|
|
|
offers an integration test suite for OpenStack.
|
|
|
|
|
|
|
|
First, navigate to Tempest directory::
|
|
|
|
|
|
|
|
cd /opt/stack/tempest
|
|
|
|
|
|
|
|
To run all tests from the `Ironic plugin
|
2018-10-22 14:14:03 +00:00
|
|
|
<https://git.openstack.org/cgit/openstack/ironic-tempest-plugin/tree/?h=master>`_,
|
2016-04-19 11:26:01 +01:00
|
|
|
execute the following command::
|
|
|
|
|
2018-10-22 14:14:03 +00:00
|
|
|
tox -e all -- ironic
|
2016-04-19 11:26:01 +01:00
|
|
|
|
|
|
|
To limit the amount of tests that you would like to run, you can use
|
|
|
|
a regex. For instance, to limit the run to a single test file, the
|
|
|
|
following command can be used::
|
|
|
|
|
2018-10-22 14:14:03 +00:00
|
|
|
tox -e all -- ironic_tempest_plugin.tests.scenario.test_baremetal_basic_ops
|
2016-04-19 11:26:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
Debugging Tempest tests
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
It is sometimes useful to step through the test code, line by line,
|
|
|
|
especially when the error output is vague. This can be done by
|
|
|
|
running the tests in debug mode and using a debugger such as `pdb
|
|
|
|
<https://docs.python.org/2/library/pdb.html>`_.
|
|
|
|
|
|
|
|
For example, after editing the *test_baremetal_basic_ops* file and
|
|
|
|
setting up the pdb traces you can invoke the ``run_tempest.sh`` script
|
|
|
|
in the Tempest directory with the following parameters::
|
|
|
|
|
|
|
|
./run_tempest.sh -N -d ironic_tempest_plugin.tests.scenario.test_baremetal_basic_ops
|
|
|
|
|
|
|
|
* The *-N* parameter tells the script to run the tests in the local
|
|
|
|
environment (without a virtualenv) so it can find the Ironic tempest
|
|
|
|
plugin.
|
|
|
|
|
|
|
|
* The *-d* parameter enables the debug mode, allowing it to be used
|
|
|
|
with pdb.
|
|
|
|
|
|
|
|
For more information about the supported parameters see::
|
|
|
|
|
|
|
|
./run_tempest.sh --help
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
Always be careful when running debuggers in time sensitive code,
|
|
|
|
they may cause timeout errors that weren't there before.
|
|
|
|
|
Enable OSProfiler support in Ironic
This patch does the following:
* Adds osprofiler wsgi middleware
This middleware is used for 2 things:
- It checks that person who wants to trace is trusted and knows
secret HMAC key.
- It starts tracing in case of proper trace headers
and adds first wsgi trace point, with info about HTTP request.
* Adds initialization of osprofiler at start of service
- Initialize and set an oslo.messaging based notifier instance
to osprofiler, which will be used to send notifications to Ceilometer.
* Traces HTTP/RPC/DB API calls and SQL requests
NOTE to test this patch:
1) Make the following changes in localrc to configure DevStack to enable
OSProfiler:
enable_plugin panko https://git.openstack.org/openstack/panko
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer
enable_plugin osprofiler https://git.openstack.org/openstack/osprofiler
# Enable the following services
CEILOMETER_NOTIFICATION_TOPICS=notifications,profiler
ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral
ENABLED_SERVICES+=,ceilometer-anotification,ceilometer-collector
ENABLED_SERVICES+=,ceilometer-alarm-evaluator,ceilometer-alarm-notifier
ENABLED_SERVICES+=,ceilometer-api
NOTE: the order of enabling plugins matters.
2) Run stack.sh. Once DevStack environment is setup, enable profiler options
in ironic.conf and restart ironic services:
[profiler]
enabled = true
hmac_keys = SECRET_KEY
trace_sqlalchemy = true
3) Use openstackclient and run baremetal command with
--os-profile SECRET_KEY
[--profile can be used, but it is deprecated.]
For example, the following will cause the <trace-id> to be printed
after node list:
$ openstack --os-profile SECRET_KEY baremetal node list
.....
.....
Trace ID: <trace-id>
Display trace with command:
osprofiler trace show --html <trace-id>
4) The trace results can be saved using this command:
$ osprofiler trace show --html <trace-id> --out trace.html
OSprofiler spec: https://review.openstack.org/#/c/103825/
Co-Authored-By: Tovin Seven <vinhnt@vn.fujitsu.com>
Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Partial-Bug: #1560704
Change-Id: Icd3d7c62cf7442de8a77fc67f119ae9b03725f02
2016-08-18 16:55:56 -07:00
|
|
|
|
|
|
|
OSProfiler Tracing in Ironic
|
|
|
|
============================
|
|
|
|
|
|
|
|
OSProfiler is an OpenStack cross-project profiling library. It is being
|
|
|
|
used among OpenStack projects to look at performance issues and detect
|
|
|
|
bottlenecks. For details on how OSProfiler works and how to use it in ironic,
|
|
|
|
please refer to `OSProfiler Support Documentation <osprofiler-support>`_.
|
|
|
|
|
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
Building developer documentation
|
|
|
|
================================
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2014-02-19 19:05:05 -08:00
|
|
|
If you would like to build the documentation locally, eg. to test your
|
|
|
|
documentation changes before uploading them for review, run these
|
2016-08-03 17:32:22 +00:00
|
|
|
commands to build the documentation set:
|
|
|
|
|
|
|
|
- On your local machine::
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# activate your development virtualenv
|
2017-08-26 17:36:24 -07:00
|
|
|
. .tox/venv/bin/activate
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
# build the docs
|
2015-05-20 16:36:35 +02:00
|
|
|
tox -edocs
|
2014-02-06 12:00:14 -08:00
|
|
|
|
2016-08-03 17:32:22 +00:00
|
|
|
#Now use your browser to open the top-level index.html located at:
|
2014-02-19 19:05:05 -08:00
|
|
|
|
|
|
|
ironic/doc/build/html/index.html
|
2016-06-03 20:25:54 +03:00
|
|
|
|
2016-08-03 17:32:22 +00:00
|
|
|
|
|
|
|
- On a remote machine::
|
|
|
|
|
|
|
|
# Go to the directory that contains the docs
|
|
|
|
cd ~/ironic/doc/source/
|
|
|
|
|
|
|
|
# Build the docs
|
|
|
|
tox -edocs
|
|
|
|
|
|
|
|
# Change directory to the newly built HTML files
|
|
|
|
cd ~/ironic/doc/build/html/
|
|
|
|
|
|
|
|
# Create a server using python on port 8000
|
|
|
|
python -m SimpleHTTPServer 8000
|
|
|
|
|
|
|
|
#Now use your browser to open the top-level index.html located at:
|
|
|
|
|
|
|
|
http://your_ip:8000
|