[Openstack] [cinder] CreateVolumeFromSpecTask._create_from_image

Joshua Harlow harlowja at yahoo-inc.com
Wed Aug 21 22:37:19 UTC 2013

Is there anyway for the volume driver to have some kind of mechanism to say 'export volume before' instead of 'after'??

That would be one way to handle this.

From: Victor Rodionov <victor.rodionov at nexenta.com<mailto:victor.rodionov at nexenta.com>>
Date: Tuesday, August 20, 2013 11:31 AM
To: openstack <openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>>
Subject: [Openstack] [cinder] CreateVolumeFromSpecTask._create_from_image


It seems there is an error in CreateVolumeFromSpecTask for create volume from image (_create_from_image method)

        if not cloned:
            # TODO(harlowja): what needs to be rolled back in the clone if this
            # volume create fails?? Likely this should be a subflow or broken
            # out task in the future. That will bring up the question of how
            # do we make said subflow/task which is only triggered in the
            # clone image 'path' resumable and revertable in the correct
            # manner.
            # Create the volume and then download the image onto the volume.
            model_update = self.driver.create_volume(volume_ref)
            updates = dict(model_update or dict(), status='downloading')
                volume_ref = self.db.volume_update(context,
                                                   volume_ref['id'], updates)
            except exception.CinderException:
                LOG.exception(_("Failed updating volume %(volume_id)s with "
                                "%(updates)s") %
                              {'volume_id': volume_ref['id'],
                               'updates': updates})
            self._copy_image_to_volume(context, volume_ref,
                                       image_id, image_location, image_service)
            make_bootable = True

As you can see after volume created this task call driver _copy_image_to_volume method, problem it that for some ISCSI drivers this operation may require volume export before copy image to volume.

One of solution can be create export after volume created and then remove export when image copied.

Victor Rodionov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130821/8e6155c4/attachment.html>

More information about the Openstack mailing list