Add support of 'local-attach' feature for RBD volumes
Change-Id: I558ba135581c96358fdb96f7bd8d24e0dbdae427 Related-blueprint: bp use-cinder-without-nova
This commit is contained in:
@@ -70,7 +70,7 @@ class Client(object):
|
|||||||
|
|
||||||
with actions.ConnectVolume(self.volumes_client, volume_id) as cmd:
|
with actions.ConnectVolume(self.volumes_client, volume_id) as cmd:
|
||||||
brick_connector = self._brick_get_connector(
|
brick_connector = self._brick_get_connector(
|
||||||
connection['driver_volume_type'], is_local=True)
|
connection['driver_volume_type'], do_local_attach=True)
|
||||||
device_info = cmd.connect(brick_connector,
|
device_info = cmd.connect(brick_connector,
|
||||||
connection['data'],
|
connection['data'],
|
||||||
mountpoint, mode, hostname)
|
mountpoint, mode, hostname)
|
||||||
@@ -87,7 +87,7 @@ class Client(object):
|
|||||||
connection = cmd.initialize(self, multipath, enforce_multipath)
|
connection = cmd.initialize(self, multipath, enforce_multipath)
|
||||||
|
|
||||||
brick_connector = self._brick_get_connector(
|
brick_connector = self._brick_get_connector(
|
||||||
connection['driver_volume_type'], is_local=True)
|
connection['driver_volume_type'], do_local_attach=True)
|
||||||
|
|
||||||
with actions.DisconnectVolume(self.volumes_client, volume_id) as cmd:
|
with actions.DisconnectVolume(self.volumes_client, volume_id) as cmd:
|
||||||
cmd.disconnect(brick_connector, connection['data'], device_info)
|
cmd.disconnect(brick_connector, connection['data'], device_info)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class TestVolumeActions(base.BaseTestCase):
|
|||||||
self.v_client.volumes.initialize_connection.assert_called_once_with(
|
self.v_client.volumes.initialize_connection.assert_called_once_with(
|
||||||
self.volume_id, None)
|
self.volume_id, None)
|
||||||
|
|
||||||
@ddt.data('iscsi', 'iSCSI', 'ISCSI')
|
@ddt.data('iscsi', 'iSCSI', 'ISCSI', 'rbd', 'RBD')
|
||||||
def test_verify_protocol(self, protocol):
|
def test_verify_protocol(self, protocol):
|
||||||
with volume_actions.VerifyProtocol(*self.command_args) as cmd:
|
with volume_actions.VerifyProtocol(*self.command_args) as cmd:
|
||||||
# NOTE(e0ne): veryfy that no exception is rased
|
# NOTE(e0ne): veryfy that no exception is rased
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ class InitializeConnection(VolumeAction):
|
|||||||
|
|
||||||
|
|
||||||
class VerifyProtocol(VolumeAction):
|
class VerifyProtocol(VolumeAction):
|
||||||
# NOTE(e0ne): iSCSI drivers works without issues, RBD and NFS don't
|
# NOTE(e0ne): Only iSCSI and RBD based drivers are supported. NFS doesn't
|
||||||
# work. Drivers with other protocols are not tested yet.
|
# work. Drivers with other protocols are not tested yet.
|
||||||
SUPPORTED_PROCOTOLS = [connector.ISCSI]
|
SUPPORTED_PROCOTOLS = [connector.ISCSI, connector.RBD]
|
||||||
|
|
||||||
def verify(self, protocol):
|
def verify(self, protocol):
|
||||||
protocol = protocol.upper()
|
protocol = protocol.upper()
|
||||||
|
|||||||
Reference in New Issue
Block a user