Bug 1861787

Summary: Attaching volume created in an AZ to a shelved instance fails when cross_az_attach=False
Product: Red Hat OpenStack Reporter: Marian Krcmarik <mkrcmari>
Component: openstack-tempestAssignee: Lee Yarwood <lyarwood>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: apevec, bdobreli, dasmith, eglynn, jhakimra, kchamart, lhh, lyarwood, mkopec, oblaut, owalsh, sbauza, sgordon, slinaber, udesale, vromanso
Target Milestone: ---Keywords: Patch, Reopened, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-tempest-26.0.0-2.20210121083412.f9d31f2.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-15 07:08:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marian Krcmarik 2020-07-29 14:30:04 UTC
Description of problem:
The parameter cross_az_attach=False is used by default in DCN based deployments [1]. All compute nodes from each DCN site are in one AZ. The DCN HCI setup adds aditionally ceph cluster to the DCN site and there is the AZ with same name created for volume service on the DCN HCI site.
The tempest test [2] creates an instance in one AZ, then creates a volume in the same AZ, shelve the instance and tries to attach the volume which fails on:
Invalid volume: Instance ce7ecd63-6774-4551-ae09-6fdb8e520814 and volume 9368c908-e0e4-4187-9b6c-766732ffee90 are not in the same availability_zone. Instance is in None. Volume is in az-dcn1'

The thing is that once an instance is shleved successfully the attribute OS-EXT-AZ:availability_zone becomes None while before the shelve operation It was az-dcn1.

Is that a bug? or simply not supported scenario and tempest test should be modified to take that in account?

[1] https://opendev.org/openstack/tripleo-heat-templates/src/branch/master/environments/dcn.yaml#L22
[2] https://github.com/openstack/tempest/blob/master/tempest/api/compute/volumes/test_attach_volume.py#L273-L290
Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create an Nova AZ and Volume AZ, the same name.
2. Spawn an instance in the Nova AZ, shelve the instance
3. Try to attach the volume to the instance

Actual results:
It si refused to attach due to AZ incompability

Expected results:
Needs to be defined

Additional info:

Comment 5 Martin Kopec 2020-10-29 09:15:18 UTC
I think the LP 1889687 is very related to this one: https://bugs.launchpad.net/tempest/+bug/1647999 where we introduced compute_volume_common_az option -> https://review.opendev.org/#/c/408498/. I assume compute_volume_common_az option should resolve half your issue as I commented within the reviews (744039 and 744040). Let me know what you think, then we can update the review and push it forward.

Comment 6 Marian Krcmarik 2020-11-02 18:00:08 UTC
(In reply to Martin Kopec from comment #5)
> I think the LP 1889687 is very related to this one:
> https://bugs.launchpad.net/tempest/+bug/1647999 where we introduced
> compute_volume_common_az option -> https://review.opendev.org/#/c/408498/. I
> assume compute_volume_common_az option should resolve half your issue as I
> commented within the reviews (744039 and 744040). Let me know what you
> think, then we can update the review and push it forward.

The tempest option you mentioned was used the problem is the default behaviour SHELVED instance has no AZ attribute since It does not reside on any compute host, trying to unshelve such instance may fail If cross AZ attach is disable since It may be respawned on a compute host outside of desired AZ.

Comment 7 Martin Kopec 2021-01-18 14:58:25 UTC
The fix (Skip AttachVolumeShelveTestJSON when cross_az_attach unavailable) is part of tempest 26.

Comment 10 Martin Kopec 2021-01-29 16:33:13 UTC
The fix (Skip AttachVolumeShelveTestJSON when cross_az_attach unavailable) is part of tempest 26.

Tempest 26 (openstack-tempest-26.0.0-2.20210121083412.f9d31f2.el8ost) is now available in RHOS-16.2 repos.

Comment 14 errata-xmlrpc 2021-09-15 07:08:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:3483