Amador Pahim has uploaded a new change for review. Change subject: [RFC] Configure iSCSI iface.net_ifacename ......................................................................
[RFC] Configure iSCSI iface.net_ifacename Every iSCSI iface need to be related with a real system interface, otherwise the system will choose any interface in the same subnet to use in the iSCSI connection. This patch updates the iSCSI iface with the corresponding iface.net_ifacename. If the interface is bridgeless, the interface name is used. If the interface is bridged, then the bridge name is used. Results: https://gist.github.com/amadorpahim/5700a51ad6e25fa76d6b Change-Id: I3ebb2f272669b753700b57486d869b21dd16f2d6 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1112861 Signed-off-by: Amador Pahim <[email protected]> --- M vdsm/storage/iscsi.py 1 file changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/31534/1 diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py index 2975776..d20ea14 100644 --- a/vdsm/storage/iscsi.py +++ b/vdsm/storage/iscsi.py @@ -31,6 +31,7 @@ from collections import namedtuple import misc +from vdsm import netinfo from vdsm.config import config import devicemapper from threading import RLock @@ -320,10 +321,21 @@ def __init__(self, name, hardwareAddress=None, ipAddress=None, initiatorName=None): - # Only new tcp interfaces are supported for now - self._conf = {'iface.transport_name': 'tcp'} - + self._conf = {} self.name = name + + ni = netinfo.NetInfo() + network = tuple(ni.getBridgedNetworksAndVlansForIface(name)) + log.debug("iscsi NICS %s", network) + + if network: + self._conf['iface.net_ifacename'] = network[0][0] + else: + self._conf['iface.net_ifacename'] = name + + # Only new tcp interfaces are supported for now + self._conf['iface.transport_name'] = 'tcp' + self._loaded = False if hardwareAddress: -- To view, visit http://gerrit.ovirt.org/31534 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ebb2f272669b753700b57486d869b21dd16f2d6 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Amador Pahim <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
