<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Is there anyway for the volume driver to have some kind of mechanism to say 'export volume before' instead of 'after'??</div>
<div><br>
</div>
<div>That would be one way to handle this.</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Victor Rodionov <<a href="mailto:victor.rodionov@nexenta.com">victor.rodionov@nexenta.com</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, August 20, 2013 11:31 AM<br>
<span style="font-weight:bold">To: </span>openstack <<a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>[Openstack] [cinder] CreateVolumeFromSpecTask._create_from_image<br>
</div>
<div><br>
</div>
<div>
<div>
<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>
</div>
</div>
</span>
</body>
</html>