<div dir="ltr">Hello,<div><br></div><div>It seems there is an error in CreateVolumeFromSpecTask for create volume from image (_create_from_image method)<br></div><div><div><br> if not cloned:</div><div> # TODO(harlowja): what needs to be rolled back in the clone if this</div>
<div> # volume create fails?? Likely this should be a subflow or broken</div><div> # out task in the future. That will bring up the question of how</div><div> # do we make said subflow/task which is only triggered in the</div>
<div> # clone image 'path' resumable and revertable in the correct</div><div> # manner.</div><div> #</div><div> # Create the volume and then download the image onto the volume.</div>
<div> model_update = self.driver.create_volume(volume_ref)</div><div> updates = dict(model_update or dict(), status='downloading')</div><div> try:</div><div> volume_ref = self.db.volume_update(context,</div>
<div> volume_ref['id'], updates)</div><div> except exception.CinderException:</div><div> LOG.exception(_("Failed updating volume %(volume_id)s with "</div>
<div> "%(updates)s") %</div><div> {'volume_id': volume_ref['id'],</div><div> 'updates': updates})</div>
<div> self._copy_image_to_volume(context, volume_ref,</div><div> image_id, image_location, image_service)</div><div> make_bootable = True</div></div><div><br></div>
<div>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. </div><div><br></div>
<div>One of solution can be create export after volume created and then remove export when image copied.</div><div><br>Thanks,</div><div>Victor Rodionov</div></div>