Migrate volume raises ObjectActionError if volume is created using image

Bug #1538926 reported by Ankit Agrawal
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Michal Dulko

Bug Description

Steps to reproduce:

1. Create volume using image.
$ cinder create 1 --name <vol_name> --image <image_name or id>

2. Check "os-vol-host-attr:host" host on which volume is created.
$ cinder show <volume_id>

3. Try to migrate on different host. If volume is created on host-1, try to migrate it on host-2.
$ cinder migrate <volume_id> <host-2>

4. Return following response to the user.
Request to migrate volume <Volume: b5e28051-fdb2-412b-9363-0ac2aafa0390> has been accepted.

But raises following error in c-vol logs at source node. In this case the volume's "Migration Status" remains "starting" and we are not able to delete that volume any more.

2016-01-27 22:55:12.640 ERROR oslo_messaging.rpc.dispatcher [req-21c36b52-abf2-4fe6-af94-a19531ecfb42 809bd0cd851247efa98192f523fde3f7 a954d549046a49ff86e725bb18c1a09d] Exception during mes
sage handling: Object action save failed because: glance_metadata changed
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 143, in _dispatch_and_reply
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 189, in _dispatch
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 109, in wrapper
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/manager.py", line 1858, in migrate_volume
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher volume.save()
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 221, in wrapper
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher return fn(self, *args, **kwargs)
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/objects/volume.py", line 296, in save
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher action='save', reason=_('glance_metadata changed'))
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher ObjectActionError: Object action save failed because: glance_metadata changed
2016-01-27 22:55:12.640 TRACE oslo_messaging.rpc.dispatcher

Affects: lvm and nfs drivers.

summary: - Migrate volume raise ObjectActionError if volume is created using image
+ Migrate volume raises ObjectActionError if volume is created using image
Changed in cinder:
assignee: nobody → Ankit Agrawal (ankitagrawal)
Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

>>In this case the volume's "Migration Status" remains "starting" and we are not able to delete that volume any more.

Just a question. Can you change the status of volume which was failed to migrate volume using "cinder reset-state --reset-migration-status"?

Revision history for this message
Steve Currie (steve-currie3463) wrote :

I wanted to add a comment on this bug hope you don't mind but it might be somehow related and I recently started seeing this error after stacking from the Mitaka master this week
" Exception during message handling: Object action save failed because: glance_metadata changed"

 I see the same error in c-vol.log when attempting to change an image volume type from 1 backend to another - this used to work
for me
I simply create an image vol using the default Cirros image and I then select to change volume type, selecting on demand and point to another backend - (using cinder block storage)
At this point the volume is stuck in a retyping Status
thank you

Revision history for this message
Ankit Agrawal (ankitagrawal) wrote :

@Mitsuhiro Tanino, Yes I am able to reset migration status using "cinder reset-state --reset-migration-status" but the original issue related to "ObjectActionError" still remains there. Thanks!

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

Ankit,

Thank you for your confirmation. Please keep to fix the problem.

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/276747

Changed in cinder:
assignee: Ankit Agrawal (ankitagrawal) → Szymon Borkowski (szymon-borkowski)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Szymon Borkowski (<email address hidden>) on branch: master
Review: https://review.openstack.org/276747
Reason: It seems that that issue is already fixed on current master.

Changed in cinder:
status: In Progress → Invalid
Changed in cinder:
status: Invalid → In Progress
Changed in cinder:
importance: Undecided → Medium
Changed in cinder:
milestone: none → mitaka-rc1
Changed in cinder:
assignee: Szymon Borkowski (szymon-borkowski) → Michal Dulko (michal-dulko-f)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit 6ead3b86b201b1aed8930464a48df35f1492674a
Author: Szymon Borkowski <email address hidden>
Date: Fri Feb 5 15:05:39 2016 +0100

    Fix for glance_metadata during volume migration

    This patch allows to transfer glance_metadata together with volume
    during the migration process, when the volume is created from the
    image.

    Co-Authored-By: Michal Dulko <email address hidden>
    Change-Id: Ifee5f2c53865076f43556d9dd6b6cbef77494bc8
    Closes-Bug: 1538926

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/cinder 8.0.0.0rc1

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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