Unable to delete a group volume after transfer

Bug #1955670 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Medium
Rajat Dhasmana

Bug Description

I'm on the latest (main branch) of Cinder as of Dec 23rd 2021:

$ git log -1
commit d3cd45453fe6033a7eb83577530fa25056eade70 (HEAD -> master, origin/master, origin/HEAD)
Author: OpenStack Proposal Bot <email address hidden>
Date: Mon Dec 20 02:29:42 2021 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

    Change-Id: If21f7e9dc585ae407f4ee4c187da4c1eb2def135

Steps to reproduce this bug on a devstack:

1) Be a user in the "demo" project:
source ~/devstack/openrc admin demo

2) Create a group type
cinder group-type-create wtest

3) Create a volume group
cinder group-create --name test wtest lvmdriver-1

4) Create a volume in the group
cinder create 1 --group-id 723283d6-a085-4ad4-a535-1eeeadceadfe --volume-type 976d6c18-a23e-4759-bd8a-f11b33b99e14 --name testvol

5) Initiate transfer
cinder transfer-create testvol --name "test transfer"

6) Be a user in the "alt_demo" project:
source ~/devstack/openrc alt_demo alt_demo

7) Accept the volume transfer:
cinder transfer-accept 00240250-91bc-4271-a9aa-cad098d84b87 7bf2ee2197344d2f

8) Attempt to delete the volume:

cinder delete 3166bc72-d901-491b-b8ea-b244ea6b523b
Delete for volume 3166bc72-d901-491b-b8ea-b244ea6b523b failed: Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots or be disassociated from snapshots after volume transfer. (HTTP 400) (Request-ID: req-2a6d363d-602e-4856-a1c0-04b849d5dbb0)

How does one delete such a volume? The group still belongs to the original project, but the volume is in its new project.

Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :

Thanks Rajat for reporting this bug. This looks important, let's discuss it in next week's main or bug meeting if it's OK with you. Cheers. Sofi

Changed in cinder:
importance: Undecided → Medium
tags: added: delete group volume
Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote :

Hi Goutham,

As per my understanding, volumes that are part of a group should not be allowed to be transferred as there is no optimal way to make that happen. The volumes should first be removed from the group and then transferred.
Going through the code, i can see we've a check regarding consistency group[1] but nothing regarding generic volume groups which we should have. I will try to look into adding a check for it. Thanks for reporting this.

[1] https://github.com/openstack/cinder/blob/master/cinder/transfer/api.py#L237-L241

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/+/823185

Changed in cinder:
status: New → In Progress
Changed in cinder:
assignee: nobody → Rajat Dhasmana (whoami-rajat)
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.