Change in vdsm[master]: network: Introduce the network package
by asegurap@redhat.com
Antoni Segura Puimedon has posted comments on this change.
Change subject: network: Introduce the network package
......................................................................
Patch Set 2: Verified+1
passed unit tests.
passed functional tests.
ran the modules successfully from cmdline via /usr/share/{addNetwork,delNetwork}
ran successfully through vdsm-tool restore-nets
--
To view, visit http://gerrit.ovirt.org/25908
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I532c179d4002ed1e8e5445d02297c8d5a6248647
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
10 years, 2 months
Change in vdsm[master]: openstack_net hook: search for ovs_vsctl only when needed
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: openstack_net hook: search for ovs_vsctl only when needed
......................................................................
openstack_net hook: search for ovs_vsctl only when needed
Change-Id: I397e17782f61a94f734cf060d5ecad768379abcc
Bug-Url: https://bugzilla.redhat.com/1074628
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm_hooks/openstacknet/after_device_destroy.py
M vdsm_hooks/openstacknet/before_device_create.py
M vdsm_hooks/openstacknet/openstacknet_utils.py
3 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/25889/1
diff --git a/vdsm_hooks/openstacknet/after_device_destroy.py b/vdsm_hooks/openstacknet/after_device_destroy.py
index 8e13412..3cc7261 100755
--- a/vdsm_hooks/openstacknet/after_device_destroy.py
+++ b/vdsm_hooks/openstacknet/after_device_destroy.py
@@ -19,7 +19,6 @@
import hooking
from openstacknet_utils import EXT_BRCTL
from openstacknet_utils import EXT_IP
-from openstacknet_utils import EXT_OVS_VSCTL
from openstacknet_utils import INTEGRATION_BRIDGE
from openstacknet_utils import OPENSTACK_NET_PROVIDER_TYPE
from openstacknet_utils import PLUGIN_TYPE_KEY
@@ -29,6 +28,7 @@
from openstacknet_utils import deviceExists
from openstacknet_utils import devName
from openstacknet_utils import executeOrExit
+from openstacknet_utils import ovs_vsctl
def disconnectVnic(portId):
@@ -40,7 +40,7 @@
executeOrExit([EXT_BRCTL, 'delif', brName, vethBr])
executeOrExit([EXT_IP, 'link', 'set', brName, 'down'])
executeOrExit([EXT_BRCTL, 'delbr', brName])
- executeOrExit([EXT_OVS_VSCTL, 'del-port', INTEGRATION_BRIDGE, vethOvs])
+ executeOrExit([ovs_vsctl.cmd, 'del-port', INTEGRATION_BRIDGE, vethOvs])
executeOrExit([EXT_IP, 'link', 'delete', vethOvs])
diff --git a/vdsm_hooks/openstacknet/before_device_create.py b/vdsm_hooks/openstacknet/before_device_create.py
index 74f4671..e322ec3 100755
--- a/vdsm_hooks/openstacknet/before_device_create.py
+++ b/vdsm_hooks/openstacknet/before_device_create.py
@@ -40,7 +40,6 @@
from openstacknet_utils import DUMMY_BRIDGE
from openstacknet_utils import EXT_BRCTL
from openstacknet_utils import EXT_IP
-from openstacknet_utils import EXT_OVS_VSCTL
from openstacknet_utils import INTEGRATION_BRIDGE
from openstacknet_utils import OPENSTACK_NET_PROVIDER_TYPE
from openstacknet_utils import PLUGIN_TYPE_KEY
@@ -52,6 +51,7 @@
from openstacknet_utils import deviceExists
from openstacknet_utils import devName
from openstacknet_utils import executeOrExit
+from openstacknet_utils import ovs_vsctl
HELP_ARG = "-h"
TEST_ARG = "-t"
@@ -117,7 +117,7 @@
executeOrExit([EXT_BRCTL, 'addif', brName, vethBr])
mac = iface.getElementsByTagName('mac')[0].getAttribute('address')
- executeOrExit([EXT_OVS_VSCTL, '--', '--may-exist', 'add-port',
+ executeOrExit([ovs_vsctl.cmd, '--', '--may-exist', 'add-port',
INTEGRATION_BRIDGE, vethOvs,
'--', 'set', 'Interface', vethOvs,
'external-ids:iface-id=%s' % portId,
diff --git a/vdsm_hooks/openstacknet/openstacknet_utils.py b/vdsm_hooks/openstacknet/openstacknet_utils.py
index 686e4a0..e919908 100644
--- a/vdsm_hooks/openstacknet/openstacknet_utils.py
+++ b/vdsm_hooks/openstacknet/openstacknet_utils.py
@@ -21,9 +21,9 @@
EXT_BRCTL = CommandPath('brctl', '/sbin/brctl', '/usr/sbin/brctl').cmd
EXT_IP = CommandPath('ip', '/sbin/ip').cmd
-EXT_OVS_VSCTL = CommandPath('ovs-vsctl',
- '/usr/sbin/ovs-vsctl',
- '/usr/bin/ovs-vsctl').cmd
+ovs_vsctl = CommandPath('ovs-vsctl',
+ '/usr/sbin/aovs-vsctl',
+ '/usr/bin/aovs-vsctl')
# Make pyflakes happy
DUMMY_BRIDGE
--
To view, visit http://gerrit.ovirt.org/25889
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I397e17782f61a94f734cf060d5ecad768379abcc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
10 years, 2 months
Change in vdsm[master]: Avoid to recompile namedtuple ATTR classes in lvm.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Avoid to recompile namedtuple ATTR classes in lvm.
......................................................................
Avoid to recompile namedtuple ATTR classes in lvm.
Change-Id: I66110a7f25fb5cfd80ddffe9a22e1cbac11de447
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 9 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/25678/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 0fbed29..d963736 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -61,7 +61,9 @@
PV = namedtuple("PV", PV_FIELDS + ",guid")
VG = namedtuple("VG", VG_FIELDS + ",writeable,partial")
+VG_ATTR = namedtuple("VG_ATTR", VG_ATTR_BITS)
LV = namedtuple("LV", LV_FIELDS + ",writeable,opened,active")
+LV_ATTR = namedtuple("LV_ATTR", LV_ATTR_BITS)
Stub = namedtuple("Stub", "name, stale")
@@ -185,19 +187,6 @@
return tuple(sTags.split(",")) if sTags else tuple()
-def _attr2NamedTuple(sAttr, attrMask, label):
- """
- Converts a attr string into a named tuple.
-
- Fields are named as in attrMask.
- """
- Attrs = namedtuple(label, attrMask)
- # tuple("wz--n-") = ('w', 'z', '-', '-', 'n', '-')
- values = tuple(sAttr[:len(attrMask)])
- attrs = Attrs(*values)
- return attrs
-
-
def makePV(*args):
guid = os.path.basename(args[1])
args += (guid,)
@@ -210,8 +199,10 @@
tags = _tags2Tuple(args[VG._fields.index("tags")])
args[VG._fields.index("tags")] = tags
# Convert attr string into named tuple fields.
- attrs = _attr2NamedTuple(args[VG._fields.index("attr")], VG_ATTR_BITS,
- "VG_ATTR")
+ # tuple("wz--n-") = ('w', 'z', '-', '-', 'n', '-')
+ sAttr = args[VG._fields.index("attr")]
+ attr_values = tuple(sAttr[:len(VG_ATTR._fields)])
+ attrs = VG_ATTR(*attr_values)
args[VG._fields.index("attr")] = attrs
# Convert pv_names list to tuple.
args[VG._fields.index("pv_name")] = \
@@ -228,8 +219,9 @@
tags = _tags2Tuple(args[LV._fields.index("tags")])
args[LV._fields.index("tags")] = tags
# Convert attr string into named tuple fields.
- attrs = _attr2NamedTuple(args[LV._fields.index("attr")], LV_ATTR_BITS,
- "LV_ATTR")
+ sAttr = args[LV._fields.index("attr")]
+ attr_values = tuple(sAttr[:len(LV_ATTR._fields)])
+ attrs = LV_ATTR(*attr_values)
args[LV._fields.index("attr")] = attrs
# Add properties. Should be ordered as VG_PROPERTIES.
args.append(attrs.permission == "w") # writable
--
To view, visit http://gerrit.ovirt.org/25678
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66110a7f25fb5cfd80ddffe9a22e1cbac11de447
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years, 2 months
Change in vdsm[ovirt-3.4]: Install vdsm.conf.example during build
by ybronhei@redhat.com
Hello Douglas Schilling Landgraf, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/25450
to review the following change.
Change subject: Install vdsm.conf.example during build
......................................................................
Install vdsm.conf.example during build
The sample conf is installed by spec under vdsm docs. Docs files are not part
of RHEV-H installation to keep rhev-h env small as possible.
Although, the sample file was delivered only on Fedora which is the
standard for package delivering (to publish sample conf with the
package installation).
The sample file was requested also in rhev-h by users for reference.
This patch moves the file installation from spec to create it during
make.
Change-Id: I2606c571cd6de06eee811bbd340a790f98d11907
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1023941
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/24945
Reviewed-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/Makefile.am
M vdsm.spec.in
2 files changed, 19 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/25450/1
diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index 416e1e6..8575887 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -47,6 +47,7 @@
CLEANFILES = \
$(nodist_vdsmpylib_PYTHON) \
+ $(nodist_noinst_DATA) \
$(NULL)
@@ -54,10 +55,26 @@
config.py.in \
constants.py.in \
vdscli.py.in \
+ vdsm.conf.sample \
$(NULL)
vdsm.conf.sample: Makefile config.py
@echo " CONFIG $@"; $(PYTHON) $(builddir)/config.py > $@
+install-data-local: \
+ install-data-sample-vdsm-conf
+
+uninstall-local: \
+ uninstall-data-sample-vdsm-conf
+
+install-data-sample-vdsm-conf:
+ $(MKDIR_P) $(DESTDIR)$(vdsmconfdir)
+ $(INSTALL_DATA) vdsm.conf.sample \
+ $(DESTDIR)$(vdsmconfdir)/vdsm.conf
+
+uninstall-data-sample-vdsm-conf:
+ $(RM) $(DESTDIR)$(vdsmconfdir)/vdsm.conf
+
all-local: \
- $(nodist_vdsmpylib_PYTHON)
+ $(nodist_vdsmpylib_PYTHON) \
+ $(nodist_noinst_DATA)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index a90d1a4..91b9590 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -658,12 +658,6 @@
install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
%endif
-%if !0%{?rhel}
-# Install the configuration sample
-install -Dm 0644 lib/vdsm/vdsm.conf.sample \
- %{buildroot}%{_sysconfdir}/%{vdsm_name}/vdsm.conf
-%endif
-
# Install the polkit for libvirt
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
install -Dm 0644 vdsm/vdsm-libvirt-access.rules \
@@ -930,6 +924,7 @@
%{_datadir}/%{vdsm_name}/vdsm-store-net-config
%{_datadir}/%{vdsm_name}/vm.py*
+%config(noreplace) %{_sysconfdir}/%{vdsm_name}/vdsm.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/svdsm.logger.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/upgrade.logger.conf
@@ -1118,9 +1113,6 @@
%files python
%defattr(-, root, root, -)
%{_bindir}/vdsm-tool
-%if !0%{?rhel}
-%config(noreplace) %{_sysconfdir}/%{vdsm_name}/vdsm.conf
-%endif
%dir %{python_sitearch}/%{vdsm_name}
%dir %{python_sitearch}/%{vdsm_name}/tool
%{python_sitearch}/%{vdsm_name}/__init__.py*
--
To view, visit http://gerrit.ovirt.org/25450
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2606c571cd6de06eee811bbd340a790f98d11907
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
10 years, 2 months
Change in vdsm[ovirt-3.4]: ifcfg: Do not take bond/nic down when removing one of their ...
by asegurap@redhat.com
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/25680
to review the following change.
Change subject: ifcfg: Do not take bond/nic down when removing one of their multiple nets
......................................................................
ifcfg: Do not take bond/nic down when removing one of their multiple nets
When taking removing one of the multiple networks that sit on top of
a bond/nic, it is necessary to adjust the mtu of the devices to the
new maximum required by the remaining networks that use the devices.
Example
netA has mtu 2500 and is set over bond5.10
netB has mtu 2000 and is set over bond5.10
when both are set, bond5.10, bond5 and its link devices will
have mtu 2500. When netA is removed that should be adjusted
to 2000.
For ifcfg to apply the adjustment, it was necessary to ifdown
the nic/bond and up it again so it would read the new configuration.
The problem is that the netB of the example would see a loss of
connectivity which could affect the users. This patch addresses that
by using the ipwrapper to make the mtu adjustment and only take
down the device when no remaining networks use it.
Change-Id: Ifffad45193ccd047acdefed7412bc9ce6303874a
Bug-Url: https://bugzilla.redhat.com/1060781
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/25003
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/functional/networkTests.py
M vdsm/netconf/__init__.py
M vdsm/netconf/ifcfg.py
3 files changed, 73 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/80/25680/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index bdfbb9f..4bc5fcf 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -232,6 +232,10 @@
self.vdsm_net._vlanInRunningConfig(devName, vlanId),
'%s found unexpectedly in running config' % vlanName)
+ def assertMtu(self, mtu, *elems):
+ for elem in elems:
+ self.assertEquals(mtu, self.vdsm_net.getMtu(elem))
+
@cleanupNet
@permutations([[True], [False]])
@RequireDummyMod
@@ -321,6 +325,43 @@
status, msg = self.vdsm_net.setupNetworks(
{},
{BONDING_NAME: {'remove': True}}, {'connectivityCheck': False})
+ self.assertEqual(status, SUCCESS, msg)
+
+ @cleanupNet
+ @RequireDummyMod
+ @ValidateRunningAsRoot
+ def testSetupNetworksDelOneOfBondNets(self):
+ NETA_NAME = NETWORK_NAME + 'A'
+ NETB_NAME = NETWORK_NAME + 'B'
+ NETA_DICT = {'bonding': BONDING_NAME, 'bridged': False, 'mtu': '1600',
+ 'vlan': '4090'}
+ NETB_DICT = {'bonding': BONDING_NAME, 'bridged': False, 'mtu': '2000',
+ 'vlan': '4091'}
+ with dummyIf(2) as nics:
+ status, msg = self.vdsm_net.setupNetworks(
+ {NETA_NAME: NETA_DICT,
+ NETB_NAME: NETB_DICT},
+ {BONDING_NAME: {'nics': nics}}, NOCHK)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertNetworkExists(NETA_NAME)
+ self.assertNetworkExists(NETB_NAME)
+ self.assertBondExists(BONDING_NAME, nics)
+ self.assertMtu(NETB_DICT['mtu'], BONDING_NAME)
+
+ with nonChangingOperstate(BONDING_NAME):
+ status, msg = self.vdsm_net.setupNetworks(
+ {NETB_NAME: {'remove': True}}, {}, NOCHK)
+
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertNetworkExists(NETA_NAME)
+ self.assertNetworkDoesntExist(NETB_NAME)
+ # Check that the mtu of the bond has been adjusted to the smaller
+ # NETA value
+ self.assertMtu(NETA_DICT['mtu'], BONDING_NAME)
+
+ status, msg = self.vdsm_net.setupNetworks(
+ {NETA_NAME: {'remove': True}},
+ {BONDING_NAME: {'remove': True}}, NOCHK)
self.assertEqual(status, SUCCESS, msg)
@cleanupNet
@@ -1005,10 +1046,6 @@
JUMBO = '9000'
MIDI = '4000'
- def assertMtu(mtu, *elems):
- for elem in elems:
- self.assertEquals(mtu, self.vdsm_net.getMtu(elem))
-
with dummyIf(3) as nics:
with self.vdsm_net.pinger():
networks = {NETWORK_NAME + '1':
@@ -1024,8 +1061,8 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
- nics[1])
+ self.assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
+ nics[1])
network = {NETWORK_NAME + '3':
dict(bonding=BONDING_NAME, vlan='300', mtu=JUMBO,
@@ -1035,8 +1072,8 @@
self.assertEquals(status, SUCCESS, msg)
self.assertNetworkExists(NETWORK_NAME + '3', bridged=bridged)
- assertMtu(JUMBO, NETWORK_NAME + '3', BONDING_NAME, nics[0],
- nics[1])
+ self.assertMtu(JUMBO, NETWORK_NAME + '3', BONDING_NAME,
+ nics[0], nics[1])
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '3':
dict(remove=True)},
@@ -1044,8 +1081,8 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
- nics[1])
+ self.assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
+ nics[1])
# Keep last custom MTU on the interfaces
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '2':
@@ -1054,7 +1091,7 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, BONDING_NAME, nics[0], nics[1])
+ self.assertMtu(MIDI, BONDING_NAME, nics[0], nics[1])
# Add additional nic to the bond
status, msg = self.vdsm_net.setupNetworks({}, {BONDING_NAME:
@@ -1062,7 +1099,7 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, BONDING_NAME, nics[0], nics[1], nics[2])
+ self.assertMtu(MIDI, BONDING_NAME, nics[0], nics[1], nics[2])
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '1':
dict(remove=True)},
diff --git a/vdsm/netconf/__init__.py b/vdsm/netconf/__init__.py
index db84a9b..fe375e9 100644
--- a/vdsm/netconf/__init__.py
+++ b/vdsm/netconf/__init__.py
@@ -139,6 +139,7 @@
:param ifaceVlans: vlan devices using the interface 'iface'
:type ifaceVlans: iterable
+ :return mtu value that was applied
"""
ifaceMtu = netinfo.getMtu(iface.name)
maxMtu = netinfo.getMaxMtu(ifaceVlans, None)
@@ -147,6 +148,7 @@
self.configApplier.setBondingMtu(iface.name, maxMtu)
else:
self.configApplier.setIfaceMtu(iface.name, maxMtu)
+ return maxMtu
def getEthtoolOpts(name):
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 37e15aa..16587d9 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -34,6 +34,7 @@
from sourceRoute import DynamicSourceRoute
from vdsm.config import config
from vdsm import constants
+from vdsm import ipwrapper
from vdsm import netinfo
from vdsm import utils
from vdsm.netconfpersistence import RunningConfig
@@ -169,9 +170,11 @@
def _ifaceDownAndCleanup(self, iface, _netinfo):
"""Returns True iff the iface is to be removed."""
DynamicSourceRoute.addInterfaceTracking(iface)
- ifdown(iface.name)
+ to_be_removed = not _netinfo.ifaceUsers(iface.name)
+ if to_be_removed:
+ ifdown(iface.name)
self._removeSourceRoute(iface)
- return not _netinfo.ifaceUsers(iface.name)
+ return to_be_removed
def removeBond(self, bonding):
_netinfo = netinfo.NetInfo()
@@ -188,18 +191,30 @@
netinfo.DEFAULT_MTU)
ifup(bonding.name)
else:
- self._setNewMtu(bonding,
- _netinfo.getVlanDevsForIface(bonding.name))
- ifup(bonding.name)
+ set_mtu = self._setNewMtu(
+ bonding, _netinfo.getVlanDevsForIface(bonding.name))
+ # Since we are not taking the device up again, ifcfg will not be
+ # read at this point and we need to set the live mtu value.
+ # Note that ip link set dev bondX mtu Y sets Y on all its links
+ if set_mtu is not None:
+ ipwrapper.linkSet(bonding.name, ['mtu', str(set_mtu)])
def removeNic(self, nic):
_netinfo = netinfo.NetInfo()
to_be_removed = self._ifaceDownAndCleanup(nic, _netinfo)
if to_be_removed:
self.configApplier.removeNic(nic.name)
+ if nic.name in _netinfo.nics:
+ ifup(nic.name)
+ else:
+ logging.warning('host interface %s missing', nic.name)
else:
- self._setNewMtu(nic, _netinfo.getVlanDevsForIface(nic.name))
- ifup(nic.name)
+ set_mtu = self._setNewMtu(nic,
+ _netinfo.getVlanDevsForIface(nic.name))
+ # Since we are not taking the device up again, ifcfg will not be
+ # read at this point and we need to set the live mtu value
+ if set_mtu is not None:
+ ipwrapper.linkSet(nic.name, ['mtu', str(set_mtu)])
def _getFilePath(self, fileType, device):
return os.path.join(netinfo.NET_CONF_DIR, '%s-%s' % (fileType, device))
--
To view, visit http://gerrit.ovirt.org/25680
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifffad45193ccd047acdefed7412bc9ce6303874a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
10 years, 2 months
Change in vdsm[ovirt-3.3]: ifcfg: Do not take bond/nic down when removing one of their ...
by asegurap@redhat.com
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/25681
to review the following change.
Change subject: ifcfg: Do not take bond/nic down when removing one of their multiple nets
......................................................................
ifcfg: Do not take bond/nic down when removing one of their multiple nets
When taking removing one of the multiple networks that sit on top of
a bond/nic, it is necessary to adjust the mtu of the devices to the
new maximum required by the remaining networks that use the devices.
Example
netA has mtu 2500 and is set over bond5.10
netB has mtu 2000 and is set over bond5.10
when both are set, bond5.10, bond5 and its link devices will
have mtu 2500. When netA is removed that should be adjusted
to 2000.
For ifcfg to apply the adjustment, it was necessary to ifdown
the nic/bond and up it again so it would read the new configuration.
The problem is that the netB of the example would see a loss of
connectivity which could affect the users. This patch addresses that
by using the ipwrapper to make the mtu adjustment and only take
down the device when no remaining networks use it.
Change-Id: Ifffad45193ccd047acdefed7412bc9ce6303874a
Bug-Url: https://bugzilla.redhat.com/1060781
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/25003
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/functional/networkTests.py
M vdsm/netconf/__init__.py
M vdsm/netconf/ifcfg.py
3 files changed, 73 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/25681/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 57fe97e..6b2441c 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -125,6 +125,10 @@
def setUp(self):
self.vdsm_net = VdsProxy()
+ def assertMtu(self, mtu, *elems):
+ for elem in elems:
+ self.assertEquals(mtu, self.vdsm_net.getMtu(elem))
+
@cleanupNet
@permutations([[True], [False]])
@RequireDummyMod
@@ -215,6 +219,43 @@
status, msg = self.vdsm_net.setupNetworks(
{},
{BONDING_NAME: {'remove': True}}, {'connectivityCheck': False})
+ self.assertEqual(status, SUCCESS, msg)
+
+ @cleanupNet
+ @RequireDummyMod
+ @ValidateRunningAsRoot
+ def testSetupNetworksDelOneOfBondNets(self):
+ NETA_NAME = NETWORK_NAME + 'A'
+ NETB_NAME = NETWORK_NAME + 'B'
+ NETA_DICT = {'bonding': BONDING_NAME, 'bridged': False, 'mtu': '1600',
+ 'vlan': '4090'}
+ NETB_DICT = {'bonding': BONDING_NAME, 'bridged': False, 'mtu': '2000',
+ 'vlan': '4091'}
+ with dummyIf(2) as nics:
+ status, msg = self.vdsm_net.setupNetworks(
+ {NETA_NAME: NETA_DICT,
+ NETB_NAME: NETB_DICT},
+ {BONDING_NAME: {'nics': nics}}, NOCHK)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertNetworkExists(NETA_NAME)
+ self.assertNetworkExists(NETB_NAME)
+ self.assertBondExists(BONDING_NAME, nics)
+ self.assertMtu(NETB_DICT['mtu'], BONDING_NAME)
+
+ with nonChangingOperstate(BONDING_NAME):
+ status, msg = self.vdsm_net.setupNetworks(
+ {NETB_NAME: {'remove': True}}, {}, NOCHK)
+
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertNetworkExists(NETA_NAME)
+ self.assertNetworkDoesntExist(NETB_NAME)
+ # Check that the mtu of the bond has been adjusted to the smaller
+ # NETA value
+ self.assertMtu(NETA_DICT['mtu'], BONDING_NAME)
+
+ status, msg = self.vdsm_net.setupNetworks(
+ {NETA_NAME: {'remove': True}},
+ {BONDING_NAME: {'remove': True}}, NOCHK)
self.assertEqual(status, SUCCESS, msg)
@cleanupNet
@@ -909,10 +950,6 @@
JUMBO = '9000'
MIDI = '4000'
- def assertMtu(mtu, *elems):
- for elem in elems:
- self.assertEquals(mtu, self.vdsm_net.getMtu(elem))
-
with dummyIf(3) as nics:
with self.vdsm_net.pinger():
networks = {NETWORK_NAME + '1':
@@ -928,8 +965,8 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
- nics[1])
+ self.assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
+ nics[1])
network = {NETWORK_NAME + '3':
dict(bonding=BONDING_NAME, vlan='300', mtu=JUMBO,
@@ -940,8 +977,8 @@
self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME + '3',
bridged=bridged))
- assertMtu(JUMBO, NETWORK_NAME + '3', BONDING_NAME, nics[0],
- nics[1])
+ self.assertMtu(JUMBO, NETWORK_NAME + '3',
+ BONDING_NAME, nics[0], nics[1])
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '3':
dict(remove=True)},
@@ -949,8 +986,8 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
- nics[1])
+ self.assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0],
+ nics[1])
# Keep last custom MTU on the interfaces
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '2':
@@ -959,7 +996,7 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, BONDING_NAME, nics[0], nics[1])
+ self.assertMtu(MIDI, BONDING_NAME, nics[0], nics[1])
# Add additional nic to the bond
status, msg = self.vdsm_net.setupNetworks({}, {BONDING_NAME:
@@ -967,7 +1004,7 @@
self.assertEquals(status, SUCCESS, msg)
- assertMtu(MIDI, BONDING_NAME, nics[0], nics[1], nics[2])
+ self.assertMtu(MIDI, BONDING_NAME, nics[0], nics[1], nics[2])
status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '1':
dict(remove=True)},
diff --git a/vdsm/netconf/__init__.py b/vdsm/netconf/__init__.py
index 5b7c20a..b614183 100644
--- a/vdsm/netconf/__init__.py
+++ b/vdsm/netconf/__init__.py
@@ -110,6 +110,7 @@
:param ifaceVlans: vlan devices using the interface 'iface'
:type ifaceVlans: iterable
+ :return mtu value that was applied
"""
ifaceMtu = netinfo.getMtu(iface.name)
maxMtu = netinfo.getMaxMtu(ifaceVlans, None)
@@ -118,3 +119,4 @@
self.configApplier.setBondingMtu(iface.name, maxMtu)
else:
self.configApplier.setIfaceMtu(iface.name, maxMtu)
+ return maxMtu
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index df07d58..06bdba4 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -35,6 +35,7 @@
from sourceRoute import DynamicSourceRoute
from vdsm.config import config
from vdsm import constants
+from vdsm import ipwrapper
from vdsm import netinfo
from vdsm import utils
import libvirtCfg
@@ -149,9 +150,11 @@
def _ifaceDownAndCleanup(self, iface, _netinfo):
"""Returns True iff the iface is to be removed."""
DynamicSourceRoute.addInterfaceTracking(iface)
- ifdown(iface.name)
+ to_be_removed = not _netinfo.ifaceUsers(iface.name)
+ if to_be_removed:
+ ifdown(iface.name)
self._removeSourceRoute(iface)
- return not _netinfo.ifaceUsers(iface.name)
+ return to_be_removed
def removeBond(self, bonding):
_netinfo = netinfo.NetInfo()
@@ -166,18 +169,30 @@
netinfo.DEFAULT_MTU)
ifup(bonding.name)
else:
- self._setNewMtu(bonding,
- _netinfo.getVlanDevsForIface(bonding.name))
- ifup(bonding.name)
+ set_mtu = self._setNewMtu(
+ bonding, _netinfo.getVlanDevsForIface(bonding.name))
+ # Since we are not taking the device up again, ifcfg will not be
+ # read at this point and we need to set the live mtu value.
+ # Note that ip link set dev bondX mtu Y sets Y on all its links
+ if set_mtu is not None:
+ ipwrapper.linkSet(bonding.name, ['mtu', str(set_mtu)])
def removeNic(self, nic):
_netinfo = netinfo.NetInfo()
to_be_removed = self._ifaceDownAndCleanup(nic, _netinfo)
if to_be_removed:
self.configApplier.removeNic(nic.name)
+ if nic.name in _netinfo.nics:
+ ifup(nic.name)
+ else:
+ logging.warning('host interface %s missing', nic.name)
else:
- self._setNewMtu(nic, _netinfo.getVlanDevsForIface(nic.name))
- ifup(nic.name)
+ set_mtu = self._setNewMtu(nic,
+ _netinfo.getVlanDevsForIface(nic.name))
+ # Since we are not taking the device up again, ifcfg will not be
+ # read at this point and we need to set the live mtu value
+ if set_mtu is not None:
+ ipwrapper.linkSet(nic.name, ['mtu', str(set_mtu)])
def _getFilePath(self, fileType, device):
return os.path.join(netinfo.NET_CONF_DIR, '%s-%s' % (fileType, device))
--
To view, visit http://gerrit.ovirt.org/25681
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifffad45193ccd047acdefed7412bc9ce6303874a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
10 years, 2 months
Change in vdsm[master]: Networking import reordering
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Networking import reordering
......................................................................
Networking import reordering
Apply new ordering for vdsm imports (starting with just networking
code.
The imports will be split into sections:
- __future__
- stdlib
- site-packages
- vdsm package
- relative imports
This, together with absolute imports, will make it very easy and fast
to see what resources the current module makes use of and where those
resources come from.
this:
import glob
import libvirt
import logging
import os
import pipes
import pwd
import re
import selinux
import shutil
import threading
from . import Configurator
from ..neterrors import ConfigNetworkError
from ..netmodels import Nic, Bridge, IpConfig
from ..sourceRoute import DynamicSourceRoute
from vdsm.config import config
from vdsm import constants
from vdsm import netinfo
from vdsm import utils
from vdsm.netconfpersistence import RunningConfig
from .. import dsaversion
from . import libvirtCfg
from .. import neterrors as ne
becomes this: (annotations for explanation purposes, not in actual
code)
# stdlib
import glob
import logging
import os
import pipes
import pwd
import re
import shutil
import threading
# site-packages
import libvirt
import selinux
# vdsm package
from vdsm.config import config
from vdsm import constants
from vdsm import netinfo
from vdsm import utils
from vdsm.netconfpersistence import RunningConfig
# relative imports
from . import Configurator
from . import libvirtCfg
from .. import dsaversion
from .. import neterrors as ne
from ..neterrors import ConfigNetworkError
from ..netmodels import Nic, Bridge, IpConfig
from ..sourceRoute import DynamicSourceRoute
Change-Id: I1ea96f97bf89b10a0cd6e629210374d2cd211fe7
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/netconfpersistence.py
M lib/vdsm/netinfo.py
M vdsm/configNetwork.py
M vdsm/netconf/__init__.py
M vdsm/netconf/ifcfg.py
M vdsm/netconf/libvirtCfg.py
M vdsm/netmodels.py
M vdsm/sourceRouteThread.py
M vdsm/tc.py
M vdsm/vdsm-restore-net-config
10 files changed, 39 insertions(+), 32 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/20662/1
diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py
index 2a72a04..9cfea52 100644
--- a/lib/vdsm/netconfpersistence.py
+++ b/lib/vdsm/netconfpersistence.py
@@ -24,11 +24,10 @@
import logging
import os
-from .config import config
-from .tool.restore_nets import restore
from . import constants
from . import utils
-
+from .config import config
+from .tool.restore_nets import restore
CONF_RUN_DIR = constants.P_VDSM_RUN + 'netconf/'
# The persistent path is inside of an extra "persistence" dir in order to get
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 7e0a07a..0f6b2ef 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -20,25 +20,25 @@
from __future__ import absolute_import
from collections import namedtuple
-import errno
from fnmatch import fnmatch
from glob import iglob
from itertools import chain
+from xml.dom import minidom
+import errno
import logging
import os
import shlex
import socket
import struct
-from xml.dom import minidom
import ethtool
-from .config import config
from . import constants
+from . import libvirtconnection
+from .config import config
+from .ipwrapper import linkShowDev
from .ipwrapper import Route
from .ipwrapper import routeShowAllDefaultGateways
-from . import libvirtconnection
-from .ipwrapper import linkShowDev
NET_CONF_DIR = '/etc/sysconfig/network-scripts/'
# ifcfg persistence directories
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index d5ea840..e9059e7 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -20,29 +20,30 @@
from functools import wraps
import inspect
-import sys
-import os
-import traceback
-import time
import logging
+import os
+import sys
+import time
+import traceback
from vdsm.config import config
from vdsm import constants
+from vdsm import netinfo
from vdsm import utils
from vdsm.utils import execCmd
+
+from . import hooks
from . import neterrors as ne
-from .neterrors import ConfigNetworkError
-from vdsm import netinfo
from .netconf.ifcfg import ConfigWriter
from .netconf.ifcfg import Ifcfg
+from .neterrors import ConfigNetworkError
from .netmodels import Bond
from .netmodels import Bridge
+from .netmodels import IpConfig
from .netmodels import IPv4
from .netmodels import IPv6
-from .netmodels import IpConfig
from .netmodels import Nic
from .netmodels import Vlan
-from . import hooks
CONNECTIVITY_TIMEOUT_DEFAULT = 4
diff --git a/vdsm/netconf/__init__.py b/vdsm/netconf/__init__.py
index 0ce6364..1e20706 100644
--- a/vdsm/netconf/__init__.py
+++ b/vdsm/netconf/__init__.py
@@ -20,12 +20,13 @@
import logging
+from vdsm.config import config
+from vdsm import netinfo
+from vdsm.netconfpersistence import RunningConfig
+
from ..netmodels import Bond, Bridge
from ..sourceRoute import DynamicSourceRoute
from ..sourceRoute import StaticSourceRoute
-from vdsm import netinfo
-from vdsm.config import config
-from vdsm.netconfpersistence import RunningConfig
class Configurator(object):
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 3f2e092..bc09de8 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -19,28 +19,30 @@
from __future__ import absolute_import
import glob
-import libvirt
import logging
import os
import pipes
import pwd
import re
-import selinux
import shutil
import threading
-from . import Configurator
-from ..neterrors import ConfigNetworkError
-from ..netmodels import Nic, Bridge, IpConfig
-from ..sourceRoute import DynamicSourceRoute
+import libvirt
+import selinux
+
from vdsm.config import config
from vdsm import constants
from vdsm import netinfo
from vdsm import utils
from vdsm.netconfpersistence import RunningConfig
-from .. import dsaversion
+
+from . import Configurator
from . import libvirtCfg
+from .. import dsaversion
from .. import neterrors as ne
+from ..neterrors import ConfigNetworkError
+from ..netmodels import Nic, Bridge, IpConfig
+from ..sourceRoute import DynamicSourceRoute
class Ifcfg(Configurator):
diff --git a/vdsm/netconf/libvirtCfg.py b/vdsm/netconf/libvirtCfg.py
index b81231d..74d9b65 100644
--- a/vdsm/netconf/libvirtCfg.py
+++ b/vdsm/netconf/libvirtCfg.py
@@ -16,10 +16,11 @@
#
# Refer to the README and COPYING files for full details of the license
#
-import libvirt
from xml.dom.minidom import Document
from xml.sax.saxutils import escape
+import libvirt
+
from vdsm import libvirtconnection
from vdsm import netinfo
diff --git a/vdsm/netmodels.py b/vdsm/netmodels.py
index c0347ab..5ea5052 100644
--- a/vdsm/netmodels.py
+++ b/vdsm/netmodels.py
@@ -26,9 +26,10 @@
import socket
import struct
-from .neterrors import ConfigNetworkError
from vdsm import netinfo
+
from . import neterrors as ne
+from .neterrors import ConfigNetworkError
class NetDevice(object):
diff --git a/vdsm/sourceRouteThread.py b/vdsm/sourceRouteThread.py
index c1da9a5..5b686a1 100644
--- a/vdsm/sourceRouteThread.py
+++ b/vdsm/sourceRouteThread.py
@@ -5,9 +5,10 @@
import pyinotify
+from vdsm.constants import P_VDSM_RUN
+
from .netconf.iproute2 import Iproute2
from .sourceRoute import DynamicSourceRoute
-from vdsm.constants import P_VDSM_RUN
SOURCE_ROUTES_FOLDER = P_VDSM_RUN + 'sourceRoutes'
diff --git a/vdsm/tc.py b/vdsm/tc.py
index b47342e..f457176 100644
--- a/vdsm/tc.py
+++ b/vdsm/tc.py
@@ -1,5 +1,5 @@
#
-# Copyright 2012 Red Hat, Inc.
+# Copyright 2012-2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,8 +26,8 @@
import ethtool
-from vdsm.utils import execCmd
from vdsm.constants import EXT_TC
+from vdsm.utils import execCmd
ERR_DEV_NOEXIST = 2
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 2a23ebc..4fff50f 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -23,10 +23,11 @@
import logging
import logging.config
-from .netconf import ifcfg
from vdsm.config import config
from vdsm.netconfpersistence import RunningConfig, PersistentConfig
+
from .configNetwork import setupNetworks
+from .netconf import ifcfg
def ifcfg_restoration():
--
To view, visit http://gerrit.ovirt.org/20662
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ea96f97bf89b10a0cd6e629210374d2cd211fe7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
10 years, 2 months
Change in vdsm[master]: vm: Set numatune and guest numa topology
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: vm: Set numatune and guest numa topology
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
http://gerrit.ovirt.org/#/c/25254/2/vdsm/vm.py
File vdsm/vm.py:
Line 1131: numa = XMLElement('numa')
Line 1132: guestNumaNodes = self.conf.get('guestNumaNodes')
Line 1133: for vmCell in guestNumaNodes:
Line 1134: numa.appendChildWithArgs('cell',
Line 1135: cpus=vmCell['cpus'].replace(";", ","),
Would you explain why do we need this special handling of the semicolon? Why should we accept both colon and semicolon for the same purpose? At the least, please document this oddity in the commit message.
Line 1136: memory=str(vmCell['memory']))
Line 1137: cpu.appendChild(numa)
Line 1138:
Line 1139: self.dom.appendChild(cpu)
--
To view, visit http://gerrit.ovirt.org/25254
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I88ec56047809b03449a788ead0b97f9ed876712d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xiaolei Shi <xiao-lei.shi(a)hp.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Xiaolei Shi <xiao-lei.shi(a)hp.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
10 years, 2 months
Change in vdsm[master]: [WIP] Added getStorageDevices verb.
by barumuga@redhat.com
Hello Ayal Baron, Timothy Asir, Saggi Mizrahi, Federico Simoncelli, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/3725
to review the following change.
Change subject: [WIP] Added getStorageDevices verb.
......................................................................
[WIP] Added getStorageDevices verb.
This verb is used to get list of storage devices in the node. Return
value is a dictionary, its keys are device names and values are
properties of those devices as dictionary.
{DEVNAME: {'container': CONTAINER_DEVNAME,
'contentType': CONTENT_TYPE_STRING,
'endSize': SIZE_MB,
'flagList': STRING_LIST,
'fsSize': SIZE_MB,
'fsSizeFree': SIZE_MB,
'fsType': STRING,
'fsUuid': UUID,
'members': DEVNAME_LIST,
'model': STRING,
'mountPoint': STRING,
'name': DEVNAME,
'origin': LV_DEVNAME,
'parent': PARENT_DEVNAME,
'partitions': DEVNAME_LIST,
'size': SIZE_MB,
'sizeFree': SIZE_MB,
'startSize': SIZE_MB,
'status': STATUS_STRING,
'tableType': DISK_TABLE_TYPE,
'type': TYPE_STRING,
'uuid': UUID,
'vendor': STRING},...}
here, property dictionary contains
container: If DEVNAME is used by another device eg. LVM PV, MD etc, name
of that device is set
contentType: This is determined by various other properties. Possible
value is one of 'SWAP', 'OS', 'DATA' and 'NA'
endSize: If DEVNAME is a partition, its end boundry is set. The value
is in MB
flagList: If DEVNAME is a partition, its flags(eg. boot,bios_grub etc)
are set as a list of strings
fsSize: If DEVNAME has a file system, its size is set. The value is
in MB
fsSizeFree: If DEVNAME is mounted, its free size is set. The value is in
MB
fsType: If DEVNAME is formatted, its file system type is set
fsUuid': If DEVNAME has file system, its UUID is set
members: If DEVNAME is a MD, LVM VG etc, its member device names are
set as list of strings
model: Model of DEVNAME is set as string
mountPoint: If DEVNAME is mounted, its mount point is set
name: DEVNAME is set here for completion
origin: If DEVNAME is a snapshot of LV, that LV name is set
parent: If DEVNAME is a partition, its disk name is set
partitions: If DEVNAME is a disk, its partition names are set as list of
strings
size: Size of DEVNAME is set. The value is in MB
sizeFree: If DEVNAME is VG, its size of free extents is set. If its a
partitioned disk, its unallocated size is set. The value is
in MB
startSize: If DEVNAME is a partition, its start boundry is set. The
value is in MB
status: This is determined by various other properites of the DEVNAME.
Possible value is one of 'UNINITIALIZED', 'NA', 'UNUSABLE',
'FORMAT_UNSUPPORTED', 'MOUNTED', 'FORMATTED' and 'PARTED'
tableType': If DEVNAME is a disk, its table(label) type is set as a string
type: This is determined value. Possible value is one of 'MD',
'LVM_VG', 'LVM_LV_SNAPSHOT', 'LVM_LV' and 'BLOCK'
uuid: UUID of DEVNAME
vendor: Vendor of DEVNAME is set as string
Change-Id: I2cb217321a7a8dfcd1b507c7cba2888f08612207
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vdsm.spec.in
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/Makefile.am
A vdsm/storage_device_utils.py
M vdsm_cli/vdsClient.py
6 files changed, 505 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/3725/1
--
To view, visit http://gerrit.ovirt.org/3725
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cb217321a7a8dfcd1b507c7cba2888f08612207
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
10 years, 2 months