All Nova extensions are enabled in API v2.1, which is the only API
version we support now. There's no reason to query for these things.
Change-Id: Ib12b2f4fe53182e047d6264de850178909b8fd5d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We removed the floating network-specific caching in change
Ife5bda82eeb10c093b6cb55b0027ec16c89734d7 but an errant rebase of change
I10d3782899ac519f715d771d83303990a8289f04 reintroduced some use of the
now removed private variables used for this caching. Remove them again.
Change-Id: I5f867f91bb0e3a564d039d7184eadbe171e8f922
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2073261
This change extends the `attach_vif` and `attach_vif_to_node` methods to
accept optional parameters for VIF port UUID and VIF portgroup UUID.
This enhancement allows for more flexible VIF attachment scenarios while
ensuring that only one of these parameters can be set at a time.
- Added parameters `vif_port_uuid` and `vif_portgroup_uuid` to the
`attach_vif` method in the `Node` class.
- Updated the `attach_vif_to_node` method in the `Proxy` class to pass
these parameters to the `attach_vif` method.
- Included a check to ensure only one of `vif_port_uuid` and
`vif_portgroup_uuid` can be set at a time in both methods.
- Modified the request body in the `attach_vif` method to include these
parameters if provided.
Change-Id: I4b8487b45ae04f387c2f02a9505916072edc96aa
The implementations of these were rather confusing and required two
separate sets of arguments. Simplify them based on the
'delete_quota_set' methods.
Change-Id: I8bb0bfb039593c5b59f1f9c16523a090d899f099
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
For some reason, you need to include the project ID in the path even
though it's wholly ignored.
Change-Id: I805cdfaa89134e92eeb9726697925e9d0657af19
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change I1cb1efbf1f243cca0c5bb6e1058d25b2ad863355 introduced mypy
syntax which breaks Python releases before 3.10. Unfortunately, for
2024.2 we commit to supporting Python back to 3.9.
Specifically, you receive this error message if you run pep8 on Rocky 9:
pep8 mypy.....................................................................Failed
pep8 - hook id: mypy
pep8 - exit code: 1
pep8
pep8 openstack/dns/v2/_base.py: note: In member "list" of class "Resource":
pep8 openstack/dns/v2/_base.py:83:27: error: X | Y syntax for unions requires Python 3.10 [syntax]
pep8 Found 1 error in 1 file (checked 414 source files)
So instead, let's use typing syntax compatible with other pythons.
Change-Id: Ifcf68075e572ccfc910dbef449cd58986c2a1bf5
As preparation for those tests is pretty expensive, we can save few
seconds of the execution time by combining all the checks into one
single test.
Change-Id: I6be713773bc66938348462f226517b4eb5ed673a
To avoid accidental usage of the 'auto_allocate_network' which is created by
Neutron automatically when 'get_auto_allocated_topology' API is called,
by other tests those auto_allocated_topology tests are now run in own
project which is destroyed after tests are done.
Closes-Bug: #2071784
Change-Id: Ib92913204bd90c2fb56268f58b089a2d3ba45644
Added support to list the firmware components of a node under
the baremetal service.
- Created new functions `list_node_firmware` in baremetal proxy
and `list_firmware` in baremetal node resource.
- Added new release note to describe the new feature.
- Added unit and functional tests for the new functions.
Change-Id: Ib4b1584f24b0d4beb1594f97e1bbb8c81f5a84d5
These were causing test failures due to warnings being raised by another
package (keystoneauth) under Python 3.12. Rework things such that this
is no longer an issue by removing one filter (which wasn't really doing
anything) and reworking another to ignore DeprecationWarning-style
warnings.
Change-Id: I9aa73c59683dd9ee5fa701c436b860ce09740896
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Invert the order of these such that ResourceNotFound is an alias of
NotFoundException rather than the other way around. This is more
consistent with the other HTTP-related exceptions.
Change-Id: I3b669494cf7dc4e540a54070de42b1befe803e14
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We also start using a sentinel value here since None is a useful value
for unsetting things.
Change-Id: I3bc3150877c6c00aa9ec4355104308d7755aa1d4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is supported by early revisions of the server evacuate action.
Change-Id: I452fa9bb7077b3a1ce66552bbbf68ffd6702d1e2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
To add a tag, remove a tag, and remove all tags.
Change-Id: I4c7533007bcc85e713c532830b979b9d3fedb612
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Add a proper RateLimit class for compute (even though this is no longer
a thing starting in Newton) and use consistent naming across services.
Change-Id: Ib8a926900dca77cf48492839664bf2c5c13aab70
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Recently openstacksdk functional test, test_volume_attachment,
started failing frequently.
It mostly failed during the tearDown step trying to delete
the volume as the volume delete was already issued by
server delete (which it shouldn't be).
Looking into the issue, I found out the problem to be in
a race between the BDM record of instance being deleted (during
volume attachment delete) and trying to delete the server.
The sequence of operations that trigger this issue are:
1. Delete volume attachment
2. Wait for volume to become available
3. Delete server
In step (2), nova sends a request to Cinder to delete the
volume attachment[1], making the volume in available state[2], BUT
the operation is still ongoing on nova side to delete the BDM
record[3].
Hence we end up in a race, where nova is trying to delete the
BDM record and we issue a server delete (overlapping request), which
in turn consumes that BDM record and sends request to (which it shouldn't):
1. delete attachment (which is already deleted, hence returns 404)
2. delete volume
Later when the functional test issue another request to delete the volume,
we fail since the volume is already in the process of being deleted
(by the server delete operation -- delete_on_termination is set to true).
This analysis can yield a number of fixes in nova and cinder, namely:
1. Nova to prevent the race of BDM being deleted and being used at the same time.
2. Cinder to detect the volume being deleted and return success for
subsequent delete requests (and not fail with 400 BadRequest).
This patch focuses on fixing this on the SDK side where the flow
of operations happens too fast triggering this race condition.
We introduce a wait mechanism to wait for the VolumeAttachment resource
to be deleted and later verify that the number of attachments for the
server to be 0 before moving to the tearDown that deletes the server
and the volume.
there is a 1 second gap race happening which can be seen here:
1. server delete starting at 17:13:49
2024-06-05 17:13:49,892 openstack.iterate_timeout ****Timeout is 300 --- wait is 2.0 --- start time is 1717607629.892198 ----
2024-06-05 17:13:49,892 openstack.iterate_timeout $$$$ Count is 1 --- time difference is 299.99977254867554
2024-06-05 17:13:50,133 openstack.iterate_timeout Waiting 2.0 seconds
2. BDM being deleted at 17:13:50
(already used by server delete to do attachment and volume delete calls)
*************************** 2. row ***************************
created_at: 2024-06-05 17:13:11
...
deleted_at: 2024-06-05 17:13:50
...
device_name: /dev/vdb
volume_id: c13a3070-c5ab-4c8a-bb7e-5c7527fdf0df
attachment_id: a1280ca9-4f88-49f7-9ba2-1e796688ebcc
instance_uuid: 98bc13b2-50fe-4681-b263-80abf08929ac
...
[1] 7dc4b1ea62/nova/virt/block_device.py (L553)
[2] 9f1292ad06/cinder/volume/api.py (L2685)
[3] 7dc4b1ea62/nova/compute/manager.py (L7658-L7659)
Closes-Bug: #2067869
Change-Id: Ia59df9640d778bec4b22e608d111f82b759ac610
ironicclient automatically decoded the base64-encoded byte strings
provided to the 'node.set_provision_state' method. We should do the
same.
Change-Id: Ib4997d11b460078cddf2f422223a67a216cf17df
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We also reorder the proxy API to combine two groups.
Change-Id: Id9cb8f7cdffa374bdb4f744cf2d12fbe2709904e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is kept separate from addition of the actual hook so that we can
ignore the commit later.
Change-Id: I3af752894490d619b3ef755aca5e717edafe104c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>