Change in vdsm[master]: migration: Add incoming migration semaphore
by michal.skrivanek@redhat.com
Michal Skrivanek has posted comments on this change.
Change subject: migration: Add incoming migration semaphore
......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/45954/2/vdsm/virt/migration.py
File vdsm/virt/migration.py:
Line 54: VIR_MIGRATE_PARAM_GRAPHICS_URI = 'graphics_uri'
Line 55:
Line 56:
Line 57: mig = min(config.getint('vars', 'max_incoming_migrations'),
Line 58: caps.CpuTopology().cores())
> I wanted to remain consistent with the handling of outgoing migrations whic
I think we should follow the original logic. On small machines we don't want many incoming migrations either
Line 59:
Line 60: incomingMigrations = threading.BoundedSemaphore(mig)
Line 61:
Line 62:
--
To view, visit https://gerrit.ovirt.org/45954
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8952f732033ed160292b11fbc0c4deac099b2b3e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
8 years, 8 months
Change in vdsm[master]: vm: improve safety between startup and shutdown
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: improve safety between startup and shutdown
......................................................................
vm: improve safety between startup and shutdown
The VM startup and the VM shutdown flows
are asynchronous to each other.
Under normal conditions of load, there is a small window
on which it is unsafe to call destroy while startup is
running; here "unsafe" that the flows can stomp on each
other toes. The result is confusion, so Engine is forced
to wait for the dust to settle before to properly learn
what happened, and one flow will fail with weird errors.
Besides this confusion, there is no catastrophic effect,
but to avoid further bitrot this patch start cleaning up,
while we plan the much needed and deeper overhaul of the
code.
- replace booleans with threading.Events
- better handling of the corner case on which a VM is
destroyed while starting up, with dedicated vm exit reason.
Change-Id: I8718f58f1d255d9e603db75aa1f256c03c300f3a
Bug-Url: https://bugzilla.redhat.com/912390
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
M vdsm/virt/vmexitreason.py
2 files changed, 26 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/44989/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0fe3ab1..10e6e1c 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -256,6 +256,12 @@
self.reason = reason
+class DestroyedOnStartupError(Exception):
+ """
+ Domain destroyed during startup process.
+ """
+
+
class Vm(object):
"""
Used for abstracting communication between various parts of the
@@ -312,7 +318,7 @@
vmdevices.graphics.initLegacyConf(self.conf)
self.cif = cif
self.log = SimpleLogAdapter(self.log, {"vmId": self.conf['vmId']})
- self._destroyed = False
+ self._destroyed = threading.Event()
self._recoveryFile = constants.P_VDSM_RUN + \
str(self.conf['vmId']) + '.recovery'
self._monitorResponse = 0
@@ -357,7 +363,7 @@
self._guestSocketFile, self.cif.channelListener, self.log,
self._onGuestStatusChange)
self._domain = DomainDescriptor.from_id(self.id)
- self._released = False
+ self._released = threading.Event()
self._releaseLock = threading.Lock()
self.saveState()
self._watchdogEvent = {}
@@ -793,6 +799,13 @@
except MigrationError:
self.log.exception("Failed to start a migration destination vm")
self.setDownStatus(ERROR, vmexitreason.MIGRATION_FAILED)
+ except DestroyedOnStartupError:
+ self.log.info("Domain destroyed during startup")
+ if self._released.is_set():
+ self.setDownStatus(NORMAL, vmexitreason.DESTROYED_ON_STARTUP)
+ # else something in the destroy path may have failed.
+ # We don't know, and we don't have the means to know.
+ # Don't do anything more, to avoid to increas the mess.
except Exception as e:
if self.recovering:
self.log.info("Skipping errors on recovery", exc_info=True)
@@ -815,7 +828,7 @@
def preparePaths(self, drives):
for drive in drives:
with self._volPrepareLock:
- if self._destroyed:
+ if self._destroyed.is_set():
# A destroy request has been issued, exit early
break
drive['path'] = self.cif.prepareVolumePath(drive, self.id)
@@ -865,7 +878,7 @@
pass
def _saveStateInternal(self):
- if self._destroyed:
+ if self._destroyed.is_set():
return
toSave = self.status()
toSave['startTime'] = self._startTime
@@ -923,7 +936,7 @@
# This is not a definite fix, we're aware that there is still the
# possibility of a race condition, however this covers more cases
# than before and a quick gain
- if not self.conf.get('clientIp', '') and not self._destroyed:
+ if not self.conf.get('clientIp', '') and not self._destroyed.is_set():
delay = config.get('vars', 'user_shutdown_timeout')
timeout = config.getint('vars', 'sys_shutdown_timeout')
CDA = ConsoleDisconnectAction
@@ -1768,14 +1781,10 @@
uuidPath, name)
def _domDependentInit(self):
- if self._destroyed:
+ if self._destroyed.is_set():
# reaching here means that Vm.destroy() was called before we could
# handle it. We must handle it now
- try:
- self._dom.destroy()
- except Exception:
- pass
- raise Exception('destroy() called before Vm started')
+ raise DestroyedOnStartupError()
if not self._dom.connected:
raise MissingLibvirtDomainError(vmexitreason.LIBVIRT_START_FAILED)
@@ -3733,7 +3742,7 @@
hooks.after_device_destroy(dev._deviceXML, self.conf,
dev.custom)
- self._released = True
+ self._released.set()
return {'status': doneCode}
@@ -3793,7 +3802,7 @@
hooks.before_vm_destroy(self._domain.xml, self.conf)
with self._shutdownLock:
self._shutdownReason = vmexitreason.ADMIN_SHUTDOWN
- self._destroyed = True
+ self._destroyed.set()
return self.releaseVm()
diff --git a/vdsm/virt/vmexitreason.py b/vdsm/virt/vmexitreason.py
index c04e65e..6eb77c7 100644
--- a/vdsm/virt/vmexitreason.py
+++ b/vdsm/virt/vmexitreason.py
@@ -28,6 +28,7 @@
USER_SHUTDOWN = 7
MIGRATION_FAILED = 8
LIBVIRT_DOMAIN_MISSING = 9
+DESTROYED_ON_STARTUP = 10
exitReasons = {
@@ -40,5 +41,7 @@
ADMIN_SHUTDOWN: 'Admin shut down from the engine',
USER_SHUTDOWN: 'User shut down from within the guest',
MIGRATION_FAILED: 'VM failed to migrate',
- LIBVIRT_DOMAIN_MISSING: 'Failed to find the libvirt domain'
+ LIBVIRT_DOMAIN_MISSING: 'Failed to find the libvirt domain',
+ DESTROYED_ON_STARTUP: 'VM destroyed during the startup',
+
}
--
To view, visit https://gerrit.ovirt.org/44989
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8718f58f1d255d9e603db75aa1f256c03c300f3a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: hostdev: add udev rules for USB devices
by Martin Polednik
Martin Polednik has posted comments on this change.
Change subject: hostdev: add udev rules for USB devices
......................................................................
Patch Set 11: Verified+1
--
To view, visit https://gerrit.ovirt.org/44679
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f72f63186187254cd4aded0a2e6c396001ca28b
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: hostdev: add udev rules for USB devices
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: hostdev: add udev rules for USB devices
......................................................................
Patch Set 11:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/44679
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f72f63186187254cd4aded0a2e6c396001ca28b
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: utils.retry: Support system time changes while retry() is ru...
by Piotr Kliczewski
Piotr Kliczewski has posted comments on this change.
Change subject: utils.retry: Support system time changes while retry() is running
......................................................................
Patch Set 2: Code-Review+1
so, let's add tests in future patch.
--
To view, visit https://gerrit.ovirt.org/46075
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6bc072bc20e8f5ae2db3fd1e48d91cdce9d469f8
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh.dev(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh.dev(a)gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: utils.retry: Support system time changes while retry() is ru...
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: utils.retry: Support system time changes while retry() is running
......................................................................
Patch Set 2:
Piotr, adding test would be nice but this a trivial change that can not break the current code.
--
To view, visit https://gerrit.ovirt.org/46075
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6bc072bc20e8f5ae2db3fd1e48d91cdce9d469f8
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh.dev(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh.dev(a)gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: hostdev: add udev rules for USB devices
by michal.skrivanek@redhat.com
Michal Skrivanek has posted comments on this change.
Change subject: hostdev: add udev rules for USB devices
......................................................................
Patch Set 10: Code-Review+1
--
To view, visit https://gerrit.ovirt.org/44679
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f72f63186187254cd4aded0a2e6c396001ca28b
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: utils.retry: Support system time changes while retry() is ru...
by Piotr Kliczewski
Piotr Kliczewski has posted comments on this change.
Change subject: utils.retry: Support system time changes while retry() is running
......................................................................
Patch Set 2:
Can we have some test to be sure that it works as we think it does?
--
To view, visit https://gerrit.ovirt.org/46075
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6bc072bc20e8f5ae2db3fd1e48d91cdce9d469f8
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh.dev(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: sudoers: remove unused iscsid policies
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: sudoers: remove unused iscsid policies
......................................................................
sudoers: remove unused iscsid policies
could've been removed on:
https://gerrit.ovirt.org/#/c/305/
Change-Id: I61442dd6d581a3f701cf8c49e082f9316f22a4ba
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/sudoers.vdsm.in
1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/44504/1
diff --git a/vdsm/sudoers.vdsm.in b/vdsm/sudoers.vdsm.in
index 924cc87..d372dea 100644
--- a/vdsm/sudoers.vdsm.in
+++ b/vdsm/sudoers.vdsm.in
@@ -8,17 +8,13 @@
@KILL_PATH@, \
@CHOWN_PATH@ @VDSMUSER@\:@QEMUGROUP@ *, \
@CHOWN_PATH@ @METADATAUSER@\:@METADATAGROUP@ *, \
- @MV_PATH@ /etc/iscsi/iscsid.conf /etc/iscsi/iscsid.conf.*, \
@MV_PATH@ /etc/multipath.conf *, \
- @CP_PATH@ * /etc/iscsi/iscsid.conf, \
- @SERVICE_PATH@ iscsid *, \
@BINDIR@/vdsm-tool service-restart multipathd, \
@BINDIR@/vdsm-tool service-reload multipathd, \
@ISCSIADM_PATH@ *, \
@LVM_PATH@, \
@CAT_PATH@ /sys/block/*/device/../../*, \
@CAT_PATH@ /sys/devices/platform/host*, \
- @CAT_PATH@ /etc/iscsi/iscsid.conf, \
@CAT_PATH@ /etc/multipath.conf, \
@DD_PATH@ of=/sys/class/scsi_host/host*/scan, \
@DD_PATH@, \
--
To view, visit https://gerrit.ovirt.org/44504
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I61442dd6d581a3f701cf8c49e082f9316f22a4ba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: virt: vm with port mirroring stuck in down state
by mmirecki@redhat.com
Marcin Mirecki has uploaded a new change for review.
Change subject: virt: vm with port mirroring stuck in down state
......................................................................
virt: vm with port mirroring stuck in down state
When powering off VM with port mirroring enabled the
VM id down in the UI but stuck in down state in vdsm.
The problem was that the 'tc' command was invoked
twice when a vm was shutdown from the cli. The first
time as a result of a libvirt life cycle event which
deleted the qdisc entries for the vm, the second time
it was invoked by the engine and failed as the qdisc
entries were no longer there.
The code invoking tc was moved to be after the if
statement checking if the vm has already been released.
Change-Id: Ia43369f584f696f1387685ec8f4fc4b6f58d98a6
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1254713
Signed-off-by: Marcin Mirecki <mmirecki(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/45344/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 2aa9ce4..4159df7 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3658,13 +3658,6 @@
Stop VM and release all resources
"""
- # unsetting mirror network will clear both mirroring
- # (on the same network).
- for nic in self._devices[hwclass.NIC]:
- if hasattr(nic, 'portMirroring'):
- for network in nic.portMirroring:
- supervdsm.getProxy().unsetPortMirroring(network, nic.name)
-
# delete the payload devices
for drive in self._devices[hwclass.DISK]:
if (hasattr(drive, 'specParams') and
@@ -3675,6 +3668,14 @@
if self._released:
return {'status': doneCode}
+ # unsetting mirror network will clear both mirroring
+ # (on the same network).
+ for nic in self._devices[hwclass.NIC]:
+ if hasattr(nic, 'portMirroring'):
+ for network in nic.portMirroring:
+ supervdsm.getProxy().unsetPortMirroring(network,
+ nic.name)
+
self.log.info('Release VM resources')
self.lastStatus = vmstatus.POWERING_DOWN
# Terminate the VM's creation thread.
--
To view, visit https://gerrit.ovirt.org/45344
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia43369f584f696f1387685ec8f4fc4b6f58d98a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmirecki(a)redhat.com>
8 years, 8 months