Commit Graph

11 Commits

Author SHA1 Message Date
Harald Jensås f98dfa61c1 Write network_data.json metadata to config-dirve
cloud-init will use fall-back config when network metadata
is *not* present. This works fine if the first NIC on the node is
connected to a network with DHCP. But, when the first NIC is not
used for provisioning, cloud-init will only write a fallback config
for the first NIC. This causes the provisioned node to be unavailable.

Extend instance configuration to include network metadata so that
cloud-init can configure node networking.

Story: 2009238
Task: 43378
Change-Id: I70f1a972a6d5a0398cd348f00308957386d66067
2021-09-22 14:50:02 +02:00
Dmitry Tantsur 97311ce7fb Clean up exceptions metalsmith raises
This change switches from a mix of metalsmith and SDK exceptions
to consistently using metalsmith exceptions.

Change-Id: I43339686a42644877dbe40d1116db1585a8a0800
2019-08-02 13:59:12 +02:00
Dmitry Tantsur e9c25b02e5 Use allocation name for hostname instead of a custom field
This concludes the switch to the allocation API.

Change-Id: I25cdae7d17604140f728fdbcfea4110cbd222679
2019-06-07 11:08:48 +02:00
Dmitry Tantsur e795f6c841 Make sure to not try reserving a reserved node
After the switch to openstacksdk we no longer have a sufficient check
on node's availability or maintenance. This patch restores it.

Change-Id: I2c85cf0adb02061b3dd85f19dd10c8a5af1118da
2019-01-22 18:08:53 +01:00
Dmitry Tantsur 02932096df Clean up the edge cases around states
Currently show_instance returns an Instance even if the requested node
is not actually an instance (e.g. just an available node). This change
corrects it. Make list_instances consistent with it.

Also make the states a proper enum to avoid consumers from using invalid
values (I did it several times when working on this patch).

Change-Id: If9aad0d7f4d10a7119d1f0bccc1cc32a918a72e3
2019-01-18 17:49:01 +01:00
Dmitry Tantsur df831309ba Support traits for scheduling
Story: #2003685
Task: #26209
Change-Id: I4895c414abc55ece6cf56133f13ffaa7cd4f5f92
2018-09-07 16:57:57 +02:00
Dmitry Tantsur 51a006e307 Rework scheduling filters
Remove ValidationFilter, make it a part of reservation to avoid calling
it too many times. Fix AttributeError on failing the custom predicate.
Remove double validation in the reserver, we do another validation later
on anyway.

BREAKING: changes the exception classes.

Change-Id: Ibc3815989917ab777298a05810fd8f3e64debc8f
Story: #2003584
Task: #26178
2018-09-07 15:37:33 +02:00
Dmitry Tantsur a638cec066 Allow filtering by arbitrary predicate and conductor_group
BREAKING: changed order of arguments in reserve_node.

BREAKING: changed exceptions inheriting ReservationFailed.

Change-Id: I79cc9b2794d8332cdb818af0b7effb28d4e9a786
Story: #2003584
Task: #24890
2018-09-05 12:25:11 +02:00
Dmitry Tantsur 6030b02bb3 Separate wait_for_provision_state method
Change-Id: I27d976162c503ff494d5786649e273a6385207d2
2018-06-28 15:39:55 +02:00
Dmitry Tantsur c7dddc1f28 Additional checks on node sanity before attempting to deploy it
Check that
1. Maintenance is off
2. Not reserved by something else

If the node is not reserved, reserve it now.

Change-Id: Iad754c6f4eea461f2859dc46892f2a705ebb6733
2018-05-22 11:33:08 +02:00
Dmitry Tantsur 23fbeea112 Add docs generation (+ clean up)
Moved public access to exceptions from metalsmith itself to
metalsmith.exceptions to avoid clutterning the former.

Updated tox.ini to use upper-constraints.

Change-Id: I136e036749171dc6d36d644e79c6fcfeef6242af
2018-05-18 13:12:29 +02:00