manila_tempest_tests.tests.scenario.test_share_basic_ops create share failed because share type not found

Bug #1755795 reported by shuaili.wang
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
Unassigned

Bug Description

Manila related configuration in tempest.conf as followes:

manila = true

[share]
capability_create_share_from_snapshot_support = True
build_timeout = 2000
enable_protocols = nfs
suppress_errors_in_cleanup = True
share_creation_retry_number = 2
default_share_type_name = default
backend_names = generic1,generic2
multi_backend = True
image_with_share_tools = manila-service-image-master
image_password = manila

----------------------------------------------------------------------------------------
default_share_type_name is configured with the name of type;
Executing tempest test:manila_tempest_tests.tests.scenario.test_share_basic_ops;
when share is created, share type not found.

The logs as followes:
Traceback (most recent call last):
  File "tempest/test.py", line 99, in wrapper
    return f(self, *func_args, **func_kwargs)
  File "/root/wsl-tempest/tempest/.venv/lib/python2.7/site-packages/manila_tempest_tests/tests/scenario/test_share_basic_ops.py", line 215, in test_mount_share_one_vm
    self.create_share()
  File "/root/wsl-tempest/tempest/.venv/lib/python2.7/site-packages/manila_tempest_tests/tests/scenario/test_share_basic_ops.py", line 170, in create_share
    'share_type_id': self._get_share_type()['id'],
  File "/root/wsl-tempest/tempest/.venv/lib/python2.7/site-packages/manila_tempest_tests/tests/scenario/test_share_basic_ops.py", line 158, in _get_share_type
    if CONF.share.default_share_type_name:
  File "/root/wsl-tempest/tempest/.venv/lib/python2.7/site-packages/manila_tempest_tests/services/share/json/shares_client.py", line 641, in get_share_type
    resp, body = self.get("types/%s" % share_type_id)
  File "tempest/lib/common/rest_client.py", line 291, in get
    return self.request('GET', url, extra_headers, headers)
  File "tempest/lib/common/rest_client.py", line 664, in request
    self._error_checker(resp, resp_body)
  File "tempest/lib/common/rest_client.py", line 761, in _error_checker
    raise exceptions.NotFound(resp_body, resp=resp)
tempest.lib.exceptions.NotFound: Object not found
Details: {u'message': u'Share type not found.', u'code': 404}

Changed in manila:
assignee: nobody → shuaili.wang (shuaili.wang)
description: updated
description: updated
description: updated
Revision history for this message
Tom Barron (tpb) wrote :

Did you create a share type named 'default'?

Please check the output of the 'manila type-list' command.

Revision history for this message
shuaili.wang (shuaili.wang) wrote :

Tom Barron:
    share type named 'default', which is created by default after the environment is installed.
In my environment, the'manila type-list'command is executed as follows:

ID | Name | visibility | is_default | required_extra_specs | optional_extra_specs | Description |
+--------------------------------------+------------+------------+------------+--------------------------------------+-------------------------------------------+-------------+
| 02eb58f4-f655-404f-9fcc-86d3e75ba9a5 | dhss_true | public | - | driver_handles_share_servers : True | | None |
| 3e028070-5d8e-4d8a-bf5f-c02030121daf | dhss_false | public | - | driver_handles_share_servers : False | | None |
| b76b958f-e70d-4027-969d-16e4fe5b97b2 | default | public | YES | | None |

Revision history for this message
shuaili.wang (shuaili.wang) wrote :

Tom Barron:
    If default_share_type_name = default is not configured in tempest.conf, the test case will create a new type during the execution, and the test can be executed correctly.
    if default_share_type_name = default is configured in tempest.conf,the above error will occur.

Revision history for this message
Tom Barron (tpb) wrote :

I am puzzled by the fact that the share type named 'default', and which 'manila type-list' reports *is* the default, is missing its required_extra_specs (the driver_handles_share_servers attribute).

How was this default share type created? The cli for the manila client errors out unless one supplies a value for driver_handles_share_servers when using the 'manila type-create' command, and it is a non-optional parameter in the create_share_type api - https://developer.openstack.org/api-ref/shared-file-system/#create-share-type

Revision history for this message
shuaili.wang (shuaili.wang) wrote :

Tom Barron:
    I'm terribly sorry, I accidentally deleted the driver_handles_share_servers attribute of default.
    the'manila type-list'command is executed as follows:

+--------------------------------------+------------+------------+------------+--------------------------------------+-------------------------------------------+-------------+
| ID | Name | visibility | is_default | required_extra_specs | optional_extra_specs | Description |
+--------------------------------------+------------+------------+------------+--------------------------------------+-------------------------------------------+-------------+
| 02eb58f4-f655-404f-9fcc-86d3e75ba9a5 | dhss_true | public | - | driver_handles_share_servers : True | | None |
| 3e028070-5d8e-4d8a-bf5f-c02030121daf | dhss_false | public | - | driver_handles_share_servers : False | | None |
| b76b958f-e70d-4027-969d-16e4fe5b97b2 | default | public | YES | driver_handles_share_servers : True | | None |

Changed in manila:
assignee: shuaili.wang (shuaili.wang) → nobody
Revision history for this message
Dustin Schoenbrun (dschoenb) wrote :

We should work on minimising the usage of the default share type in tests to only tests that specifically test that functionality. We should create share types automatically for all other cases. Group setup and teardown is a good place for this stuff. There is also the possibility of individual test setup and teardown for tests that require any sort of special requirement.

Changed in manila:
status: New → Confirmed
assignee: nobody → Victoria Martinez de la Cruz (vkmc)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-tempest-plugin (master)

Fix proposed to branch: master
Review: https://review.openstack.org/584505

Changed in manila:
status: Confirmed → In Progress
Changed in manila:
assignee: Victoria Martinez de la Cruz (vkmc) → Goutham Pacha Ravi (gouthamr)
Changed in manila:
assignee: Goutham Pacha Ravi (gouthamr) → nobody
Revision history for this message
Vida Haririan (vhariria) wrote :
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

The reproduction steps as written on this bug are no longer valid, since the tests have evolved a lot. We're chasing further enhancement to the way the default share type is used (or not): https://review.opendev.org/c/openstack/manila-tempest-plugin/+/775148

Changed in manila:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.