Skip to content
Snippets Groups Projects
Commit 3e03884c authored by Pierre Riteau's avatar Pierre Riteau
Browse files

Speed up calls to Bifrost

For overcloud commands involving Bifrost (e.g. overcloud provision), we
use the Bifrost dynamic inventory. This runs bifrost_inventory.py which
gathers node and port information for all bare metal hosts. Because this
gets executed for each node in our inventory, it produces a large number
of API requests to Ironic, which grows as the number of hosts increases.

Halve the number of calls using the BIFROST_NODE_NAMES environment
variable, which restricts fetching port information to just the node
being queried. bifrost_inventory.py still performs one call for each
node, which must be fixed separately in Bifrost [1].

Time to query overcloud nodes' hardware introspection data for 44 hosts:

* before patch: 823 seconds
* after patch: 415 seconds

With the patch to Bifrost [1], this is further reduced to 46 seconds.

[1] https://review.opendev.org/c/openstack/bifrost/+/882950

Change-Id: I341075115442a38c327e3ade74b81b1b9e7e85c6
parent 7110d834
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -102,6 +103,7 @@ ...@@ -102,6 +103,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export OS_BAREMETAL_API_VERSION=1.34 && export OS_BAREMETAL_API_VERSION=1.34 &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -72,6 +73,7 @@ ...@@ -72,6 +73,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal -vvvv ansible baremetal -vvvv
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -98,6 +100,7 @@ ...@@ -98,6 +100,7 @@
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export OS_BAREMETAL_API_VERSION=1.34 && export OS_BAREMETAL_API_VERSION=1.34 &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -66,6 +67,7 @@ ...@@ -66,6 +67,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal -vvvv ansible baremetal -vvvv
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -91,6 +93,7 @@ ...@@ -91,6 +93,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal -vvvv ansible baremetal -vvvv
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -115,6 +118,7 @@ ...@@ -115,6 +118,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
command: > command: >
docker exec bifrost_deploy docker exec bifrost_deploy
bash -c ' bash -c '
env BIFROST_INVENTORY_SOURCE=ironic OS_CLOUD=bifrost env BIFROST_INVENTORY_SOURCE=ironic BIFROST_NODE_NAMES="{{ inventory_hostname }}" OS_CLOUD=bifrost
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export OS_BAREMETAL_API_VERSION=1.34 && export OS_BAREMETAL_API_VERSION=1.34 &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -77,6 +78,7 @@ ...@@ -77,6 +78,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal -vvvv ansible baremetal -vvvv
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -102,6 +104,7 @@ ...@@ -102,6 +104,7 @@
bash -c ' bash -c '
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal -vvvv ansible baremetal -vvvv
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
...@@ -166,6 +169,7 @@ ...@@ -166,6 +169,7 @@
export OS_CLOUD=bifrost && export OS_CLOUD=bifrost &&
export OS_BAREMETAL_API_VERSION=1.34 && export OS_BAREMETAL_API_VERSION=1.34 &&
export BIFROST_INVENTORY_SOURCE=ironic && export BIFROST_INVENTORY_SOURCE=ironic &&
export BIFROST_NODE_NAMES="{{ inventory_hostname }}" &&
ansible baremetal ansible baremetal
--connection local --connection local
--inventory /etc/bifrost/inventory/ --inventory /etc/bifrost/inventory/
......
---
fixes:
- |
Improves performance of Bifrost operations by preventing unnecessary
requests to the Ironic API.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment