Skip to content

Upstream work on the discoverability of certain recommended volume type aspects. #449

Open

Description

@josephineSei

As a user, I want to be able to look into a volume type object and see all aspects it fulfills so that I can choose the best suited volume type for my volumes.

In #265 a standard for volume types is created. Right now SCS, providers and consumers need to rely on Tags in the description of a volume type to discover volume types with the recommended aspects encrypted and replicated.

We want to find a way to use the internal extra_spec in volume types for the description of those two aspects, when they are present in a volume type. If this is not possible, we would like to introduce another property, which has to be set by the admin, when setting the volume type. Only after that we will have the possibility to automatically check for a volume type with replication or encyption.

Definition of Done:

  • The aspect of encryption is discoverable for a user role in upstream OpenStack
  • The aspect of replication is discoverable for a user role in upstream OpenStack
  • The standard is changed to use the upstream way of discovering replication and encryption in a volume type

Activity

  1. added
    IaaS
    SCS-VP10
    on Jan 12, 2024
  2. self-assigned this
    on Jan 12, 2024
  3. josephineSei commented on Jan 29, 2024

    @josephineSei
    ContributorAuthor

    For volume types there exist already the concept of user visible extra specs, that are triggered by policy:
    https://docs.openstack.org/cinder/latest/admin/user-visible-extra-specs.html
    It should be possible to add support for an encryption extra spec, as everything necessary is already there. The encryption parameters can be accessed as an admin like this:

    stack@woc15:~/devstack$ openstack volume type show LUKS --encryption-type
    +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Field              | Value                                                                                                                                                                                                                             |
    +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | access_project_ids | None                                                                                                                                                                                                                              |
    | description        | None                                                                                                                                                                                                                              |
    | encryption         | cipher='aes-xts-plain64', control_location='front-end', created_at='2023-11-30T16:13:15.000000', deleted='False', deleted_at=, encryption_id='872a9738-34d0-43d6-977a-91ea4858e74f', key_size='256', provider='luks', updated_at= |
    | id                 | bee35d94-d42c-42d8-b226-32be9ca5b694                                                                                                                                                                                              |
    | is_public          | True                                                                                                                                                                                                                              |
    | name               | LUKS                                                                                                                                                                                                                              |
    | properties         |                                                                                                                                                                                                                                   |
    | qos_specs_id       | None                                                                                                                                                                                                                              |
    +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    

    For replication it is harder, as it depends on the used backend. That means, it cannot be derived from inside openstack but would need the input from the provider, whether there is replication or not. I will go into discussion with the Cinder developers about this.

    But it might be possible to easily do that as the setting of extra specs is only allowed for admins now and only when the volume type is not in use. So it would just be necessary to make something like this visible to users:

    openstack volume type set --property replications=3 LUKS
    openstack volume type show LUKS --encryption-type
    +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Field              | Value                                                                                                                                                                                                                             |
    +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | access_project_ids | None                                                                                                                                                                                                                              |
    | description        | None                                                                                                                                                                                                                              |
    | encryption         | cipher='aes-xts-plain64', control_location='front-end', created_at='2023-11-30T16:13:15.000000', deleted='False', deleted_at=, encryption_id='872a9738-34d0-43d6-977a-91ea4858e74f', key_size='256', provider='luks', updated_at= |
    | id                 | bee35d94-d42c-42d8-b226-32be9ca5b694                                                                                                                                                                                              |
    | is_public          | True                                                                                                                                                                                                                              |
    | name               | LUKS                                                                                                                                                                                                                              |
    | properties         | replications='3'                                                                                                                                                                                                                  |
    | qos_specs_id       | None                                                                                                                                                                                                                              |
    +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    

    This is currently only visible for admins.

  4. josephineSei commented on Jan 30, 2024

    @josephineSei
    ContributorAuthor

    While going through the cinder code to check the places for any upstream patches, I stumbled across the policies:
    https://github.com/openstack/cinder/blob/master/cinder/policies/volume_type.py#L156
    This allows users to read the extra specs but it can be shut down through a policy file (only allowing admin access). We should keep that in mind.

  5. josephineSei commented on Jan 30, 2024

    @josephineSei
    ContributorAuthor

    I am currently trying to implement a visible user extra spec for encryption, that is automatically set when creating or unset when deleting an encryption type in here:
    https://github.com/openstack/cinder/blob/master/cinder/api/contrib/volume_type_encryption.py
    It should not be setable outside of that workflow.

  6. josephineSei commented on Jan 31, 2024

    @josephineSei
    ContributorAuthor

    I am currently running into some errors with my implementation and try to fix that:

    openstack volume type create --encryption-provider nova.volume.encryptors.luks.LuksEncryptor --encryption-cipher aes-xts-plain64 --encryption-key-size 256 --encryption-control-location front-end LUKS
    Failed to set encryption information for this volume type: The resource could not be found.<br /><br />
    
    
     (HTTP 404)
    local variable 'encryption' referenced before assignment
    
  7. josephineSei commented on Feb 1, 2024

    @josephineSei
    ContributorAuthor

    I found a neat solution for a possible encryption extra spec:

    stack@devstack:~/devstack$ openstack volume type create --encryption-provider nova.volume.encryptors.luks.LuksEncryptor --encryption-cipher aes-xts-plain64 --encryption-key-size 256 --encryption-control-location front-end LUKS3
    +-------------+------------------------------------------------------------------------------+
    | Field       | Value                                                                        |
    +-------------+------------------------------------------------------------------------------+
    | description | None                                                                         |
    | encryption  | cipher='aes-xts-plain64', control_location='front-end',                      |
    |             | encryption_id='135648f5-a979-4ee4-a5ed-14115431bf0f', key_size='256',        |
    |             | provider='nova.volume.encryptors.luks.LuksEncryptor'                         |
    | id          | d0ff021e-9379-452d-8596-f1669447edbd                                         |
    | is_public   | True                                                                         |
    | name        | LUKS3                                                                        |
    +-------------+------------------------------------------------------------------------------+
    stack@devstack:~/devstack$ openstack volume type show LUKS3
    +--------------------+--------------------------------------+
    | Field              | Value                                |
    +--------------------+--------------------------------------+
    | access_project_ids | None                                 |
    | description        | None                                 |
    | id                 | d0ff021e-9379-452d-8596-f1669447edbd |
    | is_public          | True                                 |
    | name               | LUKS3                                |
    | properties         | encryption_enabled='1'               |
    | qos_specs_id       | None                                 |
    +--------------------+--------------------------------------+
    stack@devstack:~/devstack$ source openrc demo
    WARNING: setting legacy OS_TENANT_NAME to support cli tools.
    stack@devstack:~/devstack$ openstack volume type show LUKS3
    +--------------------+--------------------------------------+
    | Field              | Value                                |
    +--------------------+--------------------------------------+
    | access_project_ids | None                                 |
    | description        | None                                 |
    | id                 | d0ff021e-9379-452d-8596-f1669447edbd |
    | is_public          | True                                 |
    | name               | LUKS3                                |
    | properties         | encryption_enabled='1'               |
    +--------------------+--------------------------------------+
    

    It is created when creating an encrypted volume type and visible to users.
    I will polish it and make an upstream patchset and ask them, if that would fit.

  8. josephineSei commented on Feb 2, 2024

    @josephineSei
    ContributorAuthor
  9. josephineSei commented on Feb 2, 2024

    @josephineSei
    ContributorAuthor

    I pushed my changes to https://review.opendev.org/c/openstack/cinder/+/907519 to discuss them with upstream.

    I was fixing a few Errors and found out, that creating custom properties / extra specs lets the volume creation fail. I am asking Upstream about the details of this.

  10. josephineSei commented on Feb 5, 2024

    @josephineSei
    ContributorAuthor

    I am investigating a hint that it might be the scheduler, who is responsible for the errors of custom properties. Mailing List Discussion: https://lists.openstack.org/archives/list/[email protected]/thread/ZWXFYIQ3FSFC5MGTSIMVEHCEJRQQRQ3X/

  11. josephineSei commented on Feb 5, 2024

    @josephineSei
    ContributorAuthor

    I am investigating a hint that it might be the scheduler, who is responsible for the errors of custom properties. Mailing List Discussion: https://lists.openstack.org/archives/list/[email protected]/thread/ZWXFYIQ3FSFC5MGTSIMVEHCEJRQQRQ3X/

    The cause of this is indeed the Cinder Scheduler, that checks ALL properties (== extra_specs) here, for their compatability with the backends: https://github.com/openstack/cinder/blob/master/cinder/scheduler/filters/capabilities_filter.py#L56

    Changing this Filter would be possible, but whether we would only allow one or two special extra_specs to be skipped in this filter or to cheange the filter using a list of extra_specs to check for their presence and compatability is something we need to discuss with upstream.

  12. josephineSei commented on Feb 7, 2024

    @josephineSei
    ContributorAuthor

    I attended the Cinder meeting to discuss my findings, but unfortunately there was not enough time, we will continue the discussion via ML or in the next week.

    https://meetings.opendev.org/meetings/cinder/2024/cinder.2024-02-07-14.00.log.html

  13. fkr commented on Feb 7, 2024

    @fkr
    Member

    thanks @josephineSei for keeping this updated.

  14. josephineSei commented on Feb 9, 2024

    @josephineSei
    ContributorAuthor

    After trying to reach out to people and going through the patches again, I added this as a discussion point for the midcycle ptg: https://etherpad.opendev.org/p/cinder-caracal-midcycles

  15. 56 remaining items

  16. josephineSei commented on Nov 4, 2024

    @josephineSei
    ContributorAuthor

    I marked the spec as active and need to investigate a bit more in unit tests, the first test seems to run on my machine: https://review.opendev.org/c/openstack/cinder/+/928794

  17. josephineSei commented on Nov 5, 2024

    @josephineSei
    ContributorAuthor

    I stumbled upon a functional unit test, that has a very strange behavior:

    When I execute the functional unit test to check the extensions I get an ERROR:

    $ tox -efunctional-py39  -vv -- cinder.tests.functional.api_sample_tests.test_extensions.ExtensionsSampleJsonTest.test_extensions
    ....
    ....
    ==============================
    Failed 1 tests - output below:
    ==============================
    
    cinder.tests.functional.api_sample_tests.test_extensions.ExtensionsSampleJsonTest.test_extensions
    -------------------------------------------------------------------------------------------------
    
    Captured traceback:
    ~~~~~~~~~~~~~~~~~~~
        Traceback (most recent call last):
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 394, in _verify_response
        response_result = self._compare_result(template_data,
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 280, in _compare_result
        matched_value = self._compare_dict(
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 183, in _compare_dict
        res = self._compare_result(expected[key], result[key],
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 284, in _compare_result
        matched_value = self._compare_list(
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 238, in _compare_list
        raise NoMatch('\n'.join(error))
    
        cinder.tests.functional.api_samples_test_base.NoMatch: Extra list items in Response:
    {'alias': 'os-types-metadata', 'description': 'Type metadata support.', 'links': [], 'name': 'TypesMetadata', 'updated': '2024-09-09T00:00:00+00:00'}
    

    When I try to add the new microversion in the extension-list-response sample, I get that Error:

    ==============================
    Failed 1 tests - output below:
    ==============================
    
    cinder.tests.functional.api_sample_tests.test_extensions.ExtensionsSampleJsonTest.test_extensions
    -------------------------------------------------------------------------------------------------
    
    Captured traceback:
    ~~~~~~~~~~~~~~~~~~~
        Traceback (most recent call last):
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 416, in _verify_response
        self._compare_result(template_data, sample_data, "Sample")
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 280, in _compare_result
        matched_value = self._compare_dict(
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 183, in _compare_dict
        res = self._compare_result(expected[key], result[key],
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 284, in _compare_result
        matched_value = self._compare_list(
    
          File ".../cinder/cinder/tests/functional/api_samples_test_base.py", line 238, in _compare_list
        raise NoMatch('\n'.join(error))
    
        cinder.tests.functional.api_samples_test_base.NoMatch: Extra list items in template:
    {'alias': 'os-types-metadata', 'description': 'Type metadata support.', 'links': [], 'name': 'TypesMetadata', 'updated': '%(extension_update)s'}
    

    The failing part here is not in the original test file, but in the abstract test-base class, where three things are compared:

    1. The response from the actual call to the function
    2. The template I first adjusted
    3. a document in the api-ref

    This is hard to detect, because the original test does not indicate the not only 2 things are compared, but in fact 3.
    This can only be concluded, when going through the base class.

    So whenever there is a template to be adjusted, it may not be the only thing to adjust in Cinder so that your unit tests will be successful.

  18. josephineSei commented on Nov 6, 2024

    @josephineSei
    ContributorAuthor

    I am continuing working on unit tests and attended the Cinder weekly meeting to raise attention for reviews.

  19. josephineSei commented on Nov 7, 2024

    @josephineSei
    ContributorAuthor

    unit tests adjustments to reflect the new microversion is going into a good direction: https://review.opendev.org/c/openstack/cinder/+/928794

  20. josephineSei commented on Nov 11, 2024

    @josephineSei
    ContributorAuthor

    I finished unit tests, I think. I will take another look in the functional and maybe tempest tests.

  21. josephineSei commented on Nov 12, 2024

    @josephineSei
    ContributorAuthor

    After fixing some failures in the OpenStack zuuil pipeline, I started looking into creating tempest tests with a microversion. This leads to the question, whether tests should reside in tempest itself or rather in the tempest plugin from Cinder.
    For now I think it should be tempest itself, but it could be argued, that these are just API and database calls and thus should rather reside in the cinder tempest plugin. You can read here when tests should be part of tempest and when not.

  22. josephineSei commented on Nov 13, 2024

    @josephineSei
    ContributorAuthor

    I again raised awareness for the patches in the cinder team meeting and also told them in the cinder channel, that we will not have that much time any more from december on to work on upstream items.
    Beside that I worked on the tempest tests.

  23. josephineSei commented on Nov 14, 2024

    @josephineSei
    ContributorAuthor

    I have a first draft of tempest tests, which should be sufficient in the amount of test cases: https://review.opendev.org/c/openstack/tempest/+/935142
    I still need to look into the pipeline and check possible errors.

  24. josephineSei commented on Nov 15, 2024

    @josephineSei
    ContributorAuthor

    Momentan funktioniert der Aufruf mit der korrekten microversion in meinen tempest tests nicht. Daher schlagen sie fehl: https://review.opendev.org/c/openstack/tempest/+/935142

    Ich versuche das Problem anzugehen und zu lösen.

  25. josephineSei commented on Nov 18, 2024

    @josephineSei
    ContributorAuthor

    I'm still on the tempest tests and also updated the clients to reflect the use of microversions. I still need to test all the patches together.

  26. josephineSei commented on Nov 19, 2024

    @josephineSei
    ContributorAuthor

    The documentation about the usage of microversions in tempest is not very clear. I am still struggeling with this.
    And I missed the dependence of the cinderclient patch on the cinder-API patch. I hope that fixes the CI-pipeline.

  27. josephineSei commented on Nov 21, 2024

    @josephineSei
    ContributorAuthor

    i fixed the tests for the cinderclient and move forward on the tempest tests with making the tests work with the correct microversion.

  28. josephineSei commented on Nov 22, 2024

    @josephineSei
    ContributorAuthor

    I tried a few more things to address that the tests use the correct microversion in the tempest tests.

  29. josephineSei commented on Nov 25, 2024

    @josephineSei
    ContributorAuthor

    The patches are in a good state, I just could not get tempest to accept the microversions:
    https://review.opendev.org/q/topic:%22user-visible-metadata-in-volume-types%22

    Nevertheless the major part of work is done, it needs reviews from upstream openstack cinder team and hopefully only smaller adjustments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

IaaSSCS-VP10upstream

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions