Change in vdsm[master]: py3: make gluster_cli_tests pass
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: py3: make gluster_cli_tests pass
......................................................................
py3: make gluster_cli_tests pass
Change-Id: I7e212e247f057f2988debaf3b2de923851b90b24
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/kaxmlrpclib.py
M lib/vdsm/network/netlink/addr.py
M tests/gluster_cli_tests.py
M vdsm/gluster/storagedev.py
4 files changed, 11 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/65008/1
diff --git a/lib/vdsm/kaxmlrpclib.py b/lib/vdsm/kaxmlrpclib.py
index e24316c..66ec9e0 100644
--- a/lib/vdsm/kaxmlrpclib.py
+++ b/lib/vdsm/kaxmlrpclib.py
@@ -33,8 +33,8 @@
from __future__ import absolute_import
from __future__ import print_function
-import xmlrpclib
-import httplib
+import six.moves.xmlrpc_client
+import six.moves.http_client
import socket
# It would have been nicer to make these server-specific and not module-wide
@@ -48,19 +48,19 @@
def Server(url, *args, **kwargs):
kwargs['transport'] = TcpkeepTransport()
- server = xmlrpclib.Server(url, *args, **kwargs)
+ server = six.moves.xmlrpc_client.Server(url, *args, **kwargs)
return server
ServerProxy = Server
-class TcpkeepTransport(xmlrpclib.Transport):
+class TcpkeepTransport(six.moves.xmlrpc_client.Transport):
def make_connection(self, host):
return TcpkeepHTTPConnection(host)
-class TcpkeepHTTPConnection(httplib.HTTPConnection):
+class TcpkeepHTTPConnection(six.moves.http_client.HTTPConnection):
def connect(self):
"""Connect to the host and port specified in __init__.
@@ -110,7 +110,7 @@
def SslServer(url, ctx, *args, **kwargs):
kwargs['transport'] = TcpkeepSafeTransport(ctx)
- server = xmlrpclib.Server(url, *args, **kwargs)
+ server = six.moves.xmlrpc_client.Server(url, *args, **kwargs)
return server
SslServerProxy = SslServer
diff --git a/lib/vdsm/network/netlink/addr.py b/lib/vdsm/network/netlink/addr.py
index 0037454..cb17bf3 100644
--- a/lib/vdsm/network/netlink/addr.py
+++ b/lib/vdsm/network/netlink/addr.py
@@ -79,7 +79,7 @@
"""Returns the textual representation of the address flags"""
flags = (c_char * (CHARBUFFSIZE * 2))()
return frozenset(_rtnl_addr_flags2str(_rtnl_addr_get_flags(addr), flags,
- sizeof(flags)).split(','))
+ sizeof(flags)).split(b','))
# C function prototypes
diff --git a/tests/gluster_cli_tests.py b/tests/gluster_cli_tests.py
index 4ab9daf..0493c27 100644
--- a/tests/gluster_cli_tests.py
+++ b/tests/gluster_cli_tests.py
@@ -18,6 +18,8 @@
# Refer to the README and COPYING files for full details of the license
#
+import six
+
from testlib import VdsmTestCase as TestCaseBase
from gluster import cli as gcli
import xml.etree.cElementTree as etree
@@ -446,7 +448,7 @@
"""
tree = etree.fromstring(out)
status = gcli._parseVolumeStatusClients(tree)
- self.assertEquals(status.keys(), ['bricks', 'name'])
+ self.assertEquals(set(six.iterkeys(status)), {'bricks', 'name'})
self.assertEquals(status['name'], 'music')
oBricks = [{'brick': '192.168.122.2:/tmp/music-b1',
'hostuuid':
diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index a7ab985..a0eefaa 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -35,7 +35,7 @@
from vdsm import utils
from vdsm.gluster import exception as ge
-import fstab
+from . import fstab
from . import gluster_mgmt_api
--
To view, visit https://gerrit.ovirt.org/65008
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e212e247f057f2988debaf3b2de923851b90b24
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
7 years, 6 months
Change in vdsm[ovirt-4.0]: Add all MOM calls to jsonrpc client
by Martin Sivak
Hello Piotr Kliczewski, Francesco Romani, Andrej Krejcir,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/63479
to review the following change.
Change subject: Add all MOM calls to jsonrpc client
......................................................................
Add all MOM calls to jsonrpc client
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1373832
Change-Id: I98839db856b0b450c5b09975a08c60b542f18b6a
Signed-off-by: Martin Sivak <msivak(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/60492
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Tested-by: Andrej Krejcir <akrejcir(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/rpc/Bridge.py
2 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/63479/1
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index caffb9a..1854869 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -60,6 +60,8 @@
'getConnectedStoragePoolsList': 'Host.getConnectedStoragePools',
'getDeviceList': 'Host.getDeviceList',
'getImagesList': 'StorageDomain.getImages',
+ 'getIoTunePolicy': 'VM.getIoTunePolicy',
+ 'getIoTune': 'VM.getIoTune',
'getSpmStatus': 'StoragePool.getSpmStatus',
'getStorageDomainInfo': 'StorageDomain.getInfo',
'getStorageDomainsList': 'Host.getStorageDomains',
@@ -93,10 +95,12 @@
'setBalloonTarget': 'VM.setBalloonTarget',
'setCpuTunePeriod': 'VM.setCpuTunePeriod',
'setCpuTuneQuota': 'VM.setCpuTuneQuota',
+ 'setKsmTune': 'Host.setKsmTune',
'setMOMPolicy': 'Host.setMOMPolicy',
'setSafeNetworkConfig': 'Host.setSafeNetworkConfig',
'setupNetworks': 'Host.setupNetworks',
'setVmTicket': 'VM.setTicket',
+ 'setIoTune': 'VM.setIoTune',
'setVolumeDescription': 'Volume.setDescription',
'shutdown': 'VM.shutdown',
'spmStart': 'StoragePool.spmStart',
diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py
index 273bd2e..192de42 100644
--- a/lib/vdsm/rpc/Bridge.py
+++ b/lib/vdsm/rpc/Bridge.py
@@ -349,7 +349,7 @@
'Host_getVMFullList': {'call': Host_getVMFullList_Call, 'ret': 'vmList'},
'Host_getAllVmStats': {'ret': 'statsList'},
'Host_setupNetworks': {'ret': 'status'},
- 'Host_setKsmTune': {'ret': 'taskStatus'},
+ 'Host_setKsmTune': {'ret': 'status'},
'Image_cloneStructure': {'ret': 'uuid'},
'Image_delete': {'ret': 'uuid'},
'Image_deleteVolumes': {'ret': 'uuid'},
@@ -402,11 +402,12 @@
'VM_migrationCreate': {'ret': VM_migrationCreate_Ret},
'VM_getMigrationStatus': {'ret': 'migrationStats'},
'VM_pause': {'ret': VM_running_state_change_Ret},
- 'VM_setCpuTunePeriod': {'ret': 'taskStatus'},
- 'VM_setCpuTuneQuota': {'ret': 'taskStatus'},
+ 'VM_setCpuTunePeriod': {'ret': 'status'},
+ 'VM_setCpuTuneQuota': {'ret': 'status'},
'VM_hotplugMemory': {'ret': 'vmList'},
'VM_setNumberOfCpus': {'ret': 'vmList'},
- 'VM_setIoTune': {'ret': 'taskStatus'},
+ 'VM_setIoTune': {'ret': 'status'},
+ 'VM_setBalloonTarget': {'ret': 'status'},
'VM_updateDevice': {'ret': 'vmList'},
'Volume_copy': {'ret': 'uuid'},
'Volume_create': {'ret': 'uuid'},
--
To view, visit https://gerrit.ovirt.org/63479
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I98839db856b0b450c5b09975a08c60b542f18b6a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
7 years, 6 months
Change in vdsm[ovirt-4.0]: Fix return value names for VM.ioTune calls
by Martin Sivak
Hello Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/63478
to review the following change.
Change subject: Fix return value names for VM.ioTune calls
......................................................................
Fix return value names for VM.ioTune calls
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1373832
Change-Id: I4eaac318db3d76743b1ff83f47268d0fc1c2dad7
Signed-off-by: Martin Sivak <msivak(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/60513
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/vmTests.py
M vdsm/virt/vm.py
2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/63478/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 6d38f46..7965317 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -864,7 +864,7 @@
u'totalBytes': 9999
}}
]
- self.assertEqual(tunables['ioTunePolicy'], expected)
+ self.assertEqual(tunables['ioTunePolicyList'], expected)
def testSetIoTune(self):
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 7fdcacf..8456f9e 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2738,12 +2738,12 @@
qos = self._getVmPolicy()
ioTuneList = qos.getElementsByTagName("ioTune")
if not ioTuneList or not ioTuneList[0].hasChildNodes():
- return response.success(ioTunePolicy=[])
+ return response.success(ioTunePolicyList=[])
for device in ioTuneList[0].getElementsByTagName("device"):
tunables.append(io_tune_dom_to_values(device))
- return response.success(ioTunePolicy=tunables)
+ return response.success(ioTunePolicyList=tunables)
def getIoTune(self):
resultList = []
@@ -2776,7 +2776,7 @@
else:
return response.error('updateIoTuneErr', e.message)
- return response.success(ioTune=resultList)
+ return response.success(ioTuneList=resultList)
def setIoTune(self, tunables):
for io_tune_change in tunables:
--
To view, visit https://gerrit.ovirt.org/63478
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4eaac318db3d76743b1ff83f47268d0fc1c2dad7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
7 years, 6 months
Change in vdsm[ovirt-4.0]: gluster: set selinux labels while creating bricks
by Ramesh Nachimuthu
Hello Piotr Kliczewski, Yaniv Bronhaim, Dan Kenigsberg, Francesco Romani, Sahina Bose,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/64296
to review the following change.
Change subject: gluster: set selinux labels while creating bricks
......................................................................
gluster: set selinux labels while creating bricks
brick should have correct selinux labels on the brick mount
points. But it missing in the createBrick vdsm verb.
This patch sets the correct selinux lables on brick mount
point using 'restorecon' and 'semanage' commands
Change-Id: I1ca5fec80831073643635875095b88c1c4c2132e
Bug-Url: https://bugzilla.redhat.com/1368474
Signed-off-by: Ramesh Nachimuthu <rnachimu(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/62773
Continuous-Integration: Jenkins CI
Reviewed-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Reviewed-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Reviewed-by: Sahina Bose <sabose(a)redhat.com>
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/gluster/exception.py
M vdsm/gluster/storagedev.py
2 files changed, 40 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/64296/1
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index 1e1b961..369d6dd 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -477,6 +477,28 @@
message = "vgscan failed"
+class GlusterHostFailedToSetSelinuxContext(GlusterHostException):
+ code = 4420
+
+ def __init__(self, brickMountPoint=None, rc=0, out=(), err=()):
+ self.rc = rc
+ self.out = out
+ self.err = err
+ self.message = "Failed to set selinux context on the brick : %s" \
+ % brickMountPoint
+
+
+class GlusterHostFailedToRunRestorecon(GlusterHostException):
+ code = 4421
+
+ def __init__(self, brickMountPoint=None, rc=0, out=(), err=()):
+ self.rc = rc
+ self.out = out
+ self.err = err
+ self.message = "Failed to run restorecon on the brick : %s" \
+ % brickMountPoint
+
+
# Hook
class GlusterHookException(GlusterException):
code = 4500
diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index ca1ee01..43f8c5f 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -21,6 +21,7 @@
import errno
import logging
import os
+import selinux
import blivet
import blivet.formats
@@ -54,6 +55,9 @@
_vgscanCommandPath = utils.CommandPath("vgscan",
"/sbin/vgscan",
"/usr/sbin/vgscan",)
+_semanageCommandPath = utils.CommandPath("semanage",
+ "/sbin/semanage",
+ "/usr/sbin/semanage",)
# All size are in MiB unless otherwise specified
DEFAULT_CHUNK_SIZE_KB = 256
@@ -313,4 +317,18 @@
raise ge.GlusterHostStorageDeviceVGScanFailedException(rc, out, err)
fstab.FsTab().add(thinlv.path, mountPoint,
DEFAULT_FS_TYPE, mntOpts=[DEFAULT_MOUNT_OPTIONS])
+
+ # If selinux is enabled, set correct selinux labels on the brick.
+ if selinux.is_selinux_enabled():
+ rc, out, err = commands.execCmd([_semanageCommandPath.cmd,
+ 'fcontext', '-a', '-t',
+ 'glusterd_brick_t', mountPoint])
+ if rc:
+ raise ge.GlusterHostFailedToSetSelinuxContext(mountPoint, rc,
+ out, err)
+ try:
+ selinux.restorecon(mountPoint, recursive=True)
+ except OSError as e:
+ errMsg = "[Errno %s] %s: '%s'" % (e.errno, e.strerror, e.filename)
+ raise ge.GlusterHostFailedToRunRestorecon(mountPoint, err=errMsg)
return _getDeviceDict(thinlv)
--
To view, visit https://gerrit.ovirt.org/64296
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ca5fec80831073643635875095b88c1c4c2132e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Ramesh N <rnachimu(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Sahina Bose <sabose(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 6 months
Change in vdsm[ovirt-4.0]: Live Merge: Remove volume run link after live merge
by ahino@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>
7 years, 6 months
Change in vdsm[ovirt-4.0]: Live Merge: Teardown volume on HSM after live merge
by ahino@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>
7 years, 6 months
Change in vdsm[master]: tests: Use same log format as vdsm
by Nir Soffer
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>
7 years, 6 months
Change in vdsm[master]: log: Nicer logging format
by Nir Soffer
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>
7 years, 6 months
Change in vdsm[master]: Revert "build tests: Require NOSE 1.3.7 and up for running t...
by edwardh@redhat.com
Edward Haas has uploaded a new change for review.
Change subject: Revert "build tests: Require NOSE 1.3.7 and up for running tests"
......................................................................
Revert "build tests: Require NOSE 1.3.7 and up for running tests"
NOSE is used during the VDSM build ('make rpm') where builders do not
use pip, just rpms provided by the standard repos.
Therefore, enforcing the nose version of 1.3.7 is not possible until it
is updated in the repos of centos7/rhel7.
This reverts commit 4e729ddd2b243d0953e2de5d31c42fc59859bf23.
Change-Id: I175c0752a5929d1b644cd41cf8d111bcce10f32d
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M Makefile.am
1 file changed, 1 insertion(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/64035/1
diff --git a/Makefile.am b/Makefile.am
index 51fe2a5..aefd2b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -132,12 +132,7 @@
.PHONY: tests
tests:
- @version=`nosetests --version | cut -d' ' -f3`; \
- if build-aux/vercmp $$version "1.3.7"; then \
- echo "Error: NOSE is too old, please install NOSE 1.3.7 or later"; \
- exit 1; \
- fi
- @$(MAKE) -C tests/ check
+ $(MAKE) -C tests/ check
all-local: \
vdsm.spec
--
To view, visit https://gerrit.ovirt.org/64035
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I175c0752a5929d1b644cd41cf8d111bcce10f32d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
7 years, 6 months
Change in vdsm[master]: py3: make network/conf_test pass
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: py3: make network/conf_test pass
......................................................................
py3: make network/conf_test pass
re.sub should not mix strings and byte arrays.
Change-Id: Idcab2d6f1f88b04d849156915a111189c4cc8589
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/Makefile.am
M tests/network/conf_test.py
2 files changed, 2 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/28/64928/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 132be62..fb3d7c3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -191,7 +191,6 @@
momTests.py \
monkeypatchTests.py \
mountTests.py \
- network/conf_test.py \
network/hook_ovs_test.py \
network/iproute2_test.py \
network/ipwrapper_test.py \
diff --git a/tests/network/conf_test.py b/tests/network/conf_test.py
index d94b5e6..c230a3c 100644
--- a/tests/network/conf_test.py
+++ b/tests/network/conf_test.py
@@ -73,8 +73,8 @@
aXml = ET.tostring(ET.fromstring(a))
bXml = ET.tostring(ET.fromstring(b))
- aXmlNrml = re.sub('>\s*\n\s*<', '><', aXml).strip()
- bXmlNrml = re.sub('>\s*\n\s*<', '><', bXml).strip()
+ aXmlNrml = re.sub(b'>\s*\n\s*<', b'><', aXml).strip()
+ bXmlNrml = re.sub(b'>\s*\n\s*<', b'><', bXml).strip()
self.assertEqual(aXmlNrml, bXmlNrml, msg)
--
To view, visit https://gerrit.ovirt.org/64928
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcab2d6f1f88b04d849156915a111189c4cc8589
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
7 years, 7 months