Federico Simoncelli has uploaded a new change for review.
Change subject: image: placeholder optimization on preallocation
......................................................................
image: placeholder optimization on preallocation
When the destination of a copy or move command is an NFS domain
we should try to optimize the placeholders creation avoiding
unnecessary prezeroing (only relevant case: RAW PREALLOCATED).
In such case in the past we were using a TEMPORARY_VOLUME_SIZE
to create a placeholder with a temporary size of 10Mb.
This is interfering with live storage migration as the following
volumes in the chain are inheriting the temporary size inside the
qcow header (virtual disk size).
With this patch we are instead forcing the creation of the volume
as SPARSE as this won't have any side effect on the qcow header.
Change-Id: I32811bd45320ef02bfc593a71dfdafc0b0550c7d
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=910445
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/image.py
M vdsm/storage/sd.py
3 files changed, 30 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/12692/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 9809bf4..e040596 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -431,6 +431,14 @@
def requiresMailbox(self):
return True
+ @property
+ def lightweightPreallocation(self):
+ """
+ This property advertises whether creating preallocated volumes
+ is a lightweight operation or not.
+ """
+ return True
+
def _registerResourceNamespaces(self):
"""
Register resources namespaces and create
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 92021ff..1b6f89d 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -523,18 +523,20 @@
# find out src volume parameters
volParams = srcVol.getVolumeParams(bs=1)
- # To avoid 'prezeroing' preallocated volume on NFS domain,
- # we create the target volume with minimal size and after
- # that w'll change its metadata back to the original size.
- if (volParams['volFormat'] == volume.COW_FORMAT
- or volParams['prealloc'] == volume.SPARSE_VOL):
- volTmpSize = volParams['size']
+ # To avoid prezeroing preallocated volumes on NFS domains
+ # we create the target as a sparse volume (since it will be
+ # soon filled with the data coming from the copy) and then
+ # we change its metadata back to the original value.
+ if (volParams['prealloc'] == volume.PREALLOCATED_VOL
+ and not destDom.lightweightPreallocation):
+ tmpVolPreallocation = volume.SPARSE_VOL
else:
- volTmpSize = TEMPORARY_VOLUME_SIZE # in sectors (10M)
+ tmpVolPreallocation = volParams['prealloc']
- destDom.createVolume(imgUUID=imgUUID, size=volTmpSize,
+ destDom.createVolume(imgUUID=imgUUID,
+ size=volParams['size'],
volFormat=volParams['volFormat'],
- preallocate=volParams['prealloc'],
+ preallocate=tmpVolPreallocation,
diskType=volParams['disktype'],
volUUID=srcVol.volUUID,
desc=volParams['descr'],
@@ -548,9 +550,9 @@
dstVol.extend((volParams['apparentsize'] + 511) / 512)
# Change destination volume metadata back to the original
- # size.
- if volTmpSize != volParams['size']:
- dstVol.setSize(volParams['size'])
+ # type.
+ if tmpVolPreallocation != volParams['prealloc']:
+ dstVol.setType(volParams['prealloc'])
dstChain.append(dstVol)
except se.StorageException:
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 9ce836b..7006a88 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -316,6 +316,14 @@
return False
@property
+ def lightweightPreallocation(self):
+ """
+ This property advertises whether creating preallocated volumes
+ is a lightweight operation or not.
+ """
+ return False
+
+ @property
def oop(self):
return oop.getProcessPool(self.sdUUID)
--
To view, visit http://gerrit.ovirt.org/12692
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32811bd45320ef02bfc593a71dfdafc0b0550c7d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsm-logrotate: change rotate to 10
......................................................................
vdsm-logrotate: change rotate to 10
Logrotate compress VDSM logs (/var/log/vdsm/*) when they achieve >15M.
However, we rotates the logs only when it reaches 100 count.
This patch purpose the rotation to 10 counts because very old logs
cannot help to get out of trouble anyway. Also, reduce the number of
files/space in the partition.
Rotating 10 files compressed seems reasonable/safe.
Change-Id: Ia28d84c455d0a2719855a33fc6861b4a74317fd0
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=928217
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm/vdsm-logrotate.conf.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/13500/1
diff --git a/vdsm/vdsm-logrotate.conf.in b/vdsm/vdsm-logrotate.conf.in
index ce71015..4b270fb 100644
--- a/vdsm/vdsm-logrotate.conf.in
+++ b/vdsm/vdsm-logrotate.conf.in
@@ -1,5 +1,5 @@
/var/log/vdsm/*.log {
- rotate 100
+ rotate 10
missingok
size 15M
compress
--
To view, visit http://gerrit.ovirt.org/13500
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia28d84c455d0a2719855a33fc6861b4a74317fd0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>