Cache volume name_id is set incorrectly when creating volume from image

Bug #1528087 reported by Peter Wang
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Peter Wang

Bug Description

After configure Generic image cache functionality in cinder

when creating a volume from image, error occurred as following:

34673 |__Atom 'cinder.volume.flows.manager.create_volume.ExtractVolumeRefTask;volume:create' {'intention': 'EXECUTE', 'state': 'SU CCESS', 'requires': {'context': <cinder.context.RequestContext object at 0x7f1c53da5b90>, 'volume_id': '9ba5fc85-2a0e-4670-bb74-bdcf 62b882ee'}, 'provides': Volume(_name_id=fe0a45e5-538a-4b04-a128-d21300dd9d4d,admin_metadata={},attach_status='detached',availability _zone='nova',bootable=False,consistencygroup=<?>,consistencygroup_id=None,created_at=2015-12-18T06:00:15Z,deleted=False,deleted_at=N one,display_description=None,display_name='image-62754519-f884-4cb8-b05e-38e34cb304aa',ec2_id=None,encryption_key_id=None,glance_met adata=<?>,host='ubuntu14-new@vnx1#Pool_1',id=9ba5fc85-2a0e-4670-bb74-bdcf62b882ee,launched_at=None,metadata={lun_type='lun'},migrati on_status=None,multiattach=False,previous_status=None,project_id=c4b50e89bafd44a78de693fd0f54dd47,provider_auth=None,provider_geomet ry=None,provider_id=None,provider_location='version^07.00.00|type^lun|system^APM00152904560|id^41',replication_driver_data=None,repl ication_extended_status=None,replication_status='disabled',scheduled_at=2015-12-18T06:04:56Z,size=1,snapshot_id=None,snapshots=<?>,s ource_volid=fe0a45e5-538a-4b04-a128-d21300dd9d4d,status='creating',terminated_at=None,updated_at=2015-12-18T06:04:56Z,user_id=a44bb0 9b536a4ed5829c7004ae19774d,volume_attachment=<?>,volume_type=<?>,volume_type_id=None)}
34674 |__volume_create_manager
34675 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager Traceback (most recent call last):
34676 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_eng ine/executor.py", line 82, in _execute_task
34677 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager result = task.execute(**arguments)
34678 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/opt/stack/cinder/cinder/volume/flows/manager/create_volume.py", l ine 827, in execute
34679 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager context, volume_ref=volume_ref, **volume_spec)
34680 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/opt/stack/cinder/cinder/volume/flows/manager/create_volume.py", l ine 484, in _create_from_source_volume
34681 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager model_update = self.driver.create_cloned_volume(volume_ref, srcvol_ref )
34682 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", li ne 105, in wrapper
34683 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager return f(*args, **kwargs)
34684 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/opt/stack/cinder/cinder/volume/drivers/emc/emc_cli_iscsi.py", lin e 83, in create_cloned_volume
34685 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager return self.cli.create_cloned_volume(volume, src_vref)
34686 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/opt/stack/cinder/cinder/volume/drivers/emc/emc_vnx_cli.py", line 2960, in create_cloned_volume
34687 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager flow_engine.run()
34688 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_eng ine/engine.py", line 159, in run
34689 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager for _state in self.run_iter():
34690 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_eng ine/engine.py", line 215, in run_iter
34691 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager self._change_state(states.FAILURE)
34692 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", li ne 204, in __exit__
34693 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager six.reraise(self.type_, self.value, self.tb)
34694 2015-12-18 06:06:43.800 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_eng ine/engine.py", line 199, in run_iter

We can clearly see the _name_id is set to the id of volume ( with id fe0a45e5-538a-4b04-a128-d21300dd9d4d) to be created from image. the cached image volume(9ba5fc85-2a0e-4670-bb74-bdcf62b882ee) then mapped to original image volume(fe0a45e5-538a-4b04-a128-d21300dd9d4d).

and addtional error happened, when trying to delete the volume in reverting stage:

