Change in vdsm[master]: Revert "Remove __init__.py file from lib64 vdsm python direc...
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Revert "Remove __init__.py file from lib64 vdsm python directory"
......................................................................
Revert "Remove __init__.py file from lib64 vdsm python directory"
This reverts commit 9f9e8b37c6fb120f1bb40514c9d22c9d5602dded. Which is
not needed anymore (we stop supporting upgrade from vdsm <=17). Without
the %post script we can declare vdsm-python as noarch.
Change-Id: Id06b502c714074a62c8ac6b5d5cb9d350472137b
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/62453/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index edd8e82..8aaa866 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -347,19 +347,6 @@
%description python
Shared libraries between the various VDSM packages.
-%post python
-# REQUIRED_FOR: Upgrade from 4.14 to 4.17
-# HACK: Remove vdsm python lib __init__ file if installed on old location
-# https://bugzilla.redhat.com/show_bug.cgi?id=1279167
-if [ "$1" -ge 2 ]; then
- if [ -d "%{python2_sitearch}/%{vdsm_name}" ]; then
- logger -t '%{vdsm_name}' \
- 'Disabling old vdsm package in %{python2_sitearch}/%{vdsm_name}.' \
- 'Removing %{python2_sitearch}/%{vdsm_name}/init.py*'
- rm -f %{python2_sitearch}/%{vdsm_name}/__init__.py*
- fi
-fi
-
%package tests
Summary: VDSM Test Suite
BuildArch: noarch
--
To view, visit https://gerrit.ovirt.org/62453
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id06b502c714074a62c8ac6b5d5cb9d350472137b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: virt: Always execute after_hibernation event
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: virt: Always execute after_hibernation event
......................................................................
virt: Always execute after_hibernation event
Previously we had no way that the after_hibernation event got executed.
The enableGuestEvents value was never set to true and we're now also
dropping it on the migration destination.
Since there is also no parameter for enabling guest events on the suspend
call it, we decided that it is much more beneficial to let the VM always
know that it is going to be hibernated and/or has been resumed from
hibernation.
Since purely from theory this information can be also determined without
the notifications there's no security issue that the Virtual Machine would
know too much about it's environment. However it's beneficial for a range of
applications which need to resynchronize, adjust the time or re-accquire an
IP address via DHCP etc.
Change-Id: Ic52b8c22d57028fb6459c7faa2bcfebd8f32d6c4
Bug-Url: https://bugzilla.redhat.com/1349907
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/59914/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index c2b1b93..d8e4239 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1866,14 +1866,19 @@
except Exception:
self.log.exception("Failed to connect to guest agent channel")
- try:
- if self.conf.get('enableGuestEvents', False):
- if self.lastStatus == vmstatus.MIGRATION_DESTINATION:
+ if self.lastStatus == vmstatus.RESTORING_STATE:
+ try:
+ self.guestAgent.events.after_hibernation()
+ except Exception:
+ self.log.exception("Unexpected error on guest after "
+ "hibernation notification")
+ elif self.conf.get('enableGuestEvents', False):
+ if self.lastStatus == vmstatus.MIGRATION_DESTINATION:
+ try:
self.guestAgent.events.after_migration()
- elif self.lastStatus == vmstatus.RESTORING_STATE:
- self.guestAgent.events.after_hibernation()
- except Exception:
- self.log.exception("Unexpected error on guest event notification")
+ except Exception:
+ self.log.exception("Unexpected error on guest after "
+ "migration notification")
# Drop enableGuestEvents from conf - Not required from here anymore
self.conf.pop('enableGuestEvents', None)
--
To view, visit https://gerrit.ovirt.org/59914
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic52b8c22d57028fb6459c7faa2bcfebd8f32d6c4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: vm: legacy rng devices fix not needed anymore
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: legacy rng devices fix not needed anymore
......................................................................
vm: legacy rng devices fix not needed anymore
We introduced this fix to deal with upgrades from Vdsm
4.16.z, and we don't need this anymore.
Change-Id: I34eef559ef3d789fd502490acc9691df15c684b9
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 0 insertions(+), 26 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/61243/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 61a59ca..df32da0 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1647,13 +1647,6 @@
self._updateDomainDescriptor()
- # REQUIRED_FOR migrate from vdsm-4.16
- #
- # We need to clean out unknown devices that are created for
- # RNG devices by VDSM 3.5 and are left in the configuration
- # after upgrade to 3.6.
- self._fixLegacyRngConf()
-
self._getUnderlyingVmDevicesInfo()
self._updateAgentChannels()
@@ -4604,25 +4597,6 @@
newChain = [x for x in device['volumeChain']
if x['volumeID'] in volumes]
device['volumeChain'] = drive.volumeChain = newChain
-
- def _fixLegacyRngConf(self):
- def _is_legacy_rng_device_conf(dev):
- """
- Returns True if dev is a legacy (3.5) RNG device conf,
- False otherwise.
- """
- return dev['type'] == hwclass.RNG and (
- 'specParams' not in dev or
- 'source' not in dev['specParams']
- )
-
- with self._confLock:
- self._devices[hwclass.RNG] = [dev for dev
- in self._devices[hwclass.RNG]
- if 'source' in dev.specParams]
- self.conf['devices'] = [dev for dev
- in self.conf['devices']
- if not _is_legacy_rng_device_conf(dev)]
def getDiskDevices(self):
return self._devices[hwclass.DISK]
--
To view, visit https://gerrit.ovirt.org/61243
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34eef559ef3d789fd502490acc9691df15c684b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[ovirt-4.0]: net: canonicalize IPv4 prefix to netmask
by phoracek@redhat.com
Petr Horáček has uploaded a new change for review.
Change subject: net: canonicalize IPv4 prefix to netmask
......................................................................
net: canonicalize IPv4 prefix to netmask
In order to fix OVS switch, this patch moves canonicalization of
passed IPv4 prefix into netmask from legacy_switch.py to
canonicalize.py.
It also adds missing 'prefix' to setupNetworks documentation.
Change-Id: I344eef120b4c19f90d4dd20c7857bb73ab259e9b
Bug-Url: https://bugzilla.redhat.com/1374194
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
---
M lib/vdsm/network/api.py
M lib/vdsm/network/canonicalize.py
M lib/vdsm/network/legacy_switch.py
M tests/network/func_static_ip_test.py
M tests/network/netfunctestlib.py
5 files changed, 30 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/64507/1
diff --git a/lib/vdsm/network/api.py b/lib/vdsm/network/api.py
index 799686f..1b5ab48 100644
--- a/lib/vdsm/network/api.py
+++ b/lib/vdsm/network/api.py
@@ -209,7 +209,7 @@
bonding="<name>" | nic="<name>"
(bonding and nics are mutually exclusive)
ipaddr="<ipv4>"
- netmask="<ipv4>"
+ netmask="<ipv4>" | prefix=<prefixlen>
gateway="<ipv4>"
bootproto="..."
ipv6addr="<ipv6>[/<prefixlen>]"
diff --git a/lib/vdsm/network/canonicalize.py b/lib/vdsm/network/canonicalize.py
index b0bc983..3468796 100644
--- a/lib/vdsm/network/canonicalize.py
+++ b/lib/vdsm/network/canonicalize.py
@@ -22,6 +22,7 @@
import six
from .netinfo import bridges, mtus, bonding, dns
+from .netinfo.addresses import prefix2netmask
from vdsm import utils
from .errors import ConfigNetworkError
@@ -47,6 +48,7 @@
_canonicalize_switch_type_net(attrs)
_canonicalize_ip_default_route(attrs)
_canonicalize_nameservers(attrs)
+ _canonicalize_prefix(attrs)
def canonicalize_bondings(bonds):
@@ -138,3 +140,15 @@
data['nameservers'] = dns.get_host_nameservers()
else:
data['nameservers'] = []
+
+
+def _canonicalize_prefix(data):
+ prefix = data.pop('prefix', None)
+ if prefix:
+ if 'netmask' in data:
+ raise ConfigNetworkError(
+ ne.ERR_BAD_PARAMS, 'Both PREFIX and NETMASK supplied')
+ try:
+ data['netmask'] = prefix2netmask(int(prefix))
+ except ValueError as ve:
+ raise ConfigNetworkError(ne.ERR_BAD_ADDR, 'Bad prefix: %s' % ve)
diff --git a/lib/vdsm/network/legacy_switch.py b/lib/vdsm/network/legacy_switch.py
index 05a62c2..8d426ec 100644
--- a/lib/vdsm/network/legacy_switch.py
+++ b/lib/vdsm/network/legacy_switch.py
@@ -30,7 +30,6 @@
from vdsm.network import kernelconfig
from vdsm.network import libvirt
from vdsm.network.netinfo import NET_PATH
-from vdsm.network.netinfo import addresses
from vdsm.network.netinfo import bridges
from vdsm.network.netinfo import mtus
from vdsm.network.netinfo import nics as netinfo_nics
@@ -187,7 +186,7 @@
@_alter_running_config
def _add_network(network, configurator, nameservers,
vlan=None, bonding=None, nic=None, ipaddr=None,
- netmask=None, prefix=None, mtu=None, gateway=None,
+ netmask=None, mtu=None, gateway=None,
dhcpv6=None, ipv6addr=None, ipv6gateway=None,
ipv6autoconf=None, bridged=True, _netinfo=None, hostQos=None,
defaultRoute=None, blockingdhcp=False, **options):
@@ -201,16 +200,6 @@
if network == '':
raise ConfigNetworkError(ne.ERR_BAD_BRIDGE,
'Empty network names are not valid')
- if prefix:
- if netmask:
- raise ConfigNetworkError(ne.ERR_BAD_PARAMS,
- 'Both PREFIX and NETMASK supplied')
- else:
- try:
- netmask = addresses.prefix2netmask(int(prefix))
- except ValueError as ve:
- raise ConfigNetworkError(ne.ERR_BAD_ADDR, 'Bad prefix: %s' %
- ve)
logging.debug('Validating network...')
if network in _netinfo.networks:
diff --git a/tests/network/func_static_ip_test.py b/tests/network/func_static_ip_test.py
index 136a44c..e9bfdb2 100644
--- a/tests/network/func_static_ip_test.py
+++ b/tests/network/func_static_ip_test.py
@@ -108,6 +108,17 @@
with self.setupNetworks(netcreate, bondcreate, NOCHK):
self.assertNetworkIp(NETWORK_NAME, netcreate[NETWORK_NAME])
+ def test_add_net_with_prefix(self):
+ with dummy_device() as nic:
+ network_attrs = {'nic': nic,
+ 'ipaddr': IPv4_ADDRESS,
+ 'prefix': IPv4_PREFIX_LEN,
+ 'switch': self.switch}
+ netcreate = {NETWORK_NAME: network_attrs}
+
+ with self.setupNetworks(netcreate, {}, NOCHK):
+ self.assertNetworkIp(NETWORK_NAME, netcreate[NETWORK_NAME])
+
@attr(type='functional', switch='legacy')
class NetworkStaticIpBasicLegacyTest(NetworkStaticIpBasicTemplate):
diff --git a/tests/network/netfunctestlib.py b/tests/network/netfunctestlib.py
index 7b59fa8..9e9b14f 100644
--- a/tests/network/netfunctestlib.py
+++ b/tests/network/netfunctestlib.py
@@ -30,6 +30,7 @@
from vdsm.network import kernelconfig
from vdsm.network.ip import dhclient
from vdsm.network.ip.address import ipv6_supported
+from vdsm.network.netinfo.addresses import prefix2netmask
from vdsm.network.netinfo.nics import operstate
from testlib import VdsmTestCase
@@ -283,7 +284,8 @@
def assertStaticIPv4(self, netattrs, ipinfo):
requires_ipaddress()
address = netattrs['ipaddr']
- netmask = netattrs['netmask']
+ netmask = (netattrs.get('netmask') or
+ prefix2netmask(int(netattrs.get('prefix'))))
self.assertEqual(address, ipinfo['addr'])
self.assertEqual(netmask, ipinfo['netmask'])
ipv4 = ipaddress.IPv4Interface(
--
To view, visit https://gerrit.ovirt.org/64507
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I344eef120b4c19f90d4dd20c7857bb73ab259e9b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: build: Disable tests during build
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: build: Disable tests during build
......................................................................
build: Disable tests during build
Tests are needed for development, not for building a package. This
allows us to use latest and greatest development tools, which are not
available in brew or koji.
Since we install nose using pip, remove the build requires - we don't
need now nose to build rpms.
Change-Id: I9e3589c365166f934f117b53c65cea4b90db3516
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/63966/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index f234b09..c7f6dde 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -62,7 +62,6 @@
BuildRequires: python2-devel
BuildRequires: python-mock
BuildRequires: python-netaddr
-BuildRequires: python-nose
BuildRequires: python-six >= 1.9.0
BuildRequires: rpm-build
@@ -95,10 +94,8 @@
%if 0%{?with_python3}
%if 0%{?rhel}
-BuildRequires: python34-nose
BuildRequires: python34-six
%else # fedora
-BuildRequires: python3-nose
BuildRequires: python3-six
BuildRequires: python3-netaddr
BuildRequires: python3-yaml
@@ -781,9 +778,6 @@
# Install the libvirt hook for cleaning up the XML
install -Dm 0755 vdsm/virt/libvirt-hook.sh \
%{buildroot}%{_sysconfdir}/libvirt/hooks/qemu
-
-%check
-make tests
%pre
# Force standard locale behavior (English)
--
To view, visit https://gerrit.ovirt.org/63966
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e3589c365166f934f117b53c65cea4b90db3516
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: tests: inspect.getargspec() is deprecated in py3
by Piotr Kliczewski
Piotr Kliczewski has uploaded a new change for review.
Change subject: tests: inspect.getargspec() is deprecated in py3
......................................................................
tests: inspect.getargspec() is deprecated in py3
We do not want to see following warning during running tests:
DeprecationWarning: inspect.getargspec() is deprecated
Change-Id: I25a58ea32bf7548a8f27cc217392fd0958cc8b7d
Signed-off-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
---
M tests/api_test.py
M tests/schemaValidationTest.py
M tests/testlib.py
3 files changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/64313/1
diff --git a/tests/api_test.py b/tests/api_test.py
index 3c57381..b977415 100644
--- a/tests/api_test.py
+++ b/tests/api_test.py
@@ -18,12 +18,11 @@
# Refer to the README and COPYING files for full details of the license
#
-import inspect
-
from vdsm.common import api
from vdsm.common import exception
from vdsm.common import response
+from testlib import getargspec
from testlib import VdsmTestCase as TestCaseBase
@@ -31,10 +30,10 @@
def test_preserve_signature(self):
vm = FakeVM()
- args = inspect.getargspec(vm.fail)
+ args = getargspec(vm.fail)
self.assertEqual(args.args, ['self', 'exc'])
self.assertEqual(args.varargs, None)
- self.assertEqual(args.keywords, None)
+ self.assertEqual(getattr(args, 'keywords', None), None)
class TestResponse(TestCaseBase):
diff --git a/tests/schemaValidationTest.py b/tests/schemaValidationTest.py
index fd87724..13df62f 100644
--- a/tests/schemaValidationTest.py
+++ b/tests/schemaValidationTest.py
@@ -29,6 +29,7 @@
from vdsm.rpc import Bridge
from api import vdsmapi
+from testlib import getargspec
from testlib import VdsmTestCase as TestCaseBase
from contextlib import contextmanager
@@ -169,12 +170,12 @@
yield class_name, class_obj
def _get_args(self, method_obj):
- args = inspect.getargspec(method_obj).args
+ args = getargspec(method_obj).args
args.remove('self')
return args
def _get_default_args(self, method_obj):
- argSpec = inspect.getargspec(method_obj)
+ argSpec = getargspec(method_obj)
if argSpec.defaults:
return argSpec.args[- len(argSpec.defaults):]
else:
diff --git a/tests/testlib.py b/tests/testlib.py
index c341c24..7c63a38 100644
--- a/tests/testlib.py
+++ b/tests/testlib.py
@@ -45,6 +45,12 @@
import mock
mock
+try:
+ from inspect import getfullargspec as getargspec
+except ImportError: # py2
+ from inspect import getargspec as getargspec
+getargspec
+
from nose import config
from nose import core
from nose import result
--
To view, visit https://gerrit.ovirt.org/64313
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I25a58ea32bf7548a8f27cc217392fd0958cc8b7d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
7 years, 5 months
Change in vdsm[master]: Add new api to get the IO tune policies for all vms
by jtokar@redhat.com
Jenny Tokar has uploaded a new change for review.
Change subject: Add new api to get the IO tune policies for all vms
......................................................................
Add new api to get the IO tune policies for all vms
This patch adds a new api to vdsm that allows retrieval
of the io tune policy and its' values for all the vms via
a single api thus removing the need to query vdsm for that
info for every present vm.
Change-Id: I16ead268367901ae85e47fb71104e23705f0e0e1
Bug-Url: https://bugzilla.redhat.com/1374988
Signed-off-by: Jenny Tokar <jtokar(a)redhat.com>
---
M lib/api/vdsm-api.yml
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/rpc/Bridge.py
M lib/vdsm/rpc/bindingxmlrpc.py
M vdsm/API.py
M vdsm/clientIF.py
M vdsm/virt/vm.py
7 files changed, 65 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/63748/7
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index c7ab7f5..c27079e 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -6027,6 +6027,28 @@
type: *VmDiskDeviceIoTuneParams
type: object
+ BulkIoTunePolicy: &BulkIoTunePolicy
+ added: '4.0'
+ description: Io tune policy info and current values for a vm
+ name: BulkIoTunePolicy
+ properties:
+ - description: Io tune policy info
+ name: policy
+ type: *VmDiskDeviceTuneLimits
+
+ - description: Io tune policy current values
+ name: current_values
+ type: *VmDiskDeviceTuneParams
+ type: object
+
+ BulkIoTunePolicyMap: &BulkIoTunePolicyMap
+ added: '4.0'
+ name: BulkIoTunePolicyMap
+ description: A map of io tune policies for all VMs
+ key-type: *UUID
+ value-type: *BulkIoTunePolicy
+ type: map
+
UpdateVmPolicyParams: &UpdateVmPolicyParams
added: '3.4'
description: QoS policy update data
@@ -7617,6 +7639,13 @@
type:
- *VmStats
+Host.getAllVmIoTunePolicies:
+ added: '4.0'
+ description: Get io tune policies for all virtual machines.
+ return:
+ description: A map of io tune policies for all VMs
+ type: *BulkIoTunePolicyMap
+
Host.hostdevListByCaps:
added: '3.6'
description: Refresh and get information about devices available on the
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index e276f86..837311c 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -59,6 +59,7 @@
'getAllTasksInfo': 'Host.getAllTasksInfo',
'getAllTasksStatuses': 'Host.getAllTasksStatuses',
'getAllVmStats': 'Host.getAllVmStats',
+ 'getAllVmIoTunePolicies': 'Host.getAllVmIoTunePolicies',
'getConnectedStoragePoolsList': 'Host.getConnectedStoragePools',
'getDeviceList': 'Host.getDeviceList',
'getImagesList': 'StorageDomain.getImages',
diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py
index 5dedcc0..7456ab3 100644
--- a/lib/vdsm/rpc/Bridge.py
+++ b/lib/vdsm/rpc/Bridge.py
@@ -354,6 +354,7 @@
'Host_getVMList': {'call': Host_getVMList_Call, 'ret': 'vmList'},
'Host_getVMFullList': {'call': Host_getVMFullList_Call, 'ret': 'vmList'},
'Host_getAllVmStats': {'ret': 'statsList'},
+ 'Host_getAllVmIoTunePolicies': {'ret': 'io_tune_policies_dict'},
'Host_setupNetworks': {'ret': 'status'},
'Host_setKsmTune': {'ret': 'status'},
'Image_cloneStructure': {'ret': 'uuid'},
diff --git a/lib/vdsm/rpc/bindingxmlrpc.py b/lib/vdsm/rpc/bindingxmlrpc.py
index b8bb3f6..1a6ab84 100644
--- a/lib/vdsm/rpc/bindingxmlrpc.py
+++ b/lib/vdsm/rpc/bindingxmlrpc.py
@@ -561,6 +561,10 @@
api = API.Global()
return api.getAllVmStats()
+ def getAllVmIoTunePolicies(self):
+ api = API.Global()
+ return api.getAllVmIoTunePolicies()
+
def hostdevListByCaps(self, caps=None):
api = API.Global()
return api.hostdevListByCaps(caps)
@@ -1073,6 +1077,7 @@
(self.getStats, 'getVdsStats'),
(self.vmGetStats, 'getVmStats'),
(self.getAllVmStats, 'getAllVmStats'),
+ (self.getAllVmIoTunePolicies, 'getAllVmIoTunePolicies'),
(self.hostdevListByCaps, 'hostdevListByCaps'),
(self.hostdevChangeNumvfs, 'hostdevChangeNumvfs'),
(self.hostdevReattach, 'hostdevReattach'),
diff --git a/vdsm/API.py b/vdsm/API.py
index f000297..0ad84bf 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -780,7 +780,7 @@
v = self._cif.vmContainer.get(self._UUID)
if not v:
return errCode['noVM']
- return v.getIoTune()
+ return v.getIoTuneResponse()
def setIoTune(self, tunables):
v = self._cif.vmContainer.get(self._UUID)
@@ -792,7 +792,7 @@
v = self._cif.vmContainer.get(self._UUID)
if not v:
return errCode['noVM']
- return v.getIoTunePolicy()
+ return v.getIoTunePolicyResponse()
def setCpuTunePeriod(self, period):
v = self._cif.vmContainer.get(self._UUID)
@@ -1395,6 +1395,13 @@
AllVmStatsValue(statsList))
return {'status': doneCode, 'statsList': Suppressed(statsList)}
+ def getAllVmIoTunePolicies(self):
+ """
+ Get IO tuning policies of all running VMs.
+ """
+ io_tune_policies_dict = self._cif.getAllVmIoTunePolicies()
+ return {'status': doneCode, 'io_tune_policies_dict': io_tune_policies_dict}
+
def hostdevListByCaps(self, caps=None):
devices = hostdev.list_by_caps(caps)
return {'status': doneCode, 'deviceList': devices}
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index fefc915..c3bc10f 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -441,6 +441,12 @@
def getAllVmStats(self):
return [v.getStats() for v in self.vmContainer.values()]
+ def getAllVmIoTunePolicies(self):
+ vm_io_tune_policies = {}
+ for v in self.vmContainer.values():
+ vm_io_tune_policies[v.id] = {'policy':v.getIoTunePolicy(), 'current_values': v.getIoTune()}
+ return vm_io_tune_policies
+
def createStompClient(self, client_socket):
if 'jsonrpc' in self.bindings:
json_binding = self.bindings['jsonrpc']
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 967dbab..0af45b7 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2576,19 +2576,29 @@
else:
return None
+ def getIoTunePolicyResponse(self):
+ tunables = self.getIoTunePolicy()
+ return response.success(ioTunePolicyList=tunables)
+
def getIoTunePolicy(self):
tunables = []
qos = self._getVmPolicy()
ioTuneList = qos.getElementsByTagName("ioTune")
if not ioTuneList or not ioTuneList[0].hasChildNodes():
- return response.success(ioTunePolicyList=[])
+ return []
for device in ioTuneList[0].getElementsByTagName("device"):
tunables.append(io_tune_dom_to_values(device))
- return response.success(ioTunePolicyList=tunables)
+ return tunables
def getIoTune(self):
+ result = self.getIoTuneResponse()
+ if response.is_error(result):
+ return []
+ return result.get('ioTuneList', [])
+
+ def getIoTuneResponse(self):
resultList = []
for device in self.getDiskDevices():
@@ -2615,8 +2625,10 @@
except libvirt.libvirtError as e:
self.log.exception("getVmIoTune failed")
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
+ self.logger.error('noVM')
return response.error('noVM')
else:
+ self.logger.error('updateIoTuneErr', e.message)
return response.error('updateIoTuneErr', e.message)
return response.success(ioTuneList=resultList)
--
To view, visit https://gerrit.ovirt.org/63748
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I16ead268367901ae85e47fb71104e23705f0e0e1
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years, 6 months
Change in vdsm[master]: [wip] infra tests: added functional test for upgrading vdsm
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: [wip] infra tests: added functional test for upgrading vdsm
......................................................................
[wip] infra tests: added functional test for upgrading vdsm
Change-Id: I589a73fa5285983f7d1adcdae49fc7bffb05bec4
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M automation/check-merged.sh
A tests/functional/upgrade_vdsm_test.py
2 files changed, 52 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/61186/1
diff --git a/automation/check-merged.sh b/automation/check-merged.sh
index 6869d49..b39ec99 100755
--- a/automation/check-merged.sh
+++ b/automation/check-merged.sh
@@ -4,7 +4,8 @@
EXPORTS="$PWD"/exported-artifacts
TEST_PATH="functional"
FUNCTIONAL_TESTS_LIST=" \
- $TEST_PATH/supervdsmFuncTests.py"
+ $TEST_PATH/supervdsmFuncTests.py \
+ $TEST_PATH/upgrade_vdsm_test.py"
DISABLE_TESTS_LIST=" \
$TEST_PATH/sosPluginTests.py \
diff --git a/tests/functional/upgrade_vdsm_test.py b/tests/functional/upgrade_vdsm_test.py
new file mode 100644
index 0000000..7da860a
--- /dev/null
+++ b/tests/functional/upgrade_vdsm_test.py
@@ -0,0 +1,50 @@
+import yum
+
+from vdsm.tool.service import service_start, service_status
+
+from testlib import VdsmTestCase
+from testValidation import ValidateRunningAsRoot
+
+_url = 'http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm'
+
+
+def _install(yb, package):
+ yb.install(name=package)
+ yb.processTransaction()
+
+
+def _remove(yb, package):
+ yb.remove(name=package)
+ yb.processTransaction()
+
+
+def _update(yb, package):
+ yb.update(name=package)
+ yb.processTransaction()
+
+
+def _installLocal(yb, pkg):
+ yb.installLocal(pkg=pkg)
+ yb.processTransaction()
+
+
+class UpgradeTest(VdsmTestCase):
+ def __init__(self):
+ self.yum_base = yum.YumBase()
+ self.yum_base.setCacheDir()
+
+ @ValidateRunningAsRoot
+ def setUp(self):
+ _remove(self.yum_base, 'vdsm')
+ self.yum_base.repos.disableRepo('ovirt-snapshot')
+ _installLocal(self.yum_base, _url)
+ _install(self.yum_base, 'vdsm')
+ service_start('vdsmd')
+
+ def tearDown(self):
+ service_start('vdsmd')
+
+ def upgrade_test(self):
+ self.yum_base.repos.enableRepo('ovirt-snapshot')
+ _update(self.yum_base, 'vdsm')
+ self.assertEqual(service_status('vdsmd'), 0)
--
To view, visit https://gerrit.ovirt.org/61186
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I589a73fa5285983f7d1adcdae49fc7bffb05bec4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 6 months
Change in vdsm[master]: migration: coalesce join() into stop()
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: migration: coalesce join() into stop()
......................................................................
migration: coalesce join() into stop()
we always call join() after stop(), so coalesce the two
method in stop().
Doing so, we can also get rid of most of the remnants of the thread
interface that pollutes DowntimeThread, MonitorThread and SourceThread.
Change-Id: Ib6def55d50a61ac983b45e826c05e09887fe5ee0
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 5 insertions(+), 22 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/62587/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 28963bf..e66fab2 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -495,13 +495,10 @@
with utils.running(self._monitorThread):
self._perform_migration(duri, muri)
- self._monitorThread.join()
-
def _perform_with_conv_schedule(self, duri, muri):
self._vm.log.debug('performing migration with conv schedule')
with utils.running(self._monitorThread):
self._perform_migration(duri, muri)
- self._monitorThread.join()
def set_max_bandwidth(self, bandwidth):
self._vm.log.debug('setting migration max bandwidth to %d', bandwidth)
@@ -556,12 +553,6 @@
def start(self):
self._thread.start()
- def join(self):
- return self._thread.join()
-
- def is_alive(self):
- return self._thread.is_alive()
-
@utils.traceback()
def run(self):
self._vm.log.debug('migration downtime thread started (%i steps)',
@@ -583,6 +574,10 @@
def stop(self):
self._vm.log.debug('stopping migration downtime thread')
self._stop.set()
+ if self._thread.is_alive():
+ # on very short migrations, the downtime thread
+ # may not be started at all.
+ self._thread.join()
def _set_downtime(self, downtime):
self._vm.log.debug('setting migration downtime to %d', downtime)
@@ -598,12 +593,6 @@
def stop(self):
pass
-
- def join(self):
- pass
-
- def is_alive(self):
- return False
def set_initial_downtime(self):
pass
@@ -628,9 +617,6 @@
def start(self):
self._thread.start()
- def join(self):
- self._thread.join()
-
@property
def enabled(self):
return MonitorThread._MIGRATION_MONITOR_INTERVAL > 0
@@ -643,10 +629,6 @@
self.monitor_migration()
finally:
self.downtime_thread.stop()
- if self.downtime_thread.is_alive():
- # on very short migrations, the downtime thread
- # may not be started at all.
- self.downtime_thread.join()
self._vm.log.debug('stopped migration monitor thread')
else:
self._vm.log.info('migration monitor thread disabled'
@@ -735,6 +717,7 @@
def stop(self):
self._vm.log.debug('stopping migration monitor thread')
self._stop.set()
+ self._thread.join()
def _next_action(self, stalling):
head = self._conv_schedule['stalling'][0]
--
To view, visit https://gerrit.ovirt.org/62587
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6def55d50a61ac983b45e826c05e09887fe5ee0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 6 months
Change in vdsm[master]: tests: bootstrap the livemerge tests
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: tests: bootstrap the livemerge tests
......................................................................
tests: bootstrap the livemerge tests
Bootstrap the livemerge tests.
We start with a simple test for LiveMergeCleanupThread, used
to verify change I149315a1934a5650222212870c87a67f5a0185b9.
Change-Id: Ie1e3efd06a3d807d46e582ef1ba6548ab1c7e30f
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/Makefile.am
A tests/livemerge_test.py
2 files changed, 90 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/62253/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 467f2d4..4270f29 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -77,6 +77,7 @@
iscsiTests.py \
jobsTests.py \
libvirtconnectionTests.py \
+ livemerge_test.py \
logutils_test.py \
lvmTests.py \
miscTests.py \
diff --git a/tests/livemerge_test.py b/tests/livemerge_test.py
new file mode 100644
index 0000000..5ad2a41
--- /dev/null
+++ b/tests/livemerge_test.py
@@ -0,0 +1,89 @@
+#
+# Copyright 2016 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+from __future__ import absolute_import
+
+import logging
+import threading
+import uuid
+
+from virt import vm
+from testlib import VdsmTestCase as TestCaseBase
+
+from monkeypatch import MonkeyPatch, MonkeyPatchScope
+
+
+class TestLiveMergeThread(TestCaseBase):
+
+ def setUp(self):
+ self.vm = FakeVm()
+ self.job = fake_job()
+ self.drive = FakeDrive()
+
+ def test_run(self):
+ t = vm.LiveMergeCleanupThread(self.vm, self.job, self.drive, False)
+ t.start()
+ self.vm.got_volume_info.wait()
+
+ self.assertTrue(t.isAlive())
+ self.assertFalse(t.isSuccessful())
+
+ self.vm.sync_done.set()
+
+ t.join()
+ self.assertTrue(t.isSuccessful())
+
+
+def fake_job(jobID=None):
+ return {
+ 'jobID': str(uuid.uuid4()) if jobID is None else jobID,
+ 'topVolume': str(uuid.uuid4()),
+ 'baseVolume': str(uuid.uuid4()),
+ }
+
+
+class FakeVm(object):
+
+ def __init__(self, vmid=None):
+ self.id = str(uuid.uuid4()) if vmid is None else vmid
+ self.sync_done = threading.Event()
+ self.got_volume_info = threading.Event()
+ self.log = logging.getLogger('test.livemerge.Vm')
+
+ def _getVolumeInfo(self, domainID, poolID, imageID, topVolUUID):
+ self.got_volume_info.set()
+ return {
+ 'capacity': 0,
+ }
+
+ def _setVolumeSize(self, domainID, poolID, imageID, baseVolUUID, capacity):
+ pass
+
+ def _syncVolumeChain(self, drive):
+ self.sync_done.wait()
+
+ def enableDriveMonitor(self):
+ pass
+
+
+class FakeDrive(object):
+ def __init__(self):
+ self.domainID = str(uuid.uuid4())
+ self.poolID = str(uuid.uuid4())
+ self.imageID = str(uuid.uuid4())
--
To view, visit https://gerrit.ovirt.org/62253
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1e3efd06a3d807d46e582ef1ba6548ab1c7e30f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 6 months