diff --git a/.gitignore b/.gitignore deleted file mode 100644 index df0ae40bf..000000000 --- a/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# Compiled files -*.py[co] -*.a -*.o -*.so - -# Sphinx -_build -doc/source/contributor/api/ - -# release notes build -releasenotes/build - -# Packages/installer info -*.egg -*.egg-info -dist -build -eggs -.eggs -parts -var -sdist -develop-eggs -.installed.cfg - -# Other -*.DS_Store -.idea -.testrepository -.tox -.venv -.*.swp -.coverage -cover -AUTHORS -ChangeLog -*.sqlite -*~ - -# Vagrant -.vagrant diff --git a/.gitreview b/.gitreview deleted file mode 100644 index 424fb37ef..000000000 --- a/.gitreview +++ /dev/null @@ -1,4 +0,0 @@ -[gerrit] -host=review.openstack.org -port=29418 -project=openstack/ironic.git diff --git a/.mailmap b/.mailmap deleted file mode 100644 index c616b54ac..000000000 --- a/.mailmap +++ /dev/null @@ -1,4 +0,0 @@ -# Format is: -# -# -Joe Gordon diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 4e0e03c3c..000000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ${TESTS_DIR:-./ironic/tests/unit/} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 1a2861ee8..000000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,10 +0,0 @@ -If you would like to contribute to the development of OpenStack, -you must follow the steps documented at: - - http://docs.openstack.org/infra/manual/developers.html#development-workflow - -Pull requests submitted through GitHub will be ignored. - -Bugs should be filed on Launchpad, not GitHub: - - https://bugs.launchpad.net/ironic diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 68c771a09..000000000 --- a/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - diff --git a/README b/README new file mode 100644 index 000000000..8fcd2b2f8 --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +This project is no longer maintained. + +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". + +For ongoing work on maintaining OpenStack packages in the Debian +distribution, please see the Debian OpenStack packaging team at +https://wiki.debian.org/OpenStack/. + +For any further questions, please email +openstack-dev@lists.openstack.org or join #openstack-dev on +Freenode. diff --git a/README.rst b/README.rst deleted file mode 100644 index 2bc1562dd..000000000 --- a/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -======================== -Team and repository tags -======================== - -.. image:: http://governance.openstack.org/badges/ironic.svg - :target: http://governance.openstack.org/reference/tags/index.html - -.. Change things from this point on - -====== -Ironic -====== - -Ironic consists of an API and plug-ins for managing and provisioning -physical machines in a security-aware and fault-tolerant manner. It can be -used with nova as a hypervisor driver, or standalone service using bifrost. -By default, it will use PXE and IPMI to interact with bare metal machines. -Ironic also supports vendor-specific plug-ins which may implement additional -functionality. - -Ironic is distributed under the terms of the Apache License, Version 2.0. The -full terms and conditions of this license are detailed in the LICENSE file. - -Project resources -~~~~~~~~~~~~~~~~~ - -* Documentation: https://docs.openstack.org/ironic/latest -* Source: https://git.openstack.org/cgit/openstack/ironic -* Bugs: https://bugs.launchpad.net/ironic -* Wiki: https://wiki.openstack.org/wiki/Ironic -* APIs: https://developer.openstack.org/api-ref/baremetal/index.html - -Project status, bugs, and requests for feature enhancements (RFEs) are tracked -on Launchpad: -https://launchpad.net/ironic - -For information on how to contribute to ironic, see -https://docs.openstack.org/ironic/latest/contributor diff --git a/RELEASE-NOTES b/RELEASE-NOTES deleted file mode 120000 index 9d8e8027d..000000000 --- a/RELEASE-NOTES +++ /dev/null @@ -1 +0,0 @@ -doc/source/releasenotes/index.rst \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index f15adc51f..000000000 --- a/Vagrantfile +++ /dev/null @@ -1,31 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# WARNING: This Vagrantfile is for development purposes only. It is intended to -# bootstrap required services - such as mysql and rabbit - into a reliably -# accessible VM, rather than forcing the engineer to install and manage these -# services manually. This Vagrantfile is not intended to assist in provisioning -# Ironic. For that, please use the bifrost project. - -VAGRANTFILE_API_VERSION = '2' - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - - config.vm.box = 'ubuntu/trusty64' - - config.vm.define 'ironic' do |ironic| - ironic.vm.provider :virtualbox do |vb| - vb.customize ['modifyvm', :id, '--memory', '512', '--cpuexecutioncap', '25'] - end - - ironic.vm.network 'private_network', ip: '192.168.99.11' # It goes to 11. - - ironic.vm.provision 'ansible' do |ansible| - ansible.verbose = 'v' - ansible.playbook = 'vagrant.yaml' - ansible.extra_vars = { - ip: '192.168.99.11' - } - end - end -end diff --git a/api-ref/regenerate-samples.sh b/api-ref/regenerate-samples.sh deleted file mode 100755 index 402870985..000000000 --- a/api-ref/regenerate-samples.sh +++ /dev/null @@ -1,269 +0,0 @@ -#!/bin/bash - -set -e -x - -if [ ! -x /usr/bin/jq ]; then - echo "This script relies on 'jq' to process JSON output." - echo "Please install it before continuing." - exit 1 -fi - -OS_AUTH_TOKEN=$(openstack token issue | grep ' id ' | awk '{print $4}') -IRONIC_URL="http://127.0.0.1:6385" - -IRONIC_API_VERSION="1.34" - -export OS_AUTH_TOKEN IRONIC_URL - -DOC_CHASSIS_UUID="dff29d23-1ded-43b4-8ae1-5eebb3e30de1" -DOC_NODE_UUID="6d85703a-565d-469a-96ce-30b6de53079d" -DOC_DYNAMIC_NODE_UUID="2b045129-a906-46af-bc1a-092b294b3428" -DOC_PORT_UUID="d2b30520-907d-46c8-bfee-c5586e6fb3a1" -DOC_PORTGROUP_UUID="e43c722c-248e-4c6e-8ce8-0d8ff129387a" -DOC_PROVISION_UPDATED_AT="2016-08-18T22:28:49.946416+00:00" -DOC_CREATED_AT="2016-08-18T22:28:48.643434+11:11" -DOC_UPDATED_AT="2016-08-18T22:28:49.653974+00:00" -DOC_IRONIC_CONDUCTOR_HOSTNAME="897ab1dad809" - -function GET { - # GET $RESOURCE - curl -s -H "X-Auth-Token: $OS_AUTH_TOKEN" \ - -H "X-OpenStack-Ironic-API-Version: $IRONIC_API_VERSION" \ - ${IRONIC_URL}/$1 | jq -S '.' -} - -function POST { - # POST $RESOURCE $FILENAME - curl -s -H "X-Auth-Token: $OS_AUTH_TOKEN" \ - -H "X-OpenStack-Ironic-API-Version: $IRONIC_API_VERSION" \ - -H "Content-Type: application/json" \ - -X POST --data @$2 \ - ${IRONIC_URL}/$1 | jq -S '.' -} - -function PATCH { - # POST $RESOURCE $FILENAME - curl -s -H "X-Auth-Token: $OS_AUTH_TOKEN" \ - -H "X-OpenStack-Ironic-API-Version: $IRONIC_API_VERSION" \ - -H "Content-Type: application/json" \ - -X PATCH --data @$2 \ - ${IRONIC_URL}/$1 | jq -S '.' -} - -function PUT { - # PUT $RESOURCE $FILENAME - curl -s -H "X-Auth-Token: $OS_AUTH_TOKEN" \ - -H "X-OpenStack-Ironic-API-Version: $IRONIC_API_VERSION" \ - -H "Content-Type: application/json" \ - -X PUT --data @$2 \ - ${IRONIC_URL}/$1 -} - -function wait_for_node_state { - local node="$1" - local field="$2" - local target_state="$3" - local attempt=10 - - while [[ $attempt -gt 0 ]]; do - res=$(openstack baremetal node show "$node" -f value -c "$field") - if [[ "$res" == "$target_state" ]]; then - break - fi - sleep 1 - attempt=$((attempt - 1)) - echo "Failed to get node $field == $target_state in $attempt attempts." - done - - if [[ $attempt == 0 ]]; then - exit 1 - fi -} - -pushd source/samples - -########### -# ROOT APIs -GET '' > api-root-response.json - -GET 'v1' > api-v1-root-response.json - - -########### -# DRIVER APIs -GET v1/drivers > drivers-list-response.json -GET v1/drivers?detail=true > drivers-list-detail-response.json -GET v1/drivers/ipmi > driver-get-response.json -GET v1/drivers/agent_ipmitool/properties > driver-property-response.json -GET v1/drivers/agent_ipmitool/raid/logical_disk_properties > driver-logical-disk-properties-response.json - - -######### -# CHASSIS - -POST v1/chassis chassis-create-request.json > chassis-show-response.json -CID=$(cat chassis-show-response.json | grep '"uuid"' | sed 's/.*"\([0-9a-f\-]*\)",*/\1/') -if [ "$CID" == "" ]; then - exit 1 -else - echo "Chassis created. UUID: $CID" -fi - -GET v1/chassis > chassis-list-response.json - -GET v1/chassis/detail > chassis-list-details-response.json - -PATCH v1/chassis/$CID chassis-update-request.json > chassis-update-response.json - -# skip GET /v1/chassis/$UUID because the response is same as POST - - -####### -# NODES - -# Create a node with a real driver, but missing ipmi_address, -# then do basic commands with it -POST v1/nodes node-create-request-classic.json > node-create-response.json -NID=$(cat node-create-response.json | grep '"uuid"' | sed 's/.*"\([0-9a-f\-]*\)",*/\1/') -if [ "$NID" == "" ]; then - exit 1 -else - echo "Node created. UUID: $NID" -fi - -# Also create a node with a dynamic driver for viewing in the node list -# endpoint -DNID=$(POST v1/nodes node-create-request-dynamic.json | grep '"uuid"' | sed 's/.*"\([0-9a-f\-]*\)",*/\1/') -if [ "$DNID" == "" ]; then - exit 1 -else - echo "Node created. UUID: $DNID" -fi - - -# get the list of passthru methods from agent* driver -GET v1/nodes/$NID/vendor_passthru/methods > node-vendor-passthru-response.json - -# Change to the fake driver and then move the node into the AVAILABLE -# state without saving any output. -# NOTE that these three JSON files are not included in the docs -PATCH v1/nodes/$NID node-update-driver.json -PUT v1/nodes/$NID/states/provision node-set-manage-state.json -PUT v1/nodes/$NID/states/provision node-set-available-state.json -# Wait node to become available -wait_for_node_state $NID provision_state available - -GET v1/nodes/$NID/validate > node-validate-response.json - -PUT v1/nodes/$NID/states/power node-set-power-off.json -# Wait node to reach power off state -wait_for_node_state $NID power_state "power off" -GET v1/nodes/$NID/states > node-get-state-response.json - -GET v1/nodes > nodes-list-response.json -GET v1/nodes/detail > nodes-list-details-response.json -GET v1/nodes/$NID > node-show-response.json - -# Put the Node in maintenance mode, then continue doing everything else -PUT v1/nodes/$NID/maintenance node-maintenance-request.json - -############ -# PORTGROUPS - -# Before we can create a portgroup, we must -# write NODE ID into the create request document body -sed -i "s/.*node_uuid.*/ \"node_uuid\": \"$NID\",/" portgroup-create-request.json - -POST v1/portgroups portgroup-create-request.json > portgroup-create-response.json -PGID=$(cat portgroup-create-response.json | grep '"uuid"' | sed 's/.*"\([0-9a-f\-]*\)",*/\1/') -if [ "$PGID" == "" ]; then - exit 1 -else - echo "Portgroup created. UUID: $PGID" -fi - -GET v1/portgroups > portgroup-list-response.json -GET v1/portgroups/detail > portgroup-list-detail-response.json -PATCH v1/portgroups/$PGID portgroup-update-request.json > portgroup-update-response.json - -# skip GET $PGID because same result as POST -# skip DELETE - -########### -# PORTS - -# Before we can create a port, we must -# write NODE ID and PORTGROUP ID into the create request document body -sed -i "s/.*node_uuid.*/ \"node_uuid\": \"$NID\",/" port-create-request.json -sed -i "s/.*portgroup_uuid.*/ \"portgroup_uuid\": \"$PGID\",/" port-create-request.json - -POST v1/ports port-create-request.json > port-create-response.json -PID=$(cat port-create-response.json | grep '"uuid"' | sed 's/.*"\([0-9a-f\-]*\)",*/\1/') -if [ "$PID" == "" ]; then - exit 1 -else - echo "Port created. UUID: $PID" -fi - -GET v1/ports > port-list-response.json -GET v1/ports/detail > port-list-detail-response.json -PATCH v1/ports/$PID port-update-request.json > port-update-response.json - -# skip GET $PID because same result as POST -# skip DELETE - -################ -# NODE PORT APIs - -GET v1/nodes/$NID/ports > node-port-list-response.json -GET v1/nodes/$NID/ports/detail > node-port-detail-response.json - -##################### -# NODE PORTGROUP APIs -GET v1/nodes/$NID/portgroups > node-portgroup-list-response.json -GET v1/nodes/$NID/portgroups/detail > node-portgroup-detail-response.json - -##################### -# PORTGROUPS PORT APIs -GET v1/portgroups/$PGID/ports > portgroup-port-list-response.json -GET v1/portgroups/$PGID/ports/detail > portgroup-port-detail-response.json - -############ -# LOOKUP API - -GET v1/lookup?node_uuid=$NID > lookup-node-response.json - - -##################### -# NODES MANAGEMENT API -# These need to be done while the node is in maintenance mode, -# and the node's driver is "fake", to avoid potential races -# with internal processes that lock the Node - -# this corrects an intentional ommission in some of the samples -PATCH v1/nodes/$NID node-update-driver-info-request.json > node-update-driver-info-response.json - -GET v1/nodes/$NID/management/boot_device/supported > node-get-supported-boot-devices-response.json -PUT v1/nodes/$NID/management/boot_device node-set-boot-device.json -GET v1/nodes/$NID/management/boot_device > node-get-boot-device-response.json - -PUT v1/nodes/$NID/management/inject_nmi node-inject-nmi.json - -############################# -# NODES VIF ATTACH/DETACH API - -POST v1/nodes/$NID/vifs node-vif-attach-request.json -GET v1/nodes/$NID/vifs > node-vif-list-response.json - - -##################### -# Replace automatically generated UUIDs by already used in documentation -sed -i "s/$CID/$DOC_CHASSIS_UUID/" *.json -sed -i "s/$NID/$DOC_NODE_UUID/" *.json -sed -i "s/$DNID/$DOC_DYNAMIC_NODE_UUID/" *.json -sed -i "s/$PID/$DOC_PORT_UUID/" *.json -sed -i "s/$PGID/$DOC_PORTGROUP_UUID/" *.json -sed -i "s/$(hostname)/$DOC_IRONIC_CONDUCTOR_HOSTNAME/" *.json -sed -i "s/created_at\": \".*\"/created_at\": \"$DOC_CREATED_AT\"/" *.json -sed -i "s/updated_at\": \".*\"/updated_at\": \"$DOC_UPDATED_AT\"/" *.json -sed -i "s/provision_updated_at\": \".*\"/provision_updated_at\": \"$DOC_PROVISION_UPDATED_AT\"/" *.json diff --git a/api-ref/source/baremetal-api-v1-chassis.inc b/api-ref/source/baremetal-api-v1-chassis.inc deleted file mode 100644 index 39563dcac..000000000 --- a/api-ref/source/baremetal-api-v1-chassis.inc +++ /dev/null @@ -1,235 +0,0 @@ -.. -*- rst -*- - -================= -Chassis (chassis) -================= - -The Chassis resource type was originally conceived as a means to group Node -resources. Support for this continues to exist in the REST API, however, it is -very minimal. The Chassis object does not provide any functionality today -aside from a means to list a group of Nodes. - -Use of this resource is discouraged, and may be deprecated and removed in a -future release. - - -List chassis with details -========================= - -.. rest_method:: GET /v1/chassis/detail - -Lists all chassis with details. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - chassis: chassis - - description: description - - extra: extra - -Response Example ----------------- - -.. literalinclude:: samples/chassis-list-details-response.json - :language: javascript - - -Show chassis details -==================== - -.. rest_method:: GET /v1/chassis/{chassis_id} - -Shows details for a chassis. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - - chassis_id: chassis_ident - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - chassis: chassis - - description: description - - extra: extra - -Response Example ----------------- - -.. literalinclude:: samples/chassis-show-response.json - :language: javascript - - -Update chassis -============== - -.. rest_method:: PATCH /v1/chassis/{chassis_id} - -Updates a chassis. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -The BODY of the PATCH request must be a JSON PATCH document, adhering to -`RFC 6902 `_. - -.. rest_parameters:: parameters.yaml - - - chassis_id: chassis_ident - - description: description - - extra: extra - -Request Example ---------------- - -.. literalinclude:: samples/chassis-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - description: description - - links: links - - extra: extra - - created_at: created_at - - updated_at: updated_at - - chassis: chassis - - nodes: nodes - - uuid: uuid - -Response Example ----------------- - -.. literalinclude:: samples/chassis-update-response.json - :language: javascript - - -Delete chassis -============== - -.. rest_method:: DELETE /v1/chassis/{chassis_id} - -Deletes a chassis. - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - chassis_id: chassis_ident - -Create chassis -============== - -.. rest_method:: POST /v1/chassis - -Creates a chassis. - -Error response codes:201,413,415,405,404,403,401,400,503,409, - -Request -------- - -.. rest_parameters:: parameters.yaml - - - chassis: chassis - - description: description - - extra: extra - -Request Example ---------------- - -.. literalinclude:: samples/chassis-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - description: description - - links: links - - extra: extra - - created_at: created_at - - updated_at: updated_at - - nodes: nodes - - uuid: uuid - -Response Example ----------------- - -.. literalinclude:: samples/chassis-show-response.json - :language: javascript - -List chassis -============ - -.. rest_method:: GET /v1/chassis - -Lists all chassis. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - chassis: chassis - - description: description - - extra: extra - -Response Example ----------------- - -.. literalinclude:: samples/chassis-list-response.json - :language: javascript diff --git a/api-ref/source/baremetal-api-v1-driver-passthru.inc b/api-ref/source/baremetal-api-v1-driver-passthru.inc deleted file mode 100644 index a43c9527b..000000000 --- a/api-ref/source/baremetal-api-v1-driver-passthru.inc +++ /dev/null @@ -1,92 +0,0 @@ -.. -*- rst -*- - -================================ -Driver Vendor Passthru (drivers) -================================ - -Each driver MAY support vendor-specific extensions, called "passthru" methods. - -Internally, Ironic's driver API supports flexibly exposing functions via the -common HTTP methods GET, PUT, POST, and DELETE. To call a passthru method, -the query string must contain the name of the method. For example, if the -method name was ``my_passthru_method``, the request would look like -``/vendor_passthru?method=my_passthru_method``. The contents of the HTTP -request are forwarded to the driver and validated there. - -Ironic's REST API provides a means to discover these methods, but does not -provide support, testing, or documentation for these endpoints. The Ironic -development team does not guarantee any compatibility within these methods -between releases, though we encourage driver authors to provide documentation -and support for them. - -Besides the endpoints documented here, all other resources and endpoints -under the heading ``vendor_passthru`` should be considered unsupported APIs, -and could be changed without warning by the driver authors. - - -List Methods -============ - -.. rest_method:: GET /v1/drivers/{driver_name}/vendor_passthru/methods - -Retrieve a list of the available vendor passthru methods for the given Driver. -The response will indicate which HTTP method(s) each vendor passthru method -allows, whether the method call will be synchronous or asynchronous, and -whether the response will include any attachment. - -Normal response code: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - driver_name: driver_ident - -Response --------- - -The response BODY is a dictionary whose keys are the method names. The value -of each item is itself a dictionary describing how to interact with that -method. - -.. rest_parameters:: parameters.yaml - - - async: passthru_async - - attach: passthru_attach - - description: passthru_description - - http_methods: passthru_http_methods - - -Call a Method -============= - -.. rest_method:: METHOD /v1/drivers/{driver_name}/vendor_passthru?method={method_name} - -The HTTP METHOD may be one of GET, POST, PUT, DELETE, depending on the driver -and method. - -This endpoint passes the request directly to the hardware driver. The -HTTP BODY must be parseable JSON, which will be converted to parameters passed -to that function. Unparseable JSON, missing parameters, or excess parameters -will cause the request to be rejected with an HTTP 400 error. - -Normal response code: 200 202 - -Error codes: 400 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - driver_name: driver_ident - - method_name: method_name - -All other parameters should be passed in the BODY. Parameter list varies by -method_name. - -Response --------- - -Varies. diff --git a/api-ref/source/baremetal-api-v1-drivers.inc b/api-ref/source/baremetal-api-v1-drivers.inc deleted file mode 100644 index 606302fc9..000000000 --- a/api-ref/source/baremetal-api-v1-drivers.inc +++ /dev/null @@ -1,226 +0,0 @@ -.. -*- rst -*- - -================= -Drivers (drivers) -================= - -Ironic has two types of drivers: *classic* drivers and *dynamic* drivers. - -A *classic* driver is a Python object containing all the logic to manage the -bare metal nodes enrolled within Ironic. A driver may be loaded within one or -more ``ironic-conductor`` services. Each driver contains a pre-determined set -of instantiated interfaces. Each type of interface (eg, ``power`` or ``boot``) -performs a specific hardware function. - -As of API version 1.30, the REST API also exposes information about *dynamic* -drivers. *Dynamic* drivers are supported via hardware types, which are Python -classes enabled via entry points. Unlike *classic* drivers, which have -pre-determined interfaces, a hardware type may support multiple types of -interfaces. For example, the ``ipmi`` hardware type may support multiple -methods for enabling node console. Which interface a node of a particular -hardware type uses is determined at runtime. This collection of interfaces is -called a *dynamic* driver. For more information about this, see the node API -documentation. - -The REST API exposes the list of drivers and which ``ironic-conductor`` -processes have loaded that driver via the Driver resource (``/v1/drivers`` -endpoint). This can be useful for operators to validate their configuration in -a heterogeneous hardware environment. Each ``ironic-conductor`` process may -load one or more drivers, and does not necessarily need to load the same -*classic* drivers as another ``ironic-conductor``. Each ``ironic-conductor`` -with the same hardware types must have the same hardware interfaces enabled. - -The REST API also exposes details about each driver, such as what properties -must be supplied to a node's ``driver_info`` for that driver to manage -hardware. - -Lastly, some drivers may expose methods through a ``driver_vendor_passthru`` -endpoint, allowing one to interact with the driver directly (i.e., without -knowing a specific node identifier). For example, this is used by the ironic -python agent ramdisk to get the UUID of the node being deployed/cleaned by -using MAC addresses of the node's network interfaces the agent has discovered. - - -List drivers -============ - -.. rest_method:: GET /v1/drivers - -Lists all drivers. - -Normal response codes: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - type: driver_type - - detail: driver_detail - -Response Parameters -------------------- - -The response BODY contains a single key, "drivers", whose value is a list of -drivers supported by this Ironic service. - -.. rest_parameters:: parameters.yaml - - - drivers: drivers - - name: driver_name - - hosts: hosts - - type: response_driver_type - - links: links - - properties: driver_property_links - -Additionally, if the request has the "detail" URL parameter set to true, each -driver will also include the following fields. - -.. rest_parameters:: parameters.yaml - - - default_boot_interface: default_boot_interface - - default_console_interface: default_console_interface - - default_deploy_interface: default_deploy_interface - - default_inspect_interface: default_inspect_interface - - default_management_interface: default_management_interface - - default_network_interface: default_network_interface - - default_power_interface: default_power_interface - - default_raid_interface: default_raid_interface - - default_vendor_interface: default_vendor_interface - - enabled_boot_interfaces: enabled_boot_interfaces - - enabled_console_interfaces: enabled_console_interfaces - - enabled_deploy_interfaces: enabled_deploy_interfaces - - enabled_inspect_interfaces: enabled_inspect_interfaces - - enabled_management_interfaces: enabled_management_interfaces - - enabled_network_interfaces: enabled_network_interfaces - - enabled_power_interfaces: enabled_power_interfaces - - enabled_raid_interfaces: enabled_raid_interfaces - - enabled_vendor_interfaces: enabled_vendor_interfaces - -Response Example ----------------- - -Example for a request with detail=false (the default): - -.. literalinclude:: samples/drivers-list-response.json - :language: javascript - -Example for a request with detail=true: - -.. literalinclude:: samples/drivers-list-detail-response.json - :language: javascript - -Show driver details -=================== - -.. rest_method:: GET /v1/drivers/{driver_name} - -Shows details for a driver. - -Normal response codes: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - driver_name: driver_ident - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - name: driver_name - - hosts: hosts - - type: response_driver_type - - default_boot_interface: default_boot_interface - - default_console_interface: default_console_interface - - default_deploy_interface: default_deploy_interface - - default_inspect_interface: default_inspect_interface - - default_management_interface: default_management_interface - - default_network_interface: default_network_interface - - default_power_interface: default_power_interface - - default_raid_interface: default_raid_interface - - default_vendor_interface: default_vendor_interface - - enabled_boot_interfaces: enabled_boot_interfaces - - enabled_console_interfaces: enabled_console_interfaces - - enabled_deploy_interfaces: enabled_deploy_interfaces - - enabled_inspect_interfaces: enabled_inspect_interfaces - - enabled_management_interfaces: enabled_management_interfaces - - enabled_network_interfaces: enabled_network_interfaces - - enabled_power_interfaces: enabled_power_interfaces - - enabled_raid_interfaces: enabled_raid_interfaces - - enabled_vendor_interfaces: enabled_vendor_interfaces - - links: links - - properties: driver_property_links - -Response Example ----------------- - -.. literalinclude:: samples/driver-get-response.json - :language: javascript - - -Show driver properties -====================== - -.. rest_method:: GET /v1/drivers/{driver_name}/properties - -Shows the required and optional parameters that ``driver_name`` expects to be -supplied in the ``driver_info`` field for every Node it manages. - -To check if all required parameters have been supplied to a Node, you should -query the ``/v1/nodes/{node_ident}/validate`` endpoint. - -Normal response codes: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - driver_name: driver_ident - -Response Example ----------------- - -The response BODY is a dictionary, but the keys are unique to each driver. -The structure of the response is ``property`` : ``description``. - -The following example is returned from the ``agent_ipmitool`` driver. - -.. literalinclude:: samples/driver-property-response.json - :language: javascript - - -Show driver logical disk properties -=================================== - -.. rest_method:: GET /v1/drivers/{driver_name}/raid/logical_disk_properties - -Show the required and optional parameters that ``driver_name`` expects to be -supplied in the node's ``raid_config`` field, if a RAID configuration change is -requested. - -This resource was added in API microversion 1.12. - -Normal response codes: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - driver_name: driver_ident - -Response Example ----------------- - -The response BODY is a dictionary, but the keys are unique to each driver. -The structure of the response is ``property`` : ``description``. - -The following example is returned from the ``agent_ipmitool`` driver. - -.. literalinclude:: samples/driver-logical-disk-properties-response.json - :language: javascript diff --git a/api-ref/source/baremetal-api-v1-misc.inc b/api-ref/source/baremetal-api-v1-misc.inc deleted file mode 100644 index f86dcc3ec..000000000 --- a/api-ref/source/baremetal-api-v1-misc.inc +++ /dev/null @@ -1,100 +0,0 @@ -.. -*- rst -*- - -======= -Utility -======= - -This section describes two API endpoints used by the ``ironic-python-agent`` -ramdisk as it communicates with the Bare Metal service. These were previously -exposed as vendor passthrough methods, however, as ironic-python-agent has -become the standard ramdisk agent, these methods have been made a part of the -official REST API. - -.. note:: - **Operators are reminded not to expose the Bare Metal Service's API to - unsecured networks.** Both API endpoints listed below are available to - *unauthenticated* clients because the default method for booting the - ``ironic-python-agent`` ramdisk does not provide the agent with keystone - credentials. - -.. note:: - It is possible to include keys in your ramdisk, or pass keys in via the - boot method, if your driver supports it; if that is done, you may configure - these endpoints to require authentication by changing the policy rules - ``baremetal:driver:ipa_lookup`` and ``baremetal:node:ipa_heartbeat``. - In light of that, operators are recommended to ensure that this endpoint is - only available on the ``provisioning`` and ``cleaning`` networks. - - -Agent Lookup -============ - -.. rest_method:: GET /v1/lookup - -Beginning with the v1.22 API, a ``/lookup`` method is exposed at the root of -the REST API. This should only be used by the ``ironic-python-agent`` ramdisk -to retrieve required configuration data from the Bare Metal service. - -By default, ``/v1/lookup`` will only match Nodes that are expected to be -running the ``ironic-python-agent`` ramdisk (for instance, because the Bare -Metal service has just initiated a deployment). It can not be used as a -generic search mechanism, though this behaviour may be changed by setting -the ``[api] restrict_lookup = false`` configuration option for the ironic-api -service. - -The query string should include either or both a ``node_uuid`` or an -``addresses`` query parameter. If a matching Node is found, information about -that Node shall be returned, including instance-specific information such as -the configdrive. - -Normal response codes: 200 - -Error response codes: 400 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_uuid: r_node_uuid - - addresses: r_addresses - -Response --------- - -Returns only the information about the corresponding Node that the -``ironic-python-agent`` process requires. - -.. rest_parameters:: parameters.yaml - - - node: agent_node - - config: agent_config - -Response Example ----------------- - -.. literalinclude:: samples/lookup-node-response.json - :language: javascript - - -Agent Heartbeat -=============== - -.. rest_method:: POST /v1/heartbeat/{node_ident} - -Beginning with the v1.22 API, a ``/heartbeat`` method is exposed at the root of -the REST API. This is used as a callback from within the ``ironic-python-agent`` -ramdisk, so that an active ramdisk may periodically contact the Bare Metal -service and provide the current URL at which to contact the agent. - -Normal response codes: 202 - -Error response codes: 400 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - callback_url: callback_url diff --git a/api-ref/source/baremetal-api-v1-node-management.inc b/api-ref/source/baremetal-api-v1-node-management.inc deleted file mode 100644 index 38341fff7..000000000 --- a/api-ref/source/baremetal-api-v1-node-management.inc +++ /dev/null @@ -1,428 +0,0 @@ -.. -*- rst -*- - -======================= -Node Management (nodes) -======================= - -Nodes can be managed through several sub-resources. - -Maintenance mode can be set by the operator, with an optional "reason" stored -by Ironic. - -The supplied ``driver_info`` can be validated to ensure that the selected -``driver`` has all the information it requires to manage the Node. - -A Node can be rebooted, turned on, or turned off by requesting a change to its -power state. This is handled asynchronously and tracked in the ``target_power_state`` -field after the request is received. - -A Node's boot device can be changed, and the set of supported boot devices -can be queried. - -A request to change a Node's provision state is also tracked asynchronously; -the ``target_provision_state`` represents the requested state. A Node -may transition through several discrete ``provision_state`` steps before arriving -at the requested state. This can vary between drivers and based on configuration. - -For example, a Node in the ``available`` state can have an instance deployed to it -by requesting the provision state of ``active``. During this transition, the Node's -``provision_state`` will temporarily be set to ``deploying``, and depending on the driver, -it may also be ``wait call-back``. When the transitions are complete, ``target_provision_state`` -will be set to ``None`` and ``provision_state`` will be set to ``active``. -To destroy the instance, request the provision state of ``delete``. During this -transition, the Node may or may not go through a ``cleaning`` state, -depending on the service configuration. - - -Validate Node -=============== - -.. rest_method:: GET /v1/nodes/{node_ident}/validate - -Request that Ironic validate whether the Node's ``driver`` has enough information -to manage the Node. This polls each ``interface`` on the driver, and returns -the status of that ``interface`` as an element in the response. Note that each -``driver`` may require different information to be supplied, and not all drivers -support all interfaces. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -Response --------- - -Each element in the response will contain a "result" variable, which will have -a value of "true" or "false", indicating that the interface either has or does -not have sufficient information to function. A value of ``null`` indicates that -the Node's driver does not support that interface. - -.. rest_parameters:: parameters.yaml - - - power: v_power - - boot: v_boot - - deploy: v_deploy - - console: v_console - - management: v_management - - inspect: v_inspect - - raid: v_raid - -**Example node validation response:** - -.. literalinclude:: samples/node-validate-response.json - :language: javascript - - -Set Maintenance Flag -============================= - -.. rest_method:: PUT /v1/nodes/{node_ident}/maintenance - -Request that Ironic set the maintenance flag on the Node. This will disable -certain automatic actions that the Node's driver may take, and remove -the Node from Nova's available resource pool. - -Normal response code: 202 - -.. TODO: Add link to user / operator documentation on the Maintenance flag - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - reason: reason - -**Example request: mark a node for maintenance:** - -.. literalinclude:: samples/node-maintenance-request.json - -Clear Maintenance Flag -============================== - -.. rest_method:: DELETE /v1/nodes/{node_ident}/maintenance - -The maintenance flag is unset by sending a DELETE request to this endpoint. -If the request is accepted, Ironic will also clear the ``maintenance_reason`` -field. - -Normal response code: 202 - -.. TODO: Add link to user / operator documentation on the Maintenance flag - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -Set Boot Device -=============== - -.. rest_method:: PUT /v1/nodes/{node_ident}/management/boot_device - -Set the boot device for the given Node, and set it persistently or for one-time -boot. The exact behaviour of this depends on the hardware driver. - -.. note:: In some drivers, eg. the ``*_ipmitool`` family, this method initiates a synchronous call - to the hardware management device (BMC). It should be used with caution! This - is `a known bug `_. - -.. note:: Some drivers do not support one-time boot, and always set the boot device - persistently. - -Normal response code: 204 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - boot_device: boot_device - - persistent: persistent - -**Example JSON request body to set boot device:** - -.. literalinclude:: samples/node-set-boot-device.json - - -Get Boot Device -=============== - -.. rest_method:: GET /v1/nodes/{node_ident}/management/boot_device - -Get the current boot device for the given Node. - -.. note:: In some drivers, eg. the ``*_ipmitool`` family, this method initiates a synchronous call - to the hardware management device (BMC). It should be used with caution! This - is `a known bug `_. - -Normal response code: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -Response --------- - -.. rest_parameters:: parameters.yaml - - - boot_device: boot_device - - persistent: persistent - -**Example JSON response to get boot device:** - -.. literalinclude:: samples/node-get-boot-device-response.json - - -Get Supported Boot Devices -=========================== - -.. rest_method:: GET /v1/nodes/{node_ident}/management/boot_device/supported - -Retrieve the acceptable set of supported boot devices for a specific Node. - -Normal response code: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -Response --------- - -.. rest_parameters:: parameters.yaml - - - supported_boot_devices: supported_boot_devices - -**Example response listing supported boot devices:** - -.. literalinclude:: samples/node-get-supported-boot-devices-response.json - - -Inject NMI (Non-Masking Interrupts) -=================================== - -.. rest_method:: PUT /v1/nodes/{node_ident}/management/inject_nmi - -Inject NMI (Non-Masking Interrupts) for the given Node. This feature -can be used for hardware diagnostics, and actual support depends on a -driver. - -Normal response code: 204 (No content) - -Error codes: - - 400 (Invalid) - - 403 (Forbidden) - - 404 (NotFound) - - 406 (NotAcceptable) - - 409 (NodeLocked, ClientError) - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -**Request to inject NMI to a node has to be empty dictionary:** - -.. literalinclude:: samples/node-inject-nmi.json - - -Node State Summary -================== - -.. rest_method:: GET /v1/nodes/{node_ident}/states - -Get a summary of the Node's current power, provision, raid, and console status. - -Normal response code: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -Response --------- - -.. rest_parameters:: parameters.yaml - - - power_state: power_state - - target_power_state: target_power_state - - provision_state: provision_state - - target_provision_state: target_provision_state - - provision_updated_at: provision_updated_at - - last_error: last_error - - console_enabled: console_enabled - - raid_config: raid_config - - target_raid_config: target_raid_config - -**Example node state:** - -.. literalinclude:: samples/node-get-state-response.json - - -Change Node Power State -======================= - -.. rest_method:: PUT /v1/nodes/{node_ident}/states/power - -Request a change to the Node's power state. - -Normal response code: 202 (Accepted) - -Error codes: - - 409 (NodeLocked, ClientError) - - 400 (Invalid, InvalidStateRequested, InvalidParameterValue) - - 406 (NotAcceptable) - - 503 (NoFreeConductorWorkers) - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - target: target_power_state - - timeout: power_timeout - -**Example request to power off a Node:** - -.. literalinclude:: samples/node-set-power-off.json - -**Example request to soft power off a Node with timeout:** - -.. literalinclude:: samples/node-set-soft-power-off.json - - -Change Node Provision State -=========================== - -.. rest_method:: PUT /v1/nodes/{node_ident}/states/provision - -Request a change to the Node's provision state. - -Acceptable target states depend on the Node's current provision state. More -detailed documentation of the Ironic State Machine is available -`in the developer docs `_. - -Normal response code: 202 - -Error codes: - - 409 (NodeLocked, ClientError) - - 400 (InvalidState, NodeInMaintenance) - - 406 (NotAcceptable) - - 503 (NoFreeConductorWorkers) - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - target: requested_provision_state - - configdrive: configdrive - - clean_steps: clean_steps - -**Example request to deploy a Node, using a configdrive served via local webserver:** - -.. literalinclude:: samples/node-set-active-state.json - -**Example request to clean a Node, with custom clean step:** - -.. literalinclude:: samples/node-set-clean-state.json - - -Set RAID Config -=============== - -.. rest_method:: PUT /v1/nodes/{node_ident}/states/raid - -Store the supplied configuration on the Node's ``target_raid_config`` property. -This property must be structured JSON, and will be validated by the driver upon receipt. The request -schema is defined in the `documentation for the RAID feature `_ - -.. note:: Calling this API only stores the requested configuration; it will be applied the next time - that the Node transitions through the ``cleaning`` phase. - -Added in API microversion: 1.12 - -Normal response code: 204 - -.. TODO: add more description, response code, sample response - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - target_raid_config: target_raid_config - -**Example requested RAID config:** - -.. literalinclude:: samples/node-set-raid-request.json - -.. TODO: add more description, response code, sample response - -Get Console -=========== - -.. rest_method:: GET /v1/nodes/{node_ident}/states/console - -Get connection information about the console. - -.. TODO: add more description, response code, sample response - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -.. TODO: add more description, response code, sample response - -Start/Stop Console -=================== - -.. rest_method:: PUT /v1/nodes/{node_ident}/states/console - -Start or stop the serial console. - -.. TODO: add more description, response code, sample response - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - enabled: console_enabled diff --git a/api-ref/source/baremetal-api-v1-node-passthru.inc b/api-ref/source/baremetal-api-v1-node-passthru.inc deleted file mode 100644 index a9efeb7f0..000000000 --- a/api-ref/source/baremetal-api-v1-node-passthru.inc +++ /dev/null @@ -1,84 +0,0 @@ -.. -*- rst -*- - -============================ -Node Vendor Passthru (nodes) -============================ - -Each driver MAY support vendor-specific extensions, called "passthru" methods. - -Internally, Ironic's driver API supports flexibly exposing functions via the -common HTTP methods GET, PUT, POST, and DELETE. To call a passthru method, -the query string must contain the name of the method, eg. -``/vendor_passthru?method=reset_bmc``. The contents of the HTTP request are -forwarded to the Node's driver and validated there. - -Ironic's REST API provides a means to discover these methods, but does not provide -support, testing, or documentation for these endpoints. The Ironic development -team does not guarantee any compatibility within these methods between releases, -though we encourage driver authors to provide documentation and support for them. - -Besides the endpoints documented here, all other resources and endpoints -under the heading ``vendor_passthru`` should be considered -unsupported APIs, and could be changed without warning by the driver authors. - - -List Methods -============ - -.. rest_method:: GET /v1/nodes/{node_ident}/vendor_passthru/methods - -Retrieve a list of the available vendor passthru methods for the given Node. The -response will indicate which HTTP method(s) each vendor passthru method allows, -whether the method call will be synchronous or asynchronous, and whether the -response will include any attachment. - -Normal response code: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -Response --------- - -**Example passthru methods listing:** - -.. literalinclude:: samples/node-vendor-passthru-response.json - - -Call a Method -============= - -.. rest_method:: METHOD /v1/nodes/{node_ident}/vendor_passthru?method={method_name} - -The HTTP METHOD may be one of GET, POST, PUT, DELETE, depending on the driver -and method. - -This endpoint passes the request directly to the Node's hardware driver. The -HTTP BODY must be parseable JSON, which will be converted to parameters passed -to that function. Unparseable JSON, missing parameters, or excess parameters -will cause the request to be rejected with an HTTP 400 error. - -Normal response code: 200 202 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - method_name: method_name - -All other parameters should be passed in the BODY. Parameter list varies by method_name. - -Response --------- - -Varies. \ No newline at end of file diff --git a/api-ref/source/baremetal-api-v1-nodes-portgroups.inc b/api-ref/source/baremetal-api-v1-nodes-portgroups.inc deleted file mode 100644 index ca96fc4e2..000000000 --- a/api-ref/source/baremetal-api-v1-nodes-portgroups.inc +++ /dev/null @@ -1,101 +0,0 @@ -.. -*- rst -*- - -============================================== -Listing Portgroups by Node (nodes, portgroups) -============================================== - -Given a Node identifier (``uuid`` or ``name``), the API exposes the list of, -and details of, all Portgroups associated with that Node. - -These endpoints do not allow modification of the Portgroups; that should be -done by accessing the Portgroup resources under the ``/v1/portgroups`` -endpoint. - -Portgroup resource was added in API microversion 1.24, if using older -version, all the requests return ``Not Found (404)`` error code. - - -List Portgroups by Node -======================= - -.. rest_method:: GET /v1/nodes/{node_ident}/portgroups - -Return a list of bare metal Portgroups associated with ``node_ident``. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - portgroups: portgroups - - uuid: uuid - - address: portgroup_address - - name: portgroup_name - - links: links - -**Example list of a Node's Portgroups:** - -.. literalinclude:: samples/node-portgroup-list-response.json - - -List detailed Portgroups by Node -================================ - -.. rest_method:: GET /v1/nodes/{node_ident}/portgroups/detail - -Return a detailed list of bare metal Portgroups associated with ``node_ident``. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - portgroups: portgroups - - uuid: uuid - - address: portgroup_address - - name: portgroup_name - - node_uuid: node_uuid - - standalone_ports_supported: standalone_ports_supported - - internal_info: portgroup_internal_info - - extra: extra - - mode: portgroup_mode - - properties: portgroup_properties - - ports: pg_ports - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example details of a Node's Portgroups:** - -.. literalinclude:: samples/node-portgroup-detail-response.json diff --git a/api-ref/source/baremetal-api-v1-nodes-ports.inc b/api-ref/source/baremetal-api-v1-nodes-ports.inc deleted file mode 100644 index 5e4f74778..000000000 --- a/api-ref/source/baremetal-api-v1-nodes-ports.inc +++ /dev/null @@ -1,113 +0,0 @@ -.. -*- rst -*- - -==================================== -Listing Ports by Node (nodes, ports) -==================================== - -Given a Node identifier (``uuid`` or ``name``), the API exposes the list of, -and details of, all Ports associated with that Node. - -These endpoints do not allow modification of the Ports; that should be done -by accessing the Port resources under the ``/v1/ports`` endpoint. - - -List Ports by Node -=================== - -.. rest_method:: GET /v1/nodes/{node_ident}/ports - -Return a list of bare metal Ports associated with ``node_ident``. - -API microversion 1.8 added the ``fields`` request parameter. When specified, -this causes the content of the response to include only the specified fields, -rather than the default set. - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -fields. - -API microversion 1.24 added the ``portgroup_uuid`` field. - -API microversion 1.34 added the ``physical_network`` field. - -Normal response code: 200 - -Error codes: TBD - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - uuid: uuid - - address: port_address - - links: links - -**Example list of a Node's Ports:** - -.. literalinclude:: samples/node-port-list-response.json - - -List detailed Ports by Node -=========================== - -.. rest_method:: GET /v1/nodes/{node_ident}/ports/detail - -Return a detailed list of bare metal Ports associated with ``node_ident``. - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -fields. - -API microversion 1.24 added the ``portgroup_uuid`` field. - -API microversion 1.34 added the ``physical_network`` field. - -Normal response code: 200 - -Error codes: TBD - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - uuid: uuid - - address: port_address - - node_uuid: node_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - internal_info: internal_info - - extra: extra - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example details of a Node's Ports:** - -.. literalinclude:: samples/node-port-detail-response.json diff --git a/api-ref/source/baremetal-api-v1-nodes-vifs.inc b/api-ref/source/baremetal-api-v1-nodes-vifs.inc deleted file mode 100644 index 3d0bbfe67..000000000 --- a/api-ref/source/baremetal-api-v1-nodes-vifs.inc +++ /dev/null @@ -1,76 +0,0 @@ -.. -*- rst -*- - -================================== -VIFs (Virtual Interfaces) of nodes -================================== - -Starting with API version 1.28 attaching and detaching VIFs (Virtual Interfaces) -to or from a node are done via the ``v1/nodes/{node_ident}/vifs`` endpoint. Attaching -a VIF to a node means that a VIF will be mapped to a free port or port group of -the specified node. - -List attached VIFs of a Node -============================ - -.. rest_method:: GET /v1/nodes/{node_ident}/vifs - -Return a list of VIFs that are attached to the node. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Response --------- - -.. rest_parameters:: parameters.yaml - - - id: node_vif_ident - - vifs: n_vifs - - node_ident: node_ident - -**Example list of VIFs that are attached to the node:** - -.. literalinclude:: samples/node-vif-list-response.json - :language: javascript - - -Attach a VIF to a node -====================== - -.. rest_method:: POST /v1/nodes/{node_ident}/vifs - -Attach a VIF to a node. - -Normal response code: 204 - -Error codes: 400,401,403,404,409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - id: node_vif_ident - - node_ident: node_ident - -**Example request to attach a VIF to a Node:** - -.. literalinclude:: samples/node-vif-attach-request.json - - -Detach VIF from a node -====================== - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - node_vif_ident: node_vif_ident - -.. rest_method:: DELETE /v1/nodes/{node_ident}/vifs/{node_vif_ident} - -Detach VIF from a Node. - -Normal response code: 204 - -Error codes: 400,401,403,404 diff --git a/api-ref/source/baremetal-api-v1-nodes.inc b/api-ref/source/baremetal-api-v1-nodes.inc deleted file mode 100644 index 353b31025..000000000 --- a/api-ref/source/baremetal-api-v1-nodes.inc +++ /dev/null @@ -1,458 +0,0 @@ -.. -*- rst -*- - -============= -Nodes (nodes) -============= - -List, Searching, Creating, Updating, and Deleting of bare metal Node resources -are done through the ``/v1/nodes`` resource. There are also several sub-resources, -which allow further actions to be performed on a bare metal Node. - -A Node is the canonical representation of a discretely allocatable server, -capable of running an Operating System. Each Node must be associated with a -``driver``; this informs Ironic what protocol to use when managing the Node. - -Beginning with API microversion 1.6, a Node may be referenced both by its UUID -and by a unique human-readable "name" in any request. Throughout this -documentation, this is referred to as the ``node_ident``. Responses clearly -indicate whether a given field is a ``uuid`` or a ``name``. - -Depending on the Roles assigned to the authenticated OpenStack User, and upon -the configuration of the Bare Metal service, API responses may change. For -example, the default value of the "show_password" settings cause all API -responses to mask passwords within ``driver_info`` with the literal string -"\*\*\*\*\*\*". - -Create Node -=========== - -.. rest_method:: POST /v1/nodes - -Creates a new Node resource. - -This method requires that a ``driver`` be supplied in the request body. Most -subresources of a Node (eg, ``properties``, ``driver_info``, etc) may be -supplied when the Node is created, or the resource may be updated later. - -If the specified driver is a dynamic driver (available from API microversion -1.31), then all the interfaces (boot_interface, deploy_interface, etc.) -will be set to the default interface for that driver unless another enabled -interface is specified in the creation request. - -API microversion 1.2 introduced the new ``available`` state name, which replaced -``None`` as the status of an unprovisioned Node. All clients should be updated to -use the new ``available`` state name. - -Nodes in the ``available`` state may have workloads provisioned on them; they are -"available" for use. - -API microversion 1.11 changed the default initial state of newly-created Nodes -from ``available`` to ``enroll``. This provides users a workflow to verify the -manageability of a Node and perform necessary operational functions (eg, building -a RAID array) before making the Node available for provisioning. - -Normal response codes: 201 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - driver: r_driver_name - -**Example Node creation request with a dynamic driver:** - -.. literalinclude:: samples/node-create-request-dynamic.json - :language: javascript - -**Example Node creation request with a classic driver:** - -.. literalinclude:: samples/node-create-request-classic.json - :language: javascript - -Response --------- - -The response will contain the complete Node record, with the supplied data, -and any defaults added for non-specified fields. Most fields default to "null" -or "". - -API microversion 1.5 introduced the ``name`` field. - -API microversion 1.7 introduced the ``clean_step`` field` - -API microversion 1.12 introduced support for the ``raid_config`` and -``target_raid_config`` fields. - -API microversion 1.20 introduced the ``network_interface`` field. If this field -is not supplied when creating the Node, the default value will be used. - -API microversion 1.21 introduced the ``resource_class`` field, which may be -used to store a resource designation for the proposed OpenStack Placement -Engine. This field has no effect within Ironic. - -API microversion 1.24 introduced the ``/nodes/{node_ident}/portgroups`` -endpoint. - -API microversion 1.31 introduced all of the ``*_interface`` fields -(boot_interface, deploy_interface, etc.), with the exception of the -network_interface field, which was introduced in API microversion 1.20. If this -field is not supplied when creating the Node, the default value will be used. - -The list and example below are representative of the response as of API -microversion 1.31. - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: node_name - - power_state: power_state - - target_power_state: target_power_state - - provision_state: provision_state - - target_provision_state: target_provision_state - - maintenance: maintenance - - maintenance_reason: maintenance_reason - - last_error: last_error - - reservation: reservation - - driver: driver_name - - driver_info: driver_info - - driver_internal_info: driver_internal_info - - properties: n_properties - - instance_info: instance_info - - instance_uuid: instance_uuid - - chassis_uuid: chassis_uuid - - extra: extra - - console_enabled: console_enabled - - raid_config: raid_config - - target_raid_config: target_raid_config - - clean_step: clean_step - - links: links - - ports: n_ports - - portgroups: n_portgroups - - states: n_states - - resource_class: resource_class - - boot_interface: boot_interface - - console_interface: console_interface - - deploy_interface: deploy_interface - - inspect_interface: inspect_interface - - management_interface: management_interface - - network_interface: network_interface - - power_interface: power_interface - - raid_interface: raid_interface - - vendor_interface: vendor_interface - -**Example JSON representation of a Node:** - -.. literalinclude:: samples/node-create-response.json - :language: javascript - - -List Nodes -========== - -.. rest_method:: GET /v1/nodes - -Return a list of bare metal Nodes, with some useful information about -each Node. Some filtering is possible by passing in flags with the request. - -By default, this query will return the name, uuid, instance uuid, power state, -provision state, and maintenance setting for each Node. - -API microversion 1.8 added the ``fields`` Request parameter. When specified, -this causes the content of the Response to include only the specified fields, -rather than the default set. - -API microversion 1.9 added the ``provision_state`` Request parameter, allowing -the list of returned Nodes to be filtered by their current state. - -API microversion 1.16 added the ``driver`` Request parameter, allowing -the list of returned Nodes to be filtered by their driver name. - -API microversion 1.21 added the ``resource_class`` Request parameter, -allowing the list of returned Nodes to be filtered by this field. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - instance_uuid: r_instance_uuid - - maintenance: r_maintenance - - associated: r_associated - - provision_state: r_provision_state - - driver: r_driver - - resource_class: r_resource_class - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: node_name - - instance_uuid: instance_uuid - - power_state: power_state - - provision_state: provision_state - - maintenance: maintenance - - links: links - -**Example list of Nodes:** - -.. literalinclude:: samples/nodes-list-response.json - :language: javascript - - -List Nodes Detailed -=================== - -.. rest_method:: GET /v1/nodes/detail - -Return a list of bare metal Nodes with complete details. Some filtering is -possible by passing in flags with the request. - -This method is particularly useful to locate the Node associated to a given -Nova instance, eg. with a request to ``v1/nodes/detail?instance_uuid={NOVA INSTANCE UUID}`` - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - instance_uuid: r_instance_uuid - - maintenance: r_maintenance - - associated: r_associated - - provision_state: r_provision_state - - driver: r_driver - - resource_class: r_resource_class - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: node_name - - power_state: power_state - - target_power_state: target_power_state - - provision_state: provision_state - - target_provision_state: target_provision_state - - maintenance: maintenance - - maintenance_reason: maintenance_reason - - last_error: last_error - - reservation: reservation - - driver: driver_name - - driver_info: driver_info - - driver_internal_info: driver_internal_info - - properties: n_properties - - instance_info: instance_info - - instance_uuid: instance_uuid - - chassis_uuid: chassis_uuid - - extra: extra - - console_enabled: console_enabled - - raid_config: raid_config - - target_raid_config: target_raid_config - - clean_step: clean_step - - links: links - - ports: n_ports - - portgroups: n_portgroups - - states: n_states - - resource_class: resource_class - - boot_interface: boot_interface - - console_interface: console_interface - - deploy_interface: deploy_interface - - inspect_interface: inspect_interface - - management_interface: management_interface - - network_interface: network_interface - - power_interface: power_interface - - raid_interface: raid_interface - - vendor_interface: vendor_interface - -**Example detailed list of Nodes:** - -.. literalinclude:: samples/nodes-list-details-response.json - :language: javascript - - -Show Node Details -================= - -.. rest_method:: GET /v1/nodes/{node_ident} - -Shows details for a node. By default, this will return the full representation -of the resource; an optional ``fields`` parameter can be supplied to return -only the specified set. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: node_name - - power_state: power_state - - target_power_state: target_power_state - - provision_state: provision_state - - target_provision_state: target_provision_state - - maintenance: maintenance - - maintenance_reason: maintenance_reason - - last_error: last_error - - reservation: reservation - - driver: driver_name - - driver_info: driver_info - - driver_internal_info: driver_internal_info - - properties: n_properties - - instance_info: instance_info - - instance_uuid: instance_uuid - - chassis_uuid: chassis_uuid - - extra: extra - - console_enabled: console_enabled - - raid_config: raid_config - - target_raid_config: target_raid_config - - clean_step: clean_step - - links: links - - ports: n_ports - - portgroups: n_portgroups - - states: n_states - - resource_class: resource_class - - boot_interface: boot_interface - - console_interface: console_interface - - deploy_interface: deploy_interface - - inspect_interface: inspect_interface - - management_interface: management_interface - - network_interface: network_interface - - power_interface: power_interface - - raid_interface: raid_interface - - vendor_interface: vendor_interface - -**Example JSON representation of a Node:** - -.. literalinclude:: samples/node-show-response.json - :language: javascript - - -Update Node -=========== - -.. rest_method:: PATCH /v1/nodes/{node_ident} - -Updates the information stored about a Node. - -Note that this endpoint can not be used to request state changes, which are -managed through sub-resources. - -API microversion 1.25 introduced the ability to unset a node's chassis UUID. - -Normal response codes: 200 - -.. TODO: add error codes - -Request -------- - -The BODY of the PATCH request must be a JSON PATCH document, adhering to -`RFC 6902 `_. - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident - -**Example PATCH document updating Node driver_info:** - -.. literalinclude:: samples/node-update-driver-info-request.json - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: node_name - - power_state: power_state - - target_power_state: target_power_state - - provision_state: provision_state - - target_provision_state: target_provision_state - - maintenance: maintenance - - maintenance_reason: maintenance_reason - - last_error: last_error - - reservation: reservation - - driver: driver_name - - driver_info: driver_info - - driver_internal_info: driver_internal_info - - properties: n_properties - - instance_info: instance_info - - instance_uuid: instance_uuid - - chassis_uuid: chassis_uuid - - extra: extra - - console_enabled: console_enabled - - raid_config: raid_config - - target_raid_config: target_raid_config - - clean_step: clean_step - - links: links - - ports: n_ports - - portgroups: n_portgroups - - states: n_states - - resource_class: resource_class - - boot_interface: boot_interface - - console_interface: console_interface - - deploy_interface: deploy_interface - - inspect_interface: inspect_interface - - management_interface: management_interface - - network_interface: network_interface - - power_interface: power_interface - - raid_interface: raid_interface - - vendor_interface: vendor_interface - -**Example JSON representation of a Node:** - -.. literalinclude:: samples/node-update-driver-info-response.json - :language: javascript - - -Delete Node -=========== - -.. rest_method:: DELETE /v1/nodes/{node_ident} - -Deletes a node. - -Normal response codes: 204 - -.. TODO: add error codes - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_ident: node_ident diff --git a/api-ref/source/baremetal-api-v1-portgroups-ports.inc b/api-ref/source/baremetal-api-v1-portgroups-ports.inc deleted file mode 100644 index 72175cf66..000000000 --- a/api-ref/source/baremetal-api-v1-portgroups-ports.inc +++ /dev/null @@ -1,106 +0,0 @@ -.. -*- rst -*- - -============================================= -Listing Ports by Portgroup (portgroup, ports) -============================================= - -Given a Portgroup identifier (``uuid`` or ``name``), the API exposes the list -of, and details of, all Ports associated with that Portgroup. - -These endpoints do not allow modification of the Ports; that should be done -by accessing the Port resources under the ``/v1/ports`` endpoint. - -API microversion 1.24 added the ``/v1/portgroups/{portgroup_ident}/ports`` -endpoint. If using an older version, all requests to this endpoint will return -a ``Not Found (404)`` error code. - - -List Ports by Portgroup -======================= - -.. rest_method:: GET /v1/portgroups/{portgroup_ident}/ports - -Return a list of bare metal Ports associated with ``portgroup_ident``. - -When specified, the ``fields`` request parameter causes the content of the -Response to include only the specified fields, rather than the default set. - -API microversion 1.34 added the ``physical_network`` field. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - portgroup_ident: portgroup_ident - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - uuid: uuid - - address: port_address - - links: links - -**Example list of a Portgroup's Ports:** - -.. literalinclude:: samples/portgroup-port-list-response.json - - -List detailed Ports by Portgroup -================================ - -.. rest_method:: GET /v1/portgroups/{portgroup_ident}/ports/detail - -Return a detailed list of bare metal Ports associated with ``portgroup_ident``. - -API microversion 1.34 added the ``physical_network`` field. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - portgroup_ident: portgroup_ident - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - uuid: uuid - - address: port_address - - node_uuid: node_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - internal_info: internal_info - - extra: extra - - portgroup_uuid: portgroup_uuid - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example details of a Portgroup's Ports:** - -.. literalinclude:: samples/portgroup-port-detail-response.json diff --git a/api-ref/source/baremetal-api-v1-portgroups.inc b/api-ref/source/baremetal-api-v1-portgroups.inc deleted file mode 100644 index 031450c95..000000000 --- a/api-ref/source/baremetal-api-v1-portgroups.inc +++ /dev/null @@ -1,275 +0,0 @@ -.. -*- rst -*- - -======================= -Portgroups (portgroups) -======================= - -Starting with API version 1.23 ports can be combined into portgroups to support -static link aggregation group (LAG) or multi-chassis link aggregation group -(MLAG) configurations. Listing, Searching, Creating, Updating, and Deleting of -bare metal Portgroup resources are done through the ``v1/portgroups`` resource. - -All Portgroups must be associated with a Node when created. This association -can be changed, though the request may be rejected if either the current -or destination Node are in a transitive state (for example, in the process of -deploying) or are in a state that would be non-deterministically affected by -such a change (for example, there is an active user instance on the Node). - - -List Portgroups -=============== - -.. rest_method:: GET /v1/portgroups - -Return a list of bare metal Portgroups. Some filtering is possible by passing in -some parameters with the request. - -By default, this query will return the UUID, name and address for each Portgroup. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node: r_portgroup_node_ident - - address: r_portgroup_address - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - portgroups: portgroups - - uuid: uuid - - address: portgroup_address - - name: portgroup_name - - links: links - -**Example Portgroup list response:** - -.. literalinclude:: samples/portgroup-list-response.json - :language: javascript - - -Create Portgroup -================ - -.. rest_method:: POST /v1/portgroups - -Creates a new Portgroup resource. - -This method requires a Node UUID and the physical hardware address for the -Portgroup (MAC address in most cases). - -Normal response code: 201 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_uuid: node_uuid - - address: portgroup_address - -**Example Portgroup creation request:** - -.. literalinclude:: samples/portgroup-create-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: portgroup_name - - address: portgroup_address - - node_uuid: node_uuid - - standalone_ports_supported: standalone_ports_supported - - internal_info: portgroup_internal_info - - extra: extra - - mode: portgroup_mode - - properties: portgroup_properties - - created_at: created_at - - updated_at: updated_at - - links: links - - ports: pg_ports - -**Example Portgroup creation response:** - -.. literalinclude:: samples/portgroup-create-response.json - :language: javascript - - -List Detailed Portgroups -======================== - -.. rest_method:: GET /v1/portgroups/detail - -Return a list of bare metal Portgroups, with detailed information. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node: r_portgroup_node_ident - - address: r_portgroup_address - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - portgroups: portgroups - - name: portgroup_name - - uuid: uuid - - address: portgroup_address - - node_uuid: node_uuid - - standalone_ports_supported: standalone_ports_supported - - internal_info: portgroup_internal_info - - extra: extra - - mode: portgroup_mode - - properties: portgroup_properties - - created_at: created_at - - updated_at: updated_at - - links: links - - ports: pg_ports - -**Example detailed Portgroup list response:** - -.. literalinclude:: samples/portgroup-list-detail-response.json - :language: javascript - - -Show Portgroup Details -====================== - -.. rest_method:: GET /v1/portgroups/{portgroup_id} - -Show details for the given Portgroup. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - portgroup_id: portgroup_ident - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: portgroup_name - - address: portgroup_address - - node_uuid: node_uuid - - standalone_ports_supported: standalone_ports_supported - - internal_info: portgroup_internal_info - - extra: extra - - mode: portgroup_mode - - properties: portgroup_properties - - created_at: created_at - - updated_at: updated_at - - links: links - - ports: pg_ports - -**Example Portgroup details:** - -.. literalinclude:: samples/portgroup-create-response.json - :language: javascript - - -Update a Portgroup -================== - -.. rest_method:: PATCH /v1/portgroups/{portgroup_id} - -Update a Portgroup. - -Normal response code: 200 - -Error codes: 400,401,403,404 - -Request -------- - -The BODY of the PATCH request must be a JSON PATCH document, adhering to -`RFC 6902 `_. - -.. rest_parameters:: parameters.yaml - - - portgroup_id: portgroup_ident - -**Example Portgroup update request:** - -.. literalinclude:: samples/portgroup-update-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - name: portgroup_name - - address: portgroup_address - - node_uuid: node_uuid - - standalone_ports_supported: standalone_ports_supported - - internal_info: portgroup_internal_info - - extra: extra - - mode: portgroup_mode - - properties: portgroup_properties - - created_at: created_at - - updated_at: updated_at - - links: links - - ports: pg_ports - -**Example Portgroup update response:** - -.. literalinclude:: samples/portgroup-update-response.json - :language: javascript - - -Delete Portgroup -================ - -.. rest_method:: DELETE /v1/portgroups/{portgroup_id} - -Delete a Portgroup. - -Normal response code: 204 - -Error codes: 400,401,403,404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - portgroup_id: portgroup_ident diff --git a/api-ref/source/baremetal-api-v1-ports.inc b/api-ref/source/baremetal-api-v1-ports.inc deleted file mode 100644 index bc9d65203..000000000 --- a/api-ref/source/baremetal-api-v1-ports.inc +++ /dev/null @@ -1,318 +0,0 @@ -.. -*- rst -*- - -============= -Ports (ports) -============= - -Listing, Searching, Creating, Updating, and Deleting of bare metal Port -resources are done through the ``ports`` resource. - -All Ports must be associated to a Node when created. This association -can be changed, though the request may be rejected if either the current -or destination Node are in a transitive state (e.g., in the process of -deploying) or are in a state that would be non-deterministically affected by -such a change (e.g., there is an active user instance on the Node). - - -List Ports -========== - -.. rest_method:: GET /v1/ports - -Return a list of bare metal Ports. Some filtering is possible by passing in -some parameters with the request. - -By default, this query will return the uuid and address for each Port. - -API microversion 1.6 added the ``node`` query parameter. If both ``node_uuid`` -and ``node`` are specified in the request, ``node_uuid`` will be used to filter -results. - -API microversion 1.8 added the ``fields`` request parameter. When specified, -this causes the content of the response to include only the specified fields, -rather than the default set. - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -fields. - -API microversion 1.24 added the ``portgroup_uuid`` field. - -API microversion 1.34 added the ``physical_network`` field. - -Normal response code: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node: r_port_node_ident - - node_uuid: r_port_node_uuid - - portgroup: r_port_portgroup_ident - - address: r_port_address - - fields: fields - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - uuid: uuid - - address: port_address - - links: links - -**Example Port list response:** - -.. literalinclude:: samples/port-list-response.json - :language: javascript - - -Create Port -=========== - -.. rest_method:: POST /v1/ports - -Creates a new Port resource. - -This method requires a Node UUID and the physical hardware address for the Port -(MAC address in most cases). - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -request and response fields. - -API microversion 1.24 added the ``portgroup_uuid`` request and response fields. - -API microversion 1.34 added the ``physical_network`` request and response -fields. - -Normal response code: 201 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node_uuid: node_uuid - - address: port_address - - portgroup_uuid: portgroup_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - extra: extra - -**Example Port creation request:** - -.. literalinclude:: samples/port-create-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - address: port_address - - node_uuid: node_uuid - - portgroup_uuid: portgroup_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - internal_info: internal_info - - extra: extra - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example Port creation response:** - -.. literalinclude:: samples/port-create-response.json - :language: javascript - - -List Detailed Ports -=================== - -.. rest_method:: GET /v1/ports/detail - -Return a list of bare metal Ports, with detailed information. - -API microversion 1.6 added the ``node`` query parameter. If both ``node_uuid`` -and ``node`` are specified in the request, ``node_uuid`` will be used to filter -results. - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -response fields. - -API microversion 1.24 added the ``portgroup`` query parameter and -``portgroup_uuid`` response field. - -API microversion 1.34 added the ``physical_network`` response field. - -Normal response code: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - node: r_port_node_ident - - node_uuid: r_port_node_uuid - - portgroup: r_port_portgroup_ident - - address: r_port_address - - limit: limit - - marker: marker - - sort_dir: sort_dir - - sort_key: sort_key - -Response --------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - uuid: uuid - - address: port_address - - node_uuid: node_uuid - - portgroup_uuid: portgroup_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - internal_info: internal_info - - extra: extra - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example detailed Port list response:** - -.. literalinclude:: samples/port-list-detail-response.json - :language: javascript - - -Show Port Details -================= - -.. rest_method:: GET /v1/ports/{port_id} - -Show details for the given Port. - -API microversion 1.8 added the ``fields`` request parameter. When specified, -this causes the content of the response to include only the specified fields, -rather than the default set. - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -response fields. - -API microversion 1.24 added the ``portgroup_uuid`` response field. - -API microversion 1.34 added the ``physical_network`` response field. - -Normal response code: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_ident - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - address: port_address - - node_uuid: node_uuid - - portgroup_uuid: portgroup_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - internal_info: internal_info - - extra: extra - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example Port details:** - -.. literalinclude:: samples/port-create-response.json - :language: javascript - - -Update a Port -============= - -.. rest_method:: PATCH /v1/ports/{port_id} - -Update a Port. - -API microversion 1.19 added the ``pxe_enabled`` and ``local_link_connection`` -fields. - -API microversion 1.24 added the ``portgroup_uuid`` field. - -API microversion 1.34 added the ``physical_network`` field. - -Normal response code: 200 - -Request -------- - -The BODY of the PATCH request must be a JSON PATCH document, adhering to -`RFC 6902 `_. - -.. rest_parameters:: parameters.yaml - - - port_id: port_ident - -**Example Port update request:** - -.. literalinclude:: samples/port-update-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - uuid: uuid - - address: port_address - - node_uuid: node_uuid - - portgroup_uuid: portgroup_uuid - - local_link_connection: local_link_connection - - pxe_enabled: pxe_enabled - - physical_network: physical_network - - internal_info: internal_info - - extra: extra - - created_at: created_at - - updated_at: updated_at - - links: links - -**Example Port update response:** - -.. literalinclude:: samples/port-update-response.json - :language: javascript - - -Delete Port -=========== - -.. rest_method:: DELETE /v1/ports/{port_id} - -Delete a Port. - -Normal response code: 204 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_ident diff --git a/api-ref/source/baremetal-api-versions.inc b/api-ref/source/baremetal-api-versions.inc deleted file mode 100644 index 11b5ec769..000000000 --- a/api-ref/source/baremetal-api-versions.inc +++ /dev/null @@ -1,80 +0,0 @@ -.. -*- rst -*- - -============ -API versions -============ - -Concepts -======== - -In order to bring new features to users over time, the Ironic API -supports versioning. There are two kinds of versions in Ironic. - -- ''major versions'', which have dedicated urls. -- ''microversions'', which can be requested through the use of the - ``X-OpenStack-Ironic-API-Version`` header. - -The Version APIs work differently from other APIs as they *do not* require authentication. - -Beginning with the Kilo release, all API requests support the -``X-OpenStack-Ironic-API-Version`` header. This header SHOULD be supplied -with every request; in the absence of this header, each request is treated -as though coming from an older pre-Kilo client. This was done to preserve -backwards compatibility as we introduced new features in the server. - -List API versions -================= - -.. rest_method:: GET / - -This fetches all the information about all known major API versions in the -deployment. Links to more specific information will be provided for each major -API version, as well as information about supported min and max microversions. - -Normal response codes: 200 - -Request -------- - -Response Example ----------------- - -.. rest_parameters:: parameters.yaml - - - description: description - - versions: versions - - version: version - - id: id - - links: links - - min_version: x-openstack-ironic-api-min-version - -.. literalinclude:: samples/api-root-response.json - :language: javascript - - -Show v1 API -=========== - -.. rest_method:: GET /v1/ - -Show all the resources within the Ironic v1 API. - -Normal response codes: 200 - -Request -------- - -Response Example ----------------- - -.. rest_parameters:: parameters.yaml - - - id: id - - links: links - - openstack-request-id: openstack-request-id - - x-openstack-ironic-api-version: header_version - - x-openstack-ironic-api-min-version: x-openstack-ironic-api-min-version - - x-openstack-ironic-api-max-version: x-openstack-ironic-api-max-version - -.. literalinclude:: samples/api-v1-root-response.json - :language: javascript diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py deleted file mode 100644 index cdeb5381f..000000000 --- a/api-ref/source/conf.py +++ /dev/null @@ -1,231 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# ironic documentation build configuration file, created by -# sphinx-quickstart on Sat May 1 15:17:47 2010. -# -# This file is execfile()d with the current directory set to -# its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import os -import subprocess -import sys - -import openstackdocstheme - -html_theme = 'openstackdocs' -html_theme_path = [openstackdocstheme.get_html_theme_path()] -html_theme_options = { - "sidebar_mode": "toc", -} - -extensions = [ - 'os_api_ref', -] - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../../')) -sys.path.insert(0, os.path.abspath('../')) -sys.path.insert(0, os.path.abspath('./')) - -# -- General configuration ---------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -# -# source_encoding = 'utf-8' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Ironic API Reference' -copyright = u'OpenStack Foundation' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -from ironic.version import version_info -# The full version, including alpha/beta/rc tags. -release = version_info.release_string() -# The short X.Y version. -version = version_info.version_string() - -# Config logABug feature -giturl = u'https://git.openstack.org/cgit/openstack/ironic/tree/api-ref/source' -# source tree -# html_context allows us to pass arbitrary values into the html template -html_context = {"bug_tag": "api-ref", - "giturl": giturl, - "bug_project": "ironic"} - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# The reST default role (used for this markup: `text`) to use -# for all documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -add_module_names = False - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# -- Options for man page output ---------------------------------------------- - -# Grouping the document tree for man pages. -# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' - - -# -- Options for HTML output -------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -# html_theme_path = ["."] -# html_theme = '_theme' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' -git_cmd = ["git", "log", "--pretty=format:%ad, commit %h", "--date=local", - "-n1"] -html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_use_modindex = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = '' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'ironicdoc' - - -# -- Options for LaTeX output ------------------------------------------------- - -# The paper size ('letter' or 'a4'). -# latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -# latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass -# [howto/manual]). -latex_documents = [ - ('index', 'Ironic.tex', u'OpenStack Bare Metal API Documentation', - u'OpenStack Foundation', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -# latex_preamble = '' - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_use_modindex = True diff --git a/api-ref/source/index.rst b/api-ref/source/index.rst deleted file mode 100644 index f6fed5e33..000000000 --- a/api-ref/source/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -:tocdepth: 2 - -================ - Bare Metal API -================ - -.. rest_expand_all:: - -.. include:: baremetal-api-versions.inc -.. include:: baremetal-api-v1-nodes.inc -.. include:: baremetal-api-v1-node-management.inc -.. include:: baremetal-api-v1-node-passthru.inc -.. include:: baremetal-api-v1-nodes-vifs.inc -.. include:: baremetal-api-v1-portgroups.inc -.. include:: baremetal-api-v1-nodes-portgroups.inc -.. include:: baremetal-api-v1-ports.inc -.. include:: baremetal-api-v1-nodes-ports.inc -.. include:: baremetal-api-v1-portgroups-ports.inc -.. include:: baremetal-api-v1-drivers.inc -.. include:: baremetal-api-v1-driver-passthru.inc -.. include:: baremetal-api-v1-chassis.inc -.. include:: baremetal-api-v1-misc.inc - diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml deleted file mode 100644 index 5c64b20cc..000000000 --- a/api-ref/source/parameters.yaml +++ /dev/null @@ -1,1048 +0,0 @@ -# variables in header -header_version: - description: | - Specific API microversion used to generate this response. - in: header - required: true - type: string -openstack-request-id: - description: > - A unique ID for tracking the request. The request ID associated with the request - appears in the log lines for that request. By default, the middleware configuration - ensures that the request ID appears in the log files. - in: header - required: false - type: string -x-openstack-ironic-api-max-version: - description: | - Maximum API microversion supported by this endpoint, eg. "1.22" - in: header - required: true - type: string -x-openstack-ironic-api-min-version: - description: | - Minimum API microversion supported by this endpoint, eg. "1.1" - in: header - required: true - type: string -x-openstack-ironic-api-version: - description: > - A request SHOULD include this header to indicate to the Ironic API service what - version the client supports. The server will transform the response object into - compliance with the requested version, if it is supported, or return a - 406 Not Supported error. - If this header is not supplied, the server will default to ``min_version`` - in all responses. - in: header - required: true - type: string - -# variables in path -chassis_ident: - description: | - The UUID of the chassis. - in: path - required: true - type: string -driver_ident: - description: | - The name of the driver. - in: path - required: true - type: string -node_id: - description: | - The UUID of the node. - in: path - required: false - type: string -node_ident: - description: | - The UUID or Name of the node. - in: path - required: true - type: string -port_ident: - description: | - The UUID of the port. - in: path - required: true - type: string -portgroup_ident: - description: | - The UUID or Name of the portgroup. Added in API microversion 1.23. - in: path - required: true - type: string - - -callback_url: - description: | - The URL of an active ironic-python-agent ramdisk, sent back to the Bare - Metal service and stored temporarily during a provisioning action. - in: query - required: true - type: string - -# variables in driver query string -driver_detail: - description: | - Whether to show detailed information about the drivers (e.g. the - "boot_interface" field). Added in API microversion 1.30. - in: query - required: false - type: boolean -driver_type: - description: | - Only list drivers of this type. Options are "classic" or "dynamic". Added - in API microversion 1.30. - in: query - required: false - type: string - -# variables common to all query strings -fields: - description: | - One or more fields to be returned in the response. - - For example, the following request returns only the ``uuid`` - and ``name`` fields for each node: - - :: - - GET /v1/nodes?fields=uuid,name - in: query - required: false - type: array -limit: - description: | - Requests a page size of items. Returns a number of items up to a limit - value. Use the ``limit`` parameter to make an initial limited request and - use the ID of the last-seen item from the response as the ``marker`` - parameter value in a subsequent limited request. This value cannot be - larger than the ``max_limit`` option in the ``[api]`` section of the - configuration. If it is higher than ``max_limit``, only ``max-limit`` - resources will be returned. - in: query - required: false - type: integer -marker: - description: | - The ID of the last-seen item. Use the ``limit`` - parameter to make an initial limited request and use the ID of the - last-seen item from the response as the ``marker`` parameter value - in a subsequent limited request. - in: query - required: false - type: string - -# variables in the vendor_passthru query string -method_name: - description: | - Driver specific method name. - in: query - required: true - type: string - -# variable in the lookup query string -r_addresses: - description: | - Optional list of one or more Port addresses. - in: query - required: false - type: array - -# variables in the node query string -r_associated: - description: | - Filter the list of returned nodes and only return those which are, or are - not, associated with an ``instance_uuid``. - in: query - required: false - type: boolean -r_driver: - description: | - Filter the list of returned nodes, and only return those with the specified - ``driver``. - in: query - required: false - type: string -r_instance_uuid: - description: | - Filter the list of returned nodes, and only return the node with this - specific instance UUID, or an empty set if not found. - in: query - required: false - type: string -r_maintenance: - description: | - Filter the list of returned nodes and only return those with - ``maintenance`` set to ``True`` or ``False``. - in: query - required: false - type: boolean -# variable in the lookup query string -r_node_uuid: - description: | - Optional Node UUID. - in: query - required: false - type: string -r_port_address: - description: | - Filter the list of returned Ports, and only return the ones with the - specified physical hardware address, typically MAC, or an empty set if not - found. - in: query - required: false - type: string -r_port_node_ident: - description: | - Filter the list of returned Ports, and only return the ones associated - with this specific node (name or UUID), or an empty set if not found. - in: query - required: false - type: string -r_port_node_uuid: - description: | - Filter the list of returned Ports, and only return the ones associated - with this specific node UUID, or an empty set if not found. - in: query - required: false - type: string -r_port_portgroup_ident: - description: | - Filter the list of returned Ports, and only return the ones associated - with this specific Portgroup (name or UUID), or an empty set if not found. - Added in API microversion 1.24. - in: query - required: false - type: string -r_portgroup_address: - description: | - Filter the list of returned Portgroups, and only return the ones with the - specified physical hardware address, typically MAC, or an empty set if not - found. Added in API microversion 1.23. - in: query - required: false - type: string -r_portgroup_node_ident: - description: | - Filter the list of returned Portgroups, and only return the ones associated - with this specific node (name or UUID), or an empty set if not found. - Added in API microversion 1.23. - in: query - required: false - type: string -r_provision_state: - description: | - Filter the list of returned nodes, and only return those with the specified - ``provision_state``. - in: query - required: false - type: string -r_resource_class: - description: | - Filter the list of returned nodes, and only return the ones with the - specified resource class. Introduced in API version 1.21. - in: query - required: false - type: string -sort_dir: - description: | - Sorts the response by the requested sort - direction. A valid value is ``asc`` (ascending) or ``desc`` - (descending). Default is ``asc``. You can specify multiple pairs - of sort key and sort direction query parameters. If you omit the - sort direction in a pair, the API uses the natural sorting - direction of the server attribute that is provided as the - ``sort_key``. - in: query - required: false - type: string -sort_key: - description: | - Sorts the response by the this attribute value. - Default is ``id``. You can specify multiple pairs of sort key and - sort direction query parameters. If you omit the sort direction in - a pair, the API uses the natural sorting direction of the server - attribute that is provided as the ``sort_key``. - in: query - required: false - type: string - - - -# variable returned from /lookup -agent_config: - description: | - JSON document of configuration data for the ironic-python-agent process. - in: body - required: true - type: JSON -agent_node: - description: | - JSON document containing a subset of Node fields, used by the - ironic-python-agent process as it operates on the Node. - in: body - required: true - type: JSON - -# variables in the API response body -boot_device: - description: | - The boot device for a Node, eg. "pxe" or "disk". - in: body - required: true - type: string -boot_interface: - description: | - The boot interface for a Node, e.g. "pxe". Added in API microversion 1.31. - in: body - required: true - type: string -chassis: - description: | - A ``chassis`` object. - in: body - required: true - type: array -chassis_uuid: - description: | - UUID of the chassis associated with this Node. May be empty or None. - in: body - required: true - type: string -clean_step: - description: | - The current clean step. Introduced with the cleaning feature. - in: body - required: false - type: string -clean_steps: - description: | - An ordered list of cleaning steps that will be performed on the node. A - cleaning step is a dictionary with required keys ‘interface’ and ‘step’, and - optional key ‘args’. If specified, the value for ‘args’ is a keyword variable - argument dictionary that is passed to the cleaning step method. - in: body - required: false - type: array -configdrive: - description: | - A gzip'ed and base-64 encoded config drive, to be written to a partition - on the Node's boot disk. This parameter is only accepted when setting the - state to "active". - in: body - required: false - type: string or gzip+b64 blob -console_enabled: - description: | - Indicates whether console access is enabled or disabled on this node. - in: body - required: true - type: boolean -console_interface: - description: | - The console interface for a node, e.g. "no-console". Added in API - microversion 1.31. - in: body - required: true - type: string -created_at: - description: | - The UTC date and time when the resource was created, - `ISO 8601 `_ format. - in: body - required: true - type: string -default_boot_interface: - description: | - The default boot interface used for a node with a dynamic driver, if no - boot interface is specified for the node. Added in API microversion 1.30. - in: body - required: true - type: string -default_console_interface: - description: | - The default console interface used for a node with a dynamic driver, if no - console interface is specified for the node. Added in API microversion - 1.30. - in: body - required: true - type: string -default_deploy_interface: - description: | - The default deploy interface used for a node with a dynamic driver, if no - deploy interface is specified for the node. Added in API microversion - 1.30. - in: body - required: true - type: string -default_inspect_interface: - description: | - The default inspection interface used for a node with a dynamic driver, if - no inspection interface is specified for the node. Added in API - microversion 1.30. - in: body - required: true - type: string -default_management_interface: - description: | - The default management interface used for a node with a dynamic driver, if - no management interface is specified for the node. Added in API - microversion 1.30. - in: body - required: true - type: string -default_network_interface: - description: | - The default network interface used for a node with a dynamic driver, if - no network interface is specified for the node. Added in API - microversion 1.30. - in: body - required: true - type: string -default_power_interface: - description: | - The default power interface used for a node with a dynamic driver, if - no power interface is specified for the node. Added in API - microversion 1.30. - in: body - required: true - type: string -default_raid_interface: - description: | - The default RAID interface used for a node with a dynamic driver, if - no RAID interface is specified for the node. Added in API - microversion 1.30. - in: body - required: true - type: string -default_vendor_interface: - description: | - The default vendor interface used for a node with a dynamic driver, if - no vendor interface is specified for the node. Added in API - microversion 1.30. - in: body - required: true - type: string -deploy_interface: - description: | - The deploy interface for a node, e.g. "iscsi". Added in API microversion - 1.31. - in: body - required: true - type: string -description: - description: | - Descriptive text about the Ironic service. - in: body - required: true - type: string -driver_info: - description: | - All the metadata required by the driver to manage this Node. List of fields - varies between drivers, and can be retrieved from the ``/v1/drivers//properties`` resource. - in: body - required: true - type: JSON -driver_internal_info: - description: | - Internal metadata set and stored by the Node's driver. This field is read-only. - in: body - required: false - type: JSON -driver_name: - description: | - The name of the driver. - in: body - required: true - type: string -driver_property_links: - description: | - A list of links to driver properties. Added in API microversion 1.14. - in: body - required: true - type: array -drivers: - description: | - A list of driver objects. - in: body - required: true - type: array -enabled_boot_interfaces: - description: | - The enabled boot interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -enabled_console_interfaces: - description: | - The enabled console interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -enabled_deploy_interfaces: - description: | - The enabled deploy interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -enabled_inspect_interfaces: - description: | - The enabled inspection interfaces for this driver. Added in API - microversion 1.30. - in: body - required: true - type: list -enabled_management_interfaces: - description: | - The enabled management interfaces for this driver. Added in API - microversion 1.30. - in: body - required: true - type: list -enabled_network_interfaces: - description: | - The enabled network interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -enabled_power_interfaces: - description: | - The enabled power interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -enabled_raid_interfaces: - description: | - The enabled RAID interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -enabled_vendor_interfaces: - description: | - The enabled vendor interfaces for this driver. Added in API microversion - 1.30. - in: body - required: true - type: list -extra: - description: | - A set of one or more arbitrary metadata key and - value pairs. - in: body - required: true - type: object -hosts: - description: | - A list of active hosts that support this driver. - in: body - required: true - type: array -id: - description: | - Major API version, eg, "v1" - in: body - required: true - type: string -inspect_interface: - description: | - The interface used for node inspection, e.g. "no-inspect". Added in API - microversion 1.31. - in: body - required: true - type: string -inspection_finished_at: - description: | - The UTC date and time when the last hardware inspection finished - successfully, `ISO 8601 `_ format. - May be "null". - in: body - required: true - type: string -inspection_started_at: - description: | - The UTC date and time when the hardware inspection was started, - `ISO 8601 `_ format. - May be "null". - in: body - required: true - type: string -instance_info: - description: | - Information used to customize the deployed image. May include root partition - size, a base 64 encoded config drive, and other metadata. Note that this field - is erased automatically when the instance is deleted (this is done by requesting - the Node provision state be changed to DELETED). - in: body - required: true - type: JSON -instance_uuid: - description: | - UUID of the Nova instance associated with this Node. - in: body - required: true - type: string -internal_info: - description: | - Internal metadata set and stored by the Port. This field is read-only. - Added in API microversion 1.18. - in: body - required: true - type: JSON -last_error: - description: | - Any error from the most recent (last) transaction that started but failed to finish. - in: body - required: true - type: string -links: - description: | - A list of relative links. Includes the self and - bookmark links. - in: body - required: true - type: array -local_link_connection: - description: | - The Port binding profile. If specified, must contain ``switch_id`` (only - a MAC address or an OpenFlow based datapath_id of the switch are accepted - in this field) and ``port_id`` (identifier of the physical port on the - switch to which node's port is connected to) fields. ``switch_info`` is an - optional string field to be used to store any vendor-specific information. - Added in API microversion 1.19. - in: body - required: true - type: JSON -maintenance: - description: | - Whether or not this Node is currently in "maintenance mode". Setting a Node - into maintenance mode removes it from the available resource pool and halts - some internal automation. This can happen manually (eg, via an API request) - or automatically when Ironic detects a hardware fault that prevents communication - with the machine. - in: body - required: true - type: boolean -maintenance_reason: - description: | - User-settable description of the reason why this Node was placed into - maintenance mode - in: body - required: false - type: string -management_interface: - description: | - Interface for out-of-band node management, e.g. "ipmitool". Added in API - microversion 1.31. - in: body - required: true - type: string -n_portgroups: - description: | - Links to the collection of portgroups on this node. - Added in API microversion 1.24. - in: body - required: true - type: array -n_ports: - description: | - Links to the collection of ports on this node - in: body - required: true - type: array -n_properties: - description: | - Physical characteristics of this Node. Populated by ironic-inspector during - inspection. May be edited via the REST API at any time. - in: body - required: true - type: JSON -n_states: - description: | - Links to the collection of states. Note that this resource is also used to - request state transitions. - in: body - required: true - type: array -n_vifs: - description: | - VIFs attached to this node. Added in API microversion 1.28. - in: body - required: true - type: array -name: - description: | - The name of the driver. - in: body - required: true - type: string -network_interface: - description: | - Which Network Interface provider to use when plumbing the network - connections for this Node. Added in API microversion v1.20 - in: body - required: true - type: string -node_name: - description: | - Human-readable identifier for the Node resource. May be undefined. Certain - words are reserved. Added in API microversion 1.5 - in: body - required: false - type: string -node_uuid: - description: | - UUID of the Node this resource belongs to. - in: body - required: true - type: string -node_vif_ident: - description: | - The UUID or name of the VIF. Added in API microversion 1.28. - in: body - required: true - type: string -nodes: - description: | - Links to the collection of nodes contained in - this chassis. - in: body - required: true - type: array -passthru_async: - description: | - If True the passthru function is invoked asynchronously; if False, - synchronously. - in: body - required: true - type: boolean -passthru_attach: - description: | - True if the return value will be attached to the response object, and False - if the return value will be returned in the response body. - in: body - required: true - type: boolean -passthru_description: - description: | - A description of what the method does, including any method parameters. - in: body - required: true - type: string -passthru_http_methods: - description: | - A list of HTTP methods supported by the vendor function. - in: body - required: true - type: array -persistent: - description: | - Whether the boot device should be set only for the next reboot, or - persistently. - in: body - required: true - type: boolean -pg_ports: - description: | - Links to the collection of ports belonging to this portgroup. Added in - API microversion 1.24. - in: body - required: true - type: array -physical_network: - description: | - The name of the physical network to which a port is connected. May be - empty. Added in API microversion 1.34. - in: body - required: true - type: string -port_address: - description: | - Physical hardware address of this network Port, typically the hardware - MAC address. - in: body - required: true - type: string -portgroup_address: - description: | - Physical hardware address of this Portgroup, typically the hardware - MAC address. Added in API microversion 1.23. - in: body - required: true - type: string -portgroup_internal_info: - description: | - Internal metadata set and stored by the Portgroup. This field is read-only. - Added in API microversion 1.23. - in: body - required: true - type: JSON -portgroup_mode: - description: | - Mode of the port group. For possible values, refer to - https://www.kernel.org/doc/Documentation/networking/bonding.txt. If not - specified in a request to create a port group, it will be set to the value - of the ``[DEFAULT]default_portgroup_mode`` configuration option. When set, - can not be removed from the port group. Added in API microversion 1.26. - in: body - required: true - type: string -portgroup_name: - description: | - Human-readable identifier for the Portgroup resource. May be undefined. - Added in API microversion 1.23. - in: body - required: false - type: string -portgroup_properties: - description: | - Key/value properties related to the port group's configuration. - Added in API microversion 1.26. - in: body - required: true - type: JSON -portgroup_uuid: - description: | - UUID of the Portgroup this resource belongs to. Added in API microversion 1.23. - in: body - required: true - type: string -portgroups: - description: | - A collection of Portgroup resources. Added in API microversion 1.23. - in: body - required: true - type: array -ports: - description: | - A collection of Port resources. - in: body - required: true - type: array -power_interface: - description: | - Interface used for performing power actions on the node, e.g. "ipmitool". - Added in API microversion 1.31. - in: body - required: true - type: string -power_state: - description: | - The current power state of this Node. Usually, "power on" or "power off", but may be "None" - if Ironic is unable to determine the power state (eg, due to hardware failure). - in: body - required: true - type: string -power_timeout: - description: | - Timeout for a power state transition. Added in API microversion 1.27. - in: body - required: false - type: integer -properties: - description: | - A list of links to driver properties. - in: body - required: true - type: array -provision_state: - description: | - The current provisioning state of this Node. - in: body - required: true - type: string -provision_updated_at: - description: | - The UTC date and time when the resource was created, - `ISO 8601 `_ format. - ``null`` if the node is not being provisioned. - in: body - required: true - type: string -pxe_enabled: - description: | - Indicates whether PXE is enabled or disabled on the Port. Added in API - microversion 1.19. - in: body - required: true - type: boolean -r_driver_name: - description: | - The name of the driver used to manage this Node. - in: body - required: true - type: string -raid_config: - description: | - Represents the current RAID configuration of the node. Introduced with - the cleaning feature. - in: body - required: false - type: JSON -raid_interface: - description: | - Interface used for configuring RAID on this node, e.g. "no-raid". Added in - API microversion 1.31. - in: body - required: true - type: string -reason: - description: | - Specify the reason for setting the Node into maintenance mode. - in: body - required: false - type: string -requested_provision_state: - description: | - One of the provisioning verbs: manage, provide, inspect, clean, active, - rebuild, delete (deleted), abort. - in: body - required: true - type: string -reservation: - description: | - The ``name`` of an Ironic Conductor host which is holding a lock on this node, - if a lock is held. Usually "null", but this field can be useful for debugging. - in: body - required: true - type: string -resource_class: - description: | - A string which can be used by external schedulers to identify this Node as - a unit of a specific type of resource. This will be used by the openstack - Placement Engine in a future release. Added in API microversion 1.21. - in: body - required: true - type: string -response_driver_type: - description: | - Type of this driver ("classic" or "dynamic"). - in: body - required: true - type: string -standalone_ports_supported: - description: | - Indicates whether ports that are members of this portgroup can be - used as stand-alone ports. Added in API microversion 1.23. - in: body - required: true - type: boolean -supported_boot_devices: - description: | - List of boot devices which this Node's driver supports. - in: body - required: true - type: array -target_power_state: - description: | - If a power state transition has been requested, this field represents the - requested (ie, "target") state either "power on", "power off", or "rebooting". - Added new target power states "soft power off" and "soft rebooting" in API - microversion 1.27. - in: body - required: true - type: string -target_provision_state: - description: | - If a provisioning action has been requested, this field represents the - requested (ie, "target") state. Note that a Node may go through several - states during its transition to this target state. For instance, when requesting - an instance be deployed to an AVAILABLE Node, the Node may go through the following - state change progression: AVAILABLE -> DEPLOYING -> DEPLOYWAIT -> DEPLOYING -> ACTIVE - in: body - required: true - type: string -target_raid_config: - description: | - Represents the requested RAID configuration of the node, which will be - applied when the Node next transitions through the CLEANING state. Introduced - with the cleaning feature. - in: body - required: true - type: JSON -updated_at: - description: | - The UTC date and time when the resource was updated, - `ISO 8601 `_ format. - May be "null". - in: body - required: true - type: string -uuid: - description: | - The UUID for the resource. - in: body - required: true - type: string - -# variables returned from node-validate -v_boot: - description: | - Status of the "boot" interface - in: body - required: true - type: object -v_console: - description: | - Status of the "console" interface - in: body - required: true - type: object -v_deploy: - description: | - Status of the "deploy" interface - in: body - required: true - type: object -v_inspect: - description: | - Status of the "inspect" interface - in: body - required: true - type: object -v_management: - description: | - Status of the "management" interface - in: body - required: true - type: object -v_power: - description: | - Status of the "power" interface - in: body - required: true - type: object -v_raid: - description: | - Status of the "raid" interface - in: body - required: true - type: object -vendor_interface: - description: | - Interface for vendor-specific functionality on this node, e.g. "no-vendor". - Added in API microversion 1.31. - in: body - required: true - type: string -version: - description: | - Versioning of this API response, eg. "1.22". - in: body - required: true - type: string -versions: - description: | - Array of information about currently supported versions. - in: body - required: true - type: array diff --git a/api-ref/source/samples/api-root-response.json b/api-ref/source/samples/api-root-response.json deleted file mode 100644 index 68f00f7f2..000000000 --- a/api-ref/source/samples/api-root-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "default_version": { - "id": "v1", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/", - "rel": "self" - } - ], - "min_version": "1.1", - "status": "CURRENT", - "version": "1.31" - }, - "description": "Ironic is an OpenStack project which aims to provision baremetal machines.", - "name": "OpenStack Ironic API", - "versions": [ - { - "id": "v1", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/", - "rel": "self" - } - ], - "min_version": "1.1", - "status": "CURRENT", - "version": "1.31" - } - ] -} diff --git a/api-ref/source/samples/api-v1-root-response.json b/api-ref/source/samples/api-v1-root-response.json deleted file mode 100644 index e2841bc4a..000000000 --- a/api-ref/source/samples/api-v1-root-response.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "chassis": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/", - "rel": "bookmark" - } - ], - "drivers": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/", - "rel": "bookmark" - } - ], - "heartbeat": [ - { - "href": "http://127.0.0.1:6385/v1/heartbeat/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/heartbeat/", - "rel": "bookmark" - } - ], - "id": "v1", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/", - "rel": "self" - }, - { - "href": "https://docs.openstack.org/ironic/latest/contributor/webapi.html", - "rel": "describedby", - "type": "text/html" - } - ], - "lookup": [ - { - "href": "http://127.0.0.1:6385/v1/lookup/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/lookup/", - "rel": "bookmark" - } - ], - "media_types": [ - { - "base": "application/json", - "type": "application/vnd.openstack.ironic.v1+json" - } - ], - "nodes": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/", - "rel": "bookmark" - } - ], - "portgroups": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/", - "rel": "bookmark" - } - ], - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/ports/", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/", - "rel": "bookmark" - } - ] -} diff --git a/api-ref/source/samples/chassis-create-request.json b/api-ref/source/samples/chassis-create-request.json deleted file mode 100644 index 7ce621ed6..000000000 --- a/api-ref/source/samples/chassis-create-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Sample chassis" -} diff --git a/api-ref/source/samples/chassis-list-details-response.json b/api-ref/source/samples/chassis-list-details-response.json deleted file mode 100644 index 770d5ad3a..000000000 --- a/api-ref/source/samples/chassis-list-details-response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "chassis": [ - { - "created_at": "2016-08-18T22:28:48.643434+11:11", - "description": "Sample chassis", - "extra": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "bookmark" - } - ], - "nodes": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1/nodes", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1/nodes", - "rel": "bookmark" - } - ], - "updated_at": null, - "uuid": "dff29d23-1ded-43b4-8ae1-5eebb3e30de1" - } - ] -} diff --git a/api-ref/source/samples/chassis-list-response.json b/api-ref/source/samples/chassis-list-response.json deleted file mode 100644 index 2fa9e5d94..000000000 --- a/api-ref/source/samples/chassis-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "chassis": [ - { - "description": "Sample chassis", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "bookmark" - } - ], - "uuid": "dff29d23-1ded-43b4-8ae1-5eebb3e30de1" - } - ] -} diff --git a/api-ref/source/samples/chassis-show-response.json b/api-ref/source/samples/chassis-show-response.json deleted file mode 100644 index bfc6200c1..000000000 --- a/api-ref/source/samples/chassis-show-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "created_at": "2016-08-18T22:28:48.643434+11:11", - "description": "Sample chassis", - "extra": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "bookmark" - } - ], - "nodes": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1/nodes", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1/nodes", - "rel": "bookmark" - } - ], - "updated_at": null, - "uuid": "dff29d23-1ded-43b4-8ae1-5eebb3e30de1" -} diff --git a/api-ref/source/samples/chassis-update-request.json b/api-ref/source/samples/chassis-update-request.json deleted file mode 100644 index d898e8b7c..000000000 --- a/api-ref/source/samples/chassis-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "op": "replace", - "path": "/description", - "value": "Updated Chassis" - } -] diff --git a/api-ref/source/samples/chassis-update-response.json b/api-ref/source/samples/chassis-update-response.json deleted file mode 100644 index 627243a36..000000000 --- a/api-ref/source/samples/chassis-update-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "created_at": "2016-08-18T22:28:48.643434+11:11", - "description": "Updated Chassis", - "extra": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1", - "rel": "bookmark" - } - ], - "nodes": [ - { - "href": "http://127.0.0.1:6385/v1/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1/nodes", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/chassis/dff29d23-1ded-43b4-8ae1-5eebb3e30de1/nodes", - "rel": "bookmark" - } - ], - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "dff29d23-1ded-43b4-8ae1-5eebb3e30de1" -} diff --git a/api-ref/source/samples/driver-get-response.json b/api-ref/source/samples/driver-get-response.json deleted file mode 100644 index 421b78e6c..000000000 --- a/api-ref/source/samples/driver-get-response.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "default_boot_interface": "pxe", - "default_console_interface": "no-console", - "default_deploy_interface": "iscsi", - "default_inspect_interface": "no-inspect", - "default_management_interface": "ipmitool", - "default_network_interface": "flat", - "default_power_interface": "ipmitool", - "default_raid_interface": "no-raid", - "default_vendor_interface": "no-vendor", - "enabled_boot_interfaces": [ - "pxe" - ], - "enabled_console_interfaces": [ - "no-console" - ], - "enabled_deploy_interfaces": [ - "iscsi", - "direct" - ], - "enabled_inspect_interfaces": [ - "no-inspect" - ], - "enabled_management_interfaces": [ - "ipmitool" - ], - "enabled_network_interfaces": [ - "flat", - "noop" - ], - "enabled_power_interfaces": [ - "ipmitool" - ], - "enabled_raid_interfaces": [ - "no-raid", - "agent" - ], - "enabled_vendor_interfaces": [ - "no-vendor" - ], - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/ipmi", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/ipmi", - "rel": "bookmark" - } - ], - "name": "ipmi", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/ipmi/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/ipmi/properties", - "rel": "bookmark" - } - ], - "type": "dynamic" -} diff --git a/api-ref/source/samples/driver-logical-disk-properties-response.json b/api-ref/source/samples/driver-logical-disk-properties-response.json deleted file mode 100644 index 35bae97a2..000000000 --- a/api-ref/source/samples/driver-logical-disk-properties-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "controller": "Controller to use for this logical disk. If not specified, the driver will choose a suitable RAID controller on the bare metal node. Optional.", - "disk_type": "The type of disk preferred. Valid values are 'hdd' and 'ssd'. If this is not specified, disk type will not be a selection criterion for choosing backing physical disks. Optional.", - "interface_type": "The interface type of disk. Valid values are 'sata', 'scsi' and 'sas'. If this is not specified, interface type will not be a selection criterion for choosing backing physical disks. Optional.", - "is_root_volume": "Specifies whether this disk is a root volume. By default, this is False. Optional.", - "number_of_physical_disks": "Number of physical disks to use for this logical disk. By default, the driver uses the minimum number of disks required for that RAID level. Optional.", - "physical_disks": "The physical disks to use for this logical disk. If not specified, the driver will choose suitable physical disks to use. Optional.", - "raid_level": "RAID level for the logical disk. Valid values are 'JBOD', '0', '1', '2', '5', '6', '1+0', '5+0' and '6+0'. Required.", - "share_physical_disks": "Specifies whether other logical disks can share physical disks with this logical disk. By default, this is False. Optional.", - "size_gb": "Size in GiB (Integer) for the logical disk. Use 'MAX' as size_gb if this logical disk is supposed to use the rest of the space available. Required.", - "volume_name": "Name of the volume to be created. If this is not specified, it will be auto-generated. Optional." -} diff --git a/api-ref/source/samples/driver-property-response.json b/api-ref/source/samples/driver-property-response.json deleted file mode 100644 index e666a8327..000000000 --- a/api-ref/source/samples/driver-property-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deploy_forces_oob_reboot": "Whether Ironic should force a reboot of the Node via the out-of-band channel after deployment is complete. Provides compatibility with older deploy ramdisks. Defaults to False. Optional.", - "deploy_kernel": "UUID (from Glance) of the deployment kernel. Required.", - "deploy_ramdisk": "UUID (from Glance) of the ramdisk that is mounted at boot time. Required.", - "image_http_proxy": "URL of a proxy server for HTTP connections. Optional.", - "image_https_proxy": "URL of a proxy server for HTTPS connections. Optional.", - "image_no_proxy": "A comma-separated list of host names, IP addresses and domain names (with optional :port) that will be excluded from proxying. To denote a doman name, use a dot to prefix the domain name. This value will be ignored if ``image_http_proxy`` and ``image_https_proxy`` are not specified. Optional.", - "ipmi_address": "IP address or hostname of the node. Required.", - "ipmi_bridging": "bridging_type; default is \"no\". One of \"single\", \"dual\", \"no\". Optional.", - "ipmi_force_boot_device": "Whether Ironic should specify the boot device to the BMC each time the server is turned on, eg. because the BMC is not capable of remembering the selected boot device across power cycles; default value is False. Optional.", - "ipmi_local_address": "local IPMB address for bridged requests. Used only if ipmi_bridging is set to \"single\" or \"dual\". Optional.", - "ipmi_password": "password. Optional.", - "ipmi_port": "remote IPMI RMCP port. Optional.", - "ipmi_priv_level": "privilege level; default is ADMINISTRATOR. One of ADMINISTRATOR, CALLBACK, OPERATOR, USER. Optional.", - "ipmi_protocol_version": "the version of the IPMI protocol; default is \"2.0\". One of \"1.5\", \"2.0\". Optional.", - "ipmi_target_address": "destination address for bridged request. Required only if ipmi_bridging is set to \"single\" or \"dual\".", - "ipmi_target_channel": "destination channel for bridged request. Required only if ipmi_bridging is set to \"single\" or \"dual\".", - "ipmi_terminal_port": "node's UDP port to connect to. Only required for console access.", - "ipmi_transit_address": "transit address for bridged request. Required only if ipmi_bridging is set to \"dual\".", - "ipmi_transit_channel": "transit channel for bridged request. Required only if ipmi_bridging is set to \"dual\".", - "ipmi_username": "username; default is NULL user. Optional." -} diff --git a/api-ref/source/samples/drivers-list-detail-response.json b/api-ref/source/samples/drivers-list-detail-response.json deleted file mode 100644 index 32e3856a2..000000000 --- a/api-ref/source/samples/drivers-list-detail-response.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "drivers": [ - { - "default_boot_interface": null, - "default_console_interface": null, - "default_deploy_interface": null, - "default_inspect_interface": null, - "default_management_interface": null, - "default_network_interface": null, - "default_power_interface": null, - "default_raid_interface": null, - "default_vendor_interface": null, - "enabled_boot_interfaces": null, - "enabled_console_interfaces": null, - "enabled_deploy_interfaces": null, - "enabled_inspect_interfaces": null, - "enabled_management_interfaces": null, - "enabled_network_interfaces": null, - "enabled_power_interfaces": null, - "enabled_raid_interfaces": null, - "enabled_vendor_interfaces": null, - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/agent_ipmitool", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/agent_ipmitool", - "rel": "bookmark" - } - ], - "name": "agent_ipmitool", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/agent_ipmitool/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/agent_ipmitool/properties", - "rel": "bookmark" - } - ], - "type": "classic" - }, - { - "default_boot_interface": null, - "default_console_interface": null, - "default_deploy_interface": null, - "default_inspect_interface": null, - "default_management_interface": null, - "default_network_interface": null, - "default_power_interface": null, - "default_raid_interface": null, - "default_vendor_interface": null, - "enabled_boot_interfaces": null, - "enabled_console_interfaces": null, - "enabled_deploy_interfaces": null, - "enabled_inspect_interfaces": null, - "enabled_management_interfaces": null, - "enabled_network_interfaces": null, - "enabled_power_interfaces": null, - "enabled_raid_interfaces": null, - "enabled_vendor_interfaces": null, - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/fake", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/fake", - "rel": "bookmark" - } - ], - "name": "fake", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/fake/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/fake/properties", - "rel": "bookmark" - } - ], - "type": "classic" - }, - { - "default_boot_interface": "pxe", - "default_console_interface": "no-console", - "default_deploy_interface": "iscsi", - "default_inspect_interface": "no-inspect", - "default_management_interface": "ipmitool", - "default_network_interface": "flat", - "default_power_interface": "ipmitool", - "default_raid_interface": "no-raid", - "default_vendor_interface": "no-vendor", - "enabled_boot_interfaces": [ - "pxe" - ], - "enabled_console_interfaces": [ - "no-console" - ], - "enabled_deploy_interfaces": [ - "iscsi", - "direct" - ], - "enabled_inspect_interfaces": [ - "no-inspect" - ], - "enabled_management_interfaces": [ - "ipmitool" - ], - "enabled_network_interfaces": [ - "flat", - "noop" - ], - "enabled_power_interfaces": [ - "ipmitool" - ], - "enabled_raid_interfaces": [ - "no-raid", - "agent" - ], - "enabled_vendor_interfaces": [ - "no-vendor" - ], - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/ipmi", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/ipmi", - "rel": "bookmark" - } - ], - "name": "ipmi", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/ipmi/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/ipmi/properties", - "rel": "bookmark" - } - ], - "type": "dynamic" - } - ] -} diff --git a/api-ref/source/samples/drivers-list-response.json b/api-ref/source/samples/drivers-list-response.json deleted file mode 100644 index c36a22a67..000000000 --- a/api-ref/source/samples/drivers-list-response.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "drivers": [ - { - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/agent_ipmitool", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/agent_ipmitool", - "rel": "bookmark" - } - ], - "name": "agent_ipmitool", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/agent_ipmitool/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/agent_ipmitool/properties", - "rel": "bookmark" - } - ], - "type": "classic" - }, - { - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/fake", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/fake", - "rel": "bookmark" - } - ], - "name": "fake", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/fake/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/fake/properties", - "rel": "bookmark" - } - ], - "type": "classic" - }, - { - "hosts": [ - "897ab1dad809" - ], - "links": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/ipmi", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/ipmi", - "rel": "bookmark" - } - ], - "name": "ipmi", - "properties": [ - { - "href": "http://127.0.0.1:6385/v1/drivers/ipmi/properties", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/drivers/ipmi/properties", - "rel": "bookmark" - } - ], - "type": "dynamic" - } - ] -} diff --git a/api-ref/source/samples/lookup-node-response.json b/api-ref/source/samples/lookup-node-response.json deleted file mode 100644 index 995bf4078..000000000 --- a/api-ref/source/samples/lookup-node-response.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "config": { - "heartbeat_timeout": 300, - "metrics": { - "backend": "noop", - "global_prefix": null, - "prepend_host": false, - "prepend_host_reverse": true, - "prepend_uuid": false - }, - "metrics_statsd": { - "statsd_host": "localhost", - "statsd_port": 8125 - } - }, - "node": { - "driver_internal_info": { - "clean_steps": null - }, - "instance_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "bookmark" - } - ], - "properties": {}, - "uuid": "6d85703a-565d-469a-96ce-30b6de53079d" - } -} diff --git a/api-ref/source/samples/node-create-request-classic.json b/api-ref/source/samples/node-create-request-classic.json deleted file mode 100644 index 1e9de7d90..000000000 --- a/api-ref/source/samples/node-create-request-classic.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "test_node_classic", - "driver": "agent_ipmitool", - "driver_info": { - "ipmi_username": "ADMIN", - "ipmi_password": "password" - } -} diff --git a/api-ref/source/samples/node-create-request-dynamic.json b/api-ref/source/samples/node-create-request-dynamic.json deleted file mode 100644 index 1aa360a87..000000000 --- a/api-ref/source/samples/node-create-request-dynamic.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "test_node_dynamic", - "driver": "ipmi", - "driver_info": { - "ipmi_username": "ADMIN", - "ipmi_password": "password" - }, - "power_interface": "ipmitool" -} diff --git a/api-ref/source/samples/node-create-response.json b/api-ref/source/samples/node-create-response.json deleted file mode 100644 index b6124a765..000000000 --- a/api-ref/source/samples/node-create-response.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "boot_interface": null, - "chassis_uuid": null, - "clean_step": {}, - "console_enabled": false, - "console_interface": null, - "created_at": "2016-08-18T22:28:48.643434+11:11", - "deploy_interface": null, - "driver": "agent_ipmitool", - "driver_info": { - "ipmi_password": "******", - "ipmi_username": "ADMIN" - }, - "driver_internal_info": {}, - "extra": {}, - "inspect_interface": null, - "inspection_finished_at": null, - "inspection_started_at": null, - "instance_info": {}, - "instance_uuid": null, - "last_error": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "bookmark" - } - ], - "maintenance": false, - "maintenance_reason": null, - "management_interface": null, - "name": "test_node_classic", - "network_interface": "flat", - "portgroups": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "bookmark" - } - ], - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "bookmark" - } - ], - "power_interface": null, - "power_state": null, - "properties": {}, - "provision_state": "enroll", - "provision_updated_at": null, - "raid_config": {}, - "raid_interface": null, - "reservation": null, - "resource_class": null, - "states": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "bookmark" - } - ], - "target_power_state": null, - "target_provision_state": null, - "target_raid_config": {}, - "updated_at": null, - "uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "vendor_interface": null -} diff --git a/api-ref/source/samples/node-get-boot-device-response.json b/api-ref/source/samples/node-get-boot-device-response.json deleted file mode 100644 index 572a6c130..000000000 --- a/api-ref/source/samples/node-get-boot-device-response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "boot_device": "pxe", - "persistent": false -} diff --git a/api-ref/source/samples/node-get-state-response.json b/api-ref/source/samples/node-get-state-response.json deleted file mode 100644 index 009552beb..000000000 --- a/api-ref/source/samples/node-get-state-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "console_enabled": false, - "last_error": null, - "power_state": "power off", - "provision_state": "available", - "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", - "raid_config": {}, - "target_power_state": null, - "target_provision_state": null, - "target_raid_config": {} -} diff --git a/api-ref/source/samples/node-get-supported-boot-devices-response.json b/api-ref/source/samples/node-get-supported-boot-devices-response.json deleted file mode 100644 index e5739326c..000000000 --- a/api-ref/source/samples/node-get-supported-boot-devices-response.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "supported_boot_devices": [ - "pxe" - ] -} diff --git a/api-ref/source/samples/node-inject-nmi.json b/api-ref/source/samples/node-inject-nmi.json deleted file mode 100644 index 0967ef424..000000000 --- a/api-ref/source/samples/node-inject-nmi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/api-ref/source/samples/node-maintenance-request.json b/api-ref/source/samples/node-maintenance-request.json deleted file mode 100644 index 3cea207b5..000000000 --- a/api-ref/source/samples/node-maintenance-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "reason": "Replacing the hard drive" -} \ No newline at end of file diff --git a/api-ref/source/samples/node-port-detail-response.json b/api-ref/source/samples/node-port-detail-response.json deleted file mode 100644 index e0f4292bd..000000000 --- a/api-ref/source/samples/node-port-detail-response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ports": [ - { - "address": "22:22:22:22:22:22", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "local_link_connection": { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - }, - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "physical_network": "physnet1", - "portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "pxe_enabled": true, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" - } - ] -} diff --git a/api-ref/source/samples/node-port-list-response.json b/api-ref/source/samples/node-port-list-response.json deleted file mode 100644 index 9cfc44413..000000000 --- a/api-ref/source/samples/node-port-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ports": [ - { - "address": "22:22:22:22:22:22", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" - } - ] -} diff --git a/api-ref/source/samples/node-portgroup-detail-response.json b/api-ref/source/samples/node-portgroup-detail-response.json deleted file mode 100644 index c1a686249..000000000 --- a/api-ref/source/samples/node-portgroup-detail-response.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "portgroups": [ - { - "address": "22:22:22:22:22:22", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "bookmark" - } - ], - "mode": "active-backup", - "name": "test_portgroup", - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "bookmark" - } - ], - "properties": {}, - "standalone_ports_supported": true, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a" - } - ] -} diff --git a/api-ref/source/samples/node-portgroup-list-response.json b/api-ref/source/samples/node-portgroup-list-response.json deleted file mode 100644 index e34207ae0..000000000 --- a/api-ref/source/samples/node-portgroup-list-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "portgroups": [ - { - "address": "22:22:22:22:22:22", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "bookmark" - } - ], - "name": "test_portgroup", - "uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a" - } - ] -} diff --git a/api-ref/source/samples/node-set-active-state.json b/api-ref/source/samples/node-set-active-state.json deleted file mode 100644 index f89115ce4..000000000 --- a/api-ref/source/samples/node-set-active-state.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "target": "active", - "configdrive": "http://127.0.0.1/images/test-node-config-drive.iso.gz" -} \ No newline at end of file diff --git a/api-ref/source/samples/node-set-available-state.json b/api-ref/source/samples/node-set-available-state.json deleted file mode 100644 index d5147cb2b..000000000 --- a/api-ref/source/samples/node-set-available-state.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "target": "provide" -} diff --git a/api-ref/source/samples/node-set-boot-device.json b/api-ref/source/samples/node-set-boot-device.json deleted file mode 100644 index cb0141173..000000000 --- a/api-ref/source/samples/node-set-boot-device.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "boot_device": "pxe", - "persistent": false -} diff --git a/api-ref/source/samples/node-set-clean-state.json b/api-ref/source/samples/node-set-clean-state.json deleted file mode 100644 index c19ef3443..000000000 --- a/api-ref/source/samples/node-set-clean-state.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "target": "clean", - "clean_steps": [ - { - "interface": "deploy", - "step": "upgrade_firmware", - "args": { - "force": "True" - } - } - ] -} diff --git a/api-ref/source/samples/node-set-manage-state.json b/api-ref/source/samples/node-set-manage-state.json deleted file mode 100644 index b8508fa87..000000000 --- a/api-ref/source/samples/node-set-manage-state.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "target": "manage" -} diff --git a/api-ref/source/samples/node-set-power-off.json b/api-ref/source/samples/node-set-power-off.json deleted file mode 100644 index 5602f053d..000000000 --- a/api-ref/source/samples/node-set-power-off.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "target": "power off" -} \ No newline at end of file diff --git a/api-ref/source/samples/node-set-raid-request.json b/api-ref/source/samples/node-set-raid-request.json deleted file mode 100644 index 7bb7612d3..000000000 --- a/api-ref/source/samples/node-set-raid-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "logical_disks" : [ - { - "size_gb" : 100, - "is_root_volume" : true, - "raid_level" : "1" - } - ] -} diff --git a/api-ref/source/samples/node-set-soft-power-off.json b/api-ref/source/samples/node-set-soft-power-off.json deleted file mode 100644 index 91c3e2fd2..000000000 --- a/api-ref/source/samples/node-set-soft-power-off.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "target": "soft power off", - "timeout": 300 -} diff --git a/api-ref/source/samples/node-show-response.json b/api-ref/source/samples/node-show-response.json deleted file mode 100644 index 5902944b1..000000000 --- a/api-ref/source/samples/node-show-response.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "boot_interface": null, - "chassis_uuid": null, - "clean_step": {}, - "console_enabled": false, - "console_interface": null, - "created_at": "2016-08-18T22:28:48.643434+11:11", - "deploy_interface": null, - "driver": "fake", - "driver_info": { - "ipmi_password": "******", - "ipmi_username": "ADMIN" - }, - "driver_internal_info": { - "clean_steps": null - }, - "extra": {}, - "inspect_interface": null, - "inspection_finished_at": null, - "inspection_started_at": null, - "instance_info": {}, - "instance_uuid": null, - "last_error": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "bookmark" - } - ], - "maintenance": false, - "maintenance_reason": null, - "management_interface": null, - "name": "test_node_classic", - "network_interface": "flat", - "portgroups": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "bookmark" - } - ], - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "bookmark" - } - ], - "power_interface": null, - "power_state": "power off", - "properties": {}, - "provision_state": "available", - "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", - "raid_config": {}, - "raid_interface": null, - "reservation": null, - "resource_class": null, - "states": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "bookmark" - } - ], - "target_power_state": null, - "target_provision_state": null, - "target_raid_config": {}, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "vendor_interface": null -} diff --git a/api-ref/source/samples/node-update-driver-info-request.json b/api-ref/source/samples/node-update-driver-info-request.json deleted file mode 100644 index fdd9001fb..000000000 --- a/api-ref/source/samples/node-update-driver-info-request.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "op": "replace", - "path": "/driver_info/ipmi_username", - "value": "OPERATOR" - }, - { - "op": "add", - "path": "/driver_info/deploy_kernel", - "value": "http://127.0.0.1/images/kernel" - }, - { - "op": "add", - "path": "/driver_info/deploy_ramdisk", - "value": "http://127.0.0.1/images/ramdisk" - } -] diff --git a/api-ref/source/samples/node-update-driver-info-response.json b/api-ref/source/samples/node-update-driver-info-response.json deleted file mode 100644 index 2c316cd24..000000000 --- a/api-ref/source/samples/node-update-driver-info-response.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "boot_interface": null, - "chassis_uuid": null, - "clean_step": {}, - "console_enabled": false, - "console_interface": null, - "created_at": "2016-08-18T22:28:48.643434+11:11", - "deploy_interface": null, - "driver": "fake", - "driver_info": { - "deploy_kernel": "http://127.0.0.1/images/kernel", - "deploy_ramdisk": "http://127.0.0.1/images/ramdisk", - "ipmi_password": "******", - "ipmi_username": "OPERATOR" - }, - "driver_internal_info": { - "clean_steps": null - }, - "extra": {}, - "inspect_interface": null, - "inspection_finished_at": null, - "inspection_started_at": null, - "instance_info": {}, - "instance_uuid": null, - "last_error": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "bookmark" - } - ], - "maintenance": true, - "maintenance_reason": "Replacing the hard drive", - "management_interface": null, - "name": "test_node_classic", - "network_interface": "flat", - "portgroups": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "bookmark" - } - ], - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "bookmark" - } - ], - "power_interface": null, - "power_state": "power off", - "properties": {}, - "provision_state": "available", - "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", - "raid_config": {}, - "raid_interface": null, - "reservation": null, - "resource_class": null, - "states": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "bookmark" - } - ], - "target_power_state": null, - "target_provision_state": null, - "target_raid_config": {}, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "vendor_interface": null -} diff --git a/api-ref/source/samples/node-update-driver.json b/api-ref/source/samples/node-update-driver.json deleted file mode 100644 index 797404843..000000000 --- a/api-ref/source/samples/node-update-driver.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "op" : "replace", - "path" : "/driver", - "value" : "fake" - } -] diff --git a/api-ref/source/samples/node-validate-response.json b/api-ref/source/samples/node-validate-response.json deleted file mode 100644 index 5eee6aabd..000000000 --- a/api-ref/source/samples/node-validate-response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "boot": { - "result": true - }, - "console": { - "result": true - }, - "deploy": { - "result": true - }, - "inspect": { - "result": true - }, - "management": { - "result": true - }, - "network": { - "result": true - }, - "power": { - "result": true - }, - "raid": { - "result": true - } -} diff --git a/api-ref/source/samples/node-vendor-passthru-response.json b/api-ref/source/samples/node-vendor-passthru-response.json deleted file mode 100644 index 225d3ab48..000000000 --- a/api-ref/source/samples/node-vendor-passthru-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "bmc_reset": { - "async": true, - "attach": false, - "description": "", - "http_methods": [ - "POST" - ], - "require_exclusive_lock": true - }, - "send_raw": { - "async": true, - "attach": false, - "description": "", - "http_methods": [ - "POST" - ], - "require_exclusive_lock": true - } -} diff --git a/api-ref/source/samples/node-vif-attach-request.json b/api-ref/source/samples/node-vif-attach-request.json deleted file mode 100644 index 9d6dd0a9b..000000000 --- a/api-ref/source/samples/node-vif-attach-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "id": "1974dcfa-836f-41b2-b541-686c100900e5" -} diff --git a/api-ref/source/samples/node-vif-list-response.json b/api-ref/source/samples/node-vif-list-response.json deleted file mode 100644 index b90c21d38..000000000 --- a/api-ref/source/samples/node-vif-list-response.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "vifs": [ - { - "id": "1974dcfa-836f-41b2-b541-686c100900e5" - } - ] -} diff --git a/api-ref/source/samples/nodes-list-details-response.json b/api-ref/source/samples/nodes-list-details-response.json deleted file mode 100644 index aae8ccd15..000000000 --- a/api-ref/source/samples/nodes-list-details-response.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "nodes": [ - { - "boot_interface": null, - "chassis_uuid": null, - "clean_step": {}, - "console_enabled": false, - "console_interface": null, - "created_at": "2016-08-18T22:28:48.643434+11:11", - "deploy_interface": null, - "driver": "fake", - "driver_info": { - "ipmi_password": "******", - "ipmi_username": "ADMIN" - }, - "driver_internal_info": { - "clean_steps": null - }, - "extra": {}, - "inspect_interface": null, - "inspection_finished_at": null, - "inspection_started_at": null, - "instance_info": {}, - "instance_uuid": null, - "last_error": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "bookmark" - } - ], - "maintenance": false, - "maintenance_reason": null, - "management_interface": null, - "name": "test_node_classic", - "network_interface": "flat", - "portgroups": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", - "rel": "bookmark" - } - ], - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/ports", - "rel": "bookmark" - } - ], - "power_interface": null, - "power_state": "power off", - "properties": {}, - "provision_state": "available", - "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", - "raid_config": {}, - "raid_interface": null, - "reservation": null, - "resource_class": null, - "states": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d/states", - "rel": "bookmark" - } - ], - "target_power_state": null, - "target_provision_state": null, - "target_raid_config": {}, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "vendor_interface": null - }, - { - "boot_interface": "pxe", - "chassis_uuid": null, - "clean_step": {}, - "console_enabled": false, - "console_interface": "no-console", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "deploy_interface": "iscsi", - "driver": "ipmi", - "driver_info": { - "ipmi_password": "******", - "ipmi_username": "ADMIN" - }, - "driver_internal_info": {}, - "extra": {}, - "inspect_interface": "no-inspect", - "inspection_finished_at": null, - "inspection_started_at": null, - "instance_info": {}, - "instance_uuid": null, - "last_error": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/2b045129-a906-46af-bc1a-092b294b3428", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/2b045129-a906-46af-bc1a-092b294b3428", - "rel": "bookmark" - } - ], - "maintenance": false, - "maintenance_reason": null, - "management_interface": "ipmitool", - "name": "test_node_dynamic", - "network_interface": "flat", - "portgroups": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/2b045129-a906-46af-bc1a-092b294b3428/portgroups", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/2b045129-a906-46af-bc1a-092b294b3428/portgroups", - "rel": "bookmark" - } - ], - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/2b045129-a906-46af-bc1a-092b294b3428/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/2b045129-a906-46af-bc1a-092b294b3428/ports", - "rel": "bookmark" - } - ], - "power_interface": "ipmitool", - "power_state": null, - "properties": {}, - "provision_state": "enroll", - "provision_updated_at": null, - "raid_config": {}, - "raid_interface": "no-raid", - "reservation": null, - "resource_class": null, - "states": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/2b045129-a906-46af-bc1a-092b294b3428/states", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/2b045129-a906-46af-bc1a-092b294b3428/states", - "rel": "bookmark" - } - ], - "target_power_state": null, - "target_provision_state": null, - "target_raid_config": {}, - "updated_at": null, - "uuid": "2b045129-a906-46af-bc1a-092b294b3428", - "vendor_interface": "no-vendor" - } - ] -} diff --git a/api-ref/source/samples/nodes-list-response.json b/api-ref/source/samples/nodes-list-response.json deleted file mode 100644 index c36121fa4..000000000 --- a/api-ref/source/samples/nodes-list-response.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "nodes": [ - { - "instance_uuid": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", - "rel": "bookmark" - } - ], - "maintenance": false, - "name": "test_node_classic", - "power_state": "power off", - "provision_state": "available", - "uuid": "6d85703a-565d-469a-96ce-30b6de53079d" - }, - { - "instance_uuid": null, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/nodes/2b045129-a906-46af-bc1a-092b294b3428", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/nodes/2b045129-a906-46af-bc1a-092b294b3428", - "rel": "bookmark" - } - ], - "maintenance": false, - "name": "test_node_dynamic", - "power_state": null, - "provision_state": "enroll", - "uuid": "2b045129-a906-46af-bc1a-092b294b3428" - } - ] -} diff --git a/api-ref/source/samples/port-create-request.json b/api-ref/source/samples/port-create-request.json deleted file mode 100644 index 8018f8dec..000000000 --- a/api-ref/source/samples/port-create-request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "address": "11:11:11:11:11:11", - "local_link_connection": { - "switch_id": "0a:1b:2c:3d:4e:5f", - "port_id": "Ethernet3/1", - "switch_info": "switch1" - }, - "physical_network": "physnet1" -} diff --git a/api-ref/source/samples/port-create-response.json b/api-ref/source/samples/port-create-response.json deleted file mode 100644 index ef88e965f..000000000 --- a/api-ref/source/samples/port-create-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "address": "11:11:11:11:11:11", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "local_link_connection": { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - }, - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "physical_network": "physnet1", - "portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "pxe_enabled": true, - "updated_at": null, - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" -} diff --git a/api-ref/source/samples/port-list-detail-response.json b/api-ref/source/samples/port-list-detail-response.json deleted file mode 100644 index aa99ef743..000000000 --- a/api-ref/source/samples/port-list-detail-response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ports": [ - { - "address": "11:11:11:11:11:11", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "local_link_connection": { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - }, - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "physical_network": "physnet1", - "portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "pxe_enabled": true, - "updated_at": null, - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" - } - ] -} diff --git a/api-ref/source/samples/port-list-response.json b/api-ref/source/samples/port-list-response.json deleted file mode 100644 index 078061856..000000000 --- a/api-ref/source/samples/port-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ports": [ - { - "address": "11:11:11:11:11:11", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" - } - ] -} diff --git a/api-ref/source/samples/port-update-request.json b/api-ref/source/samples/port-update-request.json deleted file mode 100644 index fe4a0c647..000000000 --- a/api-ref/source/samples/port-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "path" : "/address", - "value" : "22:22:22:22:22:22", - "op" : "replace" - } -] diff --git a/api-ref/source/samples/port-update-response.json b/api-ref/source/samples/port-update-response.json deleted file mode 100644 index e0a1e0744..000000000 --- a/api-ref/source/samples/port-update-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "address": "22:22:22:22:22:22", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "local_link_connection": { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - }, - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "physical_network": "physnet1", - "portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "pxe_enabled": true, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" -} diff --git a/api-ref/source/samples/portgroup-create-request.json b/api-ref/source/samples/portgroup-create-request.json deleted file mode 100644 index 593469002..000000000 --- a/api-ref/source/samples/portgroup-create-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "address": "11:11:11:11:11:11", - "name": "test_portgroup" -} diff --git a/api-ref/source/samples/portgroup-create-response.json b/api-ref/source/samples/portgroup-create-response.json deleted file mode 100644 index 35e58e3d3..000000000 --- a/api-ref/source/samples/portgroup-create-response.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "address": "11:11:11:11:11:11", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "bookmark" - } - ], - "mode": "active-backup", - "name": "test_portgroup", - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "bookmark" - } - ], - "properties": {}, - "standalone_ports_supported": true, - "updated_at": null, - "uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a" -} diff --git a/api-ref/source/samples/portgroup-list-detail-response.json b/api-ref/source/samples/portgroup-list-detail-response.json deleted file mode 100644 index 90789fc5e..000000000 --- a/api-ref/source/samples/portgroup-list-detail-response.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "portgroups": [ - { - "address": "11:11:11:11:11:11", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "bookmark" - } - ], - "mode": "active-backup", - "name": "test_portgroup", - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "bookmark" - } - ], - "properties": {}, - "standalone_ports_supported": true, - "updated_at": null, - "uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a" - } - ] -} diff --git a/api-ref/source/samples/portgroup-list-response.json b/api-ref/source/samples/portgroup-list-response.json deleted file mode 100644 index 06829e899..000000000 --- a/api-ref/source/samples/portgroup-list-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "portgroups": [ - { - "address": "11:11:11:11:11:11", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "bookmark" - } - ], - "name": "test_portgroup", - "uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a" - } - ] -} diff --git a/api-ref/source/samples/portgroup-port-detail-response.json b/api-ref/source/samples/portgroup-port-detail-response.json deleted file mode 100644 index e0f4292bd..000000000 --- a/api-ref/source/samples/portgroup-port-detail-response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ports": [ - { - "address": "22:22:22:22:22:22", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "local_link_connection": { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - }, - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "physical_network": "physnet1", - "portgroup_uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "pxe_enabled": true, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" - } - ] -} diff --git a/api-ref/source/samples/portgroup-port-list-response.json b/api-ref/source/samples/portgroup-port-list-response.json deleted file mode 100644 index 9cfc44413..000000000 --- a/api-ref/source/samples/portgroup-port-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ports": [ - { - "address": "22:22:22:22:22:22", - "links": [ - { - "href": "http://127.0.0.1:6385/v1/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/ports/d2b30520-907d-46c8-bfee-c5586e6fb3a1", - "rel": "bookmark" - } - ], - "uuid": "d2b30520-907d-46c8-bfee-c5586e6fb3a1" - } - ] -} diff --git a/api-ref/source/samples/portgroup-update-request.json b/api-ref/source/samples/portgroup-update-request.json deleted file mode 100644 index fe4a0c647..000000000 --- a/api-ref/source/samples/portgroup-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "path" : "/address", - "value" : "22:22:22:22:22:22", - "op" : "replace" - } -] diff --git a/api-ref/source/samples/portgroup-update-response.json b/api-ref/source/samples/portgroup-update-response.json deleted file mode 100644 index 5847a1847..000000000 --- a/api-ref/source/samples/portgroup-update-response.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "address": "22:22:22:22:22:22", - "created_at": "2016-08-18T22:28:48.643434+11:11", - "extra": {}, - "internal_info": {}, - "links": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a", - "rel": "bookmark" - } - ], - "mode": "active-backup", - "name": "test_portgroup", - "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", - "ports": [ - { - "href": "http://127.0.0.1:6385/v1/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "self" - }, - { - "href": "http://127.0.0.1:6385/portgroups/e43c722c-248e-4c6e-8ce8-0d8ff129387a/ports", - "rel": "bookmark" - } - ], - "properties": {}, - "standalone_ports_supported": true, - "updated_at": "2016-08-18T22:28:49.653974+00:00", - "uuid": "e43c722c-248e-4c6e-8ce8-0d8ff129387a" -} diff --git a/babel.cfg b/babel.cfg deleted file mode 100644 index 15cd6cb76..000000000 --- a/babel.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[python: **.py] - diff --git a/devstack/files/apache-ipxe-ironic.template b/devstack/files/apache-ipxe-ironic.template deleted file mode 100644 index 88641946f..000000000 --- a/devstack/files/apache-ipxe-ironic.template +++ /dev/null @@ -1,12 +0,0 @@ -Listen %PUBLICPORT% - - - DocumentRoot "%HTTPROOT%" - - Options Indexes FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - Require all granted - - diff --git a/devstack/files/apache-ironic-api-redirect.template b/devstack/files/apache-ironic-api-redirect.template deleted file mode 100644 index a4dfcbbac..000000000 --- a/devstack/files/apache-ironic-api-redirect.template +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed under the Apache License, Version 1.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is an example Apache2 configuration file for using the -# Ironic API through mod_wsgi. This version assumes you are -# running devstack to configure the software. - -Listen %IRONIC_SERVICE_PORT% - - - Redirect 307 / %IRONIC_SERVICE_PROTOCOL%://%IRONIC_SERVICE_HOST%:%IRONIC_SERVICE_PORT%/ - diff --git a/devstack/files/apache-ironic-api.template b/devstack/files/apache-ironic-api.template deleted file mode 100644 index 283c9b2f7..000000000 --- a/devstack/files/apache-ironic-api.template +++ /dev/null @@ -1,49 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This is an example Apache2 configuration file for using the -# Ironic API through mod_wsgi. This version assumes you are -# running devstack to configure the software. - -Listen %IRONIC_SERVICE_PORT% - - - WSGIDaemonProcess ironic-api user=%USER% processes=%APIWORKERS% threads=%APIWORKERS% display-name=%{GROUP} - WSGIScriptAlias / %IRONIC_WSGI_DIR%/app.wsgi - WSGIApplicationGroup %{GLOBAL} - WSGIProcessGroup ironic-api - WSGIPassAuthorization On - ErrorLogFormat "%M" - ErrorLog /var/log/%APACHE_NAME%/ironic-api.log - CustomLog /var/log/%APACHE_NAME%/ironic-api-access.log combined - - - WSGIProcessGroup ironic-api - WSGIApplicationGroup %{GLOBAL} - = 2.4> - Require all granted - - - Order allow,deny - Allow from all - - - - -Alias /baremetal %IRONIC_WSGI_DIR%/app.wsgi - - SetHandler wsgi-script - Options +ExecCGI - WSGIProcessGroup ironic-api - WSGIApplicationGroup %{GLOBAL} - WSGIPassAuthorization On - diff --git a/devstack/files/debs/ironic b/devstack/files/debs/ironic deleted file mode 100644 index adf37951d..000000000 --- a/devstack/files/debs/ironic +++ /dev/null @@ -1,39 +0,0 @@ -# apparmor is an undeclared dependency for docker on ubuntu: https://github.com/docker/docker/issues/9745 -# Starting with Debian Jessie (and thus in Ubuntu Xenial too), -# pxelinux package provides the pxelinux.0 boot loader, -# but such package is absent from Debian Wheezy / Ubuntu Trusty. -# Also, in Debian Wheezy / Ubuntu Trusty 'syslinux' depends on syslinux-common, -# but only recommends it in Jessie/Xenial. -# Make sure syslinux-common is installed for those distros as it provides -# *.c32 modules for syslinux -# TODO remove distro pinning when Wheezy / Trusty are EOLed (May 2019) -# or DevStack stops supporting those. -# In the mean time, new Debian-based release codenames will have to be added -# as distros can not be pinned with 'if-later-than' specified. -apparmor -docker.io -ipmitool -iptables -ipxe -gnupg -libguestfs0 -libguestfs-tools -libvirt-bin # dist:xenial NOPRIME -open-iscsi -openssh-client -pxelinux # dist:jessie,xenial -python-libguestfs -python-libvirt -qemu -qemu-kvm -qemu-utils -sgabios -shellinabox -syslinux # dist:wheezy,trusty -syslinux-common # dist:jessie,xenial -tftpd-hpa -xinetd -squashfs-tools -libvirt-dev -socat -ipxe-qemu diff --git a/devstack/files/hooks/qemu.py b/devstack/files/hooks/qemu.py deleted file mode 100755 index 2e21d7e12..000000000 --- a/devstack/files/hooks/qemu.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/python -tt - -# Copyright (c) 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import datetime -import os -import re -import sys - -# This script is run as a libvirt hook. -# More information here: https://libvirt.org/hooks.html - -# The devstack/lib/ironic script in function setup_qemu_log_hook() will replace -# LOG_DIR with the correct location. And will place the script into the correct -# directory. -VM_LOG_DIR = os.path.abspath("%LOG_DIR%") - -# Regular expression to find ANSI escape sequences at the beginning of a string -ANSI_ESCAPE_RE = re.compile(r""" - ^\x1b\[ # ANSI escape codes are ESC (0x1b) [ - ?([\d;]*)(\w)""", re.VERBOSE) - -NOW = datetime.datetime.now().strftime("%Y-%m-%d-%H:%M:%S") - - -def main(): - if len(sys.argv) < 3: - return - - guest_name = sys.argv[1] - action = sys.argv[2] - - if action != "release": - return - - if not console_log_exists(guest_name): - return - - new_path = move_console_log(guest_name) - if not new_path: - return - - no_ansi_filename = "{}_no_ansi_{}.log".format(guest_name, NOW) - no_ansi_path = os.path.join(VM_LOG_DIR, no_ansi_filename) - create_no_ansi_file(new_path, no_ansi_path) - - -def create_no_ansi_file(source_filename, dest_filename): - with open(source_filename) as in_file: - data = in_file.read() - - data = remove_ansi_codes(data) - - with open(dest_filename, 'w') as out_file: - out_file.write(data) - - -def get_console_log_path(guest_name): - logfile_name = "{}_console.log".format(guest_name) - return os.path.join(VM_LOG_DIR, logfile_name) - - -def console_log_exists(guest_name): - return os.path.isfile(get_console_log_path(guest_name)) - - -def move_console_log(guest_name): - new_logfile_name = "{}_console_{}.log".format(guest_name, NOW) - new_path = os.path.join(VM_LOG_DIR, new_logfile_name) - if os.path.exists(new_path): - return False - os.rename(get_console_log_path(guest_name), new_path) - return new_path - - -def remove_ansi_codes(data): - """Remove any ansi codes from the provided string""" - output = '' - while data: - result = ANSI_ESCAPE_RE.match(data) - if not result: - output += data[0] - data = data[1:] - else: - data = data[result.end():] - return output - - -if '__main__' == __name__: - sys.exit(main()) diff --git a/devstack/files/rpms/ironic b/devstack/files/rpms/ironic deleted file mode 100644 index ac22dd4e9..000000000 --- a/devstack/files/rpms/ironic +++ /dev/null @@ -1,22 +0,0 @@ -docker-io -ipmitool -iptables -ipxe-bootimgs -gnupg -libguestfs -libguestfs-tools -libvirt -libvirt-python -net-tools -openssh-clients -openvswitch -sgabios -shellinabox -syslinux -tftp-server -xinetd -squashfs-tools -libvirt-devel -socat -edk2-ovmf # dist:f24,f25 -ipxe-roms-qemu diff --git a/devstack/lib/ironic b/devstack/lib/ironic deleted file mode 100644 index 484102c1f..000000000 --- a/devstack/lib/ironic +++ /dev/null @@ -1,2275 +0,0 @@ -#!/bin/bash -# -# lib/ironic -# Functions to control the configuration and operation of the **Ironic** service - -# Dependencies: -# -# - ``functions`` file -# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined -# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined -# - ``SERVICE_HOST`` -# - ``KEYSTONE_TOKEN_FORMAT`` must be defined - -# ``stack.sh`` calls the entry points in this order: -# -# - install_ironic -# - install_ironicclient -# - init_ironic -# - start_ironic -# - stop_ironic -# - cleanup_ironic - -# ensure we don't re-source this in the same environment -[[ -z "$_IRONIC_DEVSTACK_LIB" ]] || return 0 -declare -r -g _IRONIC_DEVSTACK_LIB=1 - -# Save xtrace and pipefail settings -_XTRACE_IRONIC=$(set +o | grep xtrace) -_PIPEFAIL_IRONIC=$(set +o | grep pipefail) -set -o xtrace -set +o pipefail - -# Defaults -# -------- - -# Set up default directories -GITDIR["python-ironicclient"]=$DEST/python-ironicclient -GITDIR["ironic-lib"]=$DEST/ironic-lib - -GITREPO["pyghmi"]=${PYGHMI_REPO:-${GIT_BASE}/openstack/pyghmi.git} -GITBRANCH["pyghmi"]=${PYGHMI_BRANCH:-master} -GITDIR["pyghmi"]=$DEST/pyghmi - -GITREPO["virtualbmc"]=${VIRTUALBMC_REPO:-${GIT_BASE}/openstack/virtualbmc.git} -GITBRANCH["virtualbmc"]=${VIRTUALBMC_BRANCH:-master} -GITDIR["virtualbmc"]=$DEST/virtualbmc - -GITREPO["virtualpdu"]=${VIRTUALPDU_REPO:-${GIT_BASE}/openstack/virtualpdu.git} -GITBRANCH["virtualpdu"]=${VIRTUALPDU_BRANCH:-master} -GITDIR["virtualpdu"]=$DEST/virtualpdu - -GITREPO["sushy"]=${SUSHY_REPO:-${GIT_BASE}/openstack/sushy.git} -GITBRANCH["sushy"]=${SUSHY_BRANCH:-master} -GITDIR["sushy"]=$DEST/sushy - -IRONIC_DIR=$DEST/ironic -IRONIC_DEVSTACK_DIR=$IRONIC_DIR/devstack -IRONIC_DEVSTACK_FILES_DIR=$IRONIC_DEVSTACK_DIR/files -IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent -IRONIC_DATA_DIR=$DATA_DIR/ironic -IRONIC_STATE_PATH=/var/lib/ironic -IRONIC_AUTH_CACHE_DIR=${IRONIC_AUTH_CACHE_DIR:-/var/cache/ironic} -IRONIC_CONF_DIR=${IRONIC_CONF_DIR:-/etc/ironic} -IRONIC_CONF_FILE=$IRONIC_CONF_DIR/ironic.conf -IRONIC_ROOTWRAP_CONF=$IRONIC_CONF_DIR/rootwrap.conf -IRONIC_POLICY_JSON=$IRONIC_CONF_DIR/policy.json -if is_suse; then - IRONIC_WSGI_DIR=${IRONIC_WSGI_DIR:-/srv/www/htdocs/ironic} -else - IRONIC_WSGI_DIR=${IRONIC_WSGI_DIR:-/var/www/ironic} -fi -IRONIC_USE_MOD_WSGI=$(trueorfalse False IRONIC_USE_MOD_WSGI) - -# Deploy callback timeout can be changed from its default (1800), if required. -IRONIC_CALLBACK_TIMEOUT=${IRONIC_CALLBACK_TIMEOUT:-} - -# Deploy to hardware platform -IRONIC_HW_NODE_CPU=${IRONIC_HW_NODE_CPU:-1} -IRONIC_HW_NODE_RAM=${IRONIC_HW_NODE_RAM:-512} -IRONIC_HW_NODE_DISK=${IRONIC_HW_NODE_DISK:-10} -IRONIC_HW_EPHEMERAL_DISK=${IRONIC_HW_EPHEMERAL_DISK:-0} -IRONIC_HW_ARCH=${IRONIC_HW_ARCH:-x86_64} - -# The file is composed of multiple lines, each line includes fields -# separated by white space, in the format: -# -# [] -# -# For example: -# -# 192.168.110.107 00:1e:67:57:50:4c root otc123 -# -# Supported IRONIC_DEPLOY_DRIVERs: -# *_ipmitool or ipmi: -# -# -# *_cimc: -# -# -# *_ucs: -# -# -# *_oneview: -# -# -# *_drac: -# -# -IRONIC_HWINFO_FILE=${IRONIC_HWINFO_FILE:-$IRONIC_DATA_DIR/hardware_info} - -# Set up defaults for functional / integration testing -IRONIC_NODE_UUID=${IRONIC_NODE_UUID:-`uuidgen`} -IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$IRONIC_DEVSTACK_DIR/tools/ironic/scripts} -IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$IRONIC_DEVSTACK_DIR/tools/ironic/templates} -IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False IRONIC_BAREMETAL_BASIC_OPS) -IRONIC_SSH_USERNAME=${IRONIC_SSH_USERNAME:-`whoami`} -IRONIC_SSH_TIMEOUT=${IRONIC_SSH_TIMEOUT:-15} -IRONIC_SSH_ATTEMPTS=${IRONIC_SSH_ATTEMPTS:-5} -IRONIC_SSH_KEY_DIR=${IRONIC_SSH_KEY_DIR:-$IRONIC_DATA_DIR/ssh_keys} -IRONIC_SSH_KEY_FILENAME=${IRONIC_SSH_KEY_FILENAME:-ironic_key} -IRONIC_KEY_FILE=${IRONIC_KEY_FILE:-$IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME} -IRONIC_SSH_VIRT_TYPE=${IRONIC_SSH_VIRT_TYPE:-virsh} -IRONIC_TFTPBOOT_DIR=${IRONIC_TFTPBOOT_DIR:-$IRONIC_DATA_DIR/tftpboot} -IRONIC_TFTPSERVER_IP=${IRONIC_TFTPSERVER_IP:-$HOST_IP} -IRONIC_VM_SSH_PORT=${IRONIC_VM_SSH_PORT:-22} -IRONIC_VM_SSH_ADDRESS=${IRONIC_VM_SSH_ADDRESS:-$HOST_IP} -IRONIC_VM_COUNT=${IRONIC_VM_COUNT:-1} -IRONIC_VM_SPECS_CPU=${IRONIC_VM_SPECS_CPU:-1} -IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-1280} -IRONIC_VM_SPECS_CPU_ARCH=${IRONIC_VM_SPECS_CPU_ARCH:-'x86_64'} -IRONIC_VM_SPECS_DISK=${IRONIC_VM_SPECS_DISK:-10} -IRONIC_VM_SPECS_DISK_FORMAT=${IRONIC_VM_SPECS_DISK_FORMAT:-qcow2} -IRONIC_VM_EPHEMERAL_DISK=${IRONIC_VM_EPHEMERAL_DISK:-0} -IRONIC_VM_EMULATOR=${IRONIC_VM_EMULATOR:-'/usr/bin/qemu-system-x86_64'} -IRONIC_VM_ENGINE=${IRONIC_VM_ENGINE:-qemu} -IRONIC_VM_NETWORK_BRIDGE=${IRONIC_VM_NETWORK_BRIDGE:-brbm} -IRONIC_VM_NETWORK_RANGE=${IRONIC_VM_NETWORK_RANGE:-192.0.2.0/24} -IRONIC_VM_INTERFACE_COUNT=${IRONIC_VM_INTERFACE_COUNT:-2} -IRONIC_VM_MACS_CSV_FILE=${IRONIC_VM_MACS_CSV_FILE:-$IRONIC_DATA_DIR/ironic_macs.csv} -IRONIC_AUTHORIZED_KEYS_FILE=${IRONIC_AUTHORIZED_KEYS_FILE:-$HOME/.ssh/authorized_keys} -IRONIC_CLEAN_NET_NAME=${IRONIC_CLEAN_NET_NAME:-${IRONIC_PROVISION_NETWORK_NAME:-${PRIVATE_NETWORK_NAME}}} -IRONIC_EXTRA_PXE_PARAMS=${IRONIC_EXTRA_PXE_PARAMS:-} -IRONIC_TTY_DEV=${IRONIC_TTY_DEV:-ttyS0} - -IRONIC_TEMPEST_BUILD_TIMEOUT=${IRONIC_TEMPEST_BUILD_TIMEOUT:-${BUILD_TIMEOUT:-}} -if [[ -n "$BUILD_TIMEOUT" ]]; then - echo "WARNING: BUILD_TIMEOUT variable is renamed to IRONIC_TEMPEST_BUILD_TIMEOUT and will be deprecated in Pike." -fi - -# driver / hardware type options -IRONIC_ENABLED_DRIVERS=${IRONIC_ENABLED_DRIVERS:-fake,pxe_ipmitool,agent_ipmitool} -IRONIC_ENABLED_HARDWARE_TYPES=${IRONIC_ENABLED_HARDWARE_TYPES:-ipmi} -IRONIC_ENABLED_BOOT_INTERFACES=${IRONIC_ENABLED_BOOT_INTERFACES:-} -IRONIC_ENABLED_DEPLOY_INTERFACES=${IRONIC_ENABLED_DEPLOY_INTERFACES:-} -IRONIC_ENABLED_MANAGEMENT_INTERFACES=${IRONIC_ENABLED_MANAGEMENT_INTERFACES:-} -IRONIC_ENABLED_POWER_INTERFACES=${IRONIC_ENABLED_POWER_INTERFACES:-} -IRONIC_ENABLED_CONSOLE_INTERFACES=${IRONIC_ENABLED_CONSOLE_INTERFACES:-} -IRONIC_ENABLED_INSPECT_INTERFACES=${IRONIC_ENABLED_INSPECT_INTERFACES:-} -IRONIC_ENABLED_RAID_INTERFACES=${IRONIC_ENABLED_RAID_INTERFACES:-} -IRONIC_ENABLED_VENDOR_INTERFACES=${IRONIC_ENABLED_VENDOR_INTERFACES:-} -IRONIC_ENABLED_STORAGE_INTERFACES=${IRONIC_ENABLED_STORAGE_INTERFACES:-} -IRONIC_ENABLED_NETWORK_INTERFACES=${IRONIC_ENABLED_NETWORK_INTERFACES:-} -# If IRONIC_VM_ENGING is explicitly set to "auto" or "kvm", -# devstack will attempt to use hardware virtualization -# (aka nested kvm). We do not enable it in the infra gates -# because it is not consistently supported/working across -# all gate infrastructure providers. -if [[ "$IRONIC_VM_ENGINE" == "auto" ]]; then - sudo modprobe kvm || true - if [ ! -e /dev/kvm ]; then - echo "WARNING: Switching to QEMU" - IRONIC_VM_ENGINE=qemu - if [[ -z "$IRONIC_VM_EMULATOR" ]]; then - IRONIC_VM_EMULATOR='/usr/bin/qemu-system-x86_64' - fi - else - IRONIC_VM_ENGINE=kvm - fi -fi - -if [[ "$IRONIC_VM_ENGINE" == "kvm" ]]; then - # Set this to empty, so configure-vm.py can autodetect location - # of KVM binary - IRONIC_VM_EMULATOR="" -fi - -# By default, baremetal VMs will console output to file. -IRONIC_VM_LOG_CONSOLE=$(trueorfalse True IRONIC_VM_LOG_CONSOLE) -IRONIC_VM_LOG_DIR=${IRONIC_VM_LOG_DIR:-$IRONIC_DATA_DIR/logs/} -IRONIC_VM_LOG_ROTATE=$(trueorfalse True IRONIC_VM_LOG_ROTATE) - -# Set resource_classes for nodes to use Nova's placement engine -IRONIC_USE_RESOURCE_CLASSES=$(trueorfalse False IRONIC_USE_RESOURCE_CLASSES) - -# Whether to build the ramdisk or download a prebuilt one. -IRONIC_BUILD_DEPLOY_RAMDISK=$(trueorfalse True IRONIC_BUILD_DEPLOY_RAMDISK) - -# Ironic IPA ramdisk type, supported types are: -IRONIC_SUPPORTED_RAMDISK_TYPES_RE="^(coreos|tinyipa|dib)$" -IRONIC_RAMDISK_TYPE=${IRONIC_RAMDISK_TYPE:-tinyipa} - -# Confirm we have a supported ramdisk type or fail early. -if [[ ! "$IRONIC_RAMDISK_TYPE" =~ $IRONIC_SUPPORTED_RAMDISK_TYPES_RE ]]; then - die $LINENO "Unrecognized IRONIC_RAMDISK_TYPE: $IRONIC_RAMDISK_TYPE. Expected 'coreos', 'tinyipa' or 'dib'" -fi - -# If present, these files are used as deploy ramdisk/kernel. -# (The value must be an absolute path) -IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.initramfs} -IRONIC_DEPLOY_KERNEL=${IRONIC_DEPLOY_KERNEL:-$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.kernel} -IRONIC_DEPLOY_ISO=${IRONIC_DEPLOY_ISO:-$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.iso} - -# These parameters describe which image will be used to provision a node in -# tempest tests -if [[ -z "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" && "$IRONIC_VM_EPHEMERAL_DISK" == 0 ]]; then - IRONIC_TEMPEST_WHOLE_DISK_IMAGE=True -fi - -IRONIC_TEMPEST_WHOLE_DISK_IMAGE=$(trueorfalse False IRONIC_TEMPEST_WHOLE_DISK_IMAGE) - -# NOTE(jroll) this needs to be updated when stable branches are cut -IPA_DOWNLOAD_BRANCH=${IPA_DOWNLOAD_BRANCH:-master} -IPA_DOWNLOAD_BRANCH=$(echo $IPA_DOWNLOAD_BRANCH | tr / -) - -# Configure URLs required to download ramdisk if we're not building it, and -# IRONIC_DEPLOY_RAMDISK/KERNEL or the RAMDISK/KERNEL_URLs have not been -# preconfigured. -if [[ "$IRONIC_BUILD_DEPLOY_RAMDISK" == "False" && \ - ! (-e "$IRONIC_DEPLOY_RAMDISK" && -e "$IRONIC_DEPLOY_KERNEL") && \ - (-z "$IRONIC_AGENT_KERNEL_URL" || -z "$IRONIC_AGENT_RAMDISK_URL") ]]; then - case $IRONIC_RAMDISK_TYPE in - coreos) - IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe-${IPA_DOWNLOAD_BRANCH}.vmlinuz} - IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem-${IPA_DOWNLOAD_BRANCH}.cpio.gz} - ;; - tinyipa) - IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-${IPA_DOWNLOAD_BRANCH}.vmlinuz} - IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-${IPA_DOWNLOAD_BRANCH}.gz} - ;; - dib) - die "IRONIC_RAMDISK_TYPE 'dib' has no official pre-built "\ - "images. To fix this select a different ramdisk type, set "\ - "IRONIC_BUILD_DEPLOY_RAMDISK=True, or manually configure "\ - "IRONIC_DEPLOY_RAMDISK(_URL) and IRONIC_DEPLOY_KERNEL(_URL) "\ - "to use your own pre-built ramdisk." - ;; - esac -fi - -# This refers the options for disk-image-create and the platform on which -# to build the dib based ironic-python-agent ramdisk. -# "ubuntu" is set as the default value. -IRONIC_DIB_RAMDISK_OPTIONS=${IRONIC_DIB_RAMDISK_OPTIONS:-'ubuntu'} - -# Some drivers in Ironic require deploy ramdisk in bootable ISO format. -# Set this variable to "true" to build an ISO for deploy ramdisk and -# upload to Glance. -IRONIC_DEPLOY_ISO_REQUIRED=$(trueorfalse False IRONIC_DEPLOY_ISO_REQUIRED) -if [[ "$IRONIC_DEPLOY_ISO_REQUIRED" = "True" \ - && "$IRONIC_BUILD_DEPLOY_RAMDISK" = "False" \ - && -n "$IRONIC_DEPLOY_ISO" ]]; then - die "Prebuilt ISOs are not available, provide an ISO via IRONIC_DEPLOY_ISO \ - or set IRONIC_BUILD_DEPLOY_RAMDISK=True to use ISOs" -fi -# Which deploy driver to use - valid choices right now -# are ``pxe_ssh``, ``pxe_ipmitool``, ``agent_ssh``, ``agent_ipmitool``, -# ``pxe_snmp`` and ``ipmi``. -# -# Additional valid choices if IRONIC_IS_HARDWARE == true are: -# ``pxe_iscsi_cimc``, ``pxe_agent_cimc``, ``pxe_ucs``, ``pxe_cimc``, -# ``*_pxe_oneview`` and ``pxe_drac`` -IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-pxe_ipmitool} - -# If the requested driver is not yet enable, enable it, if it is not it will fail anyway -if [[ -z "$(echo ${IRONIC_ENABLED_DRIVERS},${IRONIC_ENABLED_HARDWARE_TYPES} | grep -w ${IRONIC_DEPLOY_DRIVER})" ]]; then - die "The deploy driver $IRONIC_DEPLOY_DRIVER is not in the list of enabled \ - drivers $IRONIC_ENABLED_DRIVERS or hardware types $IRONIC_ENABLED_HARDWARE_TYPES" -fi - -# Support entry points installation of console scripts -IRONIC_BIN_DIR=$(get_python_exec_prefix) - -# Ironic connection info. Note the port must be specified. -IRONIC_SERVICE_PROTOCOL=${IRONIC_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} -IRONIC_SERVICE_PORT=${IRONIC_SERVICE_PORT:-6385} -# If ironic api running under apache we use the path rather than port -if [[ "$IRONIC_USE_MOD_WSGI" != "True" ]]; then - IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST:$IRONIC_SERVICE_PORT} -else - IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST/baremetal} -fi - -# Enable iPXE -IRONIC_IPXE_ENABLED=$(trueorfalse True IRONIC_IPXE_ENABLED) -# Options below are only applied when IRONIC_IPXE_ENABLED is True -IRONIC_IPXE_USE_SWIFT=$(trueorfalse False IRONIC_IPXE_USE_SWIFT) -IRONIC_HTTP_DIR=${IRONIC_HTTP_DIR:-$IRONIC_DATA_DIR/httpboot} -IRONIC_HTTP_PORT=${IRONIC_HTTP_PORT:-3928} - -# Whether DevStack will be setup for bare metal or VMs -IRONIC_IS_HARDWARE=$(trueorfalse False IRONIC_IS_HARDWARE) - -# The first port in the range to bind the Virtual BMCs. The number of -# ports that will be used depends on $IRONIC_VM_COUNT variable, e.g if -# $IRONIC_VM_COUNT=3 the ports 6230, 6231 and 6232 will be used for the -# Virtual BMCs, one for each VM. -IRONIC_VBMC_PORT_RANGE_START=${IRONIC_VBMC_PORT_RANGE_START:-6230} -IRONIC_VBMC_CONFIG_FILE=${IRONIC_VBMC_CONFIG_FILE:-$HOME/.vbmc/virtualbmc.conf} -IRONIC_VBMC_LOGFILE=${IRONIC_VBMC_LOGFILE:-$IRONIC_VM_LOG_DIR/virtualbmc.log} - -# Virtual PDU configs -IRONIC_VPDU_CONFIG_FILE=${IRONIC_VPDU_CONFIG_FILE:-$HOME/.vpdu/virtualpdu.conf} -IRONIC_VPDU_PORT_RANGE_START=${IRONIC_VPDU_PORT_RANGE_START:-1} -IRONIC_VPDU_LISTEN_PORT=${IRONIC_VPDU_LISTEN_PORT:-1161} -IRONIC_VPDU_COMMUNITY=${IRONIC_VPDU_COMMUNITY:-private} -IRONIC_VPDU_SNMPDRIVER=${IRONIC_VPDU_SNMPDRIVER:-apc_rackpdu} - -# Redfish configs -IRONIC_REDFISH_EMULATOR_PORT=${IRONIC_REDFISH_EMULATOR_PORT:-9132} -IRONIC_REDFISH_EMULATOR_PID_FILE=${IRONIC_REDFISH_EMULATOR_PID_FILE:-/var/run/redfish-emulator.pid} - -# To explicitly enable configuration of Glance with Swift -# (which is required by some vendor drivers), set this -# variable to true. -IRONIC_CONFIGURE_GLANCE_WITH_SWIFT=$(trueorfalse False IRONIC_CONFIGURE_GLANCE_WITH_SWIFT) - -# The path to the libvirt hooks directory, used if IRONIC_VM_LOG_ROTATE is True -IRONIC_LIBVIRT_HOOKS_PATH=${IRONIC_LIBVIRT_HOOKS_PATH:-/etc/libvirt/hooks/} - -# The authentication strategy used by ironic-api. Valid values are: -# keystone and noauth. -IRONIC_AUTH_STRATEGY=${IRONIC_AUTH_STRATEGY:-keystone} - -# By default, terminal SSL certificate is disabled. -IRONIC_TERMINAL_SSL=$(trueorfalse False IRONIC_TERMINAL_SSL) -IRONIC_TERMINAL_CERT_DIR=${IRONIC_TERMINAL_CERT_DIR:-$IRONIC_DATA_DIR/terminal_cert/} - -# This flag is used to allow adding Link-Local-Connection info -# to ironic port-create command. LLC info is obtained from -# IRONIC_{VM,HW}_NODES_FILE -IRONIC_USE_LINK_LOCAL=$(trueorfalse False IRONIC_USE_LINK_LOCAL) - -# Allow selecting dhcp provider -IRONIC_DHCP_PROVIDER=${IRONIC_DHCP_PROVIDER:-neutron} - -# This is the network interface to use for a node -IRONIC_NETWORK_INTERFACE=${IRONIC_NETWORK_INTERFACE:-} - -# Ironic provision network name -IRONIC_PROVISION_NETWORK_NAME=${IRONIC_PROVISION_NETWORK_NAME:-} - -# Provision network provider type. Can be flat or vlan. -IRONIC_PROVISION_PROVIDER_NETWORK_TYPE=${IRONIC_PROVISION_PROVIDER_NETWORK_TYPE:-'vlan'} - -# If IRONIC_PROVISION_PROVIDER_NETWORK_TYPE is vlan. VLAN_ID may be specified. If it is not set, -# vlan will be allocated dynamically. -IRONIC_PROVISION_SEGMENTATION_ID=${IRONIC_PROVISION_SEGMENTATION_ID:-} - -# Allocation network pool for provision network -# Example: IRONIC_PROVISION_ALLOCATION_POOL=start=10.0.5.10,end=10.0.5.100 -IRONIC_PROVISION_ALLOCATION_POOL=${IRONIC_PROVISION_ALLOCATION_POOL:-'start=10.0.5.10,end=10.0.5.100'} - -# Ironic provision subnet name. -IRONIC_PROVISION_PROVIDER_SUBNET_NAME=${IRONIC_PROVISION_PROVIDER_SUBNET_NAME:-${IRONIC_PROVISION_NETWORK_NAME}-subnet} - - -# This is the storage interface to use for a node -# Only 'cinder' can be set for testing boot from volume -IRONIC_STORAGE_INTERFACE=${IRONIC_STORAGE_INTERFACE:-} - - -# With multinode case all ironic-conductors should have IP from provisioning network. -# IRONIC_PROVISION_SUBNET_GATEWAY - is configured on primary node. -# Ironic provision subnet gateway. -IRONIC_PROVISION_SUBNET_GATEWAY=${IRONIC_PROVISION_SUBNET_GATEWAY:-'10.0.5.1'} -IRONIC_PROVISION_SUBNET_SUBNODE_IP=${IRONIC_PROVISION_SUBNET_SUBNODE_IP:-'10.0.5.2'} - -# Ironic provision subnet prefix -# Example: IRONIC_PROVISION_SUBNET_PREFIX=10.0.5.0/24 -IRONIC_PROVISION_SUBNET_PREFIX=${IRONIC_PROVISION_SUBNET_PREFIX:-'10.0.5.0/24'} - -if [[ "$HOST_TOPOLOGY_ROLE" == 'primary' ]]; then - IRONIC_TFTPSERVER_IP=$IRONIC_PROVISION_SUBNET_GATEWAY - IRONIC_HTTP_SERVER=$IRONIC_PROVISION_SUBNET_GATEWAY -fi -if [[ "$HOST_TOPOLOGY_ROLE" == 'subnode' ]]; then - IRONIC_TFTPSERVER_IP=$IRONIC_PROVISION_SUBNET_SUBNODE_IP - IRONIC_HTTP_SERVER=$IRONIC_PROVISION_SUBNET_SUBNODE_IP -fi - -IRONIC_HTTP_SERVER=${IRONIC_HTTP_SERVER:-$IRONIC_TFTPSERVER_IP} - -# Port that must be permitted for iSCSI connections to be -# established from the tenant network. -ISCSI_SERVICE_PORT=${ISCSI_SERVICE_PORT:-3260} - -# Retrieving logs from the deploy ramdisk -# -# IRONIC_DEPLOY_LOGS_COLLECT possible values are: -# * always: Collect the ramdisk logs from the deployment on success or -# failure (Default in DevStack for debugging purpose). -# * on_failure: Collect the ramdisk logs upon a deployment failure -# (Default in Ironic). -# * never: Never collect the ramdisk logs. -IRONIC_DEPLOY_LOGS_COLLECT=${IRONIC_DEPLOY_LOGS_COLLECT:-always} -# IRONIC_DEPLOY_LOGS_STORAGE_BACKEND possible values are: -# * local: To store the logs in the local filesystem (Default in Ironic and DevStack). -# * swift: To store the logs in Swift. -IRONIC_DEPLOY_LOGS_STORAGE_BACKEND=${IRONIC_DEPLOY_LOGS_STORAGE_BACKEND:-local} -# The path to the directory where Ironic should put the logs when IRONIC_DEPLOY_LOGS_STORAGE_BACKEND is set to "local" -IRONIC_DEPLOY_LOGS_LOCAL_PATH=${IRONIC_DEPLOY_LOGS_LOCAL_PATH:-$IRONIC_VM_LOG_DIR/deploy_logs} - - -# Define baremetal min_microversion in tempest config. Default value None is picked from tempest. -TEMPEST_BAREMETAL_MIN_MICROVERSION=${TEMPEST_BAREMETAL_MIN_MICROVERSION:-} - -# Define baremetal max_microversion in tempest config. No default value means that it is picked from tempest. -TEMPEST_BAREMETAL_MAX_MICROVERSION=${TEMPEST_BAREMETAL_MAX_MICROVERSION:-} - -# get_pxe_boot_file() - Get the PXE/iPXE boot file path -function get_pxe_boot_file { - local pxe_boot_file - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - if is_ubuntu; then - pxe_boot_file=/usr/lib/ipxe/undionly.kpxe - elif is_fedora || is_suse; then - pxe_boot_file=/usr/share/ipxe/undionly.kpxe - fi - else - # Standard PXE - if is_ubuntu; then - # Ubuntu Xenial (16.04) places the file under /usr/lib/PXELINUX - pxe_paths="/usr/lib/syslinux/pxelinux.0 /usr/lib/PXELINUX/pxelinux.0" - for p in $pxe_paths; do - if [[ -f $p ]]; then - pxe_boot_file=$p - fi - done - elif is_fedora || is_suse; then - pxe_boot_file=/usr/share/syslinux/pxelinux.0 - fi - fi - echo $pxe_boot_file -} - -# PXE boot image -IRONIC_PXE_BOOT_IMAGE=${IRONIC_PXE_BOOT_IMAGE:-$(get_pxe_boot_file)} - -IRONIC_AUTOMATED_CLEAN_ENABLED=$(trueorfalse True IRONIC_AUTOMATED_CLEAN_ENABLED) - -# Whether configure the nodes to boot in Legacy BIOS or UEFI mode. Accepted -# values are: "bios" or "uefi", defaults to "bios". -# -# WARNING: UEFI is EXPERIMENTAL. The CirrOS images uploaded by DevStack by -# default WILL NOT WORK with UEFI. You will need to download the UEFI capable -# images manually from [0] and upload it to Glance before deploying. -IRONIC_BOOT_MODE=${IRONIC_BOOT_MODE:-bios} -IRONIC_UEFI_FILES_DIR=${IRONIC_UEFI_FILES_DIR:-/var/lib/libvirt/images} -UEFI_LOADER_PATH=$IRONIC_UEFI_FILES_DIR/OVMF_CODE.fd -UEFI_NVRAM_PATH=$IRONIC_UEFI_FILES_DIR/OVMF_VARS.fd - -# Sanity checks -if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - if [[ "$IRONIC_IPXE_ENABLED" == "False" ]]; then - die $LINENO "Boot mode UEFI is only supported when used with iPXE for now." - fi - - if ! is_fedora && ! is_ubuntu; then - die $LINENO "Boot mode UEFI only works in Ubuntu or Fedora for now." - fi -fi - -# TODO(dtantsur): change this when we change the default value. -IRONIC_DEFAULT_BOOT_OPTION=${IRONIC_DEFAULT_BOOT_OPTION:-netboot} -if [ $IRONIC_DEFAULT_BOOT_OPTION != 'netboot' ] && [ $IRONIC_DEFAULT_BOOT_OPTION != 'local' ]; then - die $LINENO "Supported values for IRONIC_DEFAULT_BOOT_OPTION are 'netboot' and 'local' only." -fi - -# Functions -# --------- - -# UEFI related functions -function get_uefi_ipxe_boot_file { - if is_ubuntu; then - echo /usr/lib/ipxe/ipxe.efi - elif is_fedora; then - echo /usr/share/ipxe/ipxe-x86_64.efi - fi -} - -function get_uefi_loader { - if is_ubuntu; then - echo /usr/share/OVMF/OVMF_CODE.fd - elif is_fedora; then - echo /usr/share/edk2/ovmf/OVMF_CODE.fd - fi -} - -function get_uefi_nvram { - if is_ubuntu; then - echo /usr/share/OVMF/OVMF_VARS.fd - elif is_fedora; then - echo /usr/share/edk2/ovmf/OVMF_VARS.fd - fi -} - -# Misc - -function restart_libvirt { - local libvirt_service_name="libvirtd" - if is_ubuntu && [ ! -f /etc/init.d/libvirtd ]; then - libvirt_service_name="libvirt-bin" - fi - restart_service $libvirt_service_name -} - -# Test if any Ironic services are enabled -# is_ironic_enabled -function is_ironic_enabled { - [[ ,${ENABLED_SERVICES} =~ ,"ir-" ]] && return 0 - return 1 -} - -function is_deployed_by_agent { - [[ -z "${IRONIC_DEPLOY_DRIVER%%agent*}" ]] && return 0 - return 1 -} - -function is_deployed_by_ipmitool { - [[ "$IRONIC_DEPLOY_DRIVER" == ipmi || -z "${IRONIC_DEPLOY_DRIVER##*_ipmitool}" ]] && return 0 - return 1 -} - -function is_deployed_by_cimc { - [[ -z "${IRONIC_DEPLOY_DRIVER##*_cimc}" ]] && return 0 - return 1 -} - -function is_deployed_by_ucs { - [[ -z "${IRONIC_DEPLOY_DRIVER##*_ucs}" ]] && return 0 - return 1 -} - -function is_deployed_by_oneview { - [[ -z "${IRONIC_DEPLOY_DRIVER##*_oneview}" ]] && return 0 -} - -function is_deployed_by_ilo { - [[ -z "${IRONIC_DEPLOY_DRIVER##*ilo}" ]] && return 0 - return 1 -} - -function is_deployed_by_drac { - [[ -z "${IRONIC_DEPLOY_DRIVER##*_drac}" ]] && return 0 - return 1 -} - -function is_deployed_by_snmp { - [[ -z "${IRONIC_DEPLOY_DRIVER##*_snmp}" ]] && return 0 - return 1 -} - -function is_deployed_by_redfish { - [[ "$IRONIC_DEPLOY_DRIVER" == redfish ]] && return 0 - return 1 -} - -function is_drac_enabled { - [[ -z "${IRONIC_ENABLED_DRIVERS##*_drac}" ]] && return 0 - return 1 -} - -function is_glance_configuration_required { - is_deployed_by_agent || [[ "$IRONIC_CONFIGURE_GLANCE_WITH_SWIFT" == "True" ]] && return 0 - return 1 -} - -function is_deploy_iso_required { - [[ "$IRONIC_IS_HARDWARE" == "True" && "$IRONIC_DEPLOY_ISO_REQUIRED" == "True" ]] && return 0 - return 1 -} - -function configure_enabled_interfaces { - local interface_name=$1 - local interface_implementations=$2 - if [[ -n $interface_implementations ]]; then - iniset $IRONIC_CONF_FILE DEFAULT enabled_${interface_name}_interfaces $interface_implementations - fi -} - -IRONIC_DEFAULT_IMAGE_NAME=cirros-${CIRROS_VERSION}-x86_64-uec -if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - IRONIC_DEFAULT_IMAGE_NAME=cirros-d160722-x86_64-uec -fi - -IRONIC_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-$IRONIC_DEFAULT_IMAGE_NAME} - -# Assert that the redfish hardware type is enabled in case we are using -# the redfish driver -if is_deployed_by_redfish && [[ "$IRONIC_ENABLED_HARDWARE_TYPES" != *"redfish"* ]]; then - die $LINENO "Please make sure that the redfish hardware" \ - "type is enabled. Take a look at the " \ - "IRONIC_ENABLED_HARDWARE_TYPES configuration option" \ - "for DevStack" -fi - -# Add link to download queue, ignore if already exist. -# TODO(vsaienko) Move to devstack https://review.openstack.org/420656 -function add_image_link { - local i_link="$1" - if ! [[ "$IMAGE_URLS" =~ "$i_link" ]]; then - if [[ -z "$IMAGE_URLS" || "${IMAGE_URLS: -1}" == "," ]]; then - IMAGE_URLS+="$i_link" - else - IMAGE_URLS+=",$i_link" - fi - fi -} - -if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-uec.tar.gz - add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-disk.img -else - # NOTE (vsaienko) We are going to test mixed drivers/partitions in single setup. - # Do not restrict downloading image only for specific case. Download both disk and uec images. - add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz - add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img -fi - - -IRONIC_WHOLEDISK_IMAGE_NAME=${IRONIC_WHOLEDISK_IMAGE_NAME:-${IRONIC_IMAGE_NAME/-uec/-disk}} -IRONIC_PARTITIONED_IMAGE_NAME=${IRONIC_PARTITIONED_IMAGE_NAME:-${IRONIC_IMAGE_NAME/-disk/-uec}} - -if [[ "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" == "True" ]]; then - IRONIC_IMAGE_NAME=$IRONIC_WHOLEDISK_IMAGE_NAME -else - IRONIC_IMAGE_NAME=$IRONIC_PARTITIONED_IMAGE_NAME -fi - -# NOTE(vsaienko) set DEFAULT_IMAGE_NAME here, as it is still used by grenade -# https://github.com/openstack-dev/grenade/blob/90c4ead2f2a7ed48c873c51cef415b83d655752e/projects/60_nova/resources.sh#L31 -export DEFAULT_IMAGE_NAME=$IRONIC_IMAGE_NAME - -# Syslinux >= 5.00 pxelinux.0 binary is not "stand-alone" anymore, -# it depends on some c32 modules to work correctly. -# More info: http://www.syslinux.org/wiki/index.php/Library_modules -function setup_syslinux_modules { - # Ignore it for iPXE, it doesn't repend on syslinux modules - [[ "$IRONIC_IPXE_ENABLED" == "True" ]] && return 0 - - # Ubuntu Xenial keeps doesn't ship pxelinux.0 as part of syslinux anymore - if is_ubuntu && [[ -d /usr/lib/PXELINUX/ ]]; then - # TODO(lucasagomes): Figure out whether its UEFI or BIOS once - # we have UEFI support in DevStack - cp -aR /usr/lib/syslinux/modules/bios/*.c32 $IRONIC_TFTPBOOT_DIR - else - cp -aR $(dirname $IRONIC_PXE_BOOT_IMAGE)/*.c32 $IRONIC_TFTPBOOT_DIR - fi -} - -function setup_virtualbmc { - # Install pyghmi from source, if requested, otherwise it will be - # downloaded as part of the virtualbmc installation - if use_library_from_git "pyghmi"; then - git_clone_by_name "pyghmi" - setup_dev_lib "pyghmi" - fi - - if use_library_from_git "virtualbmc"; then - git_clone_by_name "virtualbmc" - setup_dev_lib "virtualbmc" - else - # pyghmi is still not compatible with python3 - # hence we need to install virtualbmc in python2 - # environment else IPMI calls will fail at the gate. - USE_PYTHON3=False pip_install_gr "virtualbmc" - fi - - if [[ ! -d $(dirname $IRONIC_VBMC_CONFIG_FILE) ]]; then - mkdir -p $(dirname $IRONIC_VBMC_CONFIG_FILE) - fi - - iniset $IRONIC_VBMC_CONFIG_FILE log debug True - iniset $IRONIC_VBMC_CONFIG_FILE log logfile $IRONIC_VBMC_LOGFILE -} - - -function setup_virtualpdu { - if use_library_from_git "virtualpdu"; then - git_clone_by_name "virtualpdu" - setup_dev_lib "virtualpdu" - else - pip_install "virtualpdu" - fi - - mkdir -p $(dirname $IRONIC_VPDU_CONFIG_FILE) - - iniset $IRONIC_VPDU_CONFIG_FILE global debug True - iniset $IRONIC_VPDU_CONFIG_FILE global libvirt_uri "qemu:///system" - iniset $IRONIC_VPDU_CONFIG_FILE PDU listen_address ${HOST_IP} - iniset $IRONIC_VPDU_CONFIG_FILE PDU listen_port ${IRONIC_VPDU_LISTEN_PORT} - iniset $IRONIC_VPDU_CONFIG_FILE PDU community ${IRONIC_VPDU_COMMUNITY} - iniset $IRONIC_VPDU_CONFIG_FILE PDU ports $(_generate_pdu_ports) - iniset $IRONIC_VPDU_CONFIG_FILE PDU outlet_default_state "OFF" - - enable_service ir-vpdu -} - -# _generate_pdu_ports() - Generates list of port:node_name. -function _generate_pdu_ports { - pdu_port_number=${IRONIC_VPDU_PORT_RANGE_START} - port_config=() - for vm_name in $(_ironic_bm_vm_names); do - port_config+=("${pdu_port_number}:${vm_name}") - pdu_port_number=$(( pdu_port_number + 1 )) - done - echo ${port_config[*]} | tr ' ' ',' -} - -function start_redfish_emulator { - # TODO(lucasagomes): Use Apache WSGI instead of gunicorn - if is_ubuntu; then - install_package gunicorn - else - pip_install_gr "gunicorn" - fi - - sudo gunicorn sushy_tools.emulator.main:app --bind "${HOST_IP}:${IRONIC_REDFISH_EMULATOR_PORT}" \ - --pid "$IRONIC_REDFISH_EMULATOR_PID_FILE" --daemon -} - -function stop_redfish_emulator { - if [ -f $IRONIC_REDFISH_EMULATOR_PID_FILE ]; then - sudo kill `cat $IRONIC_REDFISH_EMULATOR_PID_FILE` || true - fi -} - -function setup_redfish { - if use_library_from_git "sushy"; then - git_clone_by_name "sushy" - setup_dev_lib "sushy" - else - pip_install_gr "sushy" - fi - - pip_install "sushy-tools" - start_redfish_emulator -} - -# install_ironic() - Install the things! -function install_ironic { - # NOTE(vsaienko) do not check required_services on subnode - if [[ "$HOST_TOPOLOGY_ROLE" != "subnode" ]]; then - # make sure all needed service were enabled - local req_services="key" - if is_service_enabled nova && [[ "$VIRT_DRIVER" == "ironic" ]]; then - req_services+=" nova glance neutron" - fi - for srv in $req_services; do - if ! is_service_enabled "$srv"; then - die $LINENO "$srv should be enabled for Ironic." - fi - done - fi - - if use_library_from_git "ironic-lib"; then - git_clone_by_name "ironic-lib" - setup_dev_lib "ironic-lib" - fi - - setup_develop $IRONIC_DIR - - if [[ "$IRONIC_USE_MOD_WSGI" == "True" || "$IRONIC_IPXE_ENABLED" == "True" ]]; then - install_apache_wsgi - fi - - if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - - # Append the nvram configuration to libvirt if it's not present already - if ! sudo grep -q "^nvram" /etc/libvirt/qemu.conf; then - echo "nvram=[\"$UEFI_LOADER_PATH:$UEFI_NVRAM_PATH\"]" | sudo tee -a /etc/libvirt/qemu.conf - fi - - # Replace the default virtio PXE ROM in QEMU with an EFI capable - # one. The EFI ROM should work on with both boot modes, Legacy - # BIOS and UEFI. - if is_ubuntu; then - # FIXME(lucasagomes): Enable the multiverse repository by - # default in the image running the gate tests. Also move the - # installation of the ovmf package to files/debs/ironic - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) multiverse" - sudo apt-get update - install_package ovmf - - sudo rm /usr/share/qemu/pxe-virtio.rom - sudo ln -s /usr/lib/ipxe/qemu/efi-virtio.rom /usr/share/qemu/pxe-virtio.rom - elif is_fedora; then - sudo rm /usr/share/qemu/pxe-virtio.rom - sudo ln -s /usr/share/ipxe.efi/1af41000.rom /usr/share/qemu/pxe-virtio.rom - fi - - # Restart libvirt to the changes to take effect - restart_libvirt - fi - - if is_deployed_by_ipmitool && [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - setup_virtualbmc - fi - - if is_deployed_by_snmp && [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - setup_virtualpdu - fi - - if is_deployed_by_redfish && [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - setup_redfish - fi - - if is_drac_enabled; then - pip_install python-dracclient - fi -} - -# install_ironicclient() - Collect sources and prepare -function install_ironicclient { - if use_library_from_git "python-ironicclient"; then - git_clone_by_name "python-ironicclient" - setup_dev_lib "python-ironicclient" - sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ironicclient"]}/tools/,/etc/bash_completion.d/}ironic.bash_completion - else - # nothing actually "requires" ironicclient, so force instally from pypi - pip_install_gr python-ironicclient - fi -} - -# _cleanup_ironic_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file -function _cleanup_ironic_apache_wsgi { - sudo rm -rf $IRONIC_HTTP_DIR - sudo rm -rf $IRONIC_WSGI_DIR - disable_apache_site ironic-api - disable_apache_site ipxe-ironic - sudo rm -f $(apache_site_config_for ironic-api) - sudo rm -f $(apache_site_config_for ipxe-ironic) - restart_apache_server -} - -# _config_ironic_apache_wsgi() - Set WSGI config files of Ironic -function _config_ironic_apache_wsgi { - local ironic_apache_conf - local ipxe_apache_conf - if [[ "$IRONIC_USE_MOD_WSGI" == "True" ]]; then - sudo mkdir -p $IRONIC_WSGI_DIR - sudo cp $IRONIC_DIR/ironic/api/app.wsgi $IRONIC_WSGI_DIR/app.wsgi - ironic_apache_conf=$(apache_site_config_for ironic-api) - sudo cp $IRONIC_DEVSTACK_FILES_DIR/apache-ironic-api.template $ironic_apache_conf - sudo sed -e " - s|%IRONIC_SERVICE_PORT%|$IRONIC_SERVICE_PORT|g; - s|%IRONIC_WSGI_DIR%|$IRONIC_WSGI_DIR|g; - s|%USER%|$STACK_USER|g; - s|%APIWORKERS%|$API_WORKERS|g; - s|%APACHE_NAME%|$APACHE_NAME|g; - " -i $ironic_apache_conf - enable_apache_site ironic-api - tail_log ir-access /var/log/$APACHE_NAME/ironic-api-access.log - tail_log ir-api /var/log/$APACHE_NAME/ironic-api.log - fi - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]]; then - ipxe_apache_conf=$(apache_site_config_for ipxe-ironic) - sudo cp $IRONIC_DEVSTACK_FILES_DIR/apache-ipxe-ironic.template $ipxe_apache_conf - sudo sed -e " - s|%PUBLICPORT%|$IRONIC_HTTP_PORT|g; - s|%HTTPROOT%|$IRONIC_HTTP_DIR|g; - " -i $ipxe_apache_conf - enable_apache_site ipxe-ironic - fi -} - -# cleanup_ironic_config_files() - Remove residual cache/config/log files, -# left over from previous runs that would need to clean up. -function cleanup_ironic_config_files { - sudo rm -rf $IRONIC_AUTH_CACHE_DIR $IRONIC_CONF_DIR - sudo rm -rf $IRONIC_VM_LOG_DIR/* -} - -# cleanup_ironic() - Clean everything left from Ironic -function cleanup_ironic { - cleanup_ironic_config_files - - # Cleanup the WSGI files - _cleanup_ironic_apache_wsgi - - # It's noop if no emulator is running - stop_redfish_emulator - - # Remove the hook to disable log rotate - sudo rm -rf $IRONIC_LIBVIRT_HOOKS_PATH/qemu -} - -# configure_ironic_dirs() - Create all directories required by Ironic and -# associated services. -function configure_ironic_dirs { - sudo install -d -o $STACK_USER $IRONIC_CONF_DIR $STACK_USER $IRONIC_DATA_DIR \ - $IRONIC_STATE_PATH $IRONIC_TFTPBOOT_DIR $IRONIC_TFTPBOOT_DIR/pxelinux.cfg - sudo chown -R $STACK_USER:$STACK_USER $IRONIC_TFTPBOOT_DIR - - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]]; then - sudo install -d -o $STACK_USER -g $STACK_USER $IRONIC_HTTP_DIR - fi - - if [ ! -f "$IRONIC_PXE_BOOT_IMAGE" ]; then - die $LINENO "PXE boot file $IRONIC_PXE_BOOT_IMAGE not found." - fi - - # Copy PXE binary - cp $IRONIC_PXE_BOOT_IMAGE $IRONIC_TFTPBOOT_DIR - setup_syslinux_modules - - if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - local uefi_ipxe_boot_file - local uefi_loader - local uefi_nvram - - uefi_ipxe_boot_file=$(get_uefi_ipxe_boot_file) - if [ ! -f $uefi_ipxe_boot_file ]; then - die $LINENO "iPXE UEFI boot file $uefi_pxe_bootfile_name not found." - fi - - cp $uefi_ipxe_boot_file $IRONIC_TFTPBOOT_DIR - - # Copy the OVMF images to libvirt's path - uefi_loader=$(get_uefi_loader) - uefi_nvram=$(get_uefi_nvram) - sudo cp $uefi_loader $UEFI_LOADER_PATH - sudo cp $uefi_nvram $UEFI_NVRAM_PATH - fi - - # Create the logs directory when saving the deploy logs to the filesystem - if [[ "$IRONIC_DEPLOY_LOGS_STORAGE_BACKEND" == "local" && "$IRONIC_DEPLOY_LOGS_COLLECT" != "never" ]]; then - install -d -o $STACK_USER $IRONIC_DEPLOY_LOGS_LOCAL_PATH - fi -} - -function configure_ironic_networks { - - if [[ -n "${IRONIC_PROVISION_NETWORK_NAME}" ]]; then - echo_summary "Configuring Ironic provisioning network" - configure_ironic_provision_network - fi - - echo_summary "Configuring Ironic cleaning network" - configure_ironic_cleaning_network -} - -function configure_ironic_cleaning_network { - iniset $IRONIC_CONF_FILE neutron cleaning_network $IRONIC_CLEAN_NET_NAME -} - -function configure_ironic_provision_network { - local net_id - local ironic_provision_network_ip - # NOTE(vsaienko) For multinode case there is no need to create a new provisioning - # network on subnode, as it was created on primary node. Just get an existed network UUID. - if [[ "$HOST_TOPOLOGY_ROLE" != 'subnode' ]]; then - die_if_not_set $LINENO IRONIC_PROVISION_SUBNET_PREFIX "You must specify the IRONIC_PROVISION_SUBNET_PREFIX" - die_if_not_set $LINENO PHYSICAL_NETWORK "You must specify the PHYSICAL_NETWORK" - die_if_not_set $LINENO IRONIC_PROVISION_SUBNET_GATEWAY "You must specify the IRONIC_PROVISION_SUBNET_GATEWAY" - - net_id=$(openstack network create --provider-network-type $IRONIC_PROVISION_PROVIDER_NETWORK_TYPE \ - --provider-physical-network "$PHYSICAL_NETWORK" \ - ${IRONIC_PROVISION_SEGMENTATION_ID:+--provider-segment $IRONIC_PROVISION_SEGMENTATION_ID} \ - ${IRONIC_PROVISION_NETWORK_NAME} -f value -c id) - - die_if_not_set $LINENO net_id "Failure creating net_id for $IRONIC_PROVISION_NETWORK_NAME" - local subnet_id - subnet_id="$(openstack subnet create --ip-version 4 \ - ${IRONIC_PROVISION_ALLOCATION_POOL:+--allocation-pool $IRONIC_PROVISION_ALLOCATION_POOL} \ - $IRONIC_PROVISION_PROVIDER_SUBNET_NAME \ - --gateway $IRONIC_PROVISION_SUBNET_GATEWAY --network $net_id \ - --subnet-range $IRONIC_PROVISION_SUBNET_PREFIX -f value -c id)" - - die_if_not_set $LINENO subnet_id "Failure creating SUBNET_ID for $IRONIC_PROVISION_NETWORK_NAME" - - ironic_provision_network_ip=$IRONIC_PROVISION_SUBNET_GATEWAY - else - net_id=$(openstack network show $IRONIC_PROVISION_NETWORK_NAME -f value -c id) - ironic_provision_network_ip=$IRONIC_PROVISION_SUBNET_SUBNODE_IP - fi - - IRONIC_PROVISION_SEGMENTATION_ID=${IRONIC_PROVISION_SEGMENTATION_ID:-`openstack network show ${net_id} -f value -c provider:segmentation_id`} - provision_net_prefix=${IRONIC_PROVISION_SUBNET_PREFIX##*/} - - # Set provision network GW on physical interface - # Add vlan on br interface in case of IRONIC_PROVISION_PROVIDER_NETWORK_TYPE==vlan - # othervise assign ip to br interface directly. - if [[ "$IRONIC_PROVISION_PROVIDER_NETWORK_TYPE" == "vlan" ]]; then - sudo ip link add link $OVS_PHYSICAL_BRIDGE name $OVS_PHYSICAL_BRIDGE.$IRONIC_PROVISION_SEGMENTATION_ID type vlan id $IRONIC_PROVISION_SEGMENTATION_ID - sudo ip link set dev $OVS_PHYSICAL_BRIDGE up - sudo ip link set dev $OVS_PHYSICAL_BRIDGE.$IRONIC_PROVISION_SEGMENTATION_ID up - sudo ip addr add dev $OVS_PHYSICAL_BRIDGE.$IRONIC_PROVISION_SEGMENTATION_ID $ironic_provision_network_ip/$provision_net_prefix - else - sudo ip link set dev $OVS_PHYSICAL_BRIDGE up - sudo ip addr add dev $OVS_PHYSICAL_BRIDGE $ironic_provision_network_ip/$provision_net_prefix - fi - - iniset $IRONIC_CONF_FILE neutron provisioning_network $IRONIC_PROVISION_NETWORK_NAME -} - -function cleanup_ironic_provision_network { - # Cleanup OVS_PHYSICAL_BRIDGE subinterfaces - local bridge_subint - bridge_subint=$(cat /proc/net/dev | sed -n "s/^\(${OVS_PHYSICAL_BRIDGE}\.[0-9]*\).*/\1/p") - for sub_int in $bridge_subint; do - sudo ip link set dev $sub_int down - sudo ip link del dev $sub_int - done -} - -# configure_ironic() - Set config files, create data dirs, etc -function configure_ironic { - configure_ironic_dirs - - # Copy over ironic configuration file and configure common parameters. - cp $IRONIC_DIR/etc/ironic/ironic.conf.sample $IRONIC_CONF_FILE - iniset $IRONIC_CONF_FILE DEFAULT debug True - inicomment $IRONIC_CONF_FILE DEFAULT log_file - iniset $IRONIC_CONF_FILE database connection `database_connection_url ironic` - iniset $IRONIC_CONF_FILE DEFAULT state_path $IRONIC_STATE_PATH - iniset $IRONIC_CONF_FILE DEFAULT use_syslog $SYSLOG - # NOTE(vsaienko) with multinode each conductor should have its own host. - iniset $IRONIC_CONF_FILE DEFAULT host $LOCAL_HOSTNAME - # Retrieve deployment logs - iniset $IRONIC_CONF_FILE agent deploy_logs_collect $IRONIC_DEPLOY_LOGS_COLLECT - iniset $IRONIC_CONF_FILE agent deploy_logs_storage_backend $IRONIC_DEPLOY_LOGS_STORAGE_BACKEND - iniset $IRONIC_CONF_FILE agent deploy_logs_local_path $IRONIC_DEPLOY_LOGS_LOCAL_PATH - - # Configure Ironic conductor, if it was enabled. - if is_service_enabled ir-cond; then - configure_ironic_conductor - fi - - # Configure Ironic API, if it was enabled. - if is_service_enabled ir-api; then - configure_ironic_api - fi - - # Format logging - setup_logging $IRONIC_CONF_FILE - - # Adds WSGI for Ironic API - if [[ "$IRONIC_USE_MOD_WSGI" == "True" || "$IRONIC_IPXE_ENABLED" == "True" ]]; then - _config_ironic_apache_wsgi - fi - - if [[ "$os_VENDOR" =~ (Debian|Ubuntu) ]]; then - # The groups change with newer libvirt. Older Ubuntu used - # 'libvirtd', but now uses libvirt like Debian. Do a quick check - # to see if libvirtd group already exists to handle grenade's case. - LIBVIRT_GROUP=$(cut -d ':' -f 1 /etc/group | grep 'libvirtd$' || true) - LIBVIRT_GROUP=${LIBVIRT_GROUP:-libvirt} - else - LIBVIRT_GROUP=libvirtd - fi - if ! getent group $LIBVIRT_GROUP >/dev/null; then - sudo groupadd $LIBVIRT_GROUP - fi - # NOTE(vsaienko) Add stack to libvirt group when installing without nova. - if ! is_service_enabled nova; then - add_user_to_group $STACK_USER $LIBVIRT_GROUP - - # This is the basic set of devices allowed / required by all virtual machines. - # Add /dev/net/tun to cgroup_device_acl, needed for type=ethernet interfaces - if ! sudo grep -q '^cgroup_device_acl' /etc/libvirt/qemu.conf; then - cat <$tempfile - chmod 0440 $tempfile - sudo chown root:root $tempfile - sudo mv $tempfile /etc/sudoers.d/ironic-rootwrap - - # set up drivers / hardware types - iniset $IRONIC_CONF_FILE DEFAULT enabled_drivers $IRONIC_ENABLED_DRIVERS - iniset $IRONIC_CONF_FILE DEFAULT enabled_hardware_types $IRONIC_ENABLED_HARDWARE_TYPES - - configure_enabled_interfaces "boot" $IRONIC_ENABLED_BOOT_INTERFACES - configure_enabled_interfaces "deploy" $IRONIC_ENABLED_DEPLOY_INTERFACES - configure_enabled_interfaces "management" $IRONIC_ENABLED_MANAGEMENT_INTERFACES - configure_enabled_interfaces "power" $IRONIC_ENABLED_POWER_INTERFACES - configure_enabled_interfaces "console" $IRONIC_ENABLED_CONSOLE_INTERFACES - configure_enabled_interfaces "inspect" $IRONIC_ENABLED_INSPECT_INTERFACES - configure_enabled_interfaces "raid" $IRONIC_ENABLED_RAID_INTERFACES - configure_enabled_interfaces "vendor" $IRONIC_ENABLED_VENDOR_INTERFACES - configure_enabled_interfaces "storage" $IRONIC_ENABLED_STORAGE_INTERFACES - configure_enabled_interfaces "network" $IRONIC_ENABLED_NETWORK_INTERFACES - - if is_deployed_by_redfish; then - # TODO(lucasagomes): We need to make it easier to configure - # specific driver interfaces in DevStack - iniset $IRONIC_CONF_FILE DEFAULT enabled_power_interfaces "redfish" - iniset $IRONIC_CONF_FILE DEFAULT enabled_management_interfaces "redfish" - fi - - iniset $IRONIC_CONF_FILE DEFAULT rootwrap_config $IRONIC_ROOTWRAP_CONF - iniset $IRONIC_CONF_FILE conductor api_url $IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT - if [[ -n "$IRONIC_CALLBACK_TIMEOUT" ]]; then - iniset $IRONIC_CONF_FILE conductor deploy_callback_timeout $IRONIC_CALLBACK_TIMEOUT - fi - iniset $IRONIC_CONF_FILE pxe tftp_server $IRONIC_TFTPSERVER_IP - iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR - iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images - if [[ "$IRONIC_TERMINAL_SSL" == "True" ]]; then - # Make sure the cert directory exist - sudo mkdir -p $IRONIC_TERMINAL_CERT_DIR - sudo chown $STACK_USER $IRONIC_TERMINAL_CERT_DIR - iniset $IRONIC_CONF_FILE console terminal_cert_dir $IRONIC_TERMINAL_CERT_DIR - # Generate the SSL certificate - openssl req \ - -x509 \ - -days 365 \ - -newkey rsa:1024 \ - -nodes \ - -keyout $IRONIC_TERMINAL_CERT_DIR/certificate.pem.key \ - -out $IRONIC_TERMINAL_CERT_DIR/certificate.pem \ - -subj '/O=OpenStack/OU=DevStack Servers' - fi - - local pxe_params="nofb nomodeset vga=normal console=${IRONIC_TTY_DEV}" - pxe_params+=" systemd.journald.forward_to_console=yes" - - pxe_params+=" $IRONIC_EXTRA_PXE_PARAMS" - - if [[ -n "$pxe_params" ]]; then - iniset $IRONIC_CONF_FILE pxe pxe_append_params "$pxe_params" - fi - - # Set these options for scenarios in which the agent fetches the image - # directly from glance, and don't set them where the image is pushed - # over iSCSI. - if is_glance_configuration_required; then - if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]] ; then - iniset $IRONIC_CONF_FILE glance swift_temp_url_key $SWIFT_TEMPURL_KEY - else - die $LINENO "SWIFT_ENABLE_TEMPURLS must be True. This is " \ - "required either because IRONIC_DEPLOY_DRIVER was " \ - "set to some agent_* driver OR configuration of " \ - "Glance with Swift was explicitly requested with " \ - "IRONIC_CONFIGURE_GLANCE_WITH_SWIFT=True" - fi - iniset $IRONIC_CONF_FILE glance swift_endpoint_url ${SWIFT_SERVICE_PROTOCOL}://${SERVICE_HOST}:${SWIFT_DEFAULT_BIND_PORT:-8080} - iniset $IRONIC_CONF_FILE glance swift_api_version v1 - local tenant_id - tenant_id=$(get_or_create_project $SERVICE_PROJECT_NAME default) - iniset $IRONIC_CONF_FILE glance swift_account AUTH_${tenant_id} - iniset $IRONIC_CONF_FILE glance swift_container glance - iniset $IRONIC_CONF_FILE glance swift_temp_url_duration 3600 - fi - - if is_deployed_by_agent; then - iniset $IRONIC_CONF_FILE api ramdisk_heartbeat_timeout 30 - fi - - # FIXME: this really needs to be tested in the gate. For now, any - # test using the agent ramdisk should skip the erase_devices clean - # step because it is too slow to run in the gate. - iniset $IRONIC_CONF_FILE deploy erase_devices_priority 0 - - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - local pxebin - pxebin=`basename $IRONIC_PXE_BOOT_IMAGE` - uefipxebin=`basename $(get_uefi_ipxe_boot_file)` - iniset $IRONIC_CONF_FILE pxe ipxe_enabled True - iniset $IRONIC_CONF_FILE pxe pxe_config_template '$pybasedir/drivers/modules/ipxe_config.template' - iniset $IRONIC_CONF_FILE pxe pxe_bootfile_name $pxebin - iniset $IRONIC_CONF_FILE pxe uefi_pxe_config_template '$pybasedir/drivers/modules/ipxe_config.template' - iniset $IRONIC_CONF_FILE pxe uefi_pxe_bootfile_name $uefipxebin - iniset $IRONIC_CONF_FILE deploy http_root $IRONIC_HTTP_DIR - iniset $IRONIC_CONF_FILE deploy http_url "http://$IRONIC_HTTP_SERVER:$IRONIC_HTTP_PORT" - if [[ "$IRONIC_IPXE_USE_SWIFT" == "True" ]]; then - iniset $IRONIC_CONF_FILE pxe ipxe_use_swift True - fi - fi - - if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - iniset $IRONIC_CONF_FILE neutron port_setup_delay 15 - fi - - iniset $IRONIC_CONF_FILE dhcp dhcp_provider $IRONIC_DHCP_PROVIDER - - iniset $IRONIC_CONF_FILE deploy default_boot_option $IRONIC_DEFAULT_BOOT_OPTION -} - -# create_ironic_cache_dir() - Part of the init_ironic() process -function create_ironic_cache_dir { - # Create cache dir - sudo mkdir -p $IRONIC_AUTH_CACHE_DIR/api - sudo chown $STACK_USER $IRONIC_AUTH_CACHE_DIR/api - rm -f $IRONIC_AUTH_CACHE_DIR/api/* - sudo mkdir -p $IRONIC_AUTH_CACHE_DIR/registry - sudo chown $STACK_USER $IRONIC_AUTH_CACHE_DIR/registry - rm -f $IRONIC_AUTH_CACHE_DIR/registry/* -} - -# create_ironic_accounts() - Set up common required ironic accounts - -# Project User Roles -# ------------------------------------------------------------------ -# service ironic admin -# service nova baremetal_admin -# demo demo baremetal_observer -function create_ironic_accounts { - if [[ "$ENABLED_SERVICES" =~ "ir-api" && "$ENABLED_SERVICES" =~ "key" ]]; then - # Define service and endpoints in Keystone - get_or_create_service "ironic" "baremetal" "Ironic baremetal provisioning service" - get_or_create_endpoint "baremetal" \ - "$REGION_NAME" \ - "$IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT" \ - "$IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT" \ - "$IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT" - - # Create ironic service user - # TODO(deva): make this work with the 'service' role - # https://bugs.launchpad.net/ironic/+bug/1605398 - create_service_user "ironic" "admin" - - # Create additional bare metal tenant and roles - get_or_create_role baremetal_admin - get_or_create_role baremetal_observer - if is_service_enabled nova; then - get_or_add_user_project_role baremetal_admin nova $SERVICE_PROJECT_NAME - fi - get_or_add_user_project_role baremetal_observer demo demo - fi -} - - -# init_ironic() - Initialize databases, etc. -function init_ironic { - - if [[ "$HOST_TOPOLOGY_ROLE" != "subnode" ]]; then - # (Re)create ironic database - recreate_database ironic - - # Migrate ironic database - $IRONIC_BIN_DIR/ironic-dbsync --config-file=$IRONIC_CONF_FILE - fi - create_ironic_cache_dir -} - -# _ironic_bm_vm_names() - Generates list of names for baremetal VMs. -function _ironic_bm_vm_names { - local idx - local num_vms - num_vms=$(($IRONIC_VM_COUNT - 1)) - for idx in $(seq 0 $num_vms); do - echo "$(get_ironic_node_prefix)-${idx}" - done -} - -# start_ironic() - Start running processes, including screen -function start_ironic { - # Start Ironic API server, if enabled. - if is_service_enabled ir-api; then - start_ironic_api - fi - - # Start Ironic conductor, if enabled. - if is_service_enabled ir-cond; then - start_ironic_conductor - fi - - # Start Apache if iPXE is enabled - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - restart_apache_server - fi - - if is_service_enabled ir-vpdu; then - start_virtualpdu - fi -} - -# start_ironic_api() - Used by start_ironic(). -# Starts Ironic API server. -function start_ironic_api { - if [[ "$IRONIC_USE_MOD_WSGI" == "True" ]]; then - restart_apache_server - else - run_process ir-api "$IRONIC_BIN_DIR/ironic-api --config-file=$IRONIC_CONF_FILE" - fi - echo "Waiting for ir-api ($IRONIC_HOSTPORT) to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT/; do sleep 1; done"; then - die $LINENO "ir-api did not start" - fi -} - -# start_ironic_conductor() - Used by start_ironic(). -# Starts Ironic conductor. -function start_ironic_conductor { - run_process ir-cond "$IRONIC_BIN_DIR/ironic-conductor --config-file=$IRONIC_CONF_FILE" - # TODO(romcheg): Find a way to check whether the conductor has started. -} - -# Starts VirtualPDU -function start_virtualpdu { - run_process ir-vpdu "$(which virtualpdu) $IRONIC_VPDU_CONFIG_FILE" libvirt -} - - -# stop_ironic() - Stop running processes -function stop_ironic { - if [[ "$IRONIC_USE_MOD_WSGI" == "True" ]]; then - disable_apache_site ironic-api - else - stop_process ir-api - fi - stop_process ir-cond -} - -# create_ovs_taps is also called by the devstack/upgrade/resources.sh script -# -# create_ovs_taps ironic_network_id -# NOTE(vsaienko) Ironic supports only Flat Neutron network. -# create_ovs_taps are needed in order to provide connectivity from ironic-conductor -# to VM. With Neutron Flat network it will be not needed. -function create_ovs_taps { - local ironic_net_id - ironic_net_id=$1 - die_if_not_set $LINENO ironic_net_id "Failed to get ironic network id" - - # Work around: No netns exists on host until a Neutron port is created. We - # need to create one in Neutron to know what netns to tap into prior to the - # first node booting. - local port_id - port_id=$(neutron port-create ${ironic_net_id} | grep " id " | get_field 2) - # NOTE(vsaienko) openstack port create was introduced in Newton. - # Since the function is used during upgrade, it should be backward compatible with Mitaka. - # Switch to openstack port create in Ocata release. - #port_id=$(openstack port create --network ${ironic_net_id} temp_port -c id -f value) - die_if_not_set $LINENO port_id "Failed to create neutron port" - - # intentional sleep to make sure the tag has been set to port - sleep 10 - - local tapdev - tapdev=$(sudo ip netns exec qdhcp-${ironic_net_id} ip link list | grep " tap" | cut -d':' -f2 | cut -d'@' -f1 | cut -b2-) - die_if_not_set $LINENO tapdev "Failed to get tap device id" - local tag_id - tag_id=$(sudo ovs-vsctl get port ${tapdev} tag) - die_if_not_set $LINENO tag_id "Failed to get tag id" - - local ovs_tap=ovs-tap - local brbm_tap=brbm-tap - # make sure veth pair is not existing, otherwise delete its links - sudo ip link show $ovs_tap && sudo ip link delete $ovs_tap - sudo ip link show $brbm_tap && sudo ip link delete $brbm_tap - # create veth pair for future interconnection between br-int and brbm - sudo ip link add $brbm_tap type veth peer name $ovs_tap - sudo ip link set dev $brbm_tap up - sudo ip link set dev $ovs_tap up - - sudo ovs-vsctl -- --if-exists del-port $ovs_tap -- add-port br-int $ovs_tap tag=$tag_id - sudo ovs-vsctl -- --if-exists del-port $brbm_tap -- add-port $IRONIC_VM_NETWORK_BRIDGE $brbm_tap - - # Remove the port needed only for workaround. - openstack port delete $port_id - - # Finally, share the fixed tenant network across all tenants. This allows the host - # to serve TFTP to a single network namespace via the tap device created above. - openstack network set $ironic_net_id --share -} - -function setup_qemu_log_hook { - # Make sure the libvirt hooks directory exist - sudo mkdir -p $IRONIC_LIBVIRT_HOOKS_PATH - - # Copy the qemu hook to the right directory - sudo cp $IRONIC_DEVSTACK_FILES_DIR/hooks/qemu.py $IRONIC_LIBVIRT_HOOKS_PATH/qemu - sudo chmod -v +x $IRONIC_LIBVIRT_HOOKS_PATH/qemu - sudo sed -e " - s|%LOG_DIR%|$IRONIC_VM_LOG_DIR|g; - " -i $IRONIC_LIBVIRT_HOOKS_PATH/qemu - - restart_libvirt - mkdir -p $IRONIC_VM_LOG_DIR - cat >${IRONIC_VM_LOG_DIR}/README << EOF -This directory contains the serial console log files from the virtual Ironic -bare-metal nodes. The *_console_* log files are the original log files and -include ANSI control codes which can make the output difficult to read. The -*_no_ansi_* log files have had ANSI control codes removed from the file and are -easier to read. - -On some occasions there won't be a corresponding *_no_ansi_* log file, for -example if the job failed due to a time-out. You may see a log file without a -date/time in the file name. In that case you can display the logfile in your -console by doing: - $ curl URL_TO_LOGFILE - -This will have your terminal process the ANSI escape codes. - -Another option, if you have the 'pv' executable installed, is to simulate a -low-speed connection. In this example simulate a 300 Bytes/second connection. - $ curl URL_TO_LOGFILE | pv -q -L 300 - -This can allow you to see some of the content before the screen is cleared by -an ANSI escape sequence. - -EOF -} - -function create_bridge_and_vms { - # Call libvirt setup scripts in a new shell to ensure any new group membership - sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/setup-network.sh $IRONIC_VM_NETWORK_BRIDGE $PUBLIC_BRIDGE_MTU" - if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then - local log_arg="-l $IRONIC_VM_LOG_DIR" - - if [[ "$IRONIC_VM_LOG_ROTATE" == "True" ]] ; then - setup_qemu_log_hook - fi - else - local log_arg="" - fi - - local vbmc_port=$IRONIC_VBMC_PORT_RANGE_START - local pdu_outlet=$IRONIC_VPDU_PORT_RANGE_START - local vm_name - local vm_opts="" - if [[ -n "$IRONIC_VM_EMULATOR" ]]; then - vm_opts+=" -e $IRONIC_VM_EMULATOR" - fi - vm_opts+=" -E $IRONIC_VM_ENGINE" - - if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - vm_opts+=" -L $UEFI_LOADER_PATH -N $UEFI_NVRAM_PATH" - fi - - local bridge_mac - bridge_mac=$(ip link show dev $IRONIC_VM_NETWORK_BRIDGE | grep -Eo "ether [A-Za-z0-9:]+"|sed "s/ether\ //") - - for vm_name in $(_ironic_bm_vm_names); do - sudo -E su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/create-node.sh -n $vm_name \ - -c $IRONIC_VM_SPECS_CPU -m $IRONIC_VM_SPECS_RAM -d $IRONIC_VM_SPECS_DISK \ - -a $IRONIC_VM_SPECS_CPU_ARCH -b $IRONIC_VM_NETWORK_BRIDGE $vm_opts -p $vbmc_port -o $pdu_outlet \ - -i $IRONIC_VM_INTERFACE_COUNT -f $IRONIC_VM_SPECS_DISK_FORMAT -M $PUBLIC_BRIDGE_MTU $log_arg" >> $IRONIC_VM_MACS_CSV_FILE - echo " ${bridge_mac} $IRONIC_VM_NETWORK_BRIDGE" >> $IRONIC_VM_MACS_CSV_FILE - - vbmc_port=$((vbmc_port+1)) - pdu_outlet=$((pdu_outlet+1)) - done - - if [[ -z "${IRONIC_PROVISION_NETWORK_NAME}" ]]; then - local ironic_net_id - ironic_net_id=$(openstack network show "$PRIVATE_NETWORK_NAME" -c id -f value) - create_ovs_taps $ironic_net_id - - # NOTE(vsaienko) Neutron no longer setup routing to private network. - # https://github.com/openstack-dev/devstack/commit/1493bdeba24674f6634160d51b8081c571df4017 - # Add route here to have connection to VMs during provisioning. - local pub_router_id - local r_net_gateway - pub_router_id=$(openstack router show $Q_ROUTER_NAME -f value -c id) - r_net_gateway=$(sudo ip netns exec qrouter-$pub_router_id ip -4 route get 8.8.8.8 |grep dev | awk '{print $7}') - local replace_range=${SUBNETPOOL_PREFIX_V4} - if [[ -z "${SUBNETPOOL_V4_ID}" ]]; then - replace_range=${FIXED_RANGE} - fi - sudo ip route replace $replace_range via $r_net_gateway - fi - -} - -function wait_for_nova_resources { - # TODO(jroll) if IRONIC_USE_RESOURCE_CLASSES, use the placement engine instead - - # After nodes have been enrolled, we need to wait for both ironic and - # nova's periodic tasks to populate the resource tracker with available - # nodes and resources. Wait up to 2 minutes for a given resource before - # timing out. - local resource=$1 - local expected_count=$2 - local i - echo_summary "Waiting 2 minutes for Nova resource tracker to pick up $resource >= $expected_count" - for i in $(seq 1 120); do - if [ $(openstack hypervisor stats show -f value -c $resource) -ge $expected_count ]; then - return 0 - fi - if is_service_enabled n-api; then - $TOP_DIR/tools/discover_hosts.sh - fi - sleep 1 - done - die $LINENO "Timed out waiting for Nova hypervisor-stats $resource >= $expected_count" -} - -function _clean_ncpu_failure { - SCREEN_NAME=${SCREEN_NAME:-stack} - SERVICE_DIR=${SERVICE_DIR:-${DEST}/status} - n_cpu_failure="$SERVICE_DIR/$SCREEN_NAME/n-cpu.failure" - if [ -f ${n_cpu_failure} ]; then - mv ${n_cpu_failure} "${n_cpu_failure}.before-restart-by-ironic" - fi -} - -function enroll_nodes { - local chassis_id - chassis_id=$(ironic chassis-create -d "ironic test chassis" | grep " uuid " | get_field 2) - die_if_not_set $LINENO chassis_id "Failed to create chassis" - - local node_prefix - node_prefix=$(get_ironic_node_prefix) - - local interface_info - - if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - local ironic_node_cpu=$IRONIC_VM_SPECS_CPU - local ironic_node_ram=$IRONIC_VM_SPECS_RAM - local ironic_node_disk=$IRONIC_VM_SPECS_DISK - local ironic_ephemeral_disk=$IRONIC_VM_EPHEMERAL_DISK - local ironic_node_arch=x86_64 - local ironic_hwinfo_file=$IRONIC_VM_MACS_CSV_FILE - - if is_deployed_by_ipmitool; then - local node_options="\ - -i ipmi_address=${HOST_IP} \ - -i ipmi_username=admin \ - -i ipmi_password=password" - elif is_deployed_by_snmp; then - local node_options="\ - -i snmp_driver=${IRONIC_VPDU_SNMPDRIVER} \ - -i snmp_address=${HOST_IP} \ - -i snmp_port=${IRONIC_VPDU_LISTEN_PORT} \ - -i snmp_protocol=2c \ - -i snmp_community=${IRONIC_VPDU_COMMUNITY}" - elif is_deployed_by_redfish; then - local node_options="\ - -i redfish_address=http://${HOST_IP}:${IRONIC_REDFISH_EMULATOR_PORT} \ - -i redfish_username=admin \ - -i redfish_password=password" - else - local node_options="\ - -i ssh_virt_type=$IRONIC_SSH_VIRT_TYPE \ - -i ssh_address=$IRONIC_VM_SSH_ADDRESS \ - -i ssh_port=$IRONIC_VM_SSH_PORT \ - -i ssh_username=$IRONIC_SSH_USERNAME \ - -i ssh_key_filename=$IRONIC_KEY_FILE" - fi - node_options="\ - $node_options \ - -i deploy_kernel=$IRONIC_DEPLOY_KERNEL_ID \ - -i deploy_ramdisk=$IRONIC_DEPLOY_RAMDISK_ID" - - else - local ironic_node_cpu=$IRONIC_HW_NODE_CPU - local ironic_node_ram=$IRONIC_HW_NODE_RAM - local ironic_node_disk=$IRONIC_HW_NODE_DISK - local ironic_ephemeral_disk=$IRONIC_HW_EPHEMERAL_DISK - local ironic_node_arch=$IRONIC_HW_ARCH - local ironic_hwinfo_file=$IRONIC_HWINFO_FILE - fi - - local total_nodes=0 - local total_cpus=0 - - while read hardware_info; do - local node_name - node_name=$node_prefix-$total_nodes - - local node_capabilities="" - if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - node_capabilities+=" -p capabilities=boot_mode:uefi" - fi - - if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - interface_info=$(echo $hardware_info | awk '{print $1}') - - if is_deployed_by_ipmitool; then - local vbmc_port - vbmc_port=$(echo $hardware_info | awk '{print $2}') - node_options+=" -i ipmi_port=$vbmc_port" - elif is_deployed_by_snmp; then - local pdu_outlet - pdu_outlet=$(echo $hardware_info | awk '{print $3}') - node_options+=" -i snmp_outlet=$pdu_outlet" - elif is_deployed_by_redfish; then - node_options+=" -i redfish_system_id=/redfish/v1/Systems/$node_name" - fi - # Local-link-connection options - local llc_opts="" - if [[ "${IRONIC_USE_LINK_LOCAL}" == "True" ]]; then - local switch_info - local switch_id - - switch_id=$(echo $hardware_info |awk '{print $4}') - switch_info=$(echo $hardware_info |awk '{print $5}') - - # NOTE(vsaienko) we will add port_id later in the code. - llc_opts="-l switch_id=${switch_id} -l switch_info=${switch_info} " - - local ironic_api_version='--ironic-api-version latest' - fi - - if [[ "${IRONIC_STORAGE_INTERFACE}" == "cinder" ]]; then - local connector_iqn="iqn.2017-05.org.openstack.$node_prefix-$total_nodes" - if [[ -n "$node_capabilities" ]]; then - node_capabilities+=",iscsi_boot:True" - else - node_capabilities+=" -p capabilities=iscsi_boot:True" - fi - fi - - else - # Currently we require all hardware platform have same CPU/RAM/DISK info - # in future, this can be enhanced to support different type, and then - # we create the bare metal flavor with minimum value - local bmc_address - bmc_address=$(echo $hardware_info |awk '{print $1}') - local mac_address - mac_address=$(echo $hardware_info |awk '{print $2}') - local bmc_username - bmc_username=$(echo $hardware_info |awk '{print $3}') - local bmc_passwd - bmc_passwd=$(echo $hardware_info |awk '{print $4}') - local node_options="-i deploy_kernel=$IRONIC_DEPLOY_KERNEL_ID" - node_options+=" -i deploy_ramdisk=$IRONIC_DEPLOY_RAMDISK_ID" - - if is_deployed_by_ipmitool; then - node_options+=" -i ipmi_address=$bmc_address -i ipmi_password=$bmc_passwd\ - -i ipmi_username=$bmc_username" - elif is_deployed_by_cimc; then - node_options+=" -i cimc_address=$bmc_address -i cimc_password=$bmc_passwd\ - -i cimc_username=$bmc_username" - elif is_deployed_by_ucs; then - local ucs_service_profile - ucs_service_profile=$(echo $hardware_info |awk '{print $5}') - node_options+=" -i ucs_address=$bmc_address -i ucs_password=$bmc_passwd\ - -i ucs_username=$bmc_username -i ucs_service_profile=$ucs_service_profile" - elif is_deployed_by_oneview; then - local server_hardware_uri - server_hardware_uri=$(echo $hardware_info |awk '{print $1}') - local server_hardware_type_uri - server_hardware_type_uri=$(echo $hardware_info |awk '{print $2}') - local enclosure_group_uri - enclosure_group_uri=$(echo $hardware_info |awk '{print $3}') - local server_profile_template_uri - server_profile_template_uri=$(echo $hardware_info |awk '{print $4}') - mac_address=$(echo $hardware_info |awk '{print $5}') - local applied_server_profile_uri - applied_server_profile_uri=$(echo $hardware_info |awk '{print $6}') - - node_options+=" -i server_hardware_uri=$server_hardware_uri" - if [[ -n "$applied_server_profile_uri" ]]; then - node_options+=" -i applied_server_profile_uri=$applied_server_profile_uri" - fi - - if [[ "$node_capabilities" ]]; then - node_capabilities+="," - else - node_capabilities+=" -p capabilities=" - fi - node_capabilities+="server_hardware_type_uri:$server_hardware_type_uri," - node_capabilities+="enclosure_group_uri:$enclosure_group_uri," - node_capabilities+="server_profile_template_uri:$server_profile_template_uri" - elif is_deployed_by_ilo; then - node_options+=" -i ilo_address=$bmc_address -i ilo_password=$bmc_passwd\ - -i ilo_username=$bmc_username" - if [[ $IRONIC_DEPLOY_DRIVER != "pxe_ilo" ]]; then - node_options+=" -i ilo_deploy_iso=$IRONIC_DEPLOY_ISO_ID" - fi - elif is_deployed_by_drac; then - node_options+=" -i drac_host=$bmc_address -i drac_password=$bmc_passwd\ - -i drac_username=$bmc_username" - fi - - interface_info="${mac_address}" - fi - - # First node created will be used for testing in ironic w/o glance - # scenario, so we need to know its UUID. - local standalone_node_uuid="" - if [ $total_nodes -eq 0 ]; then - standalone_node_uuid="--uuid $IRONIC_NODE_UUID" - fi - - local node_id - node_id=$(ironic \ - node-create $standalone_node_uuid \ - --chassis_uuid $chassis_id \ - --driver $IRONIC_DEPLOY_DRIVER \ - --name $node_name \ - -p cpus=$ironic_node_cpu\ - -p memory_mb=$ironic_node_ram\ - -p local_gb=$ironic_node_disk\ - -p cpu_arch=$ironic_node_arch \ - $node_capabilities \ - $node_options \ - | grep " uuid " | get_field 2) - - # NOTE(vsaienko) IPA didn't automatically recognize root devices less than 4Gb. - # Setting root hint allows to install OS on such devices. - # 0x1af4 is VirtIO vendor device ID. - if [[ "$ironic_node_disk" -lt "4" && is_deployed_by_agent ]]; then - ironic node-update $node_id add properties/root_device='{"vendor": "0x1af4"}' - fi - - # In case we using portgroups, we should API version that support them. - # Othervise API will return 406 ERROR - # NOTE(vsaienko) interface_info is in the following format here: - # mac1,tap-node0i1;mac2,tap-node0i2;...;macN,tap-node0iN - for info in ${interface_info//;/ }; do - local mac_address="" - local port_id="" - local llc_port_opt="" - mac_address=$(echo $info| awk -F ',' '{print $1}') - port_id=$(echo $info| awk -F ',' '{print $2}') - if [[ "${IRONIC_USE_LINK_LOCAL}" == "True" ]]; then - llc_port_opt+=" -l port_id=${port_id} " - fi - ironic $ironic_api_version port-create --address $mac_address --node $node_id $llc_opts $llc_port_opt - done - - # NOTE(vsaienko) use node-update instead of specifying network_interface - # during node creation. If node is added with latest version of API it - # will NOT go to available state automatically. - if [[ -n "${IRONIC_NETWORK_INTERFACE}" ]]; then - local n_id - n_id=$(ironic $ironic_api_version node-update $node_id add network_interface=$IRONIC_NETWORK_INTERFACE | grep " uuid " | awk '{ print $4; }') - die_if_not_set $LINENO n_id "Failed to update network interface for node" - fi - - if [[ -n "${IRONIC_STORAGE_INTERFACE}" ]]; then - openstack --os-baremetal-api-version latest baremetal node set \ - $node_id --storage-interface $IRONIC_STORAGE_INTERFACE || \ - die $LINENO "Failed to update storage interface for node $node_id" - - if [[ -n "${connector_iqn}" ]]; then - openstack --os-baremetal-api-version latest baremetal \ - volume connector create --node $node_id --type iqn \ - --connector-id $connector_iqn || \ - die $LINENO "Failed to create volume connector for node $node_id" - fi - fi - - local resource_class - if [[ "$IRONIC_USE_RESOURCE_CLASSES" == "True" ]]; then - # TODO(jroll) consider making this configurable, for now just make it unique per hardware combo - # this will look like baremetal_1cpu_256mbram_10gbdisk - resource_class="baremetal_${ironic_node_cpu}cpu_${ironic_node_ram}mbram_${ironic_node_disk}gbdisk" - openstack --os-baremetal-api-version 1.21 baremetal node set \ - --resource-class $resource_class $node_id - fi - - total_nodes=$((total_nodes+1)) - total_cpus=$((total_cpus+$ironic_node_cpu)) - done < $ironic_hwinfo_file - - if is_service_enabled nova && [[ "$VIRT_DRIVER" == "ironic" ]]; then - if [[ "$HOST_TOPOLOGY_ROLE" != 'subnode' ]]; then - local adjusted_disk - adjusted_disk=$(($ironic_node_disk - $ironic_ephemeral_disk)) - # TODO(jroll) use (yet to be defined) new-style flavor here, - # if IRONIC_USE_RESOURCE_CLASSES == True - openstack flavor create --ephemeral $ironic_ephemeral_disk --ram $ironic_node_ram --disk $adjusted_disk --vcpus $ironic_node_cpu baremetal - openstack flavor set baremetal --property "cpu_arch"="$ironic_node_arch" - - if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - openstack flavor set baremetal --property "capabilities:boot_mode"="uefi" - fi - - # NOTE(dtantsur): sometimes nova compute fails to start with ironic due - # to keystone restarting and not being able to authenticate us. - # Restart it just to be sure (and avoid gate problems like bug 1537076) - stop_nova_compute || /bin/true - # NOTE(pas-ha) if nova compute failed before restart, .failure file - # that was created will fail the service_check in the end of the deployment - _clean_ncpu_failure - start_nova_compute - else - # NOTE(vsaienko) we enrolling IRONIC_VM_COUNT on each node. So on subnode - # we expect to have 2 x total_cpus - total_nodes=$(( total_nodes * 2 )) - total_cpus=$(( total_cpus * 2 )) - fi - wait_for_nova_resources "count" $total_nodes - wait_for_nova_resources "vcpus" $total_cpus - fi -} - -function die_if_module_not_loaded { - if ! grep -q $1 /proc/modules; then - die $LINENO "$1 kernel module is not loaded" - fi -} - -function configure_iptables { - # enable tftp natting for allowing connections to HOST_IP's tftp server - if ! running_in_container; then - sudo modprobe nf_conntrack_tftp - sudo modprobe nf_nat_tftp - else - die_if_module_not_loaded nf_conntrack_tftp - die_if_module_not_loaded nf_nat_tftp - fi - # explicitly allow DHCP - packets are occasionally being dropped here - sudo iptables -I INPUT -p udp --dport 67:68 --sport 67:68 -j ACCEPT || true - # nodes boot from TFTP and callback to the API server listening on $HOST_IP - sudo iptables -I INPUT -d $IRONIC_TFTPSERVER_IP -p udp --dport 69 -j ACCEPT || true - # To use named /baremetal endpoint we should open default apache port - if [[ "$IRONIC_USE_MOD_WSGI" == "False" ]]; then - sudo iptables -I INPUT -d $HOST_IP -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true - # open ironic API on baremetal network - sudo iptables -I INPUT -d $IRONIC_HTTP_SERVER -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true - # allow IPA to connect to ironic API on subnode - sudo iptables -I FORWARD -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true - else - sudo iptables -I INPUT -d $HOST_IP -p tcp --dport 80 -j ACCEPT || true - fi - if is_deployed_by_agent; then - # agent ramdisk gets instance image from swift - sudo iptables -I INPUT -d $HOST_IP -p tcp --dport ${SWIFT_DEFAULT_BIND_PORT:-8080} -j ACCEPT || true - sudo iptables -I INPUT -d $HOST_IP -p tcp --dport $GLANCE_SERVICE_PORT -j ACCEPT || true - fi - - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - sudo iptables -I INPUT -d $IRONIC_HTTP_SERVER -p tcp --dport $IRONIC_HTTP_PORT -j ACCEPT || true - fi - - if [[ "${IRONIC_STORAGE_INTERFACE}" == "cinder" ]]; then - sudo iptables -I INPUT -d $HOST_IP -p tcp --dport $ISCSI_SERVICE_PORT -s $FLOATING_RANGE -j ACCEPT || true - fi -} - -function configure_tftpd { - # stop tftpd and setup serving via xinetd - stop_service tftpd-hpa || true - [ -f /etc/init/tftpd-hpa.conf ] && echo "manual" | sudo tee /etc/init/tftpd-hpa.override - sudo cp $IRONIC_TEMPLATES_DIR/tftpd-xinetd.template /etc/xinetd.d/tftp - sudo sed -e "s|%TFTPBOOT_DIR%|$IRONIC_TFTPBOOT_DIR|g" -i /etc/xinetd.d/tftp - - # setup tftp file mapping to satisfy requests at the root (booting) and - # /tftpboot/ sub-dir (as per deploy-ironic elements) - echo "r ^([^/]) $IRONIC_TFTPBOOT_DIR/\1" >$IRONIC_TFTPBOOT_DIR/map-file - echo "r ^(/tftpboot/) $IRONIC_TFTPBOOT_DIR/\2" >>$IRONIC_TFTPBOOT_DIR/map-file - - chmod -R 0755 $IRONIC_TFTPBOOT_DIR - restart_service xinetd -} - -function configure_ironic_ssh_keypair { - if [[ ! -d $HOME/.ssh ]]; then - mkdir -p $HOME/.ssh - chmod 700 $HOME/.ssh - fi - # recreate ssh if any part is missing - if [[ ! -e $IRONIC_KEY_FILE ]] || [[ ! -e $IRONIC_KEY_FILE.pub ]]; then - if [[ ! -d $(dirname $IRONIC_KEY_FILE) ]]; then - mkdir -p $(dirname $IRONIC_KEY_FILE) - fi - echo -e 'n\n' | ssh-keygen -q -t rsa -P '' -f $IRONIC_KEY_FILE - fi - # NOTE(vsaienko) check for new line character, add if doesn't exist. - if [[ "$(tail -c1 $IRONIC_AUTHORIZED_KEYS_FILE | wc -l)" == "0" ]]; then - echo "" >> $IRONIC_AUTHORIZED_KEYS_FILE - fi - cat $IRONIC_KEY_FILE.pub | tee -a $IRONIC_AUTHORIZED_KEYS_FILE - # remove duplicate keys. - sort -u -o $IRONIC_AUTHORIZED_KEYS_FILE $IRONIC_AUTHORIZED_KEYS_FILE -} - -function ironic_ssh_check { - local key_file=$1 - local floating_ip=$2 - local port=$3 - local default_instance_user=$4 - local attempt=$5 - local status=false - local ssh_options="-o BatchMode=yes -o ConnectTimeout=$IRONIC_SSH_TIMEOUT -o StrictHostKeyChecking=no" - while [[ $attempt -gt 0 ]]; do - ssh -p $port $ssh_options -i $key_file ${default_instance_user}@$floating_ip exit - if [[ "$?" == "0" ]]; then - status=true - break - fi - attempt=$((attempt - 1)) - echo "SSH connection failed. $attempt attempts left." - done - if ! $status; then - die $LINENO "server didn't become ssh-able!" - fi -} - -function configure_ironic_auxiliary { - configure_ironic_ssh_keypair - ironic_ssh_check $IRONIC_KEY_FILE $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME $IRONIC_SSH_ATTEMPTS -} - -function build_ipa_ramdisk { - local kernel_path=$1 - local ramdisk_path=$2 - local iso_path=$3 - case $IRONIC_RAMDISK_TYPE in - 'coreos') - build_ipa_coreos_ramdisk $kernel_path $ramdisk_path $iso_path - ;; - 'tinyipa') - build_tinyipa_ramdisk $kernel_path $ramdisk_path $iso_path - ;; - 'dib') - build_ipa_dib_ramdisk $kernel_path $ramdisk_path $iso_path - ;; - *) - die $LINENO "Unrecognised IRONIC_RAMDISK_TYPE: $IRONIC_RAMDISK_TYPE. Expected either of 'dib', 'coreos', or 'tinyipa'." - ;; - esac -} - -function build_ipa_coreos_ramdisk { - echo "Building coreos ironic-python-agent deploy ramdisk" - local kernel_path=$1 - local ramdisk_path=$2 - local iso_path=$3 - # on fedora services do not start by default - restart_service docker - git_clone $IRONIC_PYTHON_AGENT_REPO $IRONIC_PYTHON_AGENT_DIR $IRONIC_PYTHON_AGENT_BRANCH - cd $IRONIC_PYTHON_AGENT_DIR - imagebuild/coreos/build_coreos_image.sh - cp imagebuild/coreos/UPLOAD/coreos_production_pxe_image-oem.cpio.gz $ramdisk_path - cp imagebuild/coreos/UPLOAD/coreos_production_pxe.vmlinuz $kernel_path - if is_deploy_iso_required; then - imagebuild/coreos/iso-image-create -k $kernel_path -i $ramdisk_path -o $iso_path - fi - sudo rm -rf UPLOAD - cd - -} - -function build_tinyipa_ramdisk { - echo "Building ironic-python-agent deploy ramdisk" - local kernel_path=$1 - local ramdisk_path=$2 - local iso_path=$3 - git_clone $IRONIC_PYTHON_AGENT_REPO $IRONIC_PYTHON_AGENT_DIR $IRONIC_PYTHON_AGENT_BRANCH - cd $IRONIC_PYTHON_AGENT_DIR/imagebuild/tinyipa - export BUILD_AND_INSTALL_TINYIPA=true - make - cp tinyipa.gz $ramdisk_path - cp tinyipa.vmlinuz $kernel_path - if is_deploy_iso_required; then - make iso - cp tinyipa.iso $iso_path - fi - make clean - cd - -} - -# install_diskimage_builder() - Collect source and prepare or install from pip -function install_diskimage_builder { - if use_library_from_git "diskimage-builder"; then - git_clone_by_name "diskimage-builder" - setup_dev_lib "diskimage-builder" - else - pip_install_gr "diskimage-builder" - fi -} - -function build_ipa_dib_ramdisk { - local kernel_path=$1 - local ramdisk_path=$2 - local iso_path=$3 - local tempdir - tempdir=$(mktemp -d --tmpdir=${DEST}) - - # install diskimage-builder if not present - if ! $(type -P disk-image-create > /dev/null); then - install_diskimage_builder - fi - - echo "Building IPA ramdisk with DIB options: $IRONIC_DIB_RAMDISK_OPTIONS" - if is_deploy_iso_required; then - IRONIC_DIB_RAMDISK_OPTIONS+=" iso" - fi - disk-image-create "$IRONIC_DIB_RAMDISK_OPTIONS" \ - -o "$tempdir/ironic-agent" \ - ironic-agent - chmod -R +r $tempdir - mv "$tempdir/ironic-agent.kernel" "$kernel_path" - mv "$tempdir/ironic-agent.initramfs" "$ramdisk_path" - if is_deploy_iso_required; then - mv "$tempdir/ironic-agent.iso" "$iso_path" - fi - rm -rf $tempdir -} - -# build deploy kernel+ramdisk, then upload them to glance -# this function sets ``IRONIC_DEPLOY_KERNEL_ID``, ``IRONIC_DEPLOY_RAMDISK_ID`` -function upload_baremetal_ironic_deploy { - declare -g IRONIC_DEPLOY_KERNEL_ID IRONIC_DEPLOY_RAMDISK_ID - - local ironic_deploy_kernel_name - local ironic_deploy_ramdisk_name - ironic_deploy_kernel_name=$(basename $IRONIC_DEPLOY_KERNEL) - ironic_deploy_ramdisk_name=$(basename $IRONIC_DEPLOY_RAMDISK) - if [[ "$HOST_TOPOLOGY_ROLE" != 'subnode' ]]; then - echo_summary "Creating and uploading baremetal images for ironic" - - if [ ! -e "$IRONIC_DEPLOY_RAMDISK" ] || \ - [ ! -e "$IRONIC_DEPLOY_KERNEL" ] || \ - ( is_deploy_iso_required && [ ! -e "$IRONIC_DEPLOY_ISO" ] ); then - # files don't exist, need to build them - if [ "$IRONIC_BUILD_DEPLOY_RAMDISK" = "True" ]; then - # we can build them only if we're not offline - if [ "$OFFLINE" != "True" ]; then - build_ipa_ramdisk $IRONIC_DEPLOY_KERNEL $IRONIC_DEPLOY_RAMDISK $IRONIC_DEPLOY_ISO - else - die $LINENO "Deploy kernel+ramdisk or iso files don't exist and cannot be built in OFFLINE mode" - fi - else - # download the agent image tarball - wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_DEPLOY_KERNEL - wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_DEPLOY_RAMDISK - fi - fi - - # load them into glance - if ! is_deploy_iso_required; then - IRONIC_DEPLOY_KERNEL_ID=$(openstack \ - image create \ - $ironic_deploy_kernel_name \ - --public --disk-format=aki \ - --container-format=aki \ - < $IRONIC_DEPLOY_KERNEL | grep ' id ' | get_field 2) - die_if_not_set $LINENO IRONIC_DEPLOY_KERNEL_ID "Failed to load kernel image into glance" - - IRONIC_DEPLOY_RAMDISK_ID=$(openstack \ - image create \ - $ironic_deploy_ramdisk_name \ - --public --disk-format=ari \ - --container-format=ari \ - < $IRONIC_DEPLOY_RAMDISK | grep ' id ' | get_field 2) - die_if_not_set $LINENO IRONIC_DEPLOY_RAMDISK_ID "Failed to load ramdisk image into glance" - - else - IRONIC_DEPLOY_ISO_ID=$(openstack \ - image create \ - $(basename $IRONIC_DEPLOY_ISO) \ - --public --disk-format=iso \ - --container-format=bare \ - < $IRONIC_DEPLOY_ISO -f value -c id) - die_if_not_set $LINENO IRONIC_DEPLOY_ISO_ID "Failed to load deploy iso into glance" - fi - else - IRONIC_DEPLOY_KERNEL_ID=$(openstack image show $ironic_deploy_kernel_name -f value -c id) - IRONIC_DEPLOY_RAMDISK_ID=$(openstack image show $ironic_deploy_ramdisk_name -f value -c id) - fi -} - -function prepare_baremetal_basic_ops { - if [[ "$IRONIC_BAREMETAL_BASIC_OPS" != "True" ]]; then - return 0 - fi - - if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - configure_ironic_auxiliary - fi - - if ! is_service_enabled nova && [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - sudo install -g $LIBVIRT_GROUP -o $STACK_USER -m 644 $FILES/${IRONIC_WHOLEDISK_IMAGE_NAME}.img $IRONIC_HTTP_DIR - fi - - upload_baremetal_ironic_deploy - enroll_nodes - configure_tftpd - configure_iptables -} - -function cleanup_baremetal_basic_ops { - if [[ "$IRONIC_BAREMETAL_BASIC_OPS" != "True" ]]; then - return 0 - fi - rm -f $IRONIC_VM_MACS_CSV_FILE - if [ -f $IRONIC_KEY_FILE ]; then - local key - key=$(cat $IRONIC_KEY_FILE.pub) - # remove public key from authorized_keys - grep -v "$key" $IRONIC_AUTHORIZED_KEYS_FILE > temp && mv temp $IRONIC_AUTHORIZED_KEYS_FILE - chmod 0600 $IRONIC_AUTHORIZED_KEYS_FILE - fi - sudo rm -rf $IRONIC_DATA_DIR $IRONIC_STATE_PATH - - local vm_name - for vm_name in $(_ironic_bm_vm_names); do - sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/cleanup-node.sh $vm_name" - - # Cleanup node bridge/interfaces - for i in $(seq 1 $IRONIC_VM_INTERFACE_COUNT); do - sudo ip tuntap del dev tap-${vm_name}i${i} mode tap - done - done - - sudo ovs-vsctl --if-exists del-br $IRONIC_VM_NETWORK_BRIDGE - - sudo rm -rf /etc/xinetd.d/tftp /etc/init/tftpd-hpa.override - restart_service xinetd - sudo iptables -D INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true - sudo iptables -D INPUT -d $HOST_IP -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true - sudo iptables -D INPUT -d $HOST_IP -p tcp --dport 80 -j ACCEPT || true - if is_deployed_by_agent; then - # agent ramdisk gets instance image from swift - sudo iptables -D INPUT -d $HOST_IP -p tcp --dport ${SWIFT_DEFAULT_BIND_PORT:-8080} -j ACCEPT || true - fi - sudo rmmod nf_conntrack_tftp || true - sudo rmmod nf_nat_tftp || true -} - -function ironic_configure_tempest { - iniset $TEMPEST_CONFIG service_available ironic True - - if [[ -n "$TEMPEST_BAREMETAL_MIN_MICROVERSION" ]]; then - iniset $TEMPEST_CONFIG baremetal min_microversion $TEMPEST_BAREMETAL_MIN_MICROVERSION - fi - if [[ -n "$TEMPEST_BAREMETAL_MAX_MICROVERSION" ]]; then - iniset $TEMPEST_CONFIG baremetal max_microversion $TEMPEST_BAREMETAL_MAX_MICROVERSION - fi - - if is_service_enabled nova; then - local bm_flavor_id - bm_flavor_id=$(openstack flavor show baremetal -f value -c id) - die_if_not_set $LINENO bm_flavor_id "Failed to get id of baremetal flavor" - iniset $TEMPEST_CONFIG compute flavor_ref $bm_flavor_id - iniset $TEMPEST_CONFIG compute flavor_ref_alt $bm_flavor_id - iniset $TEMPEST_CONFIG compute-feature-enabled disk_config False - fi - # NOTE(jlvillal): If IRONIC_PROVISION_NETWORK_NAME is set it means that - # nodes are using the neutron network driver / multi-tenant networking. - # Otherwise we are using a flat-network. - if [[ -n "${IRONIC_PROVISION_NETWORK_NAME}" ]]; then - # multi-tenant networking - iniset $TEMPEST_CONFIG baremetal use_provision_network True - else - # flat-network - iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME - # NOTE(jroll) this disables multitenant network tests from tempest's - # tree, but not from our tree. This is a bit inconsistent, we should - # fix it. - iniset $TEMPEST_CONFIG auth create_isolated_networks False - iniset $TEMPEST_CONFIG network shared_physical_network True - fi - - local image_uuid - image_uuid=$(openstack image show $IRONIC_IMAGE_NAME -f value -c id) - iniset $TEMPEST_CONFIG compute image_ref $image_uuid - iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid - - image_uuid=$(openstack image show $IRONIC_WHOLEDISK_IMAGE_NAME -f value -c id) - iniset $TEMPEST_CONFIG baremetal whole_disk_image_ref $image_uuid - image_uuid=$(openstack image show $IRONIC_PARTITIONED_IMAGE_NAME -f value -c id) - iniset $TEMPEST_CONFIG baremetal partition_image_ref $image_uuid - - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - iniset $TEMPEST_CONFIG baremetal whole_disk_image_url "http://$IRONIC_HTTP_SERVER:$IRONIC_HTTP_PORT/${IRONIC_WHOLEDISK_IMAGE_NAME}.img" - iniset $TEMPEST_CONFIG baremetal whole_disk_image_checksum $(md5sum $FILES/${IRONIC_WHOLEDISK_IMAGE_NAME}.img) - fi - - iniset $TEMPEST_CONFIG baremetal enabled_drivers $IRONIC_ENABLED_DRIVERS - iniset $TEMPEST_CONFIG baremetal enabled_hardware_types $IRONIC_ENABLED_HARDWARE_TYPES - - local adjusted_root_disk_size_gb - if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - adjusted_root_disk_size_gb=$(( ${IRONIC_VM_SPECS_DISK} - ${IRONIC_VM_EPHEMERAL_DISK} )) - else - adjusted_root_disk_size_gb=$(( ${IRONIC_HW_NODE_DISK} - ${IRONIC_HW_EPHEMERAL_DISK} )) - fi - iniset $TEMPEST_CONFIG baremetal adjusted_root_disk_size_gb $adjusted_root_disk_size_gb - - if [[ -n "${IRONIC_TEMPEST_BUILD_TIMEOUT}" ]]; then - iniset $TEMPEST_CONFIG baremetal unprovision_timeout $IRONIC_TEMPEST_BUILD_TIMEOUT - iniset $TEMPEST_CONFIG baremetal active_timeout $IRONIC_TEMPEST_BUILD_TIMEOUT - iniset $TEMPEST_CONFIG baremetal deploywait_timeout $IRONIC_TEMPEST_BUILD_TIMEOUT - iniset $TEMPEST_CONFIG baremetal power_timeout $IRONIC_TEMPEST_BUILD_TIMEOUT - fi - - # Enabled features - iniset $TEMPEST_CONFIG baremetal_feature_enabled ipxe_enabled $IRONIC_IPXE_ENABLED -} - -function get_ironic_node_prefix { - local node_prefix="node" - if [[ "$HOST_TOPOLOGY_ROLE" == "subnode" ]]; then - node_prefix="$HOST_TOPOLOGY_ROLE" - fi - echo $node_prefix -} - -function setup_vxlan_network { - sudo ovs-vsctl add-port $IRONIC_VM_NETWORK_BRIDGE phy-brbm-vxlan - sudo ovs-vsctl add-port br_ironic_vxlan phy-vxlan-brbm - sudo ovs-vsctl set interface phy-brbm-vxlan type=patch - sudo ovs-vsctl set interface phy-vxlan-brbm type=patch - sudo ovs-vsctl set interface phy-vxlan-brbm options:peer=phy-brbm-vxlan - sudo ovs-vsctl set interface phy-brbm-vxlan options:peer=phy-vxlan-brbm -} - -# Restore xtrace + pipefail -$_XTRACE_IRONIC -$_PIPEFAIL_IRONIC - -# Tell emacs to use shell-script-mode -## Local variables: -## mode: shell-script -## End: diff --git a/devstack/plugin.sh b/devstack/plugin.sh deleted file mode 100644 index 7e1a4e4e4..000000000 --- a/devstack/plugin.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# plugin.sh - devstack plugin for ironic - -# devstack plugin contract defined at: -# http://docs.openstack.org/developer/devstack/plugins.html - -echo_summary "ironic devstack plugin.sh called: $1/$2" -source $DEST/ironic/devstack/lib/ironic - -# These packages should be tested under python 3, when the job enables Python 3 -# TODO(jlvillal) Add additional dependencies when they should support Python 3. -# Add: pyghmi and virtualbmc when they are ready -enable_python3_package ironic ironic-lib ironic-python-agent python-ironicclient - -if is_service_enabled ir-api ir-cond; then - if [[ "$1" == "stack" ]]; then - if [[ "$2" == "install" ]]; then - # stack/install - Called after the layer 1 and 2 projects source and - # their dependencies have been installed - - echo_summary "Installing Ironic" - if ! is_service_enabled nova; then - source $RC_DIR/lib/nova_plugins/functions-libvirt - install_libvirt - fi - install_ironic - install_ironicclient - cleanup_ironic_config_files - - elif [[ "$2" == "post-config" ]]; then - # stack/post-config - Called after the layer 1 and 2 services have been - # configured. All configuration files for enabled services should exist - # at this point. - - echo_summary "Configuring Ironic" - configure_ironic - - if is_service_enabled key; then - create_ironic_accounts - fi - - elif [[ "$2" == "extra" ]]; then - # stack/extra - Called near the end after layer 1 and 2 services have - # been started. - - # Initialize ironic - init_ironic - - if [[ "$IRONIC_BAREMETAL_BASIC_OPS" == "True" && "$IRONIC_IS_HARDWARE" == "False" ]]; then - echo_summary "Creating bridge and VMs" - create_bridge_and_vms - fi - - if is_service_enabled neutron || [[ "$HOST_TOPOLOGY" == "multinode" ]]; then - echo_summary "Configuring Ironic networks" - configure_ironic_networks - fi - if [[ "$HOST_TOPOLOGY" == 'multinode' ]]; then - setup_vxlan_network - fi - - # Start the ironic API and ironic taskmgr components - echo_summary "Starting Ironic" - start_ironic - prepare_baremetal_basic_ops - - elif [[ "$2" == "test-config" ]]; then - # stack/test-config - Called at the end of devstack used to configure tempest - # or any other test environments - if is_service_enabled tempest; then - echo_summary "Configuring Tempest for Ironic needs" - ironic_configure_tempest - fi - fi - fi - - if [[ "$1" == "unstack" ]]; then - # unstack - Called by unstack.sh before other services are shut down. - - stop_ironic - cleanup_ironic_provision_network - cleanup_baremetal_basic_ops - fi - - if [[ "$1" == "clean" ]]; then - # clean - Called by clean.sh before other services are cleaned, but after - # unstack.sh has been called. - - cleanup_ironic - fi -fi diff --git a/devstack/settings b/devstack/settings deleted file mode 100644 index 82d273e5e..000000000 --- a/devstack/settings +++ /dev/null @@ -1,10 +0,0 @@ -enable_service ironic ir-api ir-cond - -# NOTE(vsaienko) mtu calculation has been changed recently to 1450 -# https://github.com/openstack/neutron/commit/51a697 -# and caused https://bugs.launchpad.net/ironic/+bug/1631875 -# Get the smallest local MTU -local_mtu=$(ip link show | sed -ne 's/.*mtu \([0-9]\+\).*/\1/p' | sort -n | head -1) -# 50 bytes is overhead for vxlan (which is greater than GRE -# allowing us to use either overlay option with this MTU. -PUBLIC_BRIDGE_MTU=$((local_mtu - 50)) diff --git a/devstack/tools/ironic/scripts/cleanup-node.sh b/devstack/tools/ironic/scripts/cleanup-node.sh deleted file mode 100755 index 466b7059b..000000000 --- a/devstack/tools/ironic/scripts/cleanup-node.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# **cleanup-nodes** - -# Cleans up baremetal poseur nodes and volumes created during ironic setup -# Assumes calling user has proper libvirt group membership and access. - -set -exu - -# Make tracing more educational -export PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}: ' - -LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"} -LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"} - -NAME=$1 - -export VIRSH_DEFAULT_CONNECT_URI=$LIBVIRT_CONNECT_URI - -VOL_NAME="$NAME.qcow2" -virsh list | grep -q $NAME && virsh destroy $NAME -virsh list --inactive | grep -q $NAME && virsh undefine $NAME --nvram - -# Delete the Virtual BMC -if [[ $(type -P vbmc) != "" ]]; then - vbmc list | grep -a $NAME && vbmc delete $NAME -fi - -if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then - virsh vol-list $LIBVIRT_STORAGE_POOL | grep -q $VOL_NAME && - virsh vol-delete $VOL_NAME --pool $LIBVIRT_STORAGE_POOL -fi - -sudo brctl delif br-$NAME ovs-$NAME || true -sudo ip link set dev br-$NAME down || true -sudo brctl delbr br-$NAME || true diff --git a/devstack/tools/ironic/scripts/configure-vm.py b/devstack/tools/ironic/scripts/configure-vm.py deleted file mode 100755 index 14df8feb4..000000000 --- a/devstack/tools/ironic/scripts/configure-vm.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -import argparse -import os.path - -import jinja2 -import libvirt - -templatedir = os.path.join(os.path.dirname(os.path.dirname(__file__)), - 'templates') - - -CONSOLE_LOG = """ - - - - - - - - - - - - - - - -""" - - -CONSOLE_PTY = """ - - - - - - -""" - - -def main(): - parser = argparse.ArgumentParser( - description="Configure a kvm virtual machine for the seed image.") - parser.add_argument('--name', default='seed', - help='the name to give the machine in libvirt.') - parser.add_argument('--image', - help='Use a custom image file (must be qcow2).') - parser.add_argument('--engine', default='qemu', - help='The virtualization engine to use') - parser.add_argument('--arch', default='i686', - help='The architecture to use') - parser.add_argument('--memory', default='2097152', - help="Maximum memory for the VM in KB.") - parser.add_argument('--cpus', default='1', - help="CPU count for the VM.") - parser.add_argument('--bootdev', default='hd', - help="What boot device to use (hd/network).") - parser.add_argument('--libvirt-nic-driver', default='virtio', - help='The libvirt network driver to use') - parser.add_argument('--interface-count', default=1, type=int, - help='The number of interfaces to add to VM.'), - parser.add_argument('--console-log', - help='File to log console') - parser.add_argument('--emulator', default=None, - help='Path to emulator bin for vm template') - parser.add_argument('--disk-format', default='qcow2', - help='Disk format to use.') - parser.add_argument('--uefi-loader', default='', - help='The absolute path of the UEFI firmware blob.') - parser.add_argument('--uefi-nvram', default='', - help=('The absolute path of the non-volatile memory ' - 'to store the UEFI variables. Should be used ' - 'only when --uefi-loader is also specified.')) - args = parser.parse_args() - - env = jinja2.Environment(loader=jinja2.FileSystemLoader(templatedir)) - template = env.get_template('vm.xml') - - params = { - 'name': args.name, - 'imagefile': args.image, - 'engine': args.engine, - 'arch': args.arch, - 'memory': args.memory, - 'cpus': args.cpus, - 'bootdev': args.bootdev, - 'interface_count': args.interface_count, - 'nicdriver': args.libvirt_nic_driver, - 'emulator': args.emulator, - 'disk_format': args.disk_format, - 'uefi_loader': args.uefi_loader, - 'uefi_nvram': args.uefi_nvram, - } - - if args.emulator: - params['emulator'] = args.emulator - else: - qemu_kvm_locations = ['/usr/bin/kvm', - '/usr/bin/qemu-kvm', - '/usr/libexec/qemu-kvm'] - for location in qemu_kvm_locations: - if os.path.exists(location): - params['emulator'] = location - break - else: - raise RuntimeError("Unable to find location of kvm executable") - - if args.console_log: - params['console'] = CONSOLE_LOG % {'console_log': args.console_log} - else: - params['console'] = CONSOLE_PTY - libvirt_template = template.render(**params) - conn = libvirt.open("qemu:///system") - - a = conn.defineXML(libvirt_template) - print("Created machine %s with UUID %s" % (args.name, a.UUIDString())) - -if __name__ == '__main__': - main() diff --git a/devstack/tools/ironic/scripts/create-node.sh b/devstack/tools/ironic/scripts/create-node.sh deleted file mode 100755 index 55b25ceb7..000000000 --- a/devstack/tools/ironic/scripts/create-node.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env bash - -# **create-nodes** - -# Creates baremetal poseur nodes for ironic testing purposes - -set -ex - -# Make tracing more educational -export PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}: ' - -# Keep track of the DevStack directory -TOP_DIR=$(cd $(dirname "$0")/.. && pwd) - -while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:" arg; do - case $arg in - n) NAME=$OPTARG;; - c) CPU=$OPTARG;; - i) INTERFACE_COUNT=$OPTARG;; - M) INTERFACE_MTU=$OPTARG;; - m) MEM=$(( 1024 * OPTARG ));; - # Extra G to allow fuzz for partition table : flavor size and registered - # size need to be different to actual size. - d) DISK=$(( OPTARG + 1 ));; - a) ARCH=$OPTARG;; - b) BRIDGE=$OPTARG;; - e) EMULATOR=$OPTARG;; - E) ENGINE=$OPTARG;; - p) VBMC_PORT=$OPTARG;; - o) PDU_OUTLET=$OPTARG;; - f) DISK_FORMAT=$OPTARG;; - l) LOGDIR=$OPTARG;; - L) UEFI_LOADER=$OPTARG;; - N) UEFI_NVRAM=$OPTARG;; - esac -done - -shift $(( $OPTIND - 1 )) - -if [ -z "$UEFI_LOADER" ] && [ ! -z "$UEFI_NVRAM" ]; then - echo "Parameter -N (UEFI NVRAM) cannot be used without -L (UEFI Loader)" - exit 1 -fi - -LIBVIRT_NIC_DRIVER=${LIBVIRT_NIC_DRIVER:-"virtio"} -LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"} -LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"} - -export VIRSH_DEFAULT_CONNECT_URI=$LIBVIRT_CONNECT_URI - -if ! virsh pool-list --all | grep -q $LIBVIRT_STORAGE_POOL; then - virsh pool-define-as --name $LIBVIRT_STORAGE_POOL dir --target /var/lib/libvirt/images >&2 - virsh pool-autostart $LIBVIRT_STORAGE_POOL >&2 - virsh pool-start $LIBVIRT_STORAGE_POOL >&2 -fi - -pool_state=$(virsh pool-info $LIBVIRT_STORAGE_POOL | grep State | awk '{ print $2 }') -if [ "$pool_state" != "running" ] ; then - [ ! -d /var/lib/libvirt/images ] && sudo mkdir /var/lib/libvirt/images - virsh pool-start $LIBVIRT_STORAGE_POOL >&2 -fi - -if [ -n "$LOGDIR" ] ; then - mkdir -p "$LOGDIR" -fi - -PREALLOC= -if [ -f /etc/debian_version -a "$DISK_FORMAT" == "qcow2" ]; then - PREALLOC="--prealloc-metadata" -fi - -if [ -n "$LOGDIR" ] ; then - VM_LOGGING="--console-log $LOGDIR/${NAME}_console.log" -else - VM_LOGGING="" -fi -VOL_NAME="${NAME}.${DISK_FORMAT}" - -UEFI_OPTS="" -if [ ! -z "$UEFI_LOADER" ]; then - UEFI_OPTS="--uefi-loader $UEFI_LOADER" - - if [ ! -z "$UEFI_NVRAM" ]; then - UEFI_OPTS+=" --uefi-nvram $UEFI_NVRAM" - fi -fi - -# Create bridge and add VM interface to it. -# Additional interface will be added to this bridge and -# it will be plugged to OVS. -# This is needed in order to have interface in OVS even -# when VM is in shutdown state -INTERFACE_COUNT=${INTERFACE_COUNT:-1} - -for int in $(seq 1 $INTERFACE_COUNT); do - tapif=tap-${NAME}i${int} - sudo ip tuntap add dev $tapif mode tap - sudo ip link set $tapif mtu $INTERFACE_MTU - sudo ip link set $tapif up - sudo ovs-vsctl add-port $BRIDGE $tapif -done - -if ! virsh list --all | grep -q $NAME; then - virsh vol-list --pool $LIBVIRT_STORAGE_POOL | grep -q $VOL_NAME && - virsh vol-delete $VOL_NAME --pool $LIBVIRT_STORAGE_POOL >&2 - virsh vol-create-as $LIBVIRT_STORAGE_POOL ${VOL_NAME} ${DISK}G --format $DISK_FORMAT $PREALLOC >&2 - volume_path=$(virsh vol-path --pool $LIBVIRT_STORAGE_POOL $VOL_NAME) - # Pre-touch the VM to set +C, as it can only be set on empty files. - sudo touch "$volume_path" - sudo chattr +C "$volume_path" || true - vm_opts="" - if [[ -n "$EMULATOR" ]]; then - vm_opts+="--emulator $EMULATOR " - fi - $PYTHON $TOP_DIR/scripts/configure-vm.py \ - --bootdev network --name $NAME --image "$volume_path" \ - --arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER \ - --disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \ - --interface-count $INTERFACE_COUNT >&2 - - # Createa Virtual BMC for the node if IPMI is used - if [[ $(type -P vbmc) != "" ]]; then - vbmc add $NAME --port $VBMC_PORT - vbmc start $NAME - fi -fi - -# echo mac in format mac1,ovs-node-0i1;mac2,ovs-node-0i2;...;macN,ovs-node0iN -VM_MAC=$(echo -n $(virsh domiflist $NAME |awk '/tap-/{print $5","$1}')|tr ' ' ';') -echo -n "$VM_MAC $VBMC_PORT $PDU_OUTLET" diff --git a/devstack/tools/ironic/scripts/setup-network.sh b/devstack/tools/ironic/scripts/setup-network.sh deleted file mode 100755 index e2dfc2666..000000000 --- a/devstack/tools/ironic/scripts/setup-network.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -# **setup-network** - -# Setups openvswitch libvirt network suitable for -# running baremetal poseur nodes for ironic testing purposes - -set -exu - -# Make tracing more educational -export PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}: ' - -LIBVIRT_CONNECT_URI=${LIBVIRT_CONNECT_URI:-"qemu:///system"} - -# Keep track of the DevStack directory -TOP_DIR=$(cd $(dirname "$0")/.. && pwd) -BRIDGE_NAME=${1:-brbm} -PUBLIC_BRIDGE_MTU=${2:-1500} - -export VIRSH_DEFAULT_CONNECT_URI="$LIBVIRT_CONNECT_URI" - -# Only add bridge if missing. Bring it UP. -(sudo ovs-vsctl list-br | grep ${BRIDGE_NAME}$) || sudo ovs-vsctl add-br ${BRIDGE_NAME} -sudo ip link set dev ${BRIDGE_NAME} up - -# Remove bridge before replacing it. -(virsh net-list | grep "${BRIDGE_NAME} ") && virsh net-destroy ${BRIDGE_NAME} -(virsh net-list --inactive | grep "${BRIDGE_NAME} ") && virsh net-undefine ${BRIDGE_NAME} - -virsh net-define <(sed s/brbm/$BRIDGE_NAME/ $TOP_DIR/templates/brbm.xml) -virsh net-autostart ${BRIDGE_NAME} -virsh net-start ${BRIDGE_NAME} - -sudo ip link set dev ${BRIDGE_NAME} mtu $PUBLIC_BRIDGE_MTU diff --git a/devstack/tools/ironic/templates/brbm.xml b/devstack/tools/ironic/templates/brbm.xml deleted file mode 100644 index 0769d3f1d..000000000 --- a/devstack/tools/ironic/templates/brbm.xml +++ /dev/null @@ -1,6 +0,0 @@ - - brbm - - - - diff --git a/devstack/tools/ironic/templates/tftpd-xinetd.template b/devstack/tools/ironic/templates/tftpd-xinetd.template deleted file mode 100644 index 5f3d03f3b..000000000 --- a/devstack/tools/ironic/templates/tftpd-xinetd.template +++ /dev/null @@ -1,14 +0,0 @@ -service tftp -{ - protocol = udp - port = 69 - socket_type = dgram - wait = yes - user = root - server = /usr/sbin/in.tftpd - server_args = -v -v -v -v -v --map-file %TFTPBOOT_DIR%/map-file %TFTPBOOT_DIR% - disable = no - # This is a workaround for Fedora, where TFTP will listen only on - # IPv6 endpoint, if IPv4 flag is not used. - flags = IPv4 -} diff --git a/devstack/tools/ironic/templates/vm.xml b/devstack/tools/ironic/templates/vm.xml deleted file mode 100644 index 3fc1380ec..000000000 --- a/devstack/tools/ironic/templates/vm.xml +++ /dev/null @@ -1,65 +0,0 @@ - - {{ name }} - {{ memory }} - {{ cpus }} - - hvm - - {% if uefi_loader %} - {{ uefi_loader }} - {% if uefi_nvram %} - {{ uefi_nvram }} - {% endif %} - {% endif %} - - - - {% if engine == 'kvm' %} - - {% endif %} - - - - - - - destroy - restart - restart - - {{ emulator }} - - - - - {% if uefi_loader %} - -
- {% else %} - -
- {% endif %} - - -
- - {% for n in range(1, interface_count+1) %} - - - -
- - {% endfor %} - - -