Change in vdsm[master]: vmxml: export container metadata
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vmxml: export container metadata
......................................................................
vmxml: export container metadata
Add a metadata tags to let Engine specifiy the container
specific parameters, using custom properties.
This way we don't require changes to the Engine UI.
The metadata we add is about:
- container runtime type to use (rkt, runc...).
- mapping between VM drives and container volumes
- the image to run, to let users freely
experiment with the public repositories.
Change-Id: I1ade3c0c7d300c5ce33cb23723c3d0e59e4af664
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vmxml.py
1 file changed, 31 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/60481/1
diff --git a/vdsm/virt/vmxml.py b/vdsm/virt/vmxml.py
index 4b5edd5..cc14770 100644
--- a/vdsm/virt/vmxml.py
+++ b/vdsm/virt/vmxml.py
@@ -23,13 +23,18 @@
import xml.dom.minidom
import xml.etree.ElementTree as etree
+import six
+
from vdsm import constants
+from vdsm import convirtconnection
from vdsm import cpuarch
from vdsm import utils
+
METADATA_VM_TUNE_URI = 'http://ovirt.org/vm/tune/1.0'
METADATA_VM_TUNE_ELEMENT = 'qos'
METADATA_VM_TUNE_PREFIX = 'ovirt'
+
_BOOT_MENU_TIMEOUT = 10000 # milliseconds
@@ -243,12 +248,26 @@
metadata = Element('metadata')
self._appendMetadataQOS(metadata)
+ self._appendMetadataContainer(metadata)
self.dom.appendChild(metadata)
def _appendMetadataQOS(self, metadata):
qos = Element(METADATA_VM_TUNE_PREFIX + ':' + METADATA_VM_TUNE_ELEMENT)
qos.setAttr('xmlns:' + METADATA_VM_TUNE_PREFIX, METADATA_VM_TUNE_URI)
metadata.appendChild(qos)
+
+ def _appendMetadataContainer(self, metadata):
+ custom = self.conf.get('custom', {})
+ container_type = custom.get('containerType')
+ if not container_type:
+ return
+
+ container_image = custom.get('containerImage')
+ drive_map = find_drive_mapping(self.conf.get('custom', {}))
+
+ convirtconnection.append_metadata(
+ Element, metadata, container_type, container_image, drive_map,
+ )
def appendOs(self, use_serial_console=False):
"""
@@ -554,3 +573,15 @@
def _getMaxVCpus(self):
return self.conf.get('maxVCpus', self._getSmp())
+
+
+def find_drive_mapping(custom):
+ drive_mapping = {}
+ for key, value in six.iteritems(custom):
+ if key.startswith('volume:'):
+ try:
+ tag, name = key.split(':', 1)
+ except ValueError:
+ continue
+ drive_mapping[name.strip()] = value.strip()
+ return drive_mapping
--
To view, visit https://gerrit.ovirt.org/60481
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ade3c0c7d300c5ce33cb23723c3d0e59e4af664
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: dump_volume_chains: migrate to jsonrpcvdscli
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: dump_volume_chains: migrate to jsonrpcvdscli
......................................................................
dump_volume_chains: migrate to jsonrpcvdscli
Change-Id: I6f34824ba84498bedf9ddc7cb5b41e8cdce603a1
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M lib/vdsm/tool/dump_volume_chains.py
1 file changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/62324/1
diff --git a/lib/vdsm/tool/dump_volume_chains.py b/lib/vdsm/tool/dump_volume_chains.py
index 7928b32..eb46926 100644
--- a/lib/vdsm/tool/dump_volume_chains.py
+++ b/lib/vdsm/tool/dump_volume_chains.py
@@ -25,7 +25,8 @@
from . import expose
-from vdsm import vdscli
+from vdsm.config import config
+from vdsm import jsonrpcvdscli
# BLANK_UUID is re-declared here since it cannot be imported properly. This
# constant should be introduced under lib publicly available
@@ -96,15 +97,19 @@
_print_volume_chains(image_chains, volumes_info)
+ server.close()
+
def _connect_to_server(host, port, use_ssl):
- host_port = "%s:%s" % (host, port)
+ requestQueues = config.get("addresses", "request_queues")
+ requestQueue = requestQueues.split(",")[0]
try:
- return vdscli.connect(host_port, use_ssl)
+ return jsonrpcvdscli.connect(
+ requestQueue=requestQueue, host=host, port=port, useSSL=use_ssl)
except socket.error as e:
if e[0] == errno.ECONNREFUSED:
raise ConnectionRefusedError(
- "Connection to %s refused" % (host_port,))
+ "Connection to %s:%s refused" % (host, port))
raise
--
To view, visit https://gerrit.ovirt.org/62324
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f34824ba84498bedf9ddc7cb5b41e8cdce603a1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: net: Ignore missing graphics from VM conf on target host
by edwardh@redhat.com
Edward Haas has uploaded a new change for review.
Change subject: net: Ignore missing graphics from VM conf on target host
......................................................................
net: Ignore missing graphics from VM conf on target host
The new VM migration libvirt hook handling, recreate the interface and
graphics devices of the domxml to fir the target host. It does so using
the VM conf data.
Unfortunate, there was a bug in Engine that did not pushed the graphics
configuration to VDSM, leaving VM conf without the display information.
VDSM on the other hand, used a default, listen to all, when this data
has not been received from Engine.
On migration, the domxml includes the graphics section while the target
VM conf does not, causing an exception that fails the action.
This patch silently ignores such scenarios, leaving the source domxml as
is in the graphics section.
Change-Id: I8cc730c6448b1f70500c86b3ab39af21fa23bd5a
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M vdsm/virt/vm_migrate_hook.py
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/64300/1
diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..0ae3995 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -37,6 +37,10 @@
pass
+class VmMigrationMissingDisplayConf(Exception):
+ pass
+
+
def main(domain, event, phase, stdin=sys.stdin, stdout=sys.stdout, *args):
if event not in ('migrate', 'restore'):
sys.exit(0)
@@ -77,7 +81,14 @@
if 'devices' not in target_vm_conf:
raise VmMigrationHookError('No devices entity in VM conf')
- _set_graphics(devices, target_vm_conf)
+ try:
+ _set_graphics(devices, target_vm_conf)
+ except VmMigrationMissingDisplayConf:
+ # Due to a bug in Engine, there can be a scenario where the domxml
+ # includes a graphics section, however, the VM config on target does
+ # not. In such cases, ignore and do not touch this section.
+ pass
+
_set_bridge_interfaces(devices, target_vm_conf)
@@ -174,7 +185,7 @@
if params and 'displayNetwork' in params and 'displayIp' in params:
return params['displayNetwork'], params['displayIp']
- raise VmMigrationHookError('VM conf graphics not detected')
+ raise VmMigrationMissingDisplayConf('VM conf graphics not detected')
def _vm_item(vdscli, vm_uuid):
--
To view, visit https://gerrit.ovirt.org/64300
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cc730c6448b1f70500c86b3ab39af21fa23bd5a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: net tests: Remove redundant label from func test template.
by edwardh@redhat.com
Edward Haas has uploaded a new change for review.
Change subject: net tests: Remove redundant label from func test template.
......................................................................
net tests: Remove redundant label from func test template.
The new functional test format are using a template test class with two
sublasses, one for each switch type (legacy, ovs).
With NOSE 1.3.0 there was a need to overcome a bug, that did not pass
correctly the NOSE test labels, by labeling the template class in
addition to the subclasses.
As we are now requiring NOSE 1.3.7 for the test run, the template class
tests have been cleaned.
Change-Id: I2f75bb1d6aabceceff65d673ec776cd5b5c939c3
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M tests/network/func_bond_basic_test.py
M tests/network/func_dhclient_test.py
M tests/network/func_dns_test.py
M tests/network/func_net_basic_test.py
M tests/network/func_rollback_test.py
M tests/network/func_static_ip_test.py
6 files changed, 0 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/63931/1
diff --git a/tests/network/func_bond_basic_test.py b/tests/network/func_bond_basic_test.py
index 1f0cc6b..b6b7dd6 100644
--- a/tests/network/func_bond_basic_test.py
+++ b/tests/network/func_bond_basic_test.py
@@ -28,7 +28,6 @@
BOND_NAME = 'bond1'
-@attr(type='functional')
class BondBasicTemplate(NetFuncTestCase):
__test__ = False
diff --git a/tests/network/func_dhclient_test.py b/tests/network/func_dhclient_test.py
index 532eaf5..99c9315 100644
--- a/tests/network/func_dhclient_test.py
+++ b/tests/network/func_dhclient_test.py
@@ -37,7 +37,6 @@
DHCPv4_RANGE_TO = '192.0.3.253'
-@attr(type='functional')
class NetworkDhcpBasicTemplate(NetFuncTestCase):
__test__ = False
@@ -75,7 +74,6 @@
switch = 'ovs'
-@attr(type='functional')
class StopDhclientOnUsedNicsTemplate(NetFuncTestCase):
__test__ = False
diff --git a/tests/network/func_dns_test.py b/tests/network/func_dns_test.py
index aa4be68..0aa245c 100644
--- a/tests/network/func_dns_test.py
+++ b/tests/network/func_dns_test.py
@@ -34,7 +34,6 @@
IPv4_NETMASK = '255.255.255.0'
-@attr(type='functional')
class NetworkDNSTemplate(NetFuncTestCase):
__test__ = False
diff --git a/tests/network/func_net_basic_test.py b/tests/network/func_net_basic_test.py
index f937202..af14424 100644
--- a/tests/network/func_net_basic_test.py
+++ b/tests/network/func_net_basic_test.py
@@ -29,7 +29,6 @@
VLAN = 10
-@attr(type='functional')
class NetworkBasicTemplate(NetFuncTestCase):
__test__ = False
diff --git a/tests/network/func_rollback_test.py b/tests/network/func_rollback_test.py
index 1db9aff..19b5d22 100644
--- a/tests/network/func_rollback_test.py
+++ b/tests/network/func_rollback_test.py
@@ -33,7 +33,6 @@
IPv4_NETMASK = '255.255.255.0'
-@attr(type='functional')
class NetworkRollbackTemplate(NetFuncTestCase):
__test__ = False
diff --git a/tests/network/func_static_ip_test.py b/tests/network/func_static_ip_test.py
index 529e01e..6f336f0 100644
--- a/tests/network/func_static_ip_test.py
+++ b/tests/network/func_static_ip_test.py
@@ -42,7 +42,6 @@
IPv4IPv6 = [4, 6]
-@attr(type='functional')
class NetworkStaticIpBasicTemplate(NetFuncTestCase):
__test__ = False
@@ -135,7 +134,6 @@
switch = 'ovs'
-@attr(type='functional')
class AcquireNicsWithStaticIPTemplate(NetFuncTestCase):
__test__ = False
--
To view, visit https://gerrit.ovirt.org/63931
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f75bb1d6aabceceff65d673ec776cd5b5c939c3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: wip: jsonrpc: introduce new cli
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: wip: jsonrpc: introduce new cli
......................................................................
wip: jsonrpc: introduce new cli
Change-Id: Idd45d7e88bf2246beaf30550b12201917f32c354
Signed-off-by: Irit goihman <igoihman(a)redhat.com>
---
M lib/vdsm/Makefile.am
A lib/vdsm/jsonrpccli.py
M vdsm.spec.in
3 files changed, 200 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/64502/1
diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index d248d30..1022380 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -35,6 +35,7 @@
hooks.py \
hostdev.py \
jobs.py \
+ jsonrpccli.py \
jsonrpcvdscli.py \
kaxmlrpclib.py \
libvirtconnection.py \
diff --git a/lib/vdsm/jsonrpccli.py b/lib/vdsm/jsonrpccli.py
new file mode 100644
index 0000000..13d4d55
--- /dev/null
+++ b/lib/vdsm/jsonrpccli.py
@@ -0,0 +1,198 @@
+#
+# 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
+
+from functools import partial
+from uuid import uuid4
+
+from yajsonrpc import stompreactor
+from yajsonrpc import \
+ JsonRpcRequest, \
+ JsonRpcNoResponseError, \
+ CALL_TIMEOUT
+
+from api import vdsmapi
+from .config import config
+
+
+_COMMAND_CONVERTER = {
+ 'activateStorageDomain': 'StorageDomain.activate',
+ 'connectStoragePool': 'StoragePool.connect',
+ 'connectStorageServer': 'StoragePool.connectStorageServer',
+ 'cont': 'VM.cont',
+ 'clearTask': 'Task.clear',
+ 'create': 'VM.create',
+ 'createStorageDomain': 'StorageDomain.create',
+ 'createStoragePool': 'StoragePool.create',
+ 'createVG': 'LVMVolumeGroup.create',
+ 'createVolume': 'Volume.create',
+ 'destroy': 'VM.destroy',
+ 'destroyStoragePool': 'StoragePool.destroy',
+ 'detachStorageDomain': 'StorageDomain.detach',
+ 'disconnectStoragePool': 'StoragePool.disconnect',
+ 'disconnectStorageServer': 'StoragePool.disconnectStorageServer',
+ 'discoverSendTargets': 'ISCSIConnection.discoverSendTargets',
+ 'extendVolumeSize': 'Volume.extendSize',
+ 'formatStorageDomain': 'StorageDomain.format',
+ 'fullList': 'Host.getVMFullList',
+ 'getAllTasksInfo': 'Host.getAllTasksInfo',
+ 'getAllTasksStatuses': 'Host.getAllTasksStatuses',
+ 'getAllVmStats': 'Host.getAllVmStats',
+ 'getConnectedStoragePoolsList': 'Host.getConnectedStoragePools',
+ 'getDeviceList': 'Host.getDeviceList',
+ 'getImagesList': 'StorageDomain.getImages',
+ 'getIoTunePolicy': 'VM.getIoTunePolicy',
+ 'getIoTune': 'VM.getIoTune',
+ 'getSpmStatus': 'StoragePool.getSpmStatus',
+ 'getStorageDomainInfo': 'StorageDomain.getInfo',
+ 'getStorageDomainsList': 'Host.getStorageDomains',
+ 'getStorageDomainStats': 'StorageDomain.getStats',
+ 'getStoragePoolInfo': 'StoragePool.getInfo',
+ 'getTaskInfo': 'Task.getInfo',
+ 'getTaskStatus': 'Task.getStatus',
+ 'getVdsCapabilities': 'Host.getCapabilities',
+ 'getVdsHardwareInfo': 'Host.getHardwareInfo',
+ 'getVdsStats': 'Host.getStats',
+ 'getVGInfo': 'LVMVolumeGroup.getInfo',
+ 'getVolumeInfo': 'Volume.getInfo',
+ 'getVmStats': 'VM.getStats',
+ 'getVolumeSize': 'Volume.getSize',
+ 'getVolumesList': 'StorageDomain.getVolumes',
+ 'glusterTasksList': 'GlusterTask.list',
+ 'glusterVolumeCreate': 'GlusterVolume.create',
+ 'glusterVolumeSet': 'GlusterVolume.set',
+ 'glusterVolumesList': 'GlusterVolume.list',
+ 'glusterVolumeStart': 'GlusterVolume.start',
+ 'glusterTasksList': 'GlusterTask.list',
+ 'hotplugDisk': 'VM.hotplugDisk',
+ 'hotplugNic': 'VM.hotplugNic',
+ 'hotunplugDisk': 'VM.hotunplugDisk',
+ 'hotunplugNic': 'VM.hotunplugNic',
+ 'list': 'Host.getVMList',
+ 'migrate': 'VM.migrate',
+ 'migrateStatus': 'VM.getMigrationStatus',
+ 'migrationCreate': 'VM.migrationCreate',
+ 'ping': 'Host.ping',
+ 'prepareImage': 'Image.prepare',
+ 'repoStats': 'Host.getStorageRepoStats',
+ 'setBalloonTarget': 'VM.setBalloonTarget',
+ 'setCpuTunePeriod': 'VM.setCpuTunePeriod',
+ 'setCpuTuneQuota': 'VM.setCpuTuneQuota',
+ 'setKsmTune': 'Host.setKsmTune',
+ 'setMOMPolicy': 'Host.setMOMPolicy',
+ 'setSafeNetworkConfig': 'Host.setSafeNetworkConfig',
+ 'setupNetworks': 'Host.setupNetworks',
+ 'setVmTicket': 'VM.setTicket',
+ 'setIoTune': 'VM.setIoTune',
+ 'setVolumeDescription': 'Volume.setDescription',
+ 'shutdown': 'VM.shutdown',
+ 'spmStart': 'StoragePool.spmStart',
+ 'spmStop': 'StoragePool.spmStop',
+ 'startMonitoringDomain': 'Host.startMonitoringDomain',
+ 'stopMonitoringDomain': 'Host.stopMonitoringDomain',
+ 'updateVmPolicy': 'VM.updateVmPolicy',
+ 'validateStorageDomain': 'StorageDomain.validate',
+}
+
+
+class _Server(object):
+
+ def __init__(self, client):
+ api_strict_mode = config.getboolean('devel', 'api_strict_mode')
+ self._schema = vdsmapi.Schema([vdsmapi.find_schema()],
+ api_strict_mode)
+ self._client = client
+ self._default_timeout = CALL_TIMEOUT
+ self._timeouts = {
+ 'migrationCreate': config.getint(
+ 'vars', 'migration_create_timeout'),
+ }
+
+ def set_default_timeout(self, timeout):
+ self._default_timeout = timeout
+
+ def _prepare_args(self, className, methodName, args, kwargs):
+ allargs = self._schema.get_arg_names(vdsmapi.MethodRep(className,
+ methodName))
+ params = dict(zip(allargs, args))
+ params.update(kwargs)
+ return params
+
+ def _callMethod(self, methodName, *args, **kwargs):
+ try:
+ # TODO: method+params should be extracted from schema
+ method = _COMMAND_CONVERTER[methodName]
+ except KeyError as e:
+ raise Exception("Attempt to call function: %s with "
+ "arguments: %s error: %s" %
+ (methodName, args, e))
+
+ class_name, method_name = method.split('.')
+ params = self._prepare_args(class_name, method_name, args, kwargs)
+
+ req = JsonRpcRequest(method, params, reqId=str(uuid4()))
+
+ responses = self._client.call(
+ req, timeout=self._timeouts.get(
+ method_name,
+ kwargs.pop('_transport_timeout', self._default_timeout)))
+ if responses:
+ resp = responses[0]
+ else:
+ raise JsonRpcNoResponseError(method)
+ # TODO: raise exception on error
+ return resp.result
+
+ def migrationCreate(self, params, incomingLimit=None):
+ args = [params]
+ if incomingLimit is not None:
+ args.append(incomingLimit)
+ return self._callMethod('migrationCreate',
+ params['vmId'],
+ *args)
+
+ def create(self, params):
+ return self._callMethod('create',
+ params['vmId'],
+ params)
+
+ def __getattr__(self, methodName):
+ return partial(self._callMethod, methodName)
+
+ def close(self):
+ self._client.close()
+
+ def __del__(self):
+ self._client.close()
+
+
+def connect(host=None, port=None, useSSL=None):
+ if host is None:
+ host = 'localhost'
+ if port is None:
+ port = int(config.getint('addresses', 'management_port'))
+
+ if useSSL is None:
+ useSSL = config.getboolean('vars', 'ssl')
+
+ client = stompreactor.SimpleClient(host, port, useSSL)
+
+ return _Server(client)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 80360d0..914e3bf 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1181,6 +1181,7 @@
%{python_sitelib}/%{vdsm_name}/hooks.py*
%{python_sitelib}/%{vdsm_name}/hostdev.py*
%{python_sitelib}/%{vdsm_name}/jobs.py*
+%{python_sitelib}/%{vdsm_name}/jsonrpccli.py*
%{python_sitelib}/%{vdsm_name}/jsonrpcvdscli.py*
%{python_sitelib}/%{vdsm_name}/kaxmlrpclib.py*
%{python_sitelib}/%{vdsm_name}/libvirtconnection.py*
--
To view, visit https://gerrit.ovirt.org/64502
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd45d7e88bf2246beaf30550b12201917f32c354
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: supervdsmServer: using moduleloader for dynamic imports
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: supervdsmServer: using moduleloader for dynamic imports
......................................................................
supervdsmServer: using moduleloader for dynamic imports
moduleloader utility handles dynamic imports of modules that
belong to a given package.
Change-Id: Iba05dc1433fc9c3fea53e17c1c0cae835078233d
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 4 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/61313/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 6fd489b..ed70a95 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -21,8 +21,6 @@
import sys
import os
import errno
-import importlib
-import pkgutil
from functools import wraps
import getopt
import resource
@@ -32,6 +30,7 @@
from contextlib import closing
from vdsm import concurrent
+from vdsm import moduleloader
from vdsm.common import sigutils
from vdsm.common import zombiereaper
@@ -257,11 +256,9 @@
for name, func in listPublicFunctions(GLUSTER_MGMT_ENABLED):
setattr(_SuperVdsm, name, bind(logDecorator(func)))
- for _, module_name, _ in pkgutil.iter_modules([supervdsm_api.__path__[0]]):
- module = importlib.import_module('%s.%s' %
- (supervdsm_api.__name__,
- module_name))
- api_funcs = [f for _, f in module.__dict__.iteritems()
+ modules = moduleloader.load_modules(supervdsm_api)
+ for module_name in modules:
+ api_funcs = [f for _, f in modules[module_name].__dict__.iteritems()
if callable(f) and getattr(f, 'exposed_api', False)]
for func in api_funcs:
setattr(_SuperVdsm, func.__name__, bind(logDecorator(func)))
--
To view, visit https://gerrit.ovirt.org/61313
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba05dc1433fc9c3fea53e17c1c0cae835078233d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: py3 tests: ported imagetickets_test.py to python3
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: py3 tests: ported imagetickets_test.py to python3
......................................................................
py3 tests: ported imagetickets_test.py to python3
ported relevant code to python3 in order that imagetickets_test.py
will be python3 compatible.
Change-Id: If13fb30966d98fa0381da25f0f2907899df12e96
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M tests/Makefile.am
M tests/imagetickets_test.py
M vdsm/storage/imagetickets.py
3 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/59859/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 352f5be..16119bd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -179,7 +179,6 @@
hooksTests.py \
hostdevTests.py \
hoststatsTests.py \
- imagetickets_test.py \
iscsiTests.py \
lvmTests.py \
main.py \
diff --git a/tests/imagetickets_test.py b/tests/imagetickets_test.py
index 39a2800..f2ea111 100644
--- a/tests/imagetickets_test.py
+++ b/tests/imagetickets_test.py
@@ -18,15 +18,17 @@
# Refer to the README and COPYING files for full details of the license
#
-import httplib
import json
import socket
import io
+
+from six.moves import http_client
from monkeypatch import MonkeyPatch
from testlib import VdsmTestCase
from testlib import expandPermutations, permutations
from testlib import recorded
+
from vdsm.storage import exception as se
from storage import imagetickets
@@ -158,7 +160,7 @@
self.assertTrue(err_msg in e.value)
@MonkeyPatch(imagetickets, 'uhttp', FakeUHTTP())
- @permutations([[httplib.HTTPException], [socket.error], [OSError]])
+ @permutations([[http_client.HTTPException], [socket.error], [OSError]])
def test_image_tickets_error(self, exc_type):
ticket = create_ticket(uuid="uuid")
diff --git a/vdsm/storage/imagetickets.py b/vdsm/storage/imagetickets.py
index 281a0e9..476f249 100644
--- a/vdsm/storage/imagetickets.py
+++ b/vdsm/storage/imagetickets.py
@@ -19,12 +19,12 @@
#
import functools
-import httplib
import json
import logging
import os
from contextlib import closing
+from six.moves import http_client
try:
from ovirt_imageio_daemon import uhttp
@@ -74,7 +74,7 @@
try:
con.request(method, "/tickets/%s" % uuid, body=body)
res = con.getresponse()
- except (httplib.HTTPException, EnvironmentError) as e:
+ except (http_client.HTTPException, EnvironmentError) as e:
raise se.ImageTicketsError("Error communicating with "
"ovirt-imageio-daemon: "
"{error}".format(error=e))
--
To view, visit https://gerrit.ovirt.org/59859
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If13fb30966d98fa0381da25f0f2907899df12e96
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: alignmentScan: Use proper environment
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: alignmentScan: Use proper environment
......................................................................
alignmentScan: Use proper environment
In commit f9d12864a404 (v2v: Running virt-v2v with some sane
environment) we leaned that we should not use bare environment dict.
This patch fixes the environment when running virt-alignment-scan.
Change-Id: I522ea5454a77b06e833723e0995ccbdeab9e5e5e
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/alignmentScan.py
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/64123/1
diff --git a/vdsm/alignmentScan.py b/vdsm/alignmentScan.py
index 0957c05..3c72a9b 100644
--- a/vdsm/alignmentScan.py
+++ b/vdsm/alignmentScan.py
@@ -19,6 +19,7 @@
#
+import os
from collections import namedtuple
from vdsm.utils import CommandPath
from vdsm.storage.misc import execCmd
@@ -40,10 +41,12 @@
def runScanArgs(*args):
cmd = [_virtAlignmentScan.cmd]
cmd.extend(args)
- # TODO: remove the environment variable when the issue in
+ # TODO: remove the environment when the issue in
# virt-alignment-scan/libvirt is resolved
# http://bugzilla.redhat.com/1151838
- return execCmd(cmd, env={'LIBGUESTFS_BACKEND': 'direct'})
+ env = os.environ.copy()
+ env['LIBGUESTFS_BACKEND'] = 'direct'
+ return execCmd(cmd, env=env)
def scanImage(image_path):
--
To view, visit https://gerrit.ovirt.org/64123
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I522ea5454a77b06e833723e0995ccbdeab9e5e5e
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]: Adding percent suffix to metric name spacing
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding percent suffix to metric name spacing
......................................................................
Adding percent suffix to metric name spacing
Change-Id: Ibe87f2b9b31aaa9555b2df68689b5e9edbe398b9
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/health.py
M lib/vdsm/host/api.py
M lib/vdsm/metrics/__init__.py
3 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/62335/1
diff --git a/lib/vdsm/health.py b/lib/vdsm/health.py
index 94c9f14..7b9aede 100644
--- a/lib/vdsm/health.py
+++ b/lib/vdsm/health.py
@@ -30,6 +30,7 @@
from . import host
from vdsm.metrics import MB
+from vdsm.metrics import PERCENT
from vdsm.metrics import send
_monitor = None
@@ -128,8 +129,8 @@
report = {}
report[prefix + '.gc.uncollectable'] = \
self._stats['uncollectable_obj']
- report[prefix + '.cpu.user_pct'] = self._stats['utime_pct']
- report[prefix + '.cpu.sys_pct'] = self._stats['stime_pct']
+ report[prefix + '.cpu.user' + PERCENT] = self._stats['utime_pct']
+ report[prefix + '.cpu.sys' + PERCENT] = self._stats['stime_pct']
report[prefix + '.memory.rss' + MB] = self._stats['rss']
report[prefix + '.threads_count'] = self._stats['threads']
send(report)
diff --git a/lib/vdsm/host/api.py b/lib/vdsm/host/api.py
index 0fb7e3f..52f0e0c 100644
--- a/lib/vdsm/host/api.py
+++ b/lib/vdsm/host/api.py
@@ -31,6 +31,7 @@
from vdsm.define import Kbytes, Mbytes
from vdsm.metrics import JIFFIES
from vdsm.metrics import MB
+from vdsm.metrics import PERCENT
from vdsm.metrics import send
from vdsm.virt import vmstatus
@@ -117,7 +118,7 @@
if 'ksmPages' in hoststats:
data[prefix + '.cpu.ksm_pages'] = hoststats['ksmPages']
- data[prefix + '.cpu.ksm_cpu_precent'] = hoststats['ksmCpu']
+ data[prefix + '.cpu.ksm_cpu' + PERCENT] = hoststats['ksmCpu']
if hoststats['haStats']['configured']:
data[prefix + '.ha_score'] = hoststats['haScore']
diff --git a/lib/vdsm/metrics/__init__.py b/lib/vdsm/metrics/__init__.py
index 1007310..f7714e0 100644
--- a/lib/vdsm/metrics/__init__.py
+++ b/lib/vdsm/metrics/__init__.py
@@ -26,6 +26,7 @@
# METRIC UNIT SUFFIX REPRESENTATION
MB = '_M'
JIFFIES = '_jiff'
+PERCENT = '_percent'
_reporter = None
--
To view, visit https://gerrit.ovirt.org/62335
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe87f2b9b31aaa9555b2df68689b5e9edbe398b9
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]: hook-fcoe is arch depended
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: hook-fcoe is arch depended
......................................................................
hook-fcoe is arch depended
Using %post script in sub-package of arch depended package requires to
declare the package as arch depended.
Change-Id: Ic59d7e29a75b13e1fc39b58a8d1252d6d2971058
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/62454/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index edd8e82..728a534 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -681,7 +681,6 @@
%package hook-fcoe
Summary: Hook to enable FCoE support
-BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: fcoe-utils
--
To view, visit https://gerrit.ovirt.org/62454
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic59d7e29a75b13e1fc39b58a8d1252d6d2971058
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 5 months