Hello Nir Soffer, Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/65108
to review the following change.
Change subject: virt: Make boolean values from boolean migration options
......................................................................
virt: Make boolean values from boolean migration options
`compressed' and `autoConverge' migration options have boolean values in
the string form. They must be converted to actual booleans before they
are checked.
Change-Id: I642eb607785a1b6f877092e187c91b7a065b38e1
Bug-Url: https://bugzilla.redhat.com/1380822
Backport-To: 4.0
Signed-off-by: Milan Zamazal <mzamazal(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/65007
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/65108/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index e502756..edd2c79 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -100,6 +100,8 @@
self._dstparams = dstparams
self._enableGuestEvents = kwargs.get('enableGuestEvents', False)
self._machineParams = {}
+ # TODO: utils.tobool shouldn't be used in this constructor, the
+ # conversions should be handled properly in the API layer
self._tunneled = utils.tobool(tunneled)
self._abortOnError = utils.tobool(abortOnError)
self._consoleAddress = consoleAddress
@@ -110,8 +112,8 @@
kwargs.get('maxBandwidth') or
config.getint('vars', 'migration_max_bandwidth')
)
- self._autoConverge = autoConverge
- self._compressed = compressed
+ self._autoConverge = utils.tobool(autoConverge)
+ self._compressed = utils.tobool(compressed)
self._incomingLimit = kwargs.get('incomingLimit')
self._outgoingLimit = kwargs.get('outgoingLimit')
self.status = {
--
To view, visit https://gerrit.ovirt.org/65108
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I642eb607785a1b6f877092e187c91b7a065b38e1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Hello Adam Litke, Nir Soffer,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/64986
to review the following change.
Change subject: Live Merge: Remove volume run link after live merge
......................................................................
Live Merge: Remove volume run link after live merge
When deleting a volume while the VM is running, volume teardown doesn't
remove the volume run symbolic link: /run/vdsm/storage/sdUUID/volUUID.
In patch Iec3b6a (Live Merge: teardown volume on HSM after live merge)
we added volume teardown logic that, for block storage it deactivated
the volume. In this patch we extend volume teardown logic to unlink
volume run link.
Note that this change isn't required for file storage as no symbolic
links are created.
Change-Id: Ib88bf92e702ac6c324b87c9459b01adf165eaca4
Bug-Url: https://bugzilla.redhat.com/1321018
Signed-off-by: Ala Hino <ahino(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/59725
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Adam Litke <alitke(a)redhat.com>
Continuous-Integration: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/64986/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 58d2507..f977150 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -813,6 +813,21 @@
def teardownVolume(self, imgUUID, volUUID):
lvm.deactivateLVs(self.sdUUID, [volUUID])
+ self.removeVolumeRunLink(imgUUID, volUUID)
+
+ def removeVolumeRunLink(self, imgUUID, volUUID):
+ """
+ Remove /run/vdsm/storage/sdUUID/imgUUID/volUUID
+ """
+ vol_run_link = os.path.join(constants.P_VDSM_STORAGE,
+ self.sdUUID, imgUUID, volUUID)
+ self.log.info("Unlinking volme runtime link: %r", vol_run_link)
+ try:
+ os.unlink(vol_run_link)
+ except OSError as e:
+ if e.error != errno.ENOENT:
+ raise
+ self.log.debug("Volume run link %r does not exist", vol_run_link)
class BlockStorageDomain(sd.StorageDomain):
--
To view, visit https://gerrit.ovirt.org/64986
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib88bf92e702ac6c324b87c9459b01adf165eaca4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Hello Adam Litke, Nir Soffer,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/64985
to review the following change.
Change subject: Live Merge: Teardown volume on HSM after live merge
......................................................................
Live Merge: Teardown volume on HSM after live merge
If a VM is running on HSM and live merge is performed, the LV isn't
deactivated because the deactivation is done when deleting the volume.
However, deleting the volume is done on SPM and this means that the LV
is not deactivated on the HSM. In this patch, a logic to teardown the
volume is added after live merge has completed.
Change-Id: Iec3b6adb50293d8c98f5d8726d668eb272d16549
Bug-Url: https://bugzilla.redhat.com/1377849
Signed-off-by: Ala Hino <ahino(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/64301
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Continuous-Integration: Nir Soffer <nsoffer(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/sd.py
M vdsm/virt/vm.py
3 files changed, 32 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/64985/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 8de13b1..58d2507 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -799,6 +799,21 @@
if preallocate == sc.SPARSE_VOL and volFormat == sc.RAW_FORMAT:
raise se.IncorrectFormat(sc.type2name(volFormat))
+ def getVolumeLease(self, imgUUID, volUUID):
+ """
+ Return the volume lease (leasePath, leaseOffset)
+ """
+ if not self.hasVolumeLeases():
+ return clusterlock.Lease(None, None, None)
+ # TODO: use the sanlock specific offset when present
+ slot = self.produceVolume(imgUUID, volUUID).getMetaOffset()
+ offset = ((slot + blockVolume.RESERVED_LEASES) * self.logBlkSize *
+ sd.LEASE_BLOCKS)
+ return clusterlock.Lease(volUUID, self.getLeasesFilePath(), offset)
+
+ def teardownVolume(self, imgUUID, volUUID):
+ lvm.deactivateLVs(self.sdUUID, [volUUID])
+
class BlockStorageDomain(sd.StorageDomain):
manifestClass = BlockStorageDomainManifest
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 2b151a6..d004794 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -487,6 +487,14 @@
if preallocate is not None and preallocate not in sc.VOL_TYPE:
raise se.IncorrectType(preallocate)
+ def teardownVolume(self, imgUUID, volUUID):
+ """
+ Called when a volume is detached from a prepared image during live
+ merge flow. In this case, the volume will not be torn down when
+ the image is torn down.
+ This does nothing, subclass should override this if needed.
+ """
+
class StorageDomain(object):
log = logging.getLogger("Storage.StorageDomain")
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index a896f58..22e656c 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -66,6 +66,7 @@
from vdsm.virt.utils import isVdsmImage, cleanup_guest_socket
from storage import outOfProcess as oop
from storage import sd
+from storage import sdc
# local imports
# In future those should be imported via ..
@@ -4936,6 +4937,12 @@
self.drive.imageID, baseVolUUID,
topVolInfo['capacity'])
+ def teardown_top_volume(self):
+ # TODO move this method to storage public API
+ sd_manifest = sdc.sdCache.produce_manifest(self.drive.domainID)
+ sd_manifest.teardownVolume(self.drive.imageID,
+ self.job['topVolume'])
+
@utils.traceback()
def run(self):
self.update_base_size()
@@ -4946,6 +4953,8 @@
self.vm._syncVolumeChain(self.drive)
if self.doPivot:
self.vm.startDisksStatsCollection()
+ self.vm.enableDriveMonitor()
+ self.teardown_top_volume()
self.success = True
self.vm.log.info("Synchronization completed (job %s)",
self.job['jobID'])
--
To view, visit https://gerrit.ovirt.org/64985
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec3b6adb50293d8c98f5d8726d668eb272d16549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: tests: Use same log format as vdsm
......................................................................
tests: Use same log format as vdsm
Using the same format as in vdsm logs may make it easier to debug
failing tests. In particular, the old format was missing the module and
line number.
Change-Id: Ia8a6c07442d3fb2dd86d08f5c71c3b640bbda43d
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/run_tests_local.sh.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/64216/1
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
index a2c38c5..121eb7c 100644
--- a/tests/run_tests_local.sh.in
+++ b/tests/run_tests_local.sh.in
@@ -5,7 +5,7 @@
export \
LC_ALL=C \
- NOSE_LOGFORMAT='%(asctime)s %(levelname)-7s [%(name)s] (%(threadName)s) %(message)s' \
+ NOSE_LOGFORMAT='%(asctime)s %(levelname)-7s [%(name)s] (%(threadName)s) %(message)s (%(module)s:%(lineno)d)' \
NOSE_VERBOSE=${NOSE_VERBOSE:-3} \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" \
--
To view, visit https://gerrit.ovirt.org/64216
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8a6c07442d3fb2dd86d08f5c71c3b640bbda43d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: log: Nicer logging format
......................................................................
log: Nicer logging format
Use nicer and more standard logging format, similar to engine log
format. Having similar logging formats should make it easier to debug
and support.
Here is an example log using the new format:
2016-09-19 00:02:25,291 INFO [vds] (MainThread) (PID: 10281) I am the actual vdsm 4.18.999-578.git61bfe00.el7 voodoo6.tlv.redhat.com (3.10.0-489.el7.x86_64)
2016-09-19 00:02:25,291 INFO [vds] (MainThread) VDSM will run with cpu affinity: frozenset([1])
2016-09-19 00:02:25,379 INFO [storage.check] (MainThread) Starting check service
2016-09-19 00:02:25,384 INFO [storage.Dispatcher] (MainThread) Starting StorageDispatcher...
2016-09-19 00:02:25,385 INFO [storage.asyncevent] (check/loop) Starting <EventLoop running=True closed=False at 0x33716496>
2016-09-19 00:02:25,482 INFO [dispatcher] (MainThread) Run and protect: registerDomainStateChangeCallback(callbackFunc=<functools.partial object at 0x288f260>)
2016-09-19 00:02:25,482 INFO [dispatcher] (MainThread) Run and protect: registerDomainStateChangeCallback, Return response: None
2016-09-19 00:02:25,485 INFO [MOM] (MainThread) Preparing MOM interface
2016-09-19 00:02:25,486 INFO [MOM] (MainThread) Using named unix socket /var/run/vdsm/mom-vdsm.sock
2016-09-19 00:02:25,487 INFO [root] (MainThread) Unregistering all secrets
2016-09-19 00:02:25,491 INFO [vds] (MainThread) Setting channels' timeout to 30 seconds.
2016-09-19 00:02:25,493 INFO [vds.MultiProtocolAcceptor] (MainThread) Listening at :::54321
2016-09-19 00:02:25,526 INFO [vds] (clientIFinit) recovery: completed in 0s
2016-09-19 00:02:25,560 WARNING [storage.Multipath] (hsm/init) Map '360014052c81462a280847e8a6e3af8cd' has no slaves
2016-09-19 00:02:25,560 WARNING [storage.Multipath] (hsm/init) Map '36001405292bb96f19064f81b884fa63f' has no slaves
2016-09-19 00:02:27,115 INFO [vds] (BindingXMLRPC) XMLRPC server running
2016-09-19 00:02:27,122 INFO [health] (MainThread) Starting health monitor (interval=60)
2016-09-19 00:02:40,256 INFO [ProtocolDetector.AcceptorImpl] (Reactor thread) Accepting connection from ::1:42888
2016-09-19 00:02:40,270 INFO [ProtocolDetector.Detector] (Reactor thread) Detected protocol xml from ::1:42888
2016-09-19 00:02:40,270 INFO [vds.XMLRPCServer] (BindingXMLRPC) Starting request handler for ::1:42888
2016-09-19 00:02:40,271 INFO [vds.XMLRPCServer] (Thread-12) Request handler for ::1:42888 started
2016-09-19 00:02:40,272 INFO [throttled] (Thread-12) Current getAllVmStats: {}
2016-09-19 00:02:40,272 INFO [vds] (Thread-12) RPC call getAllVmStats finished (code=0) in 0.00 seconds
Unfinished: require updating all the tools parsing vdsm log.
Change-Id: I640c3c83db3b5818a08b4984d5358b1e27bf0ef3
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M static/etc/vdsm/logger.conf.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/64113/1
diff --git a/static/etc/vdsm/logger.conf.in b/static/etc/vdsm/logger.conf.in
index 34137ff..820fcb4 100644
--- a/static/etc/vdsm/logger.conf.in
+++ b/static/etc/vdsm/logger.conf.in
@@ -86,7 +86,7 @@
format: %(message)s
[formatter_long]
-format: %(threadName)s::%(levelname)s::%(asctime)s::%(module)s::%(lineno)d::%(name)s::(%(funcName)s) %(message)s
+format: %(asctime)s %(levelname)-7s [%(name)s] (%(threadName)s) %(message)s
[formatter_sysform]
format= vdsm %(name)s %(levelname)s %(message)s
--
To view, visit https://gerrit.ovirt.org/64113
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I640c3c83db3b5818a08b4984d5358b1e27bf0ef3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>