]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Export cinder volumes only if the status is 'in-use'
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Tue, 14 Oct 2014 16:41:41 +0000 (12:41 -0400)
committerJohn Griffith <john.griffith8@gmail.com>
Tue, 14 Oct 2014 23:45:43 +0000 (17:45 -0600)
commitf7ee62cc58d8b642af67510a310f6259492a4508
tree9bacf7c1f2058ae1ce2aba9912c19b8db0c00b6e
parent01e7c516852e53df661b2eedc970c327c1ff10ce
Export cinder volumes only if the status is 'in-use'

Currently, cinder volumes are exported both 'in-use' and 'available'
after restarting cinder-volume service.
This behavior was introduced following commit.

  commit ffefe18334a9456250e1b6ff88b7b47fb366f374
  Author: Zhiteng Huang <zhithuang@ebaysf.com>
  Date: Sat Aug 23 18:32:57 2014 +0000

If the volumes are attached to nova instances, they should be exported
via tgtd after restarting cinder-volume.
But the volumes which are not attached to instances must not be exported
because everyone can connect these volumes.

This patch changes volume export behavior that exports a volume only if
the volume status is 'in-use'.

Change-Id: I4c598c240b9290c81bd8001e5a0720c8c329aeb9
Signed-off-by: Mitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Closes-bug: #1381106
(cherry picked from commit e2f28b967910625432be0eab6a851adf53ac58ea)
cinder/volume/manager.py