gerrit-hooks has posted comments on this change.
Change subject: network: point to vars.hidden_nics when refusing to bond them
......................................................................
Patch Set 2:
* update_tracker: OK
--
To view, visit https://gerrit.ovirt.org/57485
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I83130813bb6e168c5148cf58d01ef97de39394bd
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Jenkins CI RO has abandoned this change.
Change subject: network: point to vars.hidden_nics when refusing to bond them
......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
--
To view, visit https://gerrit.ovirt.org/57485
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: I83130813bb6e168c5148cf58d01ef97de39394bd
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Jenkins CI RO has abandoned this change.
Change subject: ifcfg: remove duplicated handling of extraneous slaves
......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
--
To view, visit https://gerrit.ovirt.org/57489
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: I438f93d3002a2371920c23dba2de510559759ce0
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Jenkins CI RO has abandoned this change.
Change subject: legacy_switch: split _detach_extraneous_slaves off _bonds_edit
......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
--
To view, visit https://gerrit.ovirt.org/57488
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: I0a5008d0c801312ab93d14cdaef7674cdf8739f8
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
gerrit-hooks has posted comments on this change.
Change subject: legacy_switch: make _bonds_edit more readable
......................................................................
Patch Set 4:
* update_tracker: OK
--
To view, visit https://gerrit.ovirt.org/57487
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic6f8f3de793087b836885d8afac9256f36f1d9b3
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Jenkins CI RO has abandoned this change.
Change subject: legacy_switch: make _bonds_edit more readable
......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
--
To view, visit https://gerrit.ovirt.org/57487
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic6f8f3de793087b836885d8afac9256f36f1d9b3
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
gerrit-hooks has posted comments on this change.
Change subject: stomp: make client user aware that no connection available
......................................................................
Patch Set 10:
* Update Tracker::IGNORE, no bug url/s found
* Check Bug-Url::IGNORE, no bug url/s found
* Check Public Bug::WARN, no public bug url found
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/58029
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3c0a2b2df9ac6e9f6e75a8af0f0f3a36990c2462
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo(a)redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stirabos(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: tests: fix integration tests
......................................................................
Patch Set 7:
* Update Tracker::IGNORE, no bug url/s found
* Check Bug-Url::IGNORE, no bug url/s found
* Check Public Bug::WARN, no public bug url found
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/55871
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I98dfe4c863b2780f7d28b62a857e2fffa5f40acd
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Piotr Kliczewski has posted comments on this change.
Change subject: tests: fix integration tests
......................................................................
Patch Set 6: Verified+1
Verified by running the tests
--
To view, visit https://gerrit.ovirt.org/55871
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I98dfe4c863b2780f7d28b62a857e2fffa5f40acd
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: tests: fix integration tests
......................................................................
Patch Set 6:
* Update Tracker::IGNORE, no bug url/s found
* Check Bug-Url::IGNORE, no bug url/s found
* Check Public Bug::WARN, no public bug url found
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/55871
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I98dfe4c863b2780f7d28b62a857e2fffa5f40acd
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Edward Haas has uploaded a new change for review.
Change subject: net: support nameserver address with %iface tail
......................................................................
net: support nameserver address with %iface tail
The nameserver address may include an %<iface> tail, to specify on which
iface the address is to be reached.
The patch fixes the validation of the nameserver address when this tail
exists.
In addition, unit tests have been placed to cover the ip validation
scenarios.
Change-Id: Iea4d2eea2af8004435dae54ad56588739e028ba2
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M lib/vdsm/network/ip/validator.py
M tests/network/ip_test.py
2 files changed, 51 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/65693/1
diff --git a/lib/vdsm/network/ip/validator.py b/lib/vdsm/network/ip/validator.py
index 9e84bd1..113f2c0 100644
--- a/lib/vdsm/network/ip/validator.py
+++ b/lib/vdsm/network/ip/validator.py
@@ -48,7 +48,17 @@
def _validate_nameservers_address(nameservers_addr):
for addr in nameservers_addr:
+ addr = _normalize_address(addr)
if ':' in addr:
IPv6.validateAddress(addr)
else:
IPv4.validateAddress(addr)
+
+
+def _normalize_address(addr):
+ """
+ The nameserver address may be tailed with the interface from which it
+ should be reached: '2001::1%eth0'
+ For the purpose of address validation, such tail is ignored.
+ """
+ return addr.split('%', 1)[0]
diff --git a/tests/network/ip_test.py b/tests/network/ip_test.py
index 8dc328e..e4c7a7e 100644
--- a/tests/network/ip_test.py
+++ b/tests/network/ip_test.py
@@ -22,7 +22,9 @@
from testlib import VdsmTestCase
+from vdsm.network import errors as ne
from vdsm.network.ip import address
+from vdsm.network.ip import validator
@attr(type='unit')
@@ -44,3 +46,42 @@
self.assertEqual(None, ip.address)
self.assertEqual(None, ip.gateway)
self.assertEqual(None, ip.defaultRoute)
+
+
+@attr(type='unit')
+class TestIPValidator(VdsmTestCase):
+
+ def test_ignore_remove_networks(self):
+ validator.validate({'NET0': {'remove': True,
+ 'defaultRoute': False,
+ 'nameservers': ['8.8.8.8']}})
+
+ def test_nameserver_defined_on_a_non_primary_network_fails(self):
+ with self.assertRaises(ne.ConfigNetworkError) as cne:
+ validator.validate({'NET0': {'defaultRoute': False,
+ 'nameservers': ['8.8.8.8']}})
+ self.assertEqual(cne.exception.errCode, ne.ERR_BAD_PARAMS)
+
+ def test_nameserver_faulty_ipv4_address(self):
+ with self.assertRaises(ne.ConfigNetworkError) as cne:
+ validator.validate({'NET0': {'defaultRoute': True,
+ 'nameservers': ['a.8.8.8']}})
+ self.assertEqual(cne.exception.errCode, ne.ERR_BAD_ADDR)
+
+ def test_nameserver_faulty_ipv6_address(self):
+ with self.assertRaises(ne.ConfigNetworkError) as cne:
+ validator.validate({'NET0': {'defaultRoute': True,
+ 'nameservers': ['2001:bla::1']}})
+ self.assertEqual(cne.exception.errCode, ne.ERR_BAD_ADDR)
+
+ def test_nameserver_valid_ipv4_address(self):
+ validator.validate({'NET0': {'defaultRoute': True,
+ 'nameservers': ['8.8.8.8']}})
+
+ def test_nameserver_valid_ipv6_address(self):
+ validator.validate({'NET0': {'defaultRoute': True,
+ 'nameservers': ['2001::1']}})
+
+ def test_nameserver_address_with_interface_tail(self):
+ validator.validate({'NET0': {'defaultRoute': True,
+ 'nameservers': ['2001::1%eth1']}})
--
To view, visit https://gerrit.ovirt.org/65693
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea4d2eea2af8004435dae54ad56588739e028ba2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
Hello Dan Kenigsberg, Milan Zamazal, Martin Polednik,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65813
to review the following change.
Change subject: vm: rename statsAge parameter
......................................................................
vm: rename statsAge parameter
rename `statsAge' to `stats_age'.
Now it is pep8 friendlier, and it is easier to follow the code flow:
it is now possible to follow this flow end to end using
'git grep stats_age'.
It used to be called `statsAge' in camelCase only for legacy reasons.
Change-Id: If0b4601d0f789921c1c575f9ad19852d4ebecacc
Backport-To: 4.0
Backport-To: 3.6
Bug-Url: https://bugzilla.redhat.com/1382578
Bug-Url: https://bugzilla.redhat.com/1382583
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/65508
Reviewed-by: Martin Polednik <mpolednik(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Milan Zamazal <mzamazal(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/65813/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 5659ac5..07be2e6 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4834,18 +4834,18 @@
'running' if self._guestCpuRunning else 'stopped',
reason)
- def _setUnresponsiveIfTimeout(self, stats, statsAge):
+ def _setUnresponsiveIfTimeout(self, stats, stats_age):
if self.isMigrating():
return
# we don't care about decimals here
- if statsAge < config.getint('vars', 'vm_command_timeout'):
+ if stats_age < config.getint('vars', 'vm_command_timeout'):
return
if stats['monitorResponse'] == '-1':
return
self.log.warning('monitor became unresponsive'
' (command timeout, age=%s)',
- statsAge)
+ stats_age)
stats['monitorResponse'] = '-1'
def updateNumaInfo(self):
--
To view, visit https://gerrit.ovirt.org/65813
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If0b4601d0f789921c1c575f9ad19852d4ebecacc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Hello Dan Kenigsberg, Milan Zamazal, Martin Polednik,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65812
to review the following change.
Change subject: vm: reformat setUnresponsiveIfTimeout
......................................................................
vm: reformat setUnresponsiveIfTimeout
Reformat the order of operations to make clear
on which cases we don't care about timeouts.
Change-Id: I53e9c284962f7ebe3987e460e4d138f2a08704dc
Backport-To: 4.0
Backport-To: 3.6
Bug-Url: https://bugzilla.redhat.com/1382578
Bug-Url: https://bugzilla.redhat.com/1382583
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/65504
Continuous-Integration: Jenkins CI
Reviewed-by: Martin Polednik <mpolednik(a)redhat.com>
Reviewed-by: Milan Zamazal <mzamazal(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(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/12/65812/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 65c8731..5659ac5 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4835,13 +4835,18 @@
reason)
def _setUnresponsiveIfTimeout(self, stats, statsAge):
- if (not self.isMigrating()
- and statsAge > config.getint('vars', 'vm_command_timeout')
- and stats['monitorResponse'] != '-1'):
- self.log.warning('monitor become unresponsive'
- ' (command timeout, age=%s)',
- statsAge)
- stats['monitorResponse'] = '-1'
+ if self.isMigrating():
+ return
+ # we don't care about decimals here
+ if statsAge < config.getint('vars', 'vm_command_timeout'):
+ return
+ if stats['monitorResponse'] == '-1':
+ return
+
+ self.log.warning('monitor became unresponsive'
+ ' (command timeout, age=%s)',
+ statsAge)
+ stats['monitorResponse'] = '-1'
def updateNumaInfo(self):
self._numaInfo = numa.getVmNumaNodeRuntimeInfo(self)
--
To view, visit https://gerrit.ovirt.org/65812
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I53e9c284962f7ebe3987e460e4d138f2a08704dc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Hello Dan Kenigsberg, Milan Zamazal,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65814
to review the following change.
Change subject: vm: introduce a `monitorable' attribute
......................................................................
vm: introduce a `monitorable' attribute
In the change I3e61626625a2e0517d55dc61e361f3f5eb690c00
we fixed the stats_age reporting, in order to correctly report
the real age of VM monitoring samples.
In the same change we acknowledged a possible change in behaviour:
depending on the timing of operations and on the load of the host,
VMs could be reported 'Unresponsive' for a little time while
starting up or shutting down.
This information is tecnhically correct: the monitoring subsystem
dutifully reports unknown sampling data, which is translated into
outdated values, thus unresponsive VM, but it is misleading for
both Engine and users.
There are two root causes here:
1. creation, destruction and monitoring of a VM are all operations
which are asynchronous to each other, for both performance and
historical reasons - and both reasons are still relevant today.
2. the semantic of this reporting (VM unresponsive for stats too old)
is poorly defined, so the right thing is to keep backward
compatibility, lacking better description.
To solve this issue we generalize the old VM.incomingMigrationPending
attribute into a 'monitorable' attribute.
A VM is monitorable if it is in a meaningful state, so after the
creation process is completed, or before the shutdown process is
initiated.
We should adjust responsiveness for stats too old
only if a VM is monitorable, not inconditionally.
Otherwise we can have misreports on slow startup
or slow shutdowns.
Please note that the `monitorable' state share similarities with
the VM state (VM.lastStatus attribute), but the two concepts
overlap only for a small part.
Lacking a precise definition, we use two independent variables
to track those attributes.
Change-Id: Idb12277a5f0fdaf680032af12fa7c104c3bd6ffb
Backport-To: 4.0
Backport-To: 3.6
Bug-Url: https://bugzilla.redhat.com/1382578
Bug-Url: https://bugzilla.redhat.com/1382583
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/65590
Reviewed-by: Milan Zamazal <mzamazal(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/virt/periodic.py
M lib/vdsm/virt/vmstats.py
M tests/periodicTests.py
M tests/vmStatsTests.py
M vdsm/virt/vm.py
5 files changed, 67 insertions(+), 27 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/65814/1
diff --git a/lib/vdsm/virt/periodic.py b/lib/vdsm/virt/periodic.py
index 00229f4..661f9bf 100644
--- a/lib/vdsm/virt/periodic.py
+++ b/lib/vdsm/virt/periodic.py
@@ -290,7 +290,7 @@
def required(self):
# disable everything until migration destination VM
# isn't fully started, to avoid false positives log spam.
- return not self._vm.incomingMigrationPending()
+ return self._vm.monitorable
@property
def runnable(self):
diff --git a/lib/vdsm/virt/vmstats.py b/lib/vdsm/virt/vmstats.py
index ed424cc..eb27345 100644
--- a/lib/vdsm/virt/vmstats.py
+++ b/lib/vdsm/virt/vmstats.py
@@ -513,7 +513,7 @@
try:
yield
except KeyError:
- if vm_obj.incomingMigrationPending():
+ if not vm_obj.monitorable:
# If a VM is migration destination,
# libvirt doesn't give any disk stat.
pass
diff --git a/tests/periodicTests.py b/tests/periodicTests.py
index 6c988cf..b48ed18 100644
--- a/tests/periodicTests.py
+++ b/tests/periodicTests.py
@@ -198,6 +198,15 @@
VM_NUM = 5 # just a number, no special meaning
+VM_IDS = [
+ [()],
+ [((0,))],
+ [((0, 2))],
+ [((VM_NUM-1,))],
+ [((VM_NUM-2, VM_NUM-1))]
+]
+
+
@expandPermutations
class VmDispatcherTests(TestCaseBase):
@@ -208,31 +217,23 @@
_Visitor.VMS.clear()
- @permutations([[()],
- [((0,))],
- [((0, 2))],
- [((VM_NUM-1,))],
- [((VM_NUM-2, VM_NUM-1))]])
+ @permutations(VM_IDS)
def test_dispatch(self, failed_ids):
for i in failed_ids:
with self.cif.vmContainerLock:
vm_id = _fake_vm_id(i)
self.cif.vmContainer[vm_id].fail_required = True
- op = periodic.VmDispatcher(
- self.cif.getVMs, _FakeExecutor(), _Visitor, 0)
- # we don't care about executor (hence the simplistic fake)
- op()
+ self._check_dispatching(failed_ids)
- vms = self.cif.getVMs()
- expected = (
- set(vms.keys()) -
- set(_fake_vm_id(i) for i in failed_ids))
- for vm_id in expected:
- self.assertEqual(_Visitor.VMS.get(vm_id), 1)
+ @permutations(VM_IDS)
+ def test_skip_not_monitorable(self, unmonitorable_ids):
+ for i in unmonitorable_ids:
+ with self.cif.vmContainerLock:
+ vm_id = _fake_vm_id(i)
+ self.cif.vmContainer[vm_id].monitorable = False
- for vm_id in failed_ids:
- self.assertEqual(_Visitor.VMS.get(vm_id), None)
+ self._check_dispatching(unmonitorable_ids)
def test_dispatch_fails(self):
"""
@@ -249,6 +250,24 @@
self.assertEqual(set(skipped),
set(self.cif.getVMs().keys()))
+
+ def _check_dispatching(self, skip_ids):
+ op = periodic.VmDispatcher(
+ self.cif.getVMs, _FakeExecutor(), _Visitor, 0)
+ # we don't care about executor (hence the simplistic fake)
+ op()
+
+ for vm_id in skip_ids:
+ self.assertNotIn(_fake_vm_id(vm_id), _Visitor.VMS)
+
+ vms = self.cif.getVMs()
+
+ expected = (
+ set(vms.keys()) -
+ set(_fake_vm_id(i) for i in skip_ids)
+ )
+ for vm_id in expected:
+ self.assertEqual(_Visitor.VMS.get(vm_id), 1)
def _make_fake_vms(self):
for i in range(VM_NUM):
@@ -306,13 +325,13 @@
def required(self):
if getattr(self._vm, 'fail_required', False):
raise ValueError('required failed')
- return True
+ return super(_Visitor, self).required
@property
def runnable(self):
if getattr(self._vm, 'fail_runnable', False):
raise ValueError('runnable failed')
- return True
+ return super(_Visitor, self).runnable
def _execute(self):
_Visitor.VMS[self._vm.id] += 1
@@ -362,6 +381,10 @@
self.name = vmName
self.migrating = False
self.lastStatus = vmstatus.UP
+ self.monitorable = True
+
+ def isDomainReadyForCommands(self):
+ return True
def isMigrating(self):
return self.migrating
diff --git a/tests/vmStatsTests.py b/tests/vmStatsTests.py
index 7c385ba..fa213a7 100644
--- a/tests/vmStatsTests.py
+++ b/tests/vmStatsTests.py
@@ -582,8 +582,9 @@
self.drives = drives if drives is not None else []
self.migrationPending = False
- def incomingMigrationPending(self):
- return self.migrationPending
+ @property
+ def monitorable(self):
+ return not self.migrationPending
def getNicDevices(self):
return self.nics
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 07be2e6..395b85a 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -312,6 +312,13 @@
self._numaInfo = {}
self._vmJobs = None
self._clientPort = ''
+ self._monitorable = False
+
+ @property
+ def monitorable(self):
+ if 'migrationDest' in self.conf or 'restoreState' in self.conf:
+ return False
+ return self._monitorable
@property
def start_time(self):
@@ -769,9 +776,6 @@
if acquired:
self.log.debug('Releasing incoming migration semaphore')
migration.incomingMigrations.release()
-
- def incomingMigrationPending(self):
- return 'migrationDest' in self.conf or 'restoreState' in self.conf
def stopDisksStatsCollection(self):
self._volumesPrepared = False
@@ -1411,12 +1415,19 @@
stats['migrationProgress'] = self.migrateStatus()['progress']
try:
+ # Prevent races with the creation thread.
+ # Mimicing < 3.5 code, the creation thread marks the VM as
+ # monitorable only after the stats cache is initialized.
+ # Here we need to do the reverse: check first if a VM is
+ # monitorable, and only if it is, consider the stats_age.
+ monitorable = self._monitorable
vm_sample = sampling.stats_cache.get(self.id)
decStats = vmstats.produce(self,
vm_sample.first_value,
vm_sample.last_value,
vm_sample.interval)
- self._setUnresponsiveIfTimeout(stats, vm_sample.stats_age)
+ if monitorable:
+ self._setUnresponsiveIfTimeout(stats, vm_sample.stats_age)
except Exception:
self.log.exception("Error fetching vm stats")
else:
@@ -1823,6 +1834,7 @@
self._guestEventTime = self._startTime
sampling.stats_cache.add(self.id)
+ self._monitorable = True
try:
self.guestAgent.start()
except Exception:
@@ -4085,6 +4097,10 @@
nic.portMirroring.remove(network)
self.log.info('Release VM resources')
+ # this must be done *before* self._cleanupStatsCache() to preserve
+ # the invariant: if a VM is monitorable, it has a stats cache
+ # entry, to avoid false positives when reporting stats too old.
+ self._monitorable = False
self.lastStatus = vmstatus.POWERING_DOWN
# Terminate the VM's creation thread.
self._incomingMigrationFinished.set()
--
To view, visit https://gerrit.ovirt.org/65814
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb12277a5f0fdaf680032af12fa7c104c3bd6ffb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Petr Horáček has uploaded a new change for review.
Change subject: net: edit nic detached from bridge but still attached to a vlan
......................................................................
net: edit nic detached from bridge but still attached to a vlan
Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0e
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/1381880
---
M vdsm/network/configurators/ifcfg.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/65233/1
diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index bf93697..bc1c4c2 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -250,6 +250,11 @@
if set_mtu is not None:
ipwrapper.linkSet(nic.name, ['mtu', str(set_mtu)])
+ # If the nic was bridged, we must remove BRIDGE parameter from its
+ # ifcfg configuration file.
+ if nic.bridge:
+ self.configApplier.dropBridgeParameter(nic.name)
+
def _getFilePath(self, fileType, device):
return os.path.join(netinfo.NET_CONF_DIR, '%s-%s' % (fileType, device))
--
To view, visit https://gerrit.ovirt.org/65233
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65219
to review the following change.
Change subject: net: edit bond detached from bridge but still attached to a vlan
......................................................................
net: edit bond detached from bridge but still attached to a vlan
Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0f
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/1372798
Reviewed-on: https://gerrit.ovirt.org/63723
Reviewed-by: Edward Haas <edwardh(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/network/configurators/ifcfg.py
1 file changed, 26 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/65219/1
diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 4e7d4ab..fb58ca5 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -230,8 +230,15 @@
if set_mtu is not None:
ipwrapper.linkSet(bonding.name, ['mtu', str(set_mtu)])
- def removeNic(self, nic):
- to_be_removed = self._ifaceDownAndCleanup(nic)
+ # If the bond was bridged, we must remove BRIDGE parameter from its
+ # ifcfg configuration file.
+ if bonding.bridge:
+ self.configApplier.dropBridgeParameter(bonding.name)
+
+ def removeNic(self, nic, remove_even_if_used=False):
+ if not self.owned_device(nic.name):
+ self.normalize_device_filename(nic.name)
+ to_be_removed = self._ifaceDownAndCleanup(nic, remove_even_if_used)
if to_be_removed:
self.configApplier.removeNic(nic.name)
if nic.name in netinfo.nics():
@@ -733,6 +740,23 @@
for slave in slaves:
self.setIfaceMtu(slave, newmtu)
+ def dropBridgeParameter(self, iface_name):
+ iface_conf_path = netinfo.NET_CONF_PREF + iface_name
+
+ if not os.path.isfile(iface_conf_path):
+ return
+
+ with open(iface_conf_path) as f:
+ config_lines = f.readlines()
+
+ config_lines_without_comments_and_bridge = [
+ line for line in config_lines
+ if (not line.startswith('#') and
+ not line.startswith('BRIDGE'))]
+
+ self.writeConfFile(iface_conf_path,
+ ''.join(config_lines_without_comments_and_bridge))
+
def stop_devices(device_ifcfgs):
for dev in reversed(_sort_device_ifcfgs(device_ifcfgs)):
--
To view, visit https://gerrit.ovirt.org/65219
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: lib: shorten name of libvirt event thread
......................................................................
lib: shorten name of libvirt event thread
We need to fit in 15 ASCII chars because of the limitations
of the system; plus, we use a name more akin to the
formatting/schema we choose.
Change-Id: Ib3dedfc52ad33f3d5f21a8154c248bb130b62ca7
Bug-Url: https://bugzilla.redhat.com/1141422
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/libvirtconnection.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/65501/1
diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py
index 6e522f4..8b6599c 100644
--- a/lib/vdsm/libvirtconnection.py
+++ b/lib/vdsm/libvirtconnection.py
@@ -42,7 +42,7 @@
def start(self):
assert not self.run
- self.__thread = concurrent.thread(self.__run, name="libvirtEventLoop",
+ self.__thread = concurrent.thread(self.__run, name="libvirt/events",
logger=log.name)
self.run = True
self.__thread.start()
--
To view, visit https://gerrit.ovirt.org/65501
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3dedfc52ad33f3d5f21a8154c248bb130b62ca7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: clientIF: rename recovery thread
......................................................................
clientIF: rename recovery thread
make the thread name more explicit; "clientIFInit" was
quite opaque. The real purpose is to recover VMs.
Change-Id: I489012786f3ebd76ef7adc4607645d095cbbc1a8
Bug-Url: https://bugzilla.redhat.com/1141422
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/65502/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index fefc915..b274bac 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -104,7 +104,7 @@
self._netConfigDirty = False
self._prepareMOM()
secret.clear()
- concurrent.thread(self._recoverThread, name='clientIFinit').start()
+ concurrent.thread(self._recoverThread, name='vmrecovery').start()
self.channelListener.settimeout(
config.getint('vars', 'guest_agent_timeout'))
self.channelListener.start()
--
To view, visit https://gerrit.ovirt.org/65502
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I489012786f3ebd76ef7adc4607645d095cbbc1a8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: ignore more errors in isDomainReadyForCommands
......................................................................
vm: ignore more errors in isDomainReadyForCommands
Due to race on domain shutdown, and after migration end,
we may receive errors from libvirt which makes
the Vm.isDomainReadyForCommands() method fail with scary stacktrace.
This patches makes the method cope with VIR_ERR_OPERATION_UNSUPPORTED.
In the context of this method, this error can come only if the
domain is shutting down, so it is safe to swallow it in this case.
Please note that this is admittedly a paliative fix, because the
real fix may only happen inside libvirt.
Change-Id: I89ff61e0cd3bbb977833897c250ea337c86b9f80
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/65131/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0a767f6..f210373 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2887,8 +2887,11 @@
# to avoid racy checks.
return False
except libvirt.libvirtError as e:
- if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
- # same as NotConnectedError above: possible race on shutdown
+ IGNORED_ERRORS = (
+ libvirt.VIR_ERR_NO_DOMAIN, # race on shutdown
+ libvirt.VIR_ERR_OPERATION_INVALID, # race on migration end
+ )
+ if e.get_error_code() in IGNORED_ERRORS:
return False
else:
raise
--
To view, visit https://gerrit.ovirt.org/65131
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I89ff61e0cd3bbb977833897c250ea337c86b9f80
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: introduce a `monitorable' attribute
......................................................................
vm: introduce a `monitorable' attribute
In the change I3e61626625a2e0517d55dc61e361f3f5eb690c00
we fixed the stats_age reporting, in order to correctly report
the real age of VM monitoring samples.
In the same change we acknowledged a possible change in behaviour:
depending on the timing of operations and on the load of the host,
VMs could be reported 'Unresponsive' for a little time while
starting up or shutting down.
This information is tecnhically correct: the monitoring subsystem
dutifully reports unknown sampling data, which is translated into
outdated values, thus unresponsive VM, but it is misleading for
both Engine and users.
There are two root causes here:
1. creation, destruction and monitoring of a VM are all operations
which are asynchronous to each other, for both performance and
historical reasons - and both reasons are still relevant today.
2. the semantic of this reporting (VM unresponsive for stats too old)
is poorly defined, so the right thing is to keep backward
compatibility, lacking better description.
To solve this issue we generalize the old VM.incomingMigrationPending
attribute into a 'monitorable' attribute.
A VM is monitorable if it is in a meaningful state, so after the
creation process is completed, or before the shutdown process is
initiated.
Please note that the `monitorable' state share similarities with
the VM state (VM.lastStatus attribute), but the two concepts
overlap only for a small part.
Lacking a precise definition, we use two independent variables
to track those attributes.
Change-Id: Idb12277a5f0fdaf680032af12fa7c104c3bd6ffb
Backport-To: 4.0
Backport-To: 3.6
Bug-Url: https://bugzilla.redhat.com/1382578
Bug-Url: https://bugzilla.redhat.com/1382583
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/virt/periodic.py
M lib/vdsm/virt/vmstats.py
M tests/vmStatsTests.py
M vdsm/virt/vm.py
4 files changed, 14 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/65590/1
diff --git a/lib/vdsm/virt/periodic.py b/lib/vdsm/virt/periodic.py
index 132fe93..8a89870 100644
--- a/lib/vdsm/virt/periodic.py
+++ b/lib/vdsm/virt/periodic.py
@@ -290,7 +290,7 @@
def required(self):
# Disable everything until the migration destination VM
# is fully started, to avoid false positives log spam.
- return not self._vm.incomingMigrationPending()
+ return self._vm.monitorable
@property
def runnable(self):
diff --git a/lib/vdsm/virt/vmstats.py b/lib/vdsm/virt/vmstats.py
index dadbf26..8e271cb 100644
--- a/lib/vdsm/virt/vmstats.py
+++ b/lib/vdsm/virt/vmstats.py
@@ -495,7 +495,7 @@
try:
yield
except KeyError:
- if vm_obj.incomingMigrationPending():
+ if not vm_obj.monitorable:
# If a VM is migration destination,
# libvirt doesn't give any disk stat.
pass
diff --git a/tests/vmStatsTests.py b/tests/vmStatsTests.py
index 9827c4e..6c57696 100644
--- a/tests/vmStatsTests.py
+++ b/tests/vmStatsTests.py
@@ -580,8 +580,9 @@
self.drives = drives if drives is not None else []
self.migrationPending = False
- def incomingMigrationPending(self):
- return self.migrationPending
+ @property
+ def monitorable(self):
+ return not self.migrationPending
def getNicDevices(self):
return self.nics
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index dd633e6..ded832e 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -307,6 +307,13 @@
self._numaInfo = {}
self._vmJobs = None
self._clientPort = ''
+ self._monitorable = False
+
+ @property
+ def monitorable(self):
+ if 'migrationDest' in self.conf or 'restoreState' in self.conf:
+ return False
+ return self._monitorable
@property
def start_time(self):
@@ -585,9 +592,6 @@
if acquired:
self.log.debug('Releasing incoming migration semaphore')
migration.incomingMigrations.release()
-
- def incomingMigrationPending(self):
- return 'migrationDest' in self.conf or 'restoreState' in self.conf
def disableDriveMonitor(self):
self._driveMonitorEnabled = False
@@ -1669,6 +1673,7 @@
raise MissingLibvirtDomainError(vmexitreason.LIBVIRT_START_FAILED)
sampling.stats_cache.add(self.id)
+ self._monitorable = True
self._guestEventTime = self._startTime
@@ -3936,6 +3941,7 @@
nic.portMirroring.remove(network)
self.log.info('Release VM resources')
+ self._monitorable = False
self.lastStatus = vmstatus.POWERING_DOWN
# Terminate the VM's creation thread.
self._incomingMigrationFinished.set()
--
To view, visit https://gerrit.ovirt.org/65590
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb12277a5f0fdaf680032af12fa7c104c3bd6ffb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Martin Polednik has posted comments on this change.
Change subject: Allow pinning of VM NUMA nodes to host NUMA nodes.
......................................................................
Patch Set 7: Code-Review+1
--
To view, visit https://gerrit.ovirt.org/65565
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21004c18962d00a9df411770b24f2123d9226b4c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Francesco Romani has posted comments on this change.
Change subject: Allow pinning of VM NUMA nodes to host NUMA nodes.
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit https://gerrit.ovirt.org/65565
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21004c18962d00a9df411770b24f2123d9226b4c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Andrej Krejcir has posted comments on this change.
Change subject: Allow pinning of VM NUMA nodes to host NUMA nodes.
......................................................................
Patch Set 7: Verified+1
--
To view, visit https://gerrit.ovirt.org/65565
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21004c18962d00a9df411770b24f2123d9226b4c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Andrej Krejcir has posted comments on this change.
Change subject: Allow pinning of VM NUMA nodes to host NUMA nodes.
......................................................................
Patch Set 7:
(2 comments)
https://gerrit.ovirt.org/#/c/65565/6/vdsm/virt/vmxml.py
File vdsm/virt/vmxml.py:
Line 145: self._elem.appendChild(child)
Line 146: return child
Line 147:
Line 148:
Line 149: class Domain(object):
> I don't like this - you are adding one utility used only in one place, whi
Done
Line 150:
Line 151: def __init__(self, conf, log, arch):
Line 152: """
Line 153: Create the skeleton of a libvirt domain xml
PS6, Line 524:
> if this is used just there, with no plan for further enhancments, I'd like
Ok, Done
--
To view, visit https://gerrit.ovirt.org/65565
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21004c18962d00a9df411770b24f2123d9226b4c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
gerrit-hooks has posted comments on this change.
Change subject: Allow pinning of VM NUMA nodes to host NUMA nodes.
......................................................................
Patch Set 7:
* Update Tracker::#1306698::OK, status: NEW
* Check Bug-Url::OK
* Check Public Bug::#1306698::OK, public bug
* Check Product::IGNORE, not relevant for branch: master
* Check TM::IGNORE, not relevant for branch: master
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/65565
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21004c18962d00a9df411770b24f2123d9226b4c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Francesco Romani has posted comments on this change.
Change subject: Allow pinning of VM NUMA nodes to host NUMA nodes.
......................................................................
Patch Set 6: Code-Review+1
(2 comments)
we need to sort out one implementation detail and we are good to go.
https://gerrit.ovirt.org/#/c/65565/6/vdsm/virt/vmxml.py
File vdsm/virt/vmxml.py:
Line 145: self._elem.appendChild(child)
Line 146: return child
Line 147:
Line 148: def hasChildNodes(self):
Line 149: return self._elem.hasChildNodes()
I don't like this - you are adding one utility used only in one place, which has good workarounds.
Do you see other usage in the near future for this?
Line 150:
Line 151:
Line 152: class Domain(object):
Line 153:
PS6, Line 524: hasChildNodes
if this is used just there, with no plan for further enhancments, I'd like to use an equivalent approach, like a boolean or something like this.
Rationale: we want to switch to etree in the not-so-distant future, so we want to add utilities to our xml processing only if stricly needed. This doesn't seem the case.
--
To view, visit https://gerrit.ovirt.org/65565
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21004c18962d00a9df411770b24f2123d9226b4c
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
Francesco Romani has uploaded a new change for review.
Change subject: vm: rename statsAge parameter
......................................................................
vm: rename statsAge parameter
rename statsAge -> stats_age: pep8 friendlier, and now
easy to follow the code flow.
It used to be statsAge in camelCase onyl for legacy reasons.
Change-Id: If0b4601d0f789921c1c575f9ad19852d4ebecacc
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/65508/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index f52fbdf..8dec15b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4666,21 +4666,21 @@
'running' if self._guestCpuRunning else 'stopped',
reason)
- def _setUnresponsiveIfTimeout(self, stats, statsAge):
+ def _setUnresponsiveIfTimeout(self, stats, stats_age):
# we care about timeouts only on the stady state
if self.lastStatus not in (vmstatus.UP, vmstatus.PAUSED):
return
if self.isMigrating():
return
# we don't care about decimals here
- if statsAge < config.getint('vars', 'vm_command_timeout'):
+ if stats_age < config.getint('vars', 'vm_command_timeout'):
return
if stats['monitorResponse'] == '-1':
return
self.log.warning('monitor become unresponsive'
' (command timeout, age=%s)',
- statsAge)
+ stats_age)
stats['monitorResponse'] = '-1'
def updateNumaInfo(self):
--
To view, visit https://gerrit.ovirt.org/65508
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If0b4601d0f789921c1c575f9ad19852d4ebecacc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: reformat setUnresponsiveIfTimeout
......................................................................
vm: reformat setUnresponsiveIfTimeout
Reformat the order of operations to make clear
on which cases we don't care about timeouts.
Change-Id: I53e9c284962f7ebe3987e460e4d138f2a08704dc
Backport-To: 4.0
Bug-Url: https://bugzilla.redhat.com/1382578
Signed-off-by: Francesco Romani <fromani(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/04/65504/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index e3974e3..dc6ffe9 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4667,13 +4667,18 @@
reason)
def _setUnresponsiveIfTimeout(self, stats, statsAge):
- if (not self.isMigrating()
- and statsAge > config.getint('vars', 'vm_command_timeout')
- and stats['monitorResponse'] != '-1'):
- self.log.warning('monitor become unresponsive'
- ' (command timeout, age=%s)',
- statsAge)
- stats['monitorResponse'] = '-1'
+ if self.isMigrating():
+ return
+ # we don't care about decimals here
+ if statsAge < config.getint('vars', 'vm_command_timeout'):
+ return
+ if stats['monitorResponse') == '-1':
+ return
+
+ self.log.warning('monitor become unresponsive'
+ ' (command timeout, age=%s)',
+ statsAge)
+ stats['monitorResponse'] = '-1'
def updateNumaInfo(self):
self._numaInfo = numa.getVmNumaNodeRuntimeInfo(self)
--
To view, visit https://gerrit.ovirt.org/65504
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I53e9c284962f7ebe3987e460e4d138f2a08704dc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65760
to review the following change.
Change subject: net: edit nic detached from bridge but still attached to a vlan
......................................................................
net: edit nic detached from bridge but still attached to a vlan
Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0e
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/1372798
Reviewed-on: https://gerrit.ovirt.org/65231
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Continuous-Integration: Jenkins CI
(cherry picked from commit 0970a9e90bc229d1fc95210153aacf564353516d)
Reviewed-on: https://gerrit.ovirt.org/65232
---
M lib/vdsm/network/configurators/ifcfg.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/65760/1
diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py
index f49693a..f04a7f3 100644
--- a/lib/vdsm/network/configurators/ifcfg.py
+++ b/lib/vdsm/network/configurators/ifcfg.py
@@ -281,6 +281,11 @@
if set_mtu is not None:
ipwrapper.linkSet(nic.name, ['mtu', str(set_mtu)])
+ # If the nic was bridged, we must remove BRIDGE parameter from its
+ # ifcfg configuration file.
+ if nic.bridge:
+ self.configApplier.dropBridgeParameter(nic.name)
+
def _getFilePath(self, fileType, device):
return os.path.join(NET_CONF_DIR, '%s-%s' % (fileType, device))
--
To view, visit https://gerrit.ovirt.org/65760
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0.5
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: tests: improve periodicTests.py
......................................................................
tests: improve periodicTests.py
document a bit better the code and make it easier to understand
the test failures.
Change-Id: I75b890daed01d23cfa0a36db66615a48023b96c0
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/periodicTests.py
1 file changed, 18 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/65753/1
diff --git a/tests/periodicTests.py b/tests/periodicTests.py
index 4cc2b21..4df36d6 100644
--- a/tests/periodicTests.py
+++ b/tests/periodicTests.py
@@ -219,6 +219,9 @@
@permutations(VM_IDS)
def test_dispatch(self, failed_ids):
+ """
+ check that we dispatch even if for any reason required() raises.
+ """
for i in failed_ids:
with self.cif.vmContainerLock:
vm_id = _fake_vm_id(i)
@@ -257,16 +260,17 @@
# we don't care about executor (hence the simplistic fake)
op()
+ for vm_id in skip_ids:
+ self.assertNotIn(_fake_vm_id(vm_id), _Visitor.VMS)
+
vms = self.cif.getVMs()
+
expected = (
set(vms.keys()) -
set(_fake_vm_id(i) for i in skip_ids)
)
for vm_id in expected:
self.assertEqual(_Visitor.VMS.get(vm_id), 1)
-
- for vm_id in skip_ids:
- self.assertEqual(_Visitor.VMS.get(vm_id), None)
def _make_fake_vms(self):
for i in range(VM_NUM):
@@ -391,3 +395,14 @@
def updateNumaInfo(self):
pass
+
+ def __repr__(self):
+ return (
+ "<VM=%s name=%s migrating=%s "
+ "monitorable=%s ready=%s "
+ "fail_required=%s fail_runnable=%s>" % (
+ self.id, self.name, self.migrating,
+ self.monitorable, self.ready,
+ getattr(self, 'fail_required', False),
+ getattr(self, 'fail_runnable', False))
+ )
--
To view, visit https://gerrit.ovirt.org/65753
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I75b890daed01d23cfa0a36db66615a48023b96c0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Idan Shaby has uploaded a new change for review.
Change subject: storage: add discard support for vm disks
......................................................................
storage: add discard support for vm disks
When the engine sends the field 'passDiscard' with the value 'true' as
one of the parameters of the vm's disk's drive, vdsm adds
discard='unmap' to the disk's drive.
With that, vdsm gives the vm disk the ability to support discard.
Note that vdsm can handle scenarios of sending passDiscard with the
values 'true' or 'false', alongside not sending it at all, which makes
it possible to work with old engines that don't support the feature.
For more information about the "Pass Discard" feature, please refer to
the feature page:
http://www.ovirt.org/develop/release-management/features/storage/pass-disca…
Change-Id: I215c12260f819538e40056ec16d0b9378287ccee
Bug-Url: https://bugzilla.redhat.com/1241106
Signed-off-by: Idan Shaby <ishaby(a)redhat.com>
---
M tests/vmStorageTests.py
M vdsm/virt/vmdevices/storage.py
2 files changed, 23 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/65751/1
diff --git a/tests/vmStorageTests.py b/tests/vmStorageTests.py
index aa289d3..3c91544 100644
--- a/tests/vmStorageTests.py
+++ b/tests/vmStorageTests.py
@@ -98,6 +98,22 @@
"""
self.check({}, conf, xml, is_block_device=True)
+ def test_disk_with_pass_discard(self):
+ conf = drive_config(
+ serial='54-a672-23e5b495a9ea',
+ passDiscard='true',
+ )
+ xml = """
+ <disk device="disk" snapshot="no" type="block">
+ <source dev="/path/to/volume"/>
+ <target bus="virtio" dev="vda"/>
+ <serial>54-a672-23e5b495a9ea</serial>
+ <driver cache="none" discard="unmap" error_policy="stop"
+ io="native" name="qemu" type="raw"/>
+ </disk>
+ """
+ self.check({}, conf, xml, is_block_device=True)
+
def test_disk_file(self):
conf = drive_config(
serial='54-a672-23e5b495a9ea',
@@ -672,6 +688,7 @@
'readonly': 'False',
'shared': 'none',
'type': 'disk',
+ 'passDiscard': 'false',
}
conf.update(kw)
return conf
@@ -685,4 +702,5 @@
"format": format,
"path": "/path/to/replica",
"propagateErrors": "off",
+ 'passDiscard': 'false',
}
diff --git a/vdsm/virt/vmdevices/storage.py b/vdsm/virt/vmdevices/storage.py
index 78bf00c..dcf16c0 100644
--- a/vdsm/virt/vmdevices/storage.py
+++ b/vdsm/virt/vmdevices/storage.py
@@ -62,7 +62,8 @@
'index', 'name', 'optional', 'shared', 'truesize',
'volumeChain', 'baseVolumeID', 'serial', 'reqsize', 'cache',
'_blockDev', 'extSharedState', 'drv', 'sgio', 'GUID',
- 'diskReplicate', '_diskType', 'hosts', 'protocol', 'auth')
+ 'diskReplicate', '_diskType', 'hosts', 'protocol', 'auth',
+ 'passDiscard')
VOLWM_CHUNK_SIZE = (config.getint('irs', 'volume_utilization_chunk_mb') *
constants.MEGAB)
VOLWM_FREE_PCT = 100 - config.getint('irs', 'volume_utilization_percent')
@@ -551,6 +552,9 @@
elif drive['format']:
driverAttrs['type'] = 'raw'
+ if 'passDiscard' in drive and drive['passDiscard'] == 'true':
+ driverAttrs['discard'] = 'unmap'
+
try:
driverAttrs['iothread'] = str(drive['specParams']['pinToIoThread'])
except KeyError:
--
To view, visit https://gerrit.ovirt.org/65751
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I215c12260f819538e40056ec16d0b9378287ccee
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ishaby(a)redhat.com>
Petr Horáček has uploaded a new change for review.
Change subject: net: edit nic detached from bridge but still attached to a vlan
......................................................................
net: edit nic detached from bridge but still attached to a vlan
Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0e
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/1372798
---
M lib/vdsm/network/configurators/ifcfg.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/65232/1
diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py
index f49693a..f04a7f3 100644
--- a/lib/vdsm/network/configurators/ifcfg.py
+++ b/lib/vdsm/network/configurators/ifcfg.py
@@ -281,6 +281,11 @@
if set_mtu is not None:
ipwrapper.linkSet(nic.name, ['mtu', str(set_mtu)])
+ # If the nic was bridged, we must remove BRIDGE parameter from its
+ # ifcfg configuration file.
+ if nic.bridge:
+ self.configApplier.dropBridgeParameter(nic.name)
+
def _getFilePath(self, fileType, device):
return os.path.join(NET_CONF_DIR, '%s-%s' % (fileType, device))
--
To view, visit https://gerrit.ovirt.org/65232
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I460cb08cf436b932e7d9592557a03d7b6fc36a0e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Francesco Romani has posted comments on this change.
Change subject: virt: Initial support for post-copy migration
......................................................................
Patch Set 12: Code-Review+1
(1 comment)
we just need the packages.
https://gerrit.ovirt.org/#/c/62873/12/vdsm/virt/migration.py
File vdsm/virt/migration.py:
PS12, Line 485: # Migration may fail immediately when VIR_MIGRATE_POSTCOPY is
: # present in the following situations:
: # - The transport is not capable of full bidirectional
: # connectivity: RDMA, tunnelled, pipe.
: # - Huge pages are used (doesn't apply to transparent huge pages).
: # - QEMU uses a file as a backing for memory.
: # - Perhaps non-shared block storage may cause some trouble.
: if self._use_convergence_schedule and \
: not self._tunneled:
: for s in self._convergence_schedule.get('stalling', []):
: action = s.get('action', {}).get('name')
: if action == CONVERGENCE_SCHEDULE_POST_COPY:
: flags |= libvirt.VIR_MIGRATE_POSTCOPY
: break
it would be nice to factor this code in a method, because I want to refactor all the flags selection code in a not so distant feature.
It's just a "nice to have", however, so I'm not pushing for thiss
--
To view, visit https://gerrit.ovirt.org/62873
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4c9911f47331120a1b78326044a4949abf35d5fe
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
Francesco Romani has posted comments on this change.
Change subject: virt: vm: migration: introduce virt subloggers
......................................................................
Patch Set 16: Verified-1
not yet ready
--
To view, visit https://gerrit.ovirt.org/61993
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If2f9689fb5c0d0a80261aabed11eedbab358a491
Gerrit-PatchSet: 16
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
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>
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>
gerrit-hooks has posted comments on this change.
Change subject: virt: vm: migration: introduce virt subloggers
......................................................................
Patch Set 16:
* Update Tracker::IGNORE, no bug url/s found
* Check Bug-Url::IGNORE, no bug url/s found
* Check Public Bug::WARN, no public bug url found
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/61993
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If2f9689fb5c0d0a80261aabed11eedbab358a491
Gerrit-PatchSet: 16
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: virt: vm: migration: introduce virt subloggers
......................................................................
Patch Set 15:
* Update Tracker::IGNORE, no bug url/s found
* Check Bug-Url::IGNORE, not relevant for branch: master
* Check Public Bug::WARN, no public bug url found
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/61993
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If2f9689fb5c0d0a80261aabed11eedbab358a491
Gerrit-PatchSet: 15
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No