Prepared fixed for the MOS Victoria-based image, MOS 23.2
The list of the fixes / improvements:
* Dockerfiles: set the FROM image to the Mirantis heat
Victoria image of MOS 23.2. Fixed some packages installation.
* Python cleanup.py script: re-wrote opertions with the
volume groups and volume group types with the specific
API version, resettings volume status, finding the
server groups. Added the functions for non-existing
methods in downstream openstacksdk.
* FIO scripts: Fixed the attaching/detaching the volumes,
some other fixes.
* Refreshed the si-tests, mos-spt, cfg-checker repositories,
archived.
* Changed the tag of the toolset image for Victoria:
toolset:23.2-victoria
Change-Id: I762eaa813c4c864979a2dfb5151dd082aff98cb2
diff --git a/fio/fio_cleanup.py b/fio/fio_cleanup.py
index 753df87..f403823 100644
--- a/fio/fio_cleanup.py
+++ b/fio/fio_cleanup.py
@@ -14,6 +14,7 @@
FLAVOR_NAME: Final[str] = conn.FIO_FLAVOR_NAME
KEYPAIR_NAME: Final[str] = conn.FIO_KEYPAIR_NAME
SG_NAME: Final[str] = conn.FIO_SG_NAME
+VOL_NAME_MASK: Final[str] = conn.FIO_VOL_NAME_MASK
ROUTER_NAME: Final[str] = conn.FIO_ROUTER_NAME
NET_NAME: Final[str] = conn.FIO_NET_NAME
@@ -30,19 +31,19 @@
vol_id = att.volume_id
vol = volume.get_volume(vol_id)
try:
- conn.detach_volume(vm, vol)
+ conn.detach_volume(att, vm, vol)
print(
f"'{vol.id}' volume has been detached from fio '{vm.name}'"
" server.")
conn.delete_volume(vol)
print(f"'{vol.id}' volume has been deleted.")
- conn.delete_server(vm)
- print(f"'{vm.name}' server has been deleted.")
except ResourceFailure as e:
print(
f"Cleanup of '{vm.id}' with volume '{vol.id}' attached "
f"failed with '{e.message}' error.")
conn.delete_volume(vol)
+ conn.delete_server(vm)
+ print(f"'{vm.name}' server has been deleted.")
if __name__ == "__main__":
@@ -59,11 +60,12 @@
router = network.find_router(ROUTER_NAME)
if router:
network.update_router(router.id, external_gateway_info={})
- print("Externa GW port has been deleted from fio router.")
+ print("External GW port has been deleted from fio router.")
router_ports = network.ports(device_id=router.id)
for p in router_ports:
- network.remove_interface_from_router(router.id, port_id=p.id)
- print(f"'{p.id}' port has been deleted from fio router.")
+ if p.device_owner != "network:router_ha_interface":
+ network.remove_interface_from_router(router.id, port_id=p.id)
+ print(f"'{p.id}' port has been deleted from fio router.")
# Delete fio network topology
net = network.find_network(NET_NAME)
@@ -92,9 +94,15 @@
network.delete_security_group(sg)
print(f"fio '{sg.id}' security group has been deleted.")
+ # Delete the orphan fio volumes which are not attached (if any)
+ volumes = volume.volumes(VOL_NAME_MASK)
+ for v in volumes:
+ if not v.attachments:
+ volume.delete_volume(v.id)
+ print(f"'{v.id}' volume has been deleted.")
+
# Delete fio server group
- server_group = compute.find_server_group(
- AA_SERVER_GROUP_NAME, all_projects=True)
+ server_group = conn.find_server_group(AA_SERVER_GROUP_NAME)
if server_group:
compute.delete_server_group(server_group)
print(f"fio '{server_group.name}' server group has been deleted.")