34798 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils. py", line 264, in inner
34799 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager do_log=False, semaphores=semaphores, delay=delay):
34800 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
34801 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager return self.gen.next()
34802 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils. py", line 216, in lock
34803 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager ext_lock.acquire(delay=delay)
34804 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/fasteners/process_lock.py", line 151, in acquire
34805 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager self._do_open()
34806 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager File "/usr/local/lib/python2.7/dist-packages/fasteners/process_lock.py", line 123, in _do_open
34807 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager self.lockfile = open(self.path, 'a')
34808 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager IOError: [Errno 36] File name too long: "/opt/stack/data/cinder/cinder-Vol ume(_name_id=fe0a45e5-538a-4b04-a128-d21300dd9d4d,admin_metadata={},attach_status='detached',availability_zone='nova',bootable=False ,consistencygroup=<?>,consistencygroup_id=None,created_at=2015-12-18T06:00:15Z,deleted=False,deleted_at=None,display_description=Non e,display_name='image-62754519-f884-4cb8-b05e-38e34cb304aa',ec2_id=None,encryption_key_id=None,glance_metadata=<?>,host='ubuntu14-ne w@vnx1#Pool_1',id=9ba5fc85-2a0e-4670-bb74-bdcf62b882ee,launched_at=None,metadata={lun_type='lun'},migration_status=None,multiattach= False,previous_status=None,project_id=c4b50e89bafd44a78de693fd0f54dd47,provider_auth=None,provider_geometry=None,provider_id=None,pr ovider_location='version^07.00.00|type^lun|system^APM00152904560|id^41',replication_driver_data=None,replication_extended_status=Non e,replication_status='disabled',scheduled_at=2015-12-18T06:04:56Z,size=1,snapshot_id=None,snapshots=<?>,source_volid=fe0a45e5-538a-4 b04-a128-d21300dd9d4d,status='creating',terminated_at=None,updated_at=2015-12-18T06:04:56Z,user_id=a44bb09b536a4ed5829c7004ae19774d, volume_attachment=<?>,volume_type=<?>,volume_type_id=None)-delete_volume"
34809 2015-12-18 06:06:44.770 15147 ERROR cinder.volume.manager

Changed in cinder:
assignee: nobody → Peter Wang (peter.wang)
status: New → In Progress
Revision history for this message
Patrick East (patrick-east) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit 864cd83c5a73cc274ba2193cc757b38a528b0332
Author: peter_wang <email address hidden>
Date: Mon Dec 21 05:37:12 2015 -0500

    Remove name_id when creating volume with cache enabled

    When image_volume_cache_enabled = True, Cinder will create
    a cached image volume. But when creating this image volume,
    the name_id is set to id of newly created volume, which causes
    the image volume is unable to be created in the underlying storage
    system.

    This fix will remove the name_id so that volume.name can refer to
    correct LUN on storage system

    Also, a minor fix: passing volume.id to delete_volume since
    it only accept volume id.

    Change-Id: Ib47b189a525d8a9bd9026cc20f62542aede9c9d4
    Closes-bug: 1528087

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

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

commit 16f1dc862e9771f7b26d094bdcf41791c9fc5a8c
Author: Tomoki Sekiyama <email address hidden>
Date: Tue Dec 29 12:35:52 2015 +0900

    Fix image volume creation error

    When "image_upload_use_cinder_backend = True" is specified to
    the volume backend and the Glance cinder store is enabled,
    upload-to-image command fails with the following error:

      Create clone_image_volume: xxx for image xxx failed
      (Exception: An object of type VolumeAttachmentList is required
       in field volume_attachment, not a )

    This is due to unnecessary attributes specified in the volume
    params, such as 'volume_attachment' or 'consistencygroup'.
    This patch removes the unnecessary attributes from the params.

    Change-Id: Ia416cb6686312e1591de7fe40a7ce7d6aa2fce7d
    Closes-Bug: #1529762
    Related-Bug: #1528087

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.