From cfe5b19fad14857773b27359eec9a8d62cf1ee7d Mon Sep 17 00:00:00 2001 From: Jack Lu Date: Tue, 10 Oct 2017 15:04:57 +0800 Subject: [PATCH] Update supported transports for iscsi connector In the case that a compute host with multiple NICs can be connectted to iscsi storage network, we expect the storage traffic only be transimitted via storage NIC. This need to define an custom iface and set the iface.net_ifacename value to the storage interface name. Unfortunately, the current iscsi connector does not support to use a custom iface. The _validate_iface_transport will change it to default. After add tcp to the supported_transports, it is possible to use a custom iface. Please get the details as below: 1. CMP001 has three NICs: NIC1 is for management network, NIC2 is for tenant network, and NIC3 is for storage network. NIC3 can access storage device via layer 2 network. And NIC1 can access storage device too, but it can only access via layer 3 network. We hope all the storage traffic only be transimitted via NIC3, because they are in the same layer 2 network. 2. Get the NIC3 MAC: fa:16:3e:79:fd:63 3. Add new iscsi iface: # iscsiadm -m iface --op=new -I tcp.fa:16:3e:79:fd:63 # iscsiadm -m iface -I tcp.fa:16:3e:79:fd:63 --op=update -n iface.hwaddress -v fa:16:3e:79:fd:63 4. Edit nova.conf, and change iscsi_iface value: iscsi_iface = tcp.fa:16:3e:79:fd:63 5. Restart nova compute service: # systemctl restart openstack-nova-compute Without this change, _validate_iface_transport will change the custom iface tcp.fa:16:3e:79:fd:63 to default due to it cannot find tcp transport. According to this change, we should have a corresponding change to the nova docs, here is change to nova https://review.openstack.org/#/c/524443/ Change-Id: I85a62cb6e7f8d8982e97e792d647d38ce5641060 Closes-Bug:#1722432 --- os_brick/initiator/connectors/iscsi.py | 4 ++-- releasenotes/notes/bug-1722432-2408dab55c903c5b.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1722432-2408dab55c903c5b.yaml diff --git a/os_brick/initiator/connectors/iscsi.py b/os_brick/initiator/connectors/iscsi.py index 4202cbfac..ad9dfabd6 100644 --- a/os_brick/initiator/connectors/iscsi.py +++ b/os_brick/initiator/connectors/iscsi.py @@ -42,7 +42,7 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector): """Connector class to attach/detach iSCSI volumes.""" supported_transports = ['be2iscsi', 'bnx2i', 'cxgb3i', 'default', - 'cxgb4i', 'qla4xxx', 'ocs', 'iser'] + 'cxgb4i', 'qla4xxx', 'ocs', 'iser', 'tcp'] VALID_SESSIONS_PREFIX = ('tcp:', 'iser:') def __init__(self, root_helper, driver=None, @@ -267,7 +267,7 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector): """Check that given iscsi_iface uses only supported transports Accepted transport names for provided iface param are - be2iscsi, bnx2i, cxgb3i, cxgb4i, default, qla4xxx, ocs or iser. + be2iscsi, bnx2i, cxgb3i, cxgb4i, default, qla4xxx, ocs, iser or tcp. Note the difference between transport and iface; unlike default(iscsi_tcp)/iser, this is not one and the same for offloaded transports, where the default format is diff --git a/releasenotes/notes/bug-1722432-2408dab55c903c5b.yaml b/releasenotes/notes/bug-1722432-2408dab55c903c5b.yaml new file mode 100644 index 000000000..1f9c3645f --- /dev/null +++ b/releasenotes/notes/bug-1722432-2408dab55c903c5b.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + [`bug 1722432 `_] + Changes the supported_transports to support tcp transport. With this + change, we can define an custom iface with tcp transport to limit the + storage traffic only be transimitted via storage NIC we specified.