Change in vdsm[master]: virt: numa: move activation check in the caller
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: virt: numa: move activation check in the caller
......................................................................
virt: numa: move activation check in the caller
The existing NUMA position reporting code is activated
only if a VM is configured with 'virtual NUMA', referred
in the code as 'guest Numa Node'.
If this configuration is absent, the NUMA sampling just
does nothing.
Besides naming, this makes the code a bit harder to read
and to reason about, since often readers assume NUMA positioning
reporting always executed.
To make this easier to read, and to make room for future patches
which want to move NUMA sampling in periodic operations,
we move this check into the calling site(s), with no other intended
changes in the flow of code.
Change-Id: Ib1b94c2b45b0cbd4455d4fff719b932173536af3
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/numaUtilsTests.py
M vdsm/numaUtils.py
M vdsm/virt/vm.py
3 files changed, 22 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/39261/1
diff --git a/tests/numaUtilsTests.py b/tests/numaUtilsTests.py
index f872f3d..5a5a8ff 100644
--- a/tests/numaUtilsTests.py
+++ b/tests/numaUtilsTests.py
@@ -72,5 +72,6 @@
with fake.VM(VM_PARAMS) as testvm:
testvm._vmStats = fake.VmStatsThread(testvm)
expectedResult = {'0': [0, 1], '1': [0, 1]}
+ self.assertTrue(testvm.hasGuestNumaNode)
vmNumaNodeRuntimeMap = numaUtils.getVmNumaNodeRuntimeInfo(testvm)
self.assertEqual(expectedResult, vmNumaNodeRuntimeMap)
diff --git a/vdsm/numaUtils.py b/vdsm/numaUtils.py
index 01a4270..761a083 100644
--- a/vdsm/numaUtils.py
+++ b/vdsm/numaUtils.py
@@ -67,24 +67,23 @@
vmNumaNodeRuntimeMap = {}
- if 'guestNumaNodes' in vm.conf:
- vcpu_to_pcpu = _get_mapping_vcpu_to_pcpu(vm)
- if vcpu_to_pcpu:
- vm_numa_placement = defaultdict(set)
+ vcpu_to_pcpu = _get_mapping_vcpu_to_pcpu(vm)
+ if vcpu_to_pcpu:
+ vm_numa_placement = defaultdict(set)
- vcpu_to_pnode = supervdsm.getProxy().getVcpuNumaMemoryMapping(
- vm.conf['vmName'].encode('utf-8'))
- pcpu_to_pnode = _get_mapping_pcpu_to_pnode()
- vcpu_to_vnode = _get_mapping_vcpu_to_vnode(vm)
+ vcpu_to_pnode = supervdsm.getProxy().getVcpuNumaMemoryMapping(
+ vm.conf['vmName'].encode('utf-8'))
+ pcpu_to_pnode = _get_mapping_pcpu_to_pnode()
+ vcpu_to_vnode = _get_mapping_vcpu_to_vnode(vm)
- for vcpu_id, pcpu_id in vcpu_to_pcpu.iteritems():
- vnode_index = str(vcpu_to_vnode[vcpu_id])
- vm_numa_placement[vnode_index].add(pcpu_to_pnode[pcpu_id])
- vm_numa_placement[vnode_index].update(
- vcpu_to_pnode.get(vcpu_id, ()))
+ for vcpu_id, pcpu_id in vcpu_to_pcpu.iteritems():
+ vnode_index = str(vcpu_to_vnode[vcpu_id])
+ vm_numa_placement[vnode_index].add(pcpu_to_pnode[pcpu_id])
+ vm_numa_placement[vnode_index].update(
+ vcpu_to_pnode.get(vcpu_id, ()))
- vmNumaNodeRuntimeMap = dict((k, list(v)) for k, v in
- vm_numa_placement.iteritems())
+ vmNumaNodeRuntimeMap = dict((k, list(v)) for k, v in
+ vm_numa_placement.iteritems())
return vmNumaNodeRuntimeMap
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index dc226fb..af624cc 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -258,7 +258,9 @@
"""
Numa CPU assignments.
"""
- vmNumaNodeRuntimeMap = numaUtils.getVmNumaNodeRuntimeInfo(self._vm)
+ vmNumaNodeRuntimeMap = {}
+ if self._vm.hasGuestNumaNode:
+ numaUtils.getVmNumaNodeRuntimeInfo(self._vm)
return vmNumaNodeRuntimeMap
def _sampleDisk(self):
@@ -5024,6 +5026,10 @@
statsAge)
stats['monitorResponse'] = '-1'
+ @property
+ def hasGuestNumaNode(self):
+ return 'guestNumaNodes' in self.conf
+
class LiveMergeCleanupThread(threading.Thread):
def __init__(self, vm, jobId, drive, doPivot):
--
To view, visit https://gerrit.ovirt.org/39261
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1b94c2b45b0cbd4455d4fff719b932173536af3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: vm: bootstrap services using updateVolume
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: bootstrap services using updateVolume
......................................................................
vm: bootstrap services using updateVolume
During their lifetime the volumes of a VM needs
to be updated. This is a task carried by the
'updateVolumes' operation, which was formerly
piggybacked in the sampling threads.
But actually 'updateVolumes' is a perfect candidate
to motivy the need of a 'services' infrastructure to
run periodic (bookkeeping) tasks for VMs.
So, this patch bootstraps the usage of the newly
added services infrastructure by moving 'updateVolumes'
from sampling threads to 'services'.
No changes in behaviour are meant.
Change-Id: Idf5f4bff03acf4fb43eb6d296e4c02a6b7a52baa
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/services.py
M vdsm/virt/vm.py
2 files changed, 19 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/37594/1
diff --git a/vdsm/virt/services.py b/vdsm/virt/services.py
index dcb83a8..5bd4225 100644
--- a/vdsm/virt/services.py
+++ b/vdsm/virt/services.py
@@ -27,6 +27,7 @@
from vdsm import executor
from vdsm import schedule
+from vdsm.config import config
from vdsm.utils import monotonic_time
@@ -55,7 +56,10 @@
exc.start()
_executor = exc
- _calls = []
+ _calls = [
+ RepeatingCall(UpdateVolumes(cif),
+ config.getint('irs', 'vol_size_sample_interval'))]
+
for call in _calls:
call.start()
@@ -133,3 +137,16 @@
if self._running:
self._call = None
self._executor.dispatch(self, self._timeout)
+
+
+class UpdateVolumes(object):
+ def __init__(self, cif):
+ self._cif = cif
+
+ def __call__(self):
+ vms = self._cif.getVMs()
+ for vmId, vmObj in vms.iteritems():
+ if vmObj.isDisksStatsCollectionEnabled():
+ # Avoid queries from storage during recovery process
+ for vmDrive in vmObj.getDiskDevices():
+ vmObj.updateDriveVolume(vmDrive)
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 3a61f04..ddc852d 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -189,10 +189,6 @@
AdvancedStatsFunction(
self._highWrite,
config.getint('vars', 'vm_watermark_interval')))
- self.updateVolumes = (
- AdvancedStatsFunction(
- self._updateVolumes,
- config.getint('irs', 'vol_size_sample_interval')))
self.sampleCpu = (
AdvancedStatsFunction(
@@ -227,7 +223,7 @@
config.getint('vars', 'vm_sample_cpu_tune_interval'), 1))
self.addStatsFunction(
- self.highWrite, self.updateVolumes, self.sampleCpu,
+ self.highWrite, self.sampleCpu,
self.sampleDisk, self.sampleNet, self.sampleBalloon,
self.sampleVmJobs, self.sampleVcpuPinning, self.sampleCpuTune)
@@ -236,14 +232,6 @@
# Avoid queries from storage during recovery process
return
self._vm.extendDrivesIfNeeded()
-
- def _updateVolumes(self):
- if not self._vm.isDisksStatsCollectionEnabled():
- # Avoid queries from storage during recovery process
- return
-
- for vmDrive in self._vm.getDiskDevices():
- self._vm.updateDriveVolume(vmDrive)
def _sampleCpu(self):
"""
--
To view, visit http://gerrit.ovirt.org/37594
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf5f4bff03acf4fb43eb6d296e4c02a6b7a52baa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: virt: periodic: add utilities
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: virt: periodic: add utilities
......................................................................
virt: periodic: add utilities
Add utilities to be used by future patches
moving operations from VmStatsThread.
This patch adds
- a simple function to compute a default timeout
given a period/interval.
- a class to demultiplex an Operation on per-VM
operation. This is useful to minimize interference
among VMs in case of one operation gets stuck.
Demultiplexing operation may seem weird, but alternatives
are not so much better
- add new per-VM operations when VM is created, remove
it when VM is destroyed: add pressure on Scheduler
(OTOH, we have object living longer). Also, this creates
the need to add/remove Operations at runtime.
- move demultiplexing in Operation class
this way Operation becomes less generic. So far, Operation
class just takes care of periodic action.
Demultiplexing means bind it to Vm objects.
Change-Id: I7d0422bfce99d1e479cb5af49c7b37204ca7e295
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/periodic.py
1 file changed, 29 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/37885/1
diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index 2d88571..822d547 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -41,6 +41,10 @@
_operations = []
+def _timeout_from(interval):
+ return interval / 2.
+
+
def start(cif):
# `cif' will be used by future patches.
global _scheduler
@@ -62,6 +66,7 @@
# this needs to be there to avoid to bind too early
# _executor and _scheduler inside the Operation-s.
_operations = []
+
for op in _operations:
op.start()
@@ -89,7 +94,7 @@
scheduler=None, executor=None):
self._func = func
self._period = period
- self._timeout = period / 2.0 if timeout is None else timeout
+ self._timeout = _timeout_from(period) if timeout is None else timeout
self._scheduler = _scheduler if scheduler is None else scheduler
self._executor = _executor if executor is None else executor
self._lock = threading.Lock()
@@ -137,3 +142,26 @@
def _dispatch(self):
self._call = None
self._executor.dispatch(self, self._timeout)
+
+
+class VmDispatcher(object):
+ """
+ Adapter class. Dispatch an Operation to all VMs, to improve
+ isolation among them.
+ """
+ def __init__(self, cif, prepare, timeout):
+ """
+ cif: ClientIF reference (for getVMs)
+ prepare: callable to obtain the real callable to
+ dispatch
+ timeout: for dispatched callable
+ """
+ self._cif = cif
+ self._prepare = prepare
+ self._timeout = timeout
+
+ def __call__(self, executor):
+ vms = self._cif.getVMs()
+ for vmId, vmObj in vms.iteritems():
+ func = self._prepare(vmObj)
+ executor.dispatch(func, self._timeout)
--
To view, visit http://gerrit.ovirt.org/37885
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d0422bfce99d1e479cb5af49c7b37204ca7e295
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: virt: introduce the services infrastracture
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: virt: introduce the services infrastracture
......................................................................
virt: introduce the services infrastracture
In order to keep track of the state of a VM,
the virt code needs to perform periodic bookkeeping
operation. Currently, these operation are piggybacked
in the sampling thread, just because this is a simple
and cheap way to run some code asynchronously to Engine's
query and periodically.
But these operations can hardly be consider 'sampling',
and sometimes just can't.
To have them as part of the sampling make the code more
confusing and harder to improve, as they can't fit nicely
in any bulk sampling schema.
What we really need is a reliable method to run async,
possibly periodically, operations related to VMs.
As part of the sampling improvement effort, we added
two generic utilities which provide great buliding
blocks for this task as well, scheduler and executor.
So, this patch laids down the basic infrastructure
to run async/periodic VM-related operations, and start
moving bookkeeping operations to them.
Known issues:
- the usage of globals is questionable
- need to improve how to RepeatingCalls are stored
- the start function does too much work
- naming is questionable ("services" means nothing!
it just vaguely reminds daemons) and needs to be
improved.
Change-Id: I834c067b1d3dba16a1f8c83e555d2cc04cbf32ed
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M debian/vdsm.install
M vdsm.spec.in
M vdsm/vdsm
M vdsm/virt/Makefile.am
A vdsm/virt/services.py
5 files changed, 141 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/37593/1
diff --git a/debian/vdsm.install b/debian/vdsm.install
index cd71517..7f8fd81 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -151,6 +151,7 @@
./usr/share/vdsm/virt/guestagent.py
./usr/share/vdsm/virt/migration.py
./usr/share/vdsm/virt/sampling.py
+./usr/share/vdsm/virt/services.py
./usr/share/vdsm/virt/vm.py
./usr/share/vdsm/virt/vmchannels.py
./usr/share/vdsm/virt/vmexitreason.py
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 6c8f781..c179182 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1061,6 +1061,7 @@
%{_datadir}/%{vdsm_name}/virt/guestagent.py*
%{_datadir}/%{vdsm_name}/virt/migration.py*
%{_datadir}/%{vdsm_name}/virt/sampling.py*
+%{_datadir}/%{vdsm_name}/virt/services.py*
%{_datadir}/%{vdsm_name}/virt/vmchannels.py*
%{_datadir}/%{vdsm_name}/virt/vmstatus.py*
%{_datadir}/%{vdsm_name}/virt/vmtune.py*
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 5c1ab71..11b2996 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -40,6 +40,7 @@
from storage.hsm import HSM
import vdsm.infra.zombiereaper as zombiereaper
+from virt import services
import dsaversion
loggerConfFile = constants.P_VDSM_CONF + 'logger.conf'
@@ -88,11 +89,13 @@
from clientIF import clientIF # must import after config is read
cif = clientIF.getInstance(irs, log)
cif.start()
+ services.start(cif)
try:
while running[0]:
signal.pause()
profile.stop()
+ services.stop()
finally:
cif.prepareForShutdown()
diff --git a/vdsm/virt/Makefile.am b/vdsm/virt/Makefile.am
index 2bb8c0e..a40496e 100644
--- a/vdsm/virt/Makefile.am
+++ b/vdsm/virt/Makefile.am
@@ -29,6 +29,7 @@
guestagent.py \
migration.py \
sampling.py \
+ services.py \
vm.py \
vmchannels.py \
vmexitreason.py \
diff --git a/vdsm/virt/services.py b/vdsm/virt/services.py
new file mode 100644
index 0000000..dcb83a8
--- /dev/null
+++ b/vdsm/virt/services.py
@@ -0,0 +1,135 @@
+#
+# Copyright 2015 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
+#
+
+"""
+code to perform periodic maintenance and bookkeeping of the VMs.
+"""
+
+import logging
+import threading
+
+from vdsm import executor
+from vdsm import schedule
+from vdsm.utils import monotonic_time
+
+
+_executor = None
+_scheduler = None
+_calls = []
+
+
+def start(cif):
+ # `cif' will be used by future patches.
+ global _scheduler
+ global _executor
+ global _calls
+
+ if _scheduler is None:
+ sched = schedule.Scheduler(name="virt.Scheduler",
+ clock=monotonic_time)
+ sched.start()
+ _scheduler = sched
+
+ if _executor is None:
+ exc = executor.Executor(name="virt.Executor",
+ workers_count=4,
+ max_tasks=4*100,
+ scheduler=sched)
+ exc.start()
+ _executor = exc
+
+ _calls = []
+ for call in _calls:
+ call.start()
+
+
+def stop():
+ global _scheduler
+ global _executor
+ global _calls
+
+ if _scheduler is not None:
+ _scheduler.stop()
+
+ if _executor is not None:
+ _executor.stop()
+
+ for call in _calls:
+ call.stop()
+
+
+class RepeatingCall(object):
+ def __init__(self, func, period,
+ timeout=None,
+ immediate=False,
+ log=None,
+ scheduler=_scheduler,
+ executor=_executor):
+ self._func = func
+ self._period = period
+ self._timeout = (timeout if timeout is not None
+ else max(1.0, period/2.0))
+ self._immediate = immediate
+ self._log = (log if log is not None
+ else logging.getLogger("virt.RepeatingCall"))
+ self._scheduler = scheduler
+ self._executor = executor
+ self._lock = threading.Lock()
+ self._running = False
+ self._call = None
+
+ def start(self):
+ with self._lock:
+ if self._running:
+ raise AssertionError("Call already running")
+ self._log.debug("starting call %s", self._func)
+ self._running = True
+ self._step()
+ if self._immediate:
+ self._dispatch()
+
+ def stop(self):
+ with self._lock:
+ if self._running:
+ self._log.debug("stopping call %s", self._func)
+ self._running = False
+ if self._call:
+ self._call.cancel()
+ self._call = None
+
+ def __call__(self):
+ try:
+ self._func()
+ except Exception:
+ self._log.exception("%s call failed", self._func)
+ finally:
+ with self._lock:
+ if self._running:
+ self._step()
+
+ def _step(self):
+ self._log.debug("after %f seconds: %s", self._period, self._func)
+ self._scheduler.schedule(self._period, self._dispatch)
+
+ def _dispatch(self):
+ with self._lock:
+ if self._running:
+ self._call = None
+ self._executor.dispatch(self, self._timeout)
--
To view, visit http://gerrit.ovirt.org/37593
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I834c067b1d3dba16a1f8c83e555d2cc04cbf32ed
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: storageServer: Wait for udev events after connect
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: storageServer: Wait for udev events after connect
......................................................................
storageServer: Wait for udev events after connect
Connecting to iSCSI target starts a storm of udev events, that may not
be handled yet when iscsiadm terminates. This may lead to missing
devices and failures when creating storage domain.
Now we wait until current udev events are handled after connecting,
using new udevadm.settle(). The timeout can be configured using the
new irs:scsi_settle_timeout option.
Change-Id: Ic8b2043dc4ac410cf08c7b49b6435a818f20d995
Bug-Url: https://bugzilla.redhat.com/1205877
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/storageServer.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/39289/1
diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 8a2d939..22a90d1 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -30,6 +30,7 @@
import sys
from vdsm.compat import pickle
+from vdsm.config import config
import mount
import fileUtils
@@ -38,6 +39,7 @@
from sync import asyncmethod, AsyncCallStub
from mount import MountError
import storage_exception as se
+import udevadm
class AliasAlreadyRegisteredError(RuntimeError):
@@ -379,6 +381,8 @@
def connect(self):
iscsi.addIscsiNode(self._iface, self._target, self._cred)
+ timeout = config.getint("irs", "scsi_settle_timeout")
+ udevadm.settle(timeout)
def _match(self, session):
target = session.target
--
To view, visit https://gerrit.ovirt.org/39289
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8b2043dc4ac410cf08c7b49b6435a818f20d995
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: multipath: Wait for udev events after rescan
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: multipath: Wait for udev events after rescan
......................................................................
multipath: Wait for udev events after rescan
Previously we were using time.sleep(2) for waiting at least 2 seconds
after starting iSCSI sessions rescan. This wait was useless for two
reasons:
- The sleep was interrupted as soon as iscsiadm process terminated
- Udev events generated by the SCSI scan and by processing udev rules
may not been handled yet when iscsiadm existed.
This patch replaces the minimal scsi timeout with udevadm.settle(),
waiting until current udev events are handled. Since we perform both FC
and iSCSI scan, the correct place for waiting is in multipath.rescan()
and not in iscsi.rescan().
A new configuration was introduced, allowing fine tuning of settle
timeout in the field.
[irs]
scsi_settle_timeout = 5
Change-Id: Ieeffbdd447e96c4ec92b829388da1dc6222a2dae
Relates-To: https://bugzilla.redhat.com/1205877
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/storage/iscsi.py
M vdsm/storage/multipath.py
3 files changed, 17 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/39288/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index b664cbd..f5572ec 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -247,12 +247,13 @@
('vol_size_sample_interval', '60',
'How often should the volume size be checked (seconds).'),
- ('scsi_rescan_minimal_timeout', '2',
- 'The minimum number of seconds to wait for scsi scan to return.'),
-
('scsi_rescan_maximal_timeout', '30',
'The maximal number of seconds to wait for scsi scan to return.'),
+ ('scsi_settle_timeout', '5',
+ 'Maximum number of seconds to wait until udev events are handled '
+ 'after modifying scsi interconnects.'),
+
('sd_health_check_delay', '10',
'Storage domain health check delay, the amount of seconds to '
'wait between two successive run of the domain health check.'),
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index e7c25a0..5fbd4db 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -412,29 +412,11 @@
@misc.samplingmethod
-def rescan(minTimeout=None, maxTimeout=None):
- # FIXME: This whole thing is wrong from the core. We need to make rescan
- # completely async and have methods timeout on their own if they
- # can't find the devices they are looking for
- if minTimeout is None:
- minTimeout = config.getint('irs', 'scsi_rescan_minimal_timeout')
- if maxTimeout is None:
- maxTimeout = config.getint('irs', 'scsi_rescan_maximal_timeout')
-
- if (minTimeout > maxTimeout or minTimeout < 0):
- minTimeout = 2
- maxTimeout = 30
- log.warning("One of the following configuration arguments has an "
- "illegal value: scsi_rescan_minimal_timeout or "
- "scsi_rescan_maximal_timeout. Set to %s and %s seconds "
- "respectively.", minTimeout, maxTimeout)
-
- log.debug("Performing SCSI scan, this will take up to %s seconds",
- maxTimeout)
-
+def rescan():
+ timeout = config.getint('irs', 'scsi_rescan_maximal_timeout')
+ log.debug("Performing SCSI scan, this will take up to %s seconds", timeout)
rescanOp = iscsiadm.session_rescan_async()
- time.sleep(minTimeout)
- rescanOp.wait(timeout=(maxTimeout - minTimeout))
+ rescanOp.wait(timeout=timeout)
def devIsiSCSI(dev):
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index f12f798..a1c42b3 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -31,11 +31,14 @@
from vdsm import constants
from vdsm import utils
+from vdsm.config import config
+
import hba
import misc
import iscsi
import supervdsm
import devicemapper
+import udevadm
DEV_ISCSI = "iSCSI"
DEV_FCP = "FCP"
@@ -66,6 +69,12 @@
# Now let multipath daemon pick up new devices
misc.execCmd([constants.EXT_MULTIPATH], sudo=True)
+ # Scanning SCSI interconnects starts a storm of udev events. Wait until all
+ # events are processed, ensuring detection of new devices and creation or
+ # update of multipath devices.
+ timeout = config.getint('irs', 'scsi_settle_timeout')
+ udevadm.settle(timeout)
+
def deduceType(a, b):
if a == b:
--
To view, visit https://gerrit.ovirt.org/39288
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieeffbdd447e96c4ec92b829388da1dc6222a2dae
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: spice: support to agent file transfer disable
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: spice: support to agent file transfer disable
......................................................................
spice: support to agent file transfer disable
Spice has agent based file transfer support.
This option can be disabled in QEMU, and libvirt has support
to pass this flag to the underlying QEMU.
This patch expose this capability in VDSM, in the VM definition,
implementing the VDSM part of bz983019.
The new parameter is optional and enabled by default for backward
compatibility.
No XML changes are produced at all unless the new parameter is
specified.
Change-Id: Icc98a346baca4ab163ff30e891ae80535e49caa4
Bug-Url: https://bugzilla.redhat.com/983019
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M debian/control
M tests/vmTests.py
M vdsm.spec.in
M vdsm/virt/vm.py
M vdsm_api/vdsmapi-schema.json
5 files changed, 40 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/26917/1
diff --git a/debian/control b/debian/control
index 45c2b1c..ddbaab3 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,7 @@
python-cpopen (>= 1.3),
python-dmidecode,
python-ethtool (>=0.8),
- python-libvirt (>= 1.0.2),
+ python-libvirt (>= 1.2.2),
python-m2crypto,
python-netaddr,
python-nose,
@@ -81,8 +81,8 @@
libnl1,
libsanlock-client1 (>= 2.4),
libsanlock-dev (>= 2.4),
- libvirt-bin (>= 1.0.2),
- libvirt0 (>= 1.0.2),
+ libvirt-bin (>= 1.2.2),
+ libvirt0 (>= 1.2.2),
linux-image-generic (>= 3.6),
logrotate,
lvm2 (>= 2.02.95),
@@ -98,7 +98,7 @@
python-dmidecode,
python-ethtool (>= 0.8),
python-ethtool (>= 0.8),
- python-libvirt (>= 1.0.2),
+ python-libvirt (>= 1.2.2),
python-m2crypto,
python-netaddr,
python-parted,
@@ -294,7 +294,7 @@
Package: vdsm-hook-sriov
Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, python (>=2.7.3), vdsm (>= ${source:Version}), libvirt-bin (>= 1.0.2-1)
+Depends: ${shlibs:Depends}, ${misc:Depends}, python (>=2.7.3), vdsm (>= ${source:Version}), libvirt-bin (>= 1.2.2-1)
Description: sr-iov support for VDSM
sr-iov hook enable to add virtual functions exposed by the device
directly to a virtual machine.
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 91ee466..11695b3 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -421,6 +421,20 @@
passwdValidTo="1970-01-01T00:00:01" port="-1"
tlsPort="-1" type="spice">
<channel mode="secure" name="main"/>
+ </graphics>""",
+
+ """
+ <graphics autoport="yes" listen="0" passwd="*****"
+ passwdValidTo="1970-01-01T00:00:01" port="-1"
+ tlsPort="-1" type="spice">
+ <filetransfer enable="no"/>
+ </graphics>""",
+
+ """
+ <graphics autoport="yes" listen="0" passwd="*****"
+ passwdValidTo="1970-01-01T00:00:01" port="-1"
+ tlsPort="-1" type="spice">
+ <channel mode="secure" name="main"/>
</graphics>"""]
vmConfs = [
@@ -432,6 +446,16 @@
{'type': 'graphics', 'device': 'spice',
'specParams': {
'port': '-1', 'tlsPort': '-1',
+ 'spiceSecureChannels': 'smain'}},
+
+ {'type': 'graphics', 'device': 'spice',
+ 'specParams': {
+ 'port': '-1', 'tlsPort': '-1',
+ 'fileTransferEnable': 'false'}},
+
+ {'type': 'graphics', 'device': 'spice',
+ 'specParams': {
+ 'port': '-1', 'tlsPort': '-1',
'spiceSecureChannels': 'smain'}}]
self._verifyGraphicsXML(expectedXMLs, vmConfs, False)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index fd47bf6..af339e2 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -131,7 +131,7 @@
%endif
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18
-Requires: libvirt-daemon >= 1.0.2-1
+Requires: libvirt-daemon >= 1.2.2-1
Requires: libvirt-daemon-config-nwfilter
Requires: libvirt-daemon-driver-network
Requires: libvirt-daemon-driver-nwfilter
@@ -140,7 +140,7 @@
%if 0%{?rhel}
Requires: libvirt >= 0.10.2-29.el6_5.4
%else
-Requires: libvirt >= 1.0.2-1
+Requires: libvirt >= 1.2.2-1
%endif
%endif
Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index d68c292..27c2aab 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1415,6 +1415,10 @@
clipboard = XMLElement('clipboard', copypaste='no')
graphics.appendChild(clipboard)
+ if not utils.tobool(self.specParams.get('fileTransferEnable', True)):
+ filetransfer = XMLElement('filetransfer', enable='no')
+ graphics.appendChild(filetransfer)
+
# handle deprecated channel name in a smart way,
# not just chop 1st char!
if graphicsAttrs['type'] == 'spice':
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 0300a27..0a8c506 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2523,12 +2523,16 @@
# @copyPasteEnable: #optional Specify if copy and paste is enabled.
# Currently relevant for @spice devices only.
#
+# @fileTransferEnable: #optional Specify if file transfer is enabled.
+# Currently relevant for @qxl devices only.
+#
# Since: 4.15.0
##
{'type': 'VmGraphicsDeviceSpecParams',
'data': {'port': 'uint', '*tlsPort': 'uint', '*keyMap': 'str',
'*disableTicketing': 'bool', '*displayNetwork': 'str',
- '*spiceSecureChannels': 'str', '*copyPasteEnable': 'bool'}}
+ '*spiceSecureChannels': 'str', '*copyPasteEnable': 'bool',
+ '*fileTransferEnable': 'bool'}}
##
# @VmGraphicsDevice:
--
To view, visit http://gerrit.ovirt.org/26917
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc98a346baca4ab163ff30e891ae80535e49caa4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 12 months
Change in vdsm[master]: storage: introducing vdsm-dump-chains script (part of vdsm-t...
by Jenkins CI RO
oVirt Jenkins CI Server has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script (part of vdsm-tool)
......................................................................
Patch Set 13:
Build Started (7/7) -> http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/17590/
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Vladik Romanovsky <vladik.romanovsky(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yaniv Dary <ydary(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
8 years, 12 months
Change in vdsm[master]: storage: introducing vdsm-dump-chains script (part of vdsm-t...
by Jenkins CI RO
oVirt Jenkins CI Server has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script (part of vdsm-tool)
......................................................................
Patch Set 13:
Build Started (6/7) -> http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/...
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Vladik Romanovsky <vladik.romanovsky(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yaniv Dary <ydary(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
8 years, 12 months
Change in vdsm[master]: storage: introducing vdsm-dump-chains script (part of vdsm-t...
by Jenkins CI RO
oVirt Jenkins CI Server has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script (part of vdsm-tool)
......................................................................
Patch Set 13:
Build Started (5/7) -> http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/1...
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Vladik Romanovsky <vladik.romanovsky(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yaniv Dary <ydary(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
8 years, 12 months