Change in vdsm[master]: gluster: rename glusterCreateBrick to glusterBrickCreate
by barumuga@redhat.com
Hello Piotr Kliczewski, Timothy Asir, Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/42308
to review the following change.
Change subject: gluster: rename glusterCreateBrick to glusterBrickCreate
......................................................................
gluster: rename glusterCreateBrick to glusterBrickCreate
To make consistency in function names in supervdsm and verb names in
vdsm, this patch renames verb glusterCreateBrick to glusterBrickCreate
Change-Id: I367a864bc9bf4aa9b6a0d36b64f541fa89c61c0d
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M client/vdsClientGluster.py
M vdsm/gluster/api.py
M vdsm/gluster/apiwrapper.py
M vdsm/gluster/storagedev.py
M vdsm/rpc/vdsmapi-gluster-schema.json
5 files changed, 11 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/42308/1
diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index a4bce63..76b91e1 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -633,7 +633,7 @@
pp.pprint(status)
return status['status']['code'], status['status']['message']
- def do_glusterCreateBrick(self, args):
+ def do_glusterBrickCreate(self, args):
params = self._eqSplit(args)
devList = params.get('devices', '').split(',')
brickName = params.get('brickName', '')
@@ -646,7 +646,7 @@
raidParams['stripeSize'] = int(params.get('stripeSize', 0))
raidParams['pdCount'] = int(params.get('pdCount', 0))
- status = self.s.glusterCreateBrick(brickName, mountPoint,
+ status = self.s.glusterBrickCreate(brickName, mountPoint,
devList, fsType, raidParams)
pp.pprint(status)
return status['status']['code'], status['status']['message']
@@ -1172,8 +1172,8 @@
('[volumeName=<volume_name>]',
'snapshot list for given volume'
)),
- 'glusterCreateBrick': (
- serv.do_glusterCreateBrick,
+ 'glusterBrickCreate': (
+ serv.do_glusterBrickCreate,
('brickName=<brick_name> mountPoint=<mountPoint> '
'devices=<device[,device, ...]> '
'[raidType=<raid_type>] [stripeSize=<stripe_size>] '
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 24b8230..918c3cc 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -672,9 +672,9 @@
return {'snapshotList': status}
@exportAsVerb
- def createBrick(self, name, mountPoint, devList, fsType=None,
+ def brickCreate(self, name, mountPoint, devList, fsType=None,
raidParams={}, options=None):
- status = self.svdsmProxy.glusterCreateBrick(name,
+ status = self.svdsmProxy.glusterBrickCreate(name,
mountPoint,
devList,
fsType,
diff --git a/vdsm/gluster/apiwrapper.py b/vdsm/gluster/apiwrapper.py
index 4768a86..f607dd4 100644
--- a/vdsm/gluster/apiwrapper.py
+++ b/vdsm/gluster/apiwrapper.py
@@ -81,9 +81,9 @@
def storageDevicesList(self, options=None):
return self._gluster.storageDevicesList()
- def createBrick(self, name, mountPoint, devList, fsType=None,
+ def brickCreate(self, name, mountPoint, devList, fsType=None,
raidParams={}):
- return self._gluster.createBrick(name, mountPoint,
+ return self._gluster.brickCreate(name, mountPoint,
devList, fsType, raidParams)
diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index 2aeabad..f4178e9 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -123,7 +123,7 @@
@makePublic
-def createBrick(brickName, mountPoint, devNameList, fsType=DEFAULT_FS_TYPE,
+def brickCreate(brickName, mountPoint, devNameList, fsType=DEFAULT_FS_TYPE,
raidParams={}):
def _getDeviceList(devNameList):
return [blivetEnv.devicetree.getDeviceByName(devName.split("/")[-1])
diff --git a/vdsm/rpc/vdsmapi-gluster-schema.json b/vdsm/rpc/vdsmapi-gluster-schema.json
index c86f43c..209bfbd 100644
--- a/vdsm/rpc/vdsmapi-gluster-schema.json
+++ b/vdsm/rpc/vdsmapi-gluster-schema.json
@@ -1274,7 +1274,7 @@
'data': {'type': 'str', 'stripeSize': 'int', 'diskCnt': 'int'}}
##
-# @GlusterHost.createBrick:
+# @GlusterHost.brickCreate:
#
# Create a brick for the gluster volume
#
@@ -1293,7 +1293,7 @@
#
# Since: 4.17.0
##
-{'command': {'class': 'GlusterHost', 'name': 'createBrick'},
+{'command': {'class': 'GlusterHost', 'name': 'brickCreate'},
'data': {'name': 'str', 'mountPoint': 'str', 'devList': ['str'],
'*fsType': 'str', '*raidParams': 'RaidDevice'},
'returns': 'bool'}
--
To view, visit https://gerrit.ovirt.org/42308
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I367a864bc9bf4aa9b6a0d36b64f541fa89c61c0d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: tests: Add time per test if nose-timer is available
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: tests: Add time per test if nose-timer is available
......................................................................
tests: Add time per test if nose-timer is available
This patch adds an output like:
resourceManagerTests.ResourceManagerTests.testStressTest: 12.8313s
resourceManagerTests.ResourceManagerTests.testResourceAcquireTimeout: 1.0069s
resourceManagerTests.ResourceManagerTests.testResourceLockSwitch: 0.0108s
resourceManagerTests.ResourceManagerTests.testResourceAutorelease: 0.0101s
resourceManagerTests.ResourceManagerTests.testResourceInvalidation: 0.0093s
resourceManagerTests.ResourceManagerTests.testCrashOnSwitch: 0.0067s
resourceManagerTests.ResourceManagerTests.testResourceSwitchLockTypeFail:
0.0062s
resourceManagerTests.ResourceManagerTests.testCancelExclusiveBetweenShared:
0.0049s
resourceManagerTests.ResourceManagerTests.testAcquireResourceExclusive: 0.0042s
resourceManagerTests.ResourceManagerTests.testCancelRequest: 0.0031s
resourceManagerTests.ResourceManagerTests.testRequestRefCmp: 0.0030s
resourceManagerTests.ResourceManagerTests.testRequestRecancel: 0.0030s
resourceManagerTests.ResourceManagerTests.testResourceStatuses: 0.0029s
resourceManagerTests.ResourceManagerTests.testAccessAttributeNotExposedByRequestRef:
0.0029s
resourceManagerTests.ResourceManagerTests.testFailCreateAfterSwitch: 0.0025s
resourceManagerTests.ResourceManagerTests.testRequestWithBadCallbackOnCancel:
0.0025s
resourceManagerTests.ResourceManagerTests.testAcquireResourceShared: 0.0023s
resourceManagerTests.ResourceManagerTests.testRereleaseResource: 0.0022s
resourceManagerTests.ResourceManagerTests.testResourceWrapper: 0.0020s
resourceManagerTests.ResourceManagerTests.testRequestWithBadCallbackOnGrant:
0.0020s
resourceManagerTests.ResourceManagerTests.testRequestRefStr: 0.0020s
resourceManagerTests.ResourceManagerTests.testAccessAttributeNotExposedByWrapper:
0.0019s
resourceManagerTests.ResourceManagerTests.testErrorInFactory: 0.0017s
resourceManagerTests.ResourceManagerTests.testAcquireNonExistingResource:
0.0016s
resourceManagerTests.ResourceManagerTests.testRequestInvalidResource: 0.0015s
resourceManagerTests.ResourceManagerTests.testRequestRegrant: 0.0015s
resourceManagerTests.ResourceManagerTests.testResourceAcquireInvalidTimeout:
0.0014s
resourceManagerTests.ResourceManagerTests.testReleaseInvalidResource: 0.0014s
resourceManagerTests.ResourceManagerTests.testSingleton: 0.0014s
resourceManagerTests.ResourceManagerTests.testForceRegisterNamespace: 0.0013s
resourceManagerTests.ResourceManagerTests.testListNamespaces: 0.0013s
resourceManagerTests.ResourceManagerTests.testReregisterNamespace: 0.0012s
resourceManagerTests.ResourceManagerTests.testRegisterInvalidNamespace: 0.0012s
At the end of the usual tests if nose-timer is detected in the
system. It shows the tests over 500ms in yellow and those over 5s
in red.
If you want to get this output, do:
pip install nose-timer
Change-Id: I4960b30532a84abd259fb268c7e40a1751847a96
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M tests/run_tests_local.sh.in
M tests/testrunner.py
2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/30171/1
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
index d19f22c..f51473d 100644
--- a/tests/run_tests_local.sh.in
+++ b/tests/run_tests_local.sh.in
@@ -7,4 +7,9 @@
@top_srcdir(a)/tests/makecert.sh
fi
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir(a)/tests/testrunner.py --local-modules $@
+python -c 'import nosetimer' > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ EXTRA_ARGS='--with-timer'
+fi
+
+PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir(a)/tests/testrunner.py --local-modules $@ "$EXTRA_ARGS"
diff --git a/tests/testrunner.py b/tests/testrunner.py
index eed743f..ec24c2b 100644
--- a/tests/testrunner.py
+++ b/tests/testrunner.py
@@ -40,6 +40,16 @@
from nose import config
from nose import core
from nose import result
+try:
+ from nosetimer.plugin import TimerPlugin
+except ImportError:
+ timer_plugin = None
+else:
+ timer_plugin = TimerPlugin()
+ timer_plugin.enabled = True
+ timer_plugin.timer_ok = 500 # Okay <= 500ms
+ timer_plugin.timer_warning = 5000 # Warn > 5s
+ timer_plugin.timer_no_color = False # Enable color output
from testValidation import SlowTestsPlugin, StressTestsPlugin
@@ -378,6 +388,8 @@
plugins=core.DefaultPluginManager())
conf.plugins.addPlugin(SlowTestsPlugin())
conf.plugins.addPlugin(StressTestsPlugin())
+ if timer_plugin is not None:
+ conf.plugins.addPlugin(timer_plugin)
runner = VdsmTestRunner(stream=conf.stream,
verbosity=conf.verbosity,
--
To view, visit http://gerrit.ovirt.org/30171
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4960b30532a84abd259fb268c7e40a1751847a96
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: ImageManifest: create_image_dir
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: ImageManifest: create_image_dir
......................................................................
ImageManifest: create_image_dir
Change-Id: I94a8cfdd9fb1f3c3fd4e4e2ab409bfd287829351
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M tests/image_manifest_tests.py
M vdsm/storage/image.py
2 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/43557/1
diff --git a/tests/image_manifest_tests.py b/tests/image_manifest_tests.py
index a2ac1c0..a27eabd 100644
--- a/tests/image_manifest_tests.py
+++ b/tests/image_manifest_tests.py
@@ -23,6 +23,7 @@
from testlib import VdsmTestCase, namedTemporaryDir
from storage import sd, image
+from storage.sdm import sdm_verb
class ImageManifestTests(VdsmTestCase):
@@ -33,3 +34,14 @@
manifest = image.ImageManifest(tmpdir)
expected = os.path.join(tmpdir, sduuid, sd.DOMAIN_IMAGES, imguuid)
self.assertEquals(expected, manifest.getImageDir(sduuid, imguuid))
+
+ @sdm_verb
+ def test_create_image_dir(self):
+ with namedTemporaryDir() as tmpdir:
+ sduuid = str(uuid.uuid4())
+ imguuid = str(uuid.uuid4())
+ manifest = image.ImageManifest(tmpdir)
+ os.makedirs(os.path.join(tmpdir, sduuid, sd.DOMAIN_IMAGES))
+ manifest.create_image_dir(sduuid, imguuid)
+ self.assertTrue(os.path.exists(manifest.getImageDir(sduuid,
+ imguuid)))
\ No newline at end of file
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 81b2043..5f87921 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -38,6 +38,7 @@
from threadLocal import vars
import resourceFactories
import resourceManager as rm
+from sdm import require_sdm
log = logging.getLogger('Storage.Image')
rmanager = rm.ResourceManager.getInstance()
@@ -97,6 +98,13 @@
"""
return os.path.join(self.repoPath, sdUUID, sd.DOMAIN_IMAGES, imgUUID)
+ @require_sdm
+ def create_image_dir(self, sd_id, img_id):
+ img_dir = self.getImageDir(sd_id, img_id)
+ if not os.path.isdir(img_dir):
+ log.info("Create placeholder %s for image's volumes", img_dir)
+ os.mkdir(img_dir)
+ return img_dir
class Image:
""" Actually represents a whole virtual disk.
--
To view, visit https://gerrit.ovirt.org/43557
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94a8cfdd9fb1f3c3fd4e4e2ab409bfd287829351
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: tests: Add a live merge functional test
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: tests: Add a live merge functional test
......................................................................
tests: Add a live merge functional test
Test whether we can successfully merge the active layer. Uses lots of
the functional test infrastructure! Only runs if vdsm says it can
support live merge.
Change-Id: Idd5a2f7eedaef9e90981256de66fc3ed21658e89
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M tests/functional/utils.py
M tests/functional/virtTests.py
2 files changed, 185 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/29824/1
diff --git a/tests/functional/utils.py b/tests/functional/utils.py
index 494be98..e3cdba6 100644
--- a/tests/functional/utils.py
+++ b/tests/functional/utils.py
@@ -228,3 +228,41 @@
def updateVmPolicy(self, vmId, vcpuLimit):
result = self.vdscli.updateVmPolicy([vmId, vcpuLimit])
return result['status']['code'], result['status']['message']
+
+ def getTaskStatus(self, taskId):
+ result = self.vdscli.getTaskStatus(taskId)
+ return result['status']['code'], result['status']['message'],\
+ result['taskStatus']
+
+ def getVolumeInfo(self, sdId, spId, imgId, volId):
+ result = self.vdscli.getVolumeInfo(sdId, spId, imgId, volId)
+ return result['status']['code'], result['status']['message'],\
+ result['info']
+
+ def createVolume(self, sdId, spId, imgId, size, volFormat, preallocate,
+ diskType, volId, desc, baseImgId, baseVolId):
+ result = self.vdscli.createVolume(sdId, spId, imgId, size, volFormat,
+ preallocate, diskType, volId, desc,
+ baseImgId, baseVolId)
+ return result['status']['code'], result['status']['message'],\
+ result['uuid']
+
+ def deleteVolume(self, sdId, spId, imgId, volIds, postZero=False,
+ force=False):
+ result = self.vdscli.deleteVolume(sdId, spId, imgId, volIds, postZero,
+ force)
+ return result['status']['code'], result['status']['message'],\
+ result['uuid']
+
+ def snapshot(self, vmId, snapDrives, snapMemVolHandle=''):
+ result = self.vdscli.snapshot(vmId, snapDrives, snapMemVolHandle)
+ return result['status']['code'], result['status']['message']
+
+ def merge(self, vmId, drive, base, top, bandwidth, jobId):
+ result = self.vdscli.merge(vmId, drive, base, top, bandwidth, jobId)
+ return result['status']['code'], result['status']['message']
+
+ def list(self, fullStatus=False, vmList=()):
+ result = self.vdscli.list(fullStatus, vmList)
+ return result['status']['code'], result['status']['message'], \
+ result['vmList']
diff --git a/tests/functional/virtTests.py b/tests/functional/virtTests.py
index 94ce240..b811b92 100644
--- a/tests/functional/virtTests.py
+++ b/tests/functional/virtTests.py
@@ -22,6 +22,7 @@
import math
import tempfile
import logging
+import uuid
from stat import S_IROTH
from functools import partial, wraps
@@ -32,7 +33,8 @@
from testrunner import temporaryPath
from vdsm.utils import CommandPath, RollbackContext
-import storageTests as storage
+import storageTests
+import storage
from storage.misc import execCmd
from utils import VdsProxy, SUCCESS
@@ -109,6 +111,18 @@
return method(self, *args, **kwargs)
else:
raise SkipTest('KVM is not enabled')
+ return wrapped
+
+
+def requireLiveMerge(method):
+ @wraps(method)
+ def wrapped(self, *args, **kwargs):
+ status, msg, result = self.vdsm.getVdsCapabilities()
+ self.assertEqual(status, SUCCESS, msg)
+ if result.get('liveMerge') == 'true':
+ return method(self, *args, **kwargs)
+ else:
+ raise SkipTest('Live Merge is not available')
return wrapped
@@ -227,9 +241,9 @@
@requireKVM
@permutations([['localfs'], ['iscsi'], ['nfs']])
def testVmWithStorage(self, backendType):
- disk = storage.StorageTest()
+ disk = storageTests.StorageTest()
disk.setUp()
- conf = storage.storageLayouts[backendType]
+ conf = storageTests.storageLayouts[backendType]
drives = disk.generateDriveConf(conf)
customization = {'vmId': '88888888-eeee-ffff-aaaa-111111111111',
'vmName': 'testVmWithStorage' + backendType,
@@ -247,8 +261,8 @@
def testVmWithDevice(self, *devices):
customization = {'vmId': '77777777-ffff-3333-bbbb-222222222222',
'vmName': 'testVm', 'devices': [], 'display': 'vnc'}
- storageLayout = storage.storageLayouts['localfs']
- diskSpecs = storage.StorageTest.generateDriveConf(storageLayout)
+ storageLayout = storageTests.storageLayouts['localfs']
+ diskSpecs = storageTests.StorageTest.generateDriveConf(storageLayout)
pciSpecs = {'bus': '0x00', 'domain': '0x0000',
'function': '0x0', 'type': 'pci'}
ccidSpecs = {'slot': '0', 'controller': '0', 'type': 'ccid'}
@@ -412,3 +426,131 @@
self.vdsm.updateVmPolicy(customization['vmId'],
'50')
self.assertEqual(status, SUCCESS, msg)
+
+
+@expandPermutations
+class LiveMergeTest(VirtTestBase):
+ def _waitTask(self, taskId):
+ def assertTaskOK():
+ status, msg, result = self.vdsm.getTaskStatus(taskId)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertEquals(result['taskState'], 'finished')
+
+ self.retryAssert(assertTaskOK, timeout=60)
+
+ def _waitBlockJobs(self, vmId, jobIds):
+ def assertJobsGone():
+ status, msg, result = self.vdsm.getVmStats(vmId)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertTrue('vmJobs' in result)
+ self.assertTrue(all([x not in result['vmJobs'].keys()
+ for x in jobIds]))
+
+ self.retryAssert(assertJobsGone, timeout=60)
+
+ def _snapshotVM(self, vmId, drives, rollback):
+ snapDrives = []
+ for drive in drives:
+ sd = drive['domainID']
+ sp = drive['poolID']
+ img = drive['imageID']
+ vol = drive['volumeID']
+ newVol = str(uuid.uuid4())
+ volFormat = storage.volume.COW_FORMAT
+ preallocate = storage.volume.SPARSE_VOL
+ desc = 'snapshot for %s' % vol
+
+ # Create volume and wait
+ status, msg, result = self.vdsm.getVolumeInfo(sd, sp, img, vol)
+ self.assertEqual(status, SUCCESS, msg)
+ size = result['capacity']
+ diskType = result['disktype']
+
+ status, msg, taskId = self.vdsm.createVolume(sd, sp, img, size,
+ volFormat,
+ preallocate, diskType,
+ newVol, desc, img,
+ vol)
+ self.assertEqual(status, SUCCESS, msg)
+ self._waitTask(taskId)
+ undo = lambda sd=sd, sp=sp, img=img, vol=newVol: \
+ self._waitTask(self.vdsm.deleteVolume(sd, sp, img, vol)[2])
+ rollback.prependDefer(undo)
+
+ snapDrives.append({'domainID': sd,
+ 'imageID': img,
+ 'volumeID': newVol,
+ 'baseVolumeID': vol})
+
+ # Create snapshot
+ status, msg = self.vdsm.snapshot(vmId, snapDrives)
+ self.assertEqual(status, SUCCESS, msg)
+ return snapDrives
+
+ def _orderChain(self, vmId, dev, chain):
+ parentMap = {}
+ for vol in chain:
+ status, msg, info = self.vdsm.getVolumeInfo(dev['domainID'],
+ dev['poolID'],
+ dev['imageID'], vol)
+ self.assertEqual(status, SUCCESS, msg)
+ parent = info['parent']
+ parentMap[vol] = parent
+
+ vol = dev['volumeID']
+ chain = list()
+ while True:
+ chain.insert(0, vol)
+ vol = parentMap.get(vol, '00000000-0000-0000-0000-000000000000')
+ if vol == '00000000-0000-0000-0000-000000000000':
+ break
+ return chain
+
+ def _getVolumeChains(self, vmId):
+ chains = {}
+ status, msg, result = self.vdsm.list(True, (vmId,))
+ self.assertEqual(status, SUCCESS, msg)
+ vmDef = result[0]
+ for dev in vmDef['devices']:
+ if dev['device'] != 'disk':
+ continue
+ chains[dev['imageID']] = self._orderChain(vmId, dev,
+ [x['volumeID'] for x in
+ dev['volumeChain']])
+ return chains
+
+ @requireKVM
+ @requireLiveMerge
+ def testCapable(self):
+ pass
+
+ @permutations([['localfs']])
+ def testMergeActiveLayer(self, backendType):
+ disk = storageTests.StorageTest()
+ disk.setUp()
+ conf = storageTests.storageLayouts[backendType]
+ drives = disk.generateDriveConf(conf)
+ vmId = '12121212-abab-baba-abab-222222222222'
+ customization = {'vmId': vmId,
+ 'vmName': 'testMergeActive' + backendType,
+ 'drives': drives,
+ 'display': 'vnc'}
+
+ with RollbackContext() as rollback:
+ disk.createVdsmStorageLayout(conf, 3, rollback)
+ with RunningVm(self.vdsm, customization) as vm:
+ self._waitForStartup(vm, VM_MINIMAL_UPTIME)
+ snapDrives = self._snapshotVM(vmId, drives, rollback)
+ chains = {}
+ jobIds = []
+ for drive in snapDrives:
+ base = drive['baseVolumeID']
+ top = drive['volumeID']
+ jobId = str(uuid.uuid4())
+ chains[drive['imageID']] = [base, top]
+ status, msg = self.vdsm.merge(vmId, drive, base, top, 0,
+ jobId)
+ jobIds.append(jobId)
+ self._waitBlockJobs(vmId, jobIds)
+ actual = self._getVolumeChains(vmId)
+ self.assertEquals(chains, actual)
--
To view, visit http://gerrit.ovirt.org/29824
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd5a2f7eedaef9e90981256de66fc3ed21658e89
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: vm: Support for non-ascii vm name
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: vm: Support for non-ascii vm name
......................................................................
vm: Support for non-ascii vm name
Libvirt does not support non-ascii vm name, failing creation of such vm.
Use generated vm name based on vm id, used when vm name is not provided.
For easier debugging, we log he non-ascii name when starting a vm:
Non-ASCII vm name 'מכונה-ויראטואלית'
And also the generaed name (same when vm name is not provided):
Using generated vm name 'nb938182d-7f19-435b-9499-4cb8f1578e1b'
Note: this change may break engine side, if it expects the original vm
name in vdsm response. Fixing this on the engine side will avoid this
issue and may be better idea.
Tested with both jsonrpc and xmlrpc:
- Creating vm with non-ascii name
- Staring vm
- Opening spice console
- Stopping vm
- Restarting vdsm while vm is running
- Migrating to another host (broken with jsonrpc see bz1282054)
Change-Id: I2386c0f98aeb8161feaf19c2862be229f73eb0df
Bug-Url: https://bugzilla.redhat.com/1260131
Relates-To: https://bugzilla.redhat.com/1062943
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/48570/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index f9bc25c..a6d2bc8 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -299,8 +299,7 @@
self._devices = self._emptyDevMap()
self._connection = libvirtconnection.get(cif)
- if 'vmName' not in self.conf:
- self.conf['vmName'] = 'n%s' % self.id
+ self.conf['vmName'] = self._normalizedVmName(params)
self._guestSocketFile = self._makeChannelPath(_VMCHANNEL_DEVICE_NAME)
self._qemuguestSocketFile = self._makeChannelPath(_QEMU_GA_DEVICE_NAME)
self.guestAgent = guestagent.GuestAgent(
@@ -380,6 +379,22 @@
break
return str(idx)
+ def _normalizedVmName(self, params):
+ name = params.get('vmName')
+ if isinstance(name, unicode):
+ # Libvirt does not support non-ascii vm name
+ # See https://bugzilla.redhat.com/1260131
+ try:
+ name = name.encode('ascii')
+ except UnicodeEncodeError:
+ self.log.debug("Non-ASCII vm name '%s'", name.encode('utf8'))
+ name = None
+ if name is None:
+ # Missing or non-ascii name
+ name = 'n' + params['vmId']
+ self.log.debug("Using generated vm name %r", name)
+ return name
+
def _normalizeVdsmImg(self, drv):
drv['reqsize'] = drv.get('reqsize', '0') # Backward compatible
if 'device' not in drv:
--
To view, visit https://gerrit.ovirt.org/48570
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2386c0f98aeb8161feaf19c2862be229f73eb0df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: automation: Enable xunit report
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: automation: Enable xunit report
......................................................................
automation: Enable xunit report
This used to segfault python in the past, but I think I fixed the root
cause long time ago.
Trying to use this again since it seems to give interesting output
like the time it took to run each test.
Change-Id: Ie8c09cf21e7cf4a97b7b006f2b3ebe4943ed72b9
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M automation/check-patch.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/46640/1
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
index 15707e8..1dba426 100755
--- a/automation/check-patch.sh
+++ b/automation/check-patch.sh
@@ -14,7 +14,7 @@
"
./autogen.sh --system --enable-hooks
-make check
+make check NOSE_WITH_XUNIT=1
./automation/build-artifacts.sh
--
To view, visit https://gerrit.ovirt.org/46640
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8c09cf21e7cf4a97b7b006f2b3ebe4943ed72b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: fileSD: Keep deleted images name unique
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: fileSD: Keep deleted images name unique
......................................................................
fileSD: Keep deleted images name unique
If an image delete fails, and same image is created again, the second
image cannot be deleted, since the first image occupy the deleted image
name.
We use now _remove_me_<imagid>_<taskid>. This make it easy to locate the
failed operation in vdsm or engine logs.
Change-Id: Ia0582896d7ede028e9096da1a688e3e449ab0258
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/fileSD.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/48032/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index dc4a68e..7d8074a 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -34,6 +34,7 @@
import outOfProcess as oop
from remoteFileHandler import Timeout
from persistentDict import PersistentDict, DictValidator
+from threadLocal import vars
from vdsm import constants
from vdsm.utils import stripNewLines
from vdsm import supervdsm
@@ -204,7 +205,8 @@
def deleteImage(self, sdUUID, imgUUID, volsImgs):
currImgDir = self.getImagePath(imgUUID)
dirName, baseName = os.path.split(currImgDir)
- toDelDir = os.path.join(dirName, sd.REMOVED_IMAGE_PREFIX + baseName)
+ newName = "%s%s_%s" % (sd.REMOVED_IMAGE_PREFIX, baseName, vars.task.id)
+ toDelDir = os.path.join(dirName, newName)
self.log.debug("Renaming dir %s to %s", currImgDir, toDelDir)
try:
self.oop.os.rename(currImgDir, toDelDir)
--
To view, visit https://gerrit.ovirt.org/48032
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0582896d7ede028e9096da1a688e3e449ab0258
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: ipv6 hook: support ipv6addrs
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: ipv6 hook: support ipv6addrs
......................................................................
ipv6 hook: support ipv6addrs
Change-Id: I722d0007840060cdccdb12e4fba2a2066f33c62f
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M vdsm_hooks/ipv6/README
M vdsm_hooks/ipv6/ipv6.py
2 files changed, 12 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/39359/1
diff --git a/vdsm_hooks/ipv6/README b/vdsm_hooks/ipv6/README
index 05bd990..a96e2c2 100644
--- a/vdsm_hooks/ipv6/README
+++ b/vdsm_hooks/ipv6/README
@@ -5,13 +5,18 @@
Requirements:
* oVirt-3.5 (started supporting custom properties)
+New in version 4.18: (?)
+--------------------
+Multiple IPv6 addresses are now accepted, see Usage. Please use 'ipv6addrs'
+property instead of 'ipv6addr' which is deprecated.
+
Preparation on a host:
----------------------
yum install vdsm-hook-ipv6
Preparation on the engine side:
-------------------------------
-PROPERTIES='ipv6addr=.*;ipv6gateway=.*;ipv6autoconf=.*;dhcpv6=.*'
+PROPERTIES='ipv6addrs=.*;ipv6gateway=.*;ipv6autoconf=.*;dhcpv6=.*'
engine-config -s "UserDefinedNetworkCustomProperties=$PROPERTIES" --cver='3.5'
Don't forget to include the names of other custom network properties you may
@@ -20,9 +25,10 @@
Usage:
------
In the oVirt UI open the 'Setup Host Networks' dialog. Proceed to editing
-a desired logical network's properties. Among them you will find 'ipv6addr'
-and 'ipv6gateway', which accept custom IPv6 addresses, plus 'ipv6autoconf'
-and 'dhcpv6', which accept '0', '1' or 'false', 'true'.
+a desired logical network's properties. Among them you will find 'ipv6addrs'
+(which accepts a space-separated list of IPv6 addresses), 'ipv6gateway'
+(a single address), plus 'ipv6autoconf' and 'dhcpv6', which accept '0', '1' or
+'false', 'true'.
You may be warned that the network is in use when confirming the 'Setup Host
Networks' dialog. Make sure to stop any VMs that are using the network.
diff --git a/vdsm_hooks/ipv6/ipv6.py b/vdsm_hooks/ipv6/ipv6.py
index 6c00475..9385fab 100644
--- a/vdsm_hooks/ipv6/ipv6.py
+++ b/vdsm_hooks/ipv6/ipv6.py
@@ -34,7 +34,8 @@
def _process_network(attrs):
- for property_name in ('ipv6addr', 'ipv6gateway', 'ipv6autoconf', 'dhcpv6'):
+ for property_name in ('ipv6addrs', 'ipv6addr', 'ipv6gateway',
+ 'ipv6autoconf', 'dhcpv6'):
value = attrs['custom'].get(property_name)
if value is not None:
attrs[property_name] = value
--
To view, visit https://gerrit.ovirt.org/39359
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I722d0007840060cdccdb12e4fba2a2066f33c62f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: sourceroute: split gathering of routes and rules off configu...
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: sourceroute: split gathering of routes and rules off configure() and remove()
......................................................................
sourceroute: split gathering of routes and rules off configure() and remove()
The code is too complex (for me) to understand. I want to remove the use of
network configurators from the module because they actually call sourceroute
classes' methods only to be called back:
Ifcfg.configureNic, Configurator._addSourceRoute, StaticSourceRoute.configure,
Ifcfg.configureSourceRoute
Ifcfg.removeNic, Ifcfg._ifaceDownAndCleanup, Configurator._removeSourceRoute,
StaticSourceRoute.remove (or DynamicSourceRoute), Ifcfg.removeSourceRoute
Change-Id: I69d8949afbd5b8ba2cf14930533cda99a4580eb0
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M vdsm/network/sourceroute.py
1 file changed, 30 insertions(+), 22 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/41593/1
diff --git a/vdsm/network/sourceroute.py b/vdsm/network/sourceroute.py
index 5f06de0..d7916ed 100644
--- a/vdsm/network/sourceroute.py
+++ b/vdsm/network/sourceroute.py
@@ -25,11 +25,7 @@
from vdsm import netinfo
from vdsm.constants import P_VDSM_RUN
-from vdsm.ipwrapper import IPRoute2Error
-from vdsm.ipwrapper import Route
-from vdsm.ipwrapper import routeShowTable
-from vdsm.ipwrapper import Rule
-from vdsm.ipwrapper import ruleList
+from vdsm.ipwrapper import IPRoute2Error, Route, routeShowTable, Rule, ruleList
from vdsm.utils import rmFile
@@ -67,23 +63,32 @@
Rule(destination=self._network, table=self._table,
srcDevice=self.device)]
- def configure(self):
+ def _prepare_configuration(self):
logging.info(("Configuring gateway - ip: %s, network: %s, " +
"subnet: %s, gateway: %s, table: %s, device: %s") %
(self._ipaddr, self._network, self._mask, self._gateway,
self._table, self.device))
- routes = self._buildRoutes()
- rules = self._buildRules()
+ self.routes = self._buildRoutes()
+ self.rules = self._buildRules()
+ def configure(self):
+ self._prepare_configuration()
try:
- self._configurator.configureSourceRoute(routes, rules, self.device)
+ self._configurator.configureSourceRoute(self.routes, self.rules,
+ self.device)
except IPRoute2Error as e:
logging.error('ip binary failed during source route configuration'
': %s', e.message)
+ def _prepare_removal(self):
+ self.routes = None
+ self.rules = None
+
def remove(self):
- self._configurator.removeSourceRoute(None, None, self.device)
+ self._prepare_removal()
+ self._configurator.removeSourceRoute(self.routes, self.rules,
+ self.device)
class DynamicSourceRoute(StaticSourceRoute):
@@ -157,20 +162,23 @@
return rules
+ def _prepare_removal(self):
+ self.rules = self._getRules(self.device)
+ if self.rules:
+ self.table = self._getTable(self.rules)
+ if self.table:
+ self.routes = self._getRoutes(self.table)
+
def remove(self):
logging.info("Removing gateway - device: %s", self.device)
-
- rules = self._getRules(self.device)
- if rules:
- table = self._getTable(rules)
- if table:
- try:
- self._configurator.removeSourceRoute(
- self._getRoutes(table), rules,
- self.device)
- except IPRoute2Error as e:
- logging.error('ip binary failed during source route '
- 'removal: %s' % e.message)
+ self._prepare_removal()
+ if self.rules and self.table:
+ try:
+ self._configurator.removeSourceRoute(
+ self.routes, self.rules, self.device)
+ except IPRoute2Error as e:
+ logging.error('ip binary failed during source route '
+ 'removal: %s' % e.message)
@staticmethod
def _isLibvirtInterfaceFallback(device):
--
To view, visit https://gerrit.ovirt.org/41593
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I69d8949afbd5b8ba2cf14930533cda99a4580eb0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
7 years, 11 months
Change in vdsm[master]: sourceroute: move exception handling to the respective confi...
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: sourceroute: move exception handling to the respective configurator
......................................................................
sourceroute: move exception handling to the respective configurator
Change-Id: I579b1789522eaed025d1c059bcf7a900e499ef32
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M vdsm/network/configurators/iproute2.py
M vdsm/network/sourceroute.py
2 files changed, 16 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/41594/1
diff --git a/vdsm/network/configurators/iproute2.py b/vdsm/network/configurators/iproute2.py
index c260bfe..bec32f7 100644
--- a/vdsm/network/configurators/iproute2.py
+++ b/vdsm/network/configurators/iproute2.py
@@ -201,17 +201,22 @@
@staticmethod
def configureSourceRoute(routes, rules, device):
- for route in routes:
- routeAdd(route)
-
- for rule in rules:
- ruleAdd(rule)
+ try:
+ for route in routes:
+ routeAdd(route)
+ for rule in rules:
+ ruleAdd(rule)
+ except IPRoute2Error as e:
+ logging.error('Source route configuration failed: %s', e.message)
@staticmethod
def removeSourceRoute(routes, rules, device):
# Routes are removed automatically when the link goes down.
- for rule in rules:
- ruleDel(rule)
+ try:
+ for rule in rules:
+ ruleDel(rule)
+ except IPRoute2Error as e:
+ logging.error('Source route removal failed: %s' % e.message)
class ConfigApplier(object):
diff --git a/vdsm/network/sourceroute.py b/vdsm/network/sourceroute.py
index d7916ed..1fb9626 100644
--- a/vdsm/network/sourceroute.py
+++ b/vdsm/network/sourceroute.py
@@ -74,12 +74,8 @@
def configure(self):
self._prepare_configuration()
- try:
- self._configurator.configureSourceRoute(self.routes, self.rules,
- self.device)
- except IPRoute2Error as e:
- logging.error('ip binary failed during source route configuration'
- ': %s', e.message)
+ self._configurator.configureSourceRoute(self.routes, self.rules,
+ self.device)
def _prepare_removal(self):
self.routes = None
@@ -173,12 +169,8 @@
logging.info("Removing gateway - device: %s", self.device)
self._prepare_removal()
if self.rules and self.table:
- try:
- self._configurator.removeSourceRoute(
- self.routes, self.rules, self.device)
- except IPRoute2Error as e:
- logging.error('ip binary failed during source route '
- 'removal: %s' % e.message)
+ self._configurator.removeSourceRoute(self.routes, self.rules,
+ self.device)
@staticmethod
def _isLibvirtInterfaceFallback(device):
--
To view, visit https://gerrit.ovirt.org/41594
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I579b1789522eaed025d1c059bcf7a900e499ef32
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
7 years, 11 months