Bug 1859932

Summary: InstanceHA does not evacuate instances created with private flavor in tenant project.
Product: Red Hat Enterprise Linux 8 Reporter: Rohini Diwakar <rdiwakar>
Component: fence-agentsAssignee: pkomarov
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 8.2CC: cfeist, cluster-maint, dabarzil, jjoyce, jschluet, lmiccini, oalbrigt, pkomarov, sbradley, slinaber, tvignaud
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: 8.4   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: fence-agents-4.2.1-53.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1862024 1867156 (view as bug list) Environment:
Last Closed: 2020-11-04 02:29:00 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:
Bug Depends On:    
Bug Blocks: 1862024, 1867156    
Attachments:
Description Flags
Verification steps none

Description Rohini Diwakar 2020-07-23 10:44:14 UTC
Description of problem:

When compute node crashes, only the instances which are created with public flavor in tenant project gets evacuated to another compute but the ones created from private flavor remain on the crashed node.  

InstanceHA works for public and private flavors in admin project but it fails for tenant project. 

Version-Release number of selected component (if applicable):
RHOSP13 with InstaneHA

How reproducible:


Steps to Reproduce:

1. Create a project 
# openstack project show test_ha
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description |                                  |
| domain_id   | default                          |
| enabled     | True                             |
| id          | 7438dcb4bcd048a2864e3c62b72ced3e |
| is_domain   | False                            |
| name        | test_ha                          |
| parent_id   | default                          |
| tags        | []                               |
+-------------+----------------------------------+

2. Create a public flavor and a private flavor in the project
# openstack flavor show test_ha_private_1
+----------------------------+-------------------------------------------+
| Field                      | Value                                     |
+----------------------------+-------------------------------------------+
| OS-FLV-DISABLED:disabled   | False                                     |
| OS-FLV-EXT-DATA:ephemeral  | 0                                         |
| access_project_ids         | 7438dcb4bcd048a2864e3c62b72ced3e          |
| disk                       | 10                                        |
| id                         | bb286bc0-f150-42fd-b061-cea0ff236188      |
| name                       | test_ha_private_1                         |
| os-flavor-access:is_public | False                                     |
| properties                 | evacuable='true'                          |
| ram                        | 4096                                      |
| rxtx_factor                | 1.0                                       |
| swap                       |                                           |
| vcpus                      | 2                                         |
+----------------------------+-------------------------------------------+

# openstack flavor show test_ha_public
+----------------------------+-------------------------------------------+
| Field                      | Value                                     |
+----------------------------+-------------------------------------------+
| OS-FLV-DISABLED:disabled   | False                                     |
| OS-FLV-EXT-DATA:ephemeral  | 0                                         |
| access_project_ids         | None                                      |
| disk                       | 10                                        |
| id                         | cd4b2bc2-c2f6-4a40-a21d-42fd8b4399da      |
| name                       | test_ha_public                            |
| os-flavor-access:is_public | True                                      |
| properties                 | evacuable='true'                          |
| ram                        | 4096                                      |
| rxtx_factor                | 1.0                                       |
| swap                       |                                           |
| vcpus                      | 2                                         |
+----------------------------+-------------------------------------------+

3. Create a public instance and a private instance


4. Test InstanceHA by crashing the node, public instance gets evacuated but private one doesn't.


Actual results:
Only public instances in tenant project are evacuated

Expected results:
Both public and private instances should get evacuated

Additional info:

Comment 2 Luca Miccini 2020-07-23 12:03:59 UTC
we can probably address the private flavor and private image usecases in a single patch.

    diff --git a/agents/evacuate/fence_evacuate.py b/agents/evacuate/fence_evacuate.py
    index 88837dd8..d18a9d3d 100644
    --- a/agents/evacuate/fence_evacuate.py
    +++ b/agents/evacuate/fence_evacuate.py
    @@ -87,7 +87,7 @@ def _is_server_evacuable(server, evac_flavors, evac_images):
     
     def _get_evacuable_flavors(connection):
            result = []
    -       flavors = connection.flavors.list()
    +       flavors = connection.flavors.list(is_public=None)
            # Since the detailed view for all flavors doesn't provide the extra specs,
            # we need to call each of the flavor to get them.
            for flavor in flavors:
    @@ -103,7 +103,7 @@ def _get_evacuable_images(connection):
                    images = connection.images.list(detailed=True)
            elif hasattr(connection, "glance"):
                    # OSP12+
    -               images = connection.glance.list()
    +               images = connection.glance.list(is_public=None)
     
            for image in images:
                    if hasattr(image, 'metadata'):

Comment 3 Luca Miccini 2020-07-23 12:33:51 UTC
probably this is not needed:

    -               images = connection.glance.list()
    +               images = connection.glance.list(is_public=None)

Comment 11 pkomarov 2020-08-27 23:59:08 UTC
Created attachment 1712891 [details]
Verification steps

Verified , 

verification steps are in the attachment (too long for a regular comment)

Comment 14 errata-xmlrpc 2020-11-04 02:29:00 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 (fence-agents bug fix and enhancement update), 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/RHBA-2020:4622