cinder should not send external event when extend online is called by glance

Bug #2000724 reported by Rajat Dhasmana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Unassigned

Bug Description

When using glance cinder store, if we call the extend API for an attached volume, cinder tries to send an external event to nova.
This is because, the case of glance cinder store isn't considered in the cinder code and the extend in-use operation is assumed to be always called by nova.
Since we don't have a server_id (and even we don't need to send any external event in this case), we see the following error trace in cinder logs.

Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova [req-5d1f13b6-77ac-436a-877b-bb489fea8eb7 req-f6cf32b4-69df-4475-b861-5f30184bc4c8 service None] Failed to notify nova on events: [{'name': 'volume-extended', 'server_uuid': None, 'tag': '4bbcc393-f47e-448b-9a15-e896e8a1b0f4'}].: novaclient.exceptions.BadRequest: Invalid input for field/attribute server_uuid. Value: None. None is not of type 'string' (HTTP 400) (Request-ID: req-0836e8f9-c767-4322-9e8b-7f3561d14e78)
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova Traceback (most recent call last):
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova File "/opt/stack/cinder/cinder/compute/nova.py", line 155, in _send_events
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova response = nova.server_external_events.create(events)
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova File "/usr/local/lib/python3.8/dist-packages/novaclient/v2/server_external_events.py", line 38, in create
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova return self._create('/os-server-external-events', body, 'events',
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova File "/usr/local/lib/python3.8/dist-packages/novaclient/base.py", line 363, in _create
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova resp, body = self.api.client.post(url, body=body)
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova File "/usr/local/lib/python3.8/dist-packages/keystoneauth1/adapter.py", line 401, in post
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova return self.request(url, 'POST', **kwargs)
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova File "/usr/local/lib/python3.8/dist-packages/novaclient/client.py", line 78, in request
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova raise exceptions.from_response(resp, body, url, method)
Dec 29 17:18:48 devstack-VirtualBox cinder-volume[904991]: ERROR cinder.compute.nova novaclient.exceptions.BadRequest: Invalid input for field/attribute server_uuid. Value: None. None is not of type 'string' (HTTP 400) (Request-ID: req-0836e8f9-c767-4322-9e8b-7f3561d14e78)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/869051

Changed in cinder:
status: New → In Progress
Changed in cinder:
importance: Undecided → Medium
tags: added: extend glance glance-store
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/869051
Committed: https://opendev.org/openstack/cinder/commit/78f8a7bbe6eb12cd2b249eec456a00642181d8af
Submitter: "Zuul (22348)"
Branch: master

commit 78f8a7bbe6eb12cd2b249eec456a00642181d8af
Author: whoami-rajat <email address hidden>
Date: Tue Jan 3 14:21:11 2023 +0530

    Handle external events in extend volume

    The support to extend attached volumes is being added to glance
    cinder store with change[1].
    Currently, cinder sends external events to nova if the volume is
    in ``in-use`` state irrespective of the instance uuid value in the
    attachment records.
    When using glance cinder store, the instance_uuid field is None in
    the attachment record and that signifies that the volume is attached
    to glance host and not to a nova instance. We should not send any
    external events in this case.

    With this change, we check if the instance UUIDs are not None and
    send external events to nova. If None, we don't send any external
    events.

    [1] https://review.opendev.org/c/openstack/glance_store/+/868742

    Closes-Bug: 2000724
    Change-Id: Ia0c8ff77139524e9934ef354b1455ea01b4c31ef

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 22.0.0.0rc1

This issue was fixed in the openstack/cinder 22.0.0.0rc1 release candidate.

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.