]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
VolumeManager: initialize even if a volume can't be found
authorFlorian Haas <florian@hastexo.com>
Mon, 20 Jan 2014 21:42:11 +0000 (22:42 +0100)
committerFlorian Haas <florian@hastexo.com>
Tue, 28 Jan 2014 17:59:06 +0000 (18:59 +0100)
commitd386210bc776a599bb31553c96e2a8a43acac61d
tree32b63d9a27475a2c6c4bac8a8510608d32a611bd
parent60ffb0eedf41b56f3c6af5b301400ced95762194
VolumeManager: initialize even if a volume can't be found

If a previously volume cannot be exported (for example, because
an iSCSI target's backing LV is no longer present), VolumeManager
would previously bail out, leaving the volume service uninitialized.
This left volumes dangling in limbo: their state would be reported
as available (clearly not a reflection of reality), and they could
not be deleted (because the volume service that would be responsible
for deletion was unavailable).

Instead, catch an exception raised by ensure_export() separately,
log it, and set the volume to the error state.

For the tgt backend, this will also remove the volume_path file.
Previously this would cause an ISCSITargetRemoveFailed exception
when the volume would be removed. Instead, simply log a warning
and return, the way other backends (example: RBD) already do.

Also, add an info message that reflects the actual path and
contents of the volume_path file.

Finally, fix up the tgtadm unit test so that it tests for
identical IQNs,

Closes-bug: 1270959.

Change-Id: Id61407c9a5e020d5a823dd7b8c973d237c35cb9b
cinder/brick/iscsi/iscsi.py
cinder/volume/manager.py