During a volume create the consisgroup_id not set on the volume. Only the group_id is set.

Bug #1661393 reported by Tom Swanson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Critical
Xing Yang

Bug Description

During a volume create the consisgroup_id not set on the volume object. (It is set to None.) Only the group_id is set. If a driver has not added support for groups the volume will not be added to the consistency group.

Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Xing Yang (xing-yang)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/428578
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c7db2b81d426ac7455ae877cc1c38619a51c6df4
Submitter: Jenkins
Branch: master

commit c7db2b81d426ac7455ae877cc1c38619a51c6df4
Author: xing-yang <email address hidden>
Date: Fri Dec 2 05:57:08 2016 -0500

    Add missing consistencygroup_id in volume

    consistencygroup_id is missing from the volume object during
    volume creation after it is provided by the user. This problem
    was introduced by the migrating CG code. This patch fixed this
    issue. It also made consistencygroup object available in the
    volume object during volume creation and made consistencygroup
    object available in the cgsnapshot object when cgsnapshot is
    created/deleted.

    Change-Id: I243f9306df883831165eaed450c76cb4c831787c
    Closes-Bug: #1661393

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
jiamin (shljia) wrote :

object volume has consisgroup now, but it seems that volume.cgsnapshot is still empty.

Revision history for this message
jiamin (shljia) wrote :

I am sorry I made a mistake in #3, I mean snapshot.cgsnapshot is still empty, not volume.cgsnapshot.

Revision history for this message
jiamin (shljia) wrote :

there is another problem. though volume object has consistencygroup object now, but consistencygroup object can not get volumes list.

(Pdb) volume.consistencygroup.volumes
*** OrphanedObjectError: Cannot call obj_load_attr on orphaned ConsistencyGroup object

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 10.0.0.0rc1

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

Revision history for this message
Xing Yang (xing-yang) wrote :

Hi Jiamin,

Are "snapshot.cgsnapshot" and "volume.consistencygroup.volumes" currently used in your driver (assuming it is IBM driver)? If so, can you please provide a link to the code where they are referenced?

I'll look into how to add these data there. Since we are creating the objects for consistencygroup and cgsnapshot that do not exist in the database, I try not to hack everything if it is not needed by the drivers. If they are used by the existing drivers, I'll need to add them so the drivers won't be broken. Thanks.

Revision history for this message
Xing Yang (xing-yang) wrote :

Hi Jiamin,

I opened another bug to track this and submitted a patch. Please see if it fixed your problems:

https://review.openstack.org/#/c/430449/

Revision history for this message
Xing Yang (xing-yang) wrote :

Jiamin,

What data do you need to access from volume.consistencygroup.volumes other than volume id?

Revision history for this message
Xing Yang (xing-yang) wrote :
Revision history for this message
jiamin (shljia) wrote :

Thanks xyang for your help, you are right, it is IBM DS8000 driver.

yesterday I had switched the code in the driver from consistencygroup/cgsnapshot to generic volume group totally, and now it works. the link of the patch is https://review.openstack.org/#/c/419321

let me explain why we need to use "snapshot.cgsnapshot" and "volume.consistencygroup.volumes" before, actually now we still need to use them in this way but I have changed them to snapshot.group_snapshot and volume.group. because for DS8K driver, it needs to find out all of volumes in consistency group when user create a volume and put it into a consistency group via "cinder create --consisgroup-id xxxx --volume-type xxxx --name xxxx x" in order to get the metadata from these volumes so that it can know they have used which LSS(LSS is like a container that can hold a lot of volumes), then locate the new volume in it.

if consistencygroup has metadata, then we don't need to query all of volumes in consistency group, just store the LSS in it and get it when driver needs it, unfortunately, consistencygroups, cgsnapshots, groups, group_snapshots tables don't have such a metadata field, correct? so driver needs to query all of volumes in all of these groups.

Hope you can understand what I say, and please help me to review the patch, thank you very much.

Revision history for this message
jiamin (shljia) wrote :

I am sorry that I forgot to mention that this patch is still in the flight, so if other drivers don't use it in this way, I think you may don't need to fix it.

Revision history for this message
Xing Yang (xing-yang) wrote :

I think it's good to fix "snapshot.cgsnapshot", but I'd rather not to set "volume.consistencygroup.volumes" if it is not used in the existing code as it makes the code look ugly. "volume" is in the list of volume objects "volume.consistencygroup.volumes" so it becomes a circular reference. Setting it manually is not good as we can't load it from db dynamically.

Your new approach to use snapshot.group_snapshot and volume.group is the best as eventually we want to get rid of the old consistencygroup and cgsnapshot after all drivers have migrated to generic volume groups.

I'll take a look of your patch. Please also review my patch and make sure it doesn't break your code: https://review.openstack.org/#/c/430449/ (note: I'll remove the change to set volume.consistencygroup.volumes).

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.