Sergey Gotliv has uploaded a new change for review. Change subject: engine: Send net_ifacename to VDSM when connecting iSCSI server ......................................................................
engine: Send net_ifacename to VDSM when connecting iSCSI server In order to properly configure iSCSI multipathing each iSCSI iface should be related to the real network interface. Software iSCSI knows how to relate iface to the network interface when all network interfaces on that host reside on different subnets see [1]. However if multiple NICs reside on the same subnet iSCSI iface configuration must contain a "iface.net_ifacename" representing a name of the network layer interface, in case this network is bridged then it should be a name of the bridge. [1] http://www.open-iscsi.org/docs/README section 5.1.1. Change-Id: I3e2f3549fa08741f719eeb8d70209ab298e09da3 Bug-Url: https://bugzilla.redhat.com/1112861 Signed-off-by: Sergey Gotliv <sgot...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ConnectStorageServerVDSCommand.java 3 files changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/32383/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java index b527679..18863ff 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java @@ -80,7 +80,10 @@ .getIscsiIfacesByHostIdAndStorageTargetId(vdsId, conn.getid()); if (!ifaces.isEmpty()) { - conn.setIface(ifaces.remove(0).getName()); + VdsNetworkInterface vdsNetworkInterface = ifaces.remove(0); + conn.setIface(vdsNetworkInterface.getName()); + conn.setNetIfacename(vdsNetworkInterface.isBridged() ? + vdsNetworkInterface.getNetworkName() : vdsNetworkInterface.getName()); // Iscsi target is represented by connection object, therefore if this target is approachable // from more than one endpoint(initiator) we have to clone this connection per endpoint. @@ -88,6 +91,7 @@ StorageServerConnections newConn = StorageServerConnections.copyOf(conn); newConn.setid(Guid.newGuid().toString()); newConn.setIface(iface.getName()); + newConn.setNetIfacename(iface.isBridged() ? iface.getNetworkName() : iface.getName()); res.add(newConn); } } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java index 3564203..ab9ef01 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java @@ -189,6 +189,16 @@ this.iface = iface; } + private String netIfacename; + + public String getNetIfacename() { + return netIfacename; + } + + public void setNetIfacename(String netIfacename) { + this.netIfacename = netIfacename; + } + @Override public boolean equals(Object obj) { boolean returnValue = super.equals(obj); @@ -244,10 +254,14 @@ sb.append(this.getNfsRetrans()); sb.append(", nfsTimeo: "); sb.append(this.getNfsTimeo()); - if (getIface() != null) { + if (this.getIface() != null) { sb.append(", iface: "); sb.append(this.getIface()); } + if (getNetIfacename() != null) { + sb.append(", netIfacename: "); + sb.append(this.getNetIfacename()); + } sb.append(" };"); return sb.toString(); } diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ConnectStorageServerVDSCommand.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ConnectStorageServerVDSCommand.java index 9fb6594..89d00b75 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ConnectStorageServerVDSCommand.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ConnectStorageServerVDSCommand.java @@ -79,6 +79,7 @@ con.put("user", connection.getuser_name(), ""); con.put("password", connection.getpassword(), ""); con.putIfNotEmpty("ifaceName", connection.getIface()); + con.putIfNotEmpty("netIfacename", connection.getNetIfacename()); // storage_pool can be null when discovering iscsi send targets or when connecting // through vds which has no storage pool -- To view, visit http://gerrit.ovirt.org/32383 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e2f3549fa08741f719eeb8d70209ab298e09da3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches