Change in vdsm[master]: [WIP] createSD() and createStoragePool() explicit cmd_type_1...
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: [WIP] createSD() and createStoragePool() explicit cmd_type_1.
......................................................................
[WIP] createSD() and createStoragePool() explicit cmd_type_1.
TODO:
initSanLockLock
remove[StoragePool, SD, VG] should be type 1?
Change-Id: I1b9d533812718d29a01998934e22954cee650265
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/hsm.py
2 files changed, 88 insertions(+), 26 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/11694/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 6a02f5a..c688826 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -479,7 +479,65 @@
'vgUUID' - volume group UUID
'storageType' - NFS_DOMAIN, LOCALFS_DOMAIN, &etc.
'version' - DOMAIN_VERSIONS
+
+ This function intentionally bypasses the lvm cache sets since
+ uses a private configuration.
"""
+ def makeCreateCmd(lvSize, lvName):
+ createCmd = [constants.EXT_LVM, "lvcreate"]
+ createCmd.extend(("--config", cmdConf % filter))
+ createCmd.extend(("--contiguous", "y", "--size", "%sm" % lvSize))
+ createCmd.extend(("--name", lvName, vgName))
+ return createCmd
+
+ def createSpecialLvs():
+ for size, name in ((metaSize(vgName), sd.METADATA),
+ (sd.LEASES_SIZE, sd.LEASES),
+ (sd.IDS_SIZE, sd.IDS),
+ (sd.INBOX_SIZE, sd.INBOX),
+ (sd.OUTBOX_SIZE, sd.OUTBOX),
+ (MASTERLV_SIZE, MASTERLV)
+ ):
+ rc, out, err = misc.execCmd(makeCreateCmd(size, name),
+ sudo=True)
+ if rc != 0:
+ raise se.CannotCreateLogicalVolume(vgName, name)
+
+ def makeChangeCmd(toRemove, toAdd):
+ changeCmd = [constants.EXT_LVM, "vgchange"]
+ changeCmd.extend(lvm.LVM_NOBACKUP)
+ changeCmd.extend(("--config", cmdConf % filter))
+ for tag in toRemove:
+ changeCmd.extend(("--deltag", tag))
+ for tag in toAdd:
+ changeCmd.extend(("--addtag", tag))
+ changeCmd.append(vgName)
+ return changeCmd
+
+ def setInitialTags(toRemove, toAdd):
+ rc, out, err = misc.execCmd(makeChangeCmd(toRemove, toAdd),
+ sudo=True)
+ if rc != 0:
+ raise se.VolumeGroupReplaceTagError("vg:%s del:%s add:%s (%s)"
+ % (vgName,
+ ", ".join(toRemove),
+ ", ".join(toAdd),
+ err[-1]))
+
+ def initClusterLock():
+ lockUtilPath = config.get('irs', 'lock_util_path')
+ lockUtil = os.path.join(lockUtilPath, "safelease")
+ initCommand = [lockUtil, "release", "-f", lvm.lvPath(vgName,
+ sd.LEASES), "0"]
+ rc, out, err = misc.execCmd(initCommand, sudo=False,
+ cwd=lockUtilPath)
+ if rc != 0:
+ raise se.ClusterLockInitError("could not initialise spm lease"
+ "(%s): %s" % (rc, out))
+
+ def initSanLockLock():
+ pass
+
cls.log.info("sdUUID=%s domainName=%s domClass=%s vgUUID=%s "
"storageType=%s version=%s", sdUUID, domainName, domClass,
vgUUID, storageType, version)
@@ -510,9 +568,10 @@
raise se.StorageDomainIsMadeFromTooManyPVs()
logBlkSize, phyBlkSize = lvm.checkpvsblksize(pvs)
- # Create metadata service volume
- metasize = metaSize(vgName)
- lvm.createLV(vgName, sd.METADATA, "%s" % (metasize))
+ filter = 'filter = [ ' + '"a%' + " ".join(pvs) + '%", ' + '"r%.*%" ]'
+ cmdConf = lvm.LVMCONF_TEMPLATE.replace("locking_type=4",
+ "locking_type=1")
+ createSpecialLvs()
# Create the mapping right now so the index 0 is guaranteed
# to belong to the metadata volume. Since the metadata is at
# least SDMETADATA/METASIZE units, we know we can use the first
@@ -520,16 +579,8 @@
# pass metadata's dev to ensure it is the first mapping
mapping = cls.getMetaDataMapping(vgName)
- # Create the rest of the BlockSD internal volumes
- lvm.createLV(vgName, sd.LEASES, sd.LEASES_SIZE)
- lvm.createLV(vgName, sd.IDS, sd.IDS_SIZE)
- lvm.createLV(vgName, sd.INBOX, sd.INBOX_SIZE)
- lvm.createLV(vgName, sd.OUTBOX, sd.OUTBOX_SIZE)
- lvm.createLV(vgName, MASTERLV, MASTERLV_SIZE)
-
# Create VMS file system
_createVMSfs(os.path.join("/dev", vgName, MASTERLV))
-
lvm.deactivateLVs(vgName, MASTERLV)
path = lvm.lvPath(vgName, sd.METADATA)
@@ -545,11 +596,6 @@
raise
except se.StorageException:
raise se.VolumesZeroingError(path)
-
- if version in VERS_METADATA_LV:
- md = LvBasedSDMetadata(vgName, sd.METADATA)
- elif version in VERS_METADATA_TAG:
- md = TagBasedSDMetadata(vgName)
# create domain metadata
# FIXME : This is 99% like the metadata in file SD
@@ -579,20 +625,35 @@
initialMetadata.update(mapping)
- md.update(initialMetadata)
+ if version in VERS_METADATA_LV:
+ md = LvBasedSDMetadata(vgName, sd.METADATA)
+ md.update(initialMetadata)
+ #Replace unready tag
+ toRemove = (STORAGE_UNREADY_DOMAIN_TAG,)
+ toAdd = (STORAGE_DOMAIN_TAG,)
+ elif version in VERS_METADATA_TAG:
+ md = TagBasedSDMetadata(vgName)
+ #Add all tags here and remove the unready
+ toRemove = tuple(VGTagMetadataRW.METADATA_TAG_PREFIX +
+ lvmTagEncode(item) for item in initialMetadata)
+ toRemove.append(STORAGE_UNREADY_DOMAIN_TAG)
+ toAdd = tuple(VGTagMetadataRW.METADATA_TAG_PREFIX +
+ lvmTagEncode(item) for item in initialMetadata)
+ toAdd.append(STORAGE_DOMAIN_TAG)
- # Mark VG with Storage Domain Tag
try:
- lvm.replaceVGTag(vgName, STORAGE_UNREADY_DOMAIN_TAG,
- STORAGE_DOMAIN_TAG)
- except se.StorageException:
+ setInitialTags(toRemove, toAdd)
+ except se.VolumeGroupReplaceTagError:
raise se.VolumeGroupUninitialized(vgName)
- bsd = BlockStorageDomain(sdUUID)
+ if version in sd.DOM_SAFELEASE_VERS:
+ initClusterLock()
+ elif sd.DOM_SANLOCK_VERS:
+ initSanLockLock()
+ else:
+ cls.log.warning("Lock method for version %s unknown", version)
- bsd.initSPMlease()
-
- return bsd
+ return None
def getReadDelay(self):
t = time.time()
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 7b03064..640e7bd 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2445,7 +2445,8 @@
domVersion)
else:
raise se.StorageDomainTypeError(storageType)
- sdCache.manuallyAddDomain(newSD)
+ if newSD:
+ sdCache.manuallyAddDomain(newSD)
@public
def validateStorageDomain(self, sdUUID, options=None):
--
To view, visit http://gerrit.ovirt.org/11694
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b9d533812718d29a01998934e22954cee650265
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years
Change in vdsm[master]: [WIP] Add cmd_type_1
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: [WIP] Add cmd_type_1
......................................................................
[WIP] Add cmd_type_1
Change-Id: I0c62d42936630132722974bcdedd619d13185cde
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 20 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/11693/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 148a010..3d33ac8 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -147,6 +147,23 @@
return filt
+def _cmd_type_1(cmd, devices):
+ """
+ Use only for lvm cluster safe commands.
+
+ These are cmds that not change metadata of an existing VG.
+ _DON'T_ call this directly or indirectly.
+ """
+ filter = _buildFilter(devices)
+ conf = LVMCONF_TEMPLATE.replace("locking_type=4",
+ "locking_type=1") % filter
+ conf = conf.replace("\n", " ")
+ finalCmd = [constants.EXT_LVM, cmd[0], "--config", conf]
+ finalCmd.extend(cmd[1:])
+ rc, out, err = misc.execCmd(finalCmd, sudo=True)
+ return rc, out, err
+
+
def _buildConfig(devList):
flt = _buildFilter(chain(devList, USER_DEV_LIST))
conf = _current_lvmconf % flt
@@ -672,7 +689,7 @@
cmd.extend(("--metadatasize", metadatasize, "--metadatacopies", "2",
"--metadataignore", "y"))
cmd.extend(devices)
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _cmd_type_1(cmd)
return rc, out, err
@@ -884,7 +901,7 @@
# Activate the 1st PV metadata areas
cmd = ["pvchange", "--metadataignore", "n"]
cmd.append(pvs[0])
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _cmd_type_1(cmd, (pvs[0],))
if rc != 0:
raise se.PhysDevInitializationError(pvs[0])
@@ -892,7 +909,7 @@
if initialTag:
options.extend(("--addtag", initialTag))
cmd = ["vgcreate"] + options + [vgName] + pvs
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _cmd_type_1(cmd, pvs)
if rc == 0:
_lvminfo._invalidatepvs(pvs)
_lvminfo._invalidatevgs(vgName)
--
To view, visit http://gerrit.ovirt.org/11693
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c62d42936630132722974bcdedd619d13185cde
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years
Change in vdsm[master]: [WIP] Public checkpvsblksize
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: [WIP] Public checkpvsblksize
......................................................................
[WIP] Public checkpvsblksize
Change-Id: I02d1565e39780cb0ce97caba7b44db8b191c0c35
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/11691/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 8955657..148a010 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -878,7 +878,7 @@
def createVG(vgName, devices, initialTag, metadataSize, extentsize="128m",
force=False):
pvs = [_fqpvname(pdev) for pdev in _normalizeargs(devices)]
- _checkpvsblksize(pvs)
+ checkpvsblksize(pvs)
_initpvs(pvs, metadataSize, force)
# Activate the 1st PV metadata areas
@@ -927,7 +927,7 @@
def extendVG(vgName, devices, force):
pvs = [_fqpvname(pdev) for pdev in _normalizeargs(devices)]
- _checkpvsblksize(pvs, getVGBlockSizes(vgName))
+ checkpvsblksize(pvs, getVGBlockSizes(vgName))
vg = _lvminfo.getVg(vgName)
# Format extension PVs as all the other already in the VG
_initpvs(pvs, int(vg.vg_mda_size) / 2 ** 20, force)
@@ -967,7 +967,7 @@
return multipath.getDeviceBlockSizes(dev)
-def _checkpvsblksize(pvs, vgBlkSize=None):
+def checkpvsblksize(pvs, vgBlkSize=None):
for pv in pvs:
pvBlkSize = _getpvblksize(pv)
logPvBlkSize, phyPvBlkSize = pvBlkSize
@@ -987,12 +987,14 @@
if logPvBlkSize != vgBlkSize[0]:
raise se.VolumeGroupBlockSizeError(vgBlkSize, pvBlkSize)
+ return pvBlkSize
+
def checkVGBlockSizes(vgUUID, vgBlkSize=None):
pvs = listPVNames(vgUUID)
if not pvs:
raise se.VolumeGroupDoesNotExist("vg_uuid: %s" % vgUUID)
- _checkpvsblksize(pvs, vgBlkSize)
+ checkpvsblksize(pvs, vgBlkSize)
def getVGBlockSizes(vgUUID):
--
To view, visit http://gerrit.ovirt.org/11691
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I02d1565e39780cb0ce97caba7b44db8b191c0c35
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years
Change in vdsm[master]: check the syntaxs of optional parameters in json schema
by shaohef@linux.vnet.ibm.com
ShaoHe Feng has uploaded a new change for review.
Change subject: check the syntaxs of optional parameters in json schema
......................................................................
check the syntaxs of optional parameters in json schema
There are so many syntaxs error of optional parameters define in
json schema
This patch can both check the descrption errors of optional parameters
missing #optional and the define error of optional parameters missing *
Change-Id: I94f92459ee8787780a54a510b6f8cc074fb2a235
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
M vdsm_api/process-schema.py
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/10446/1
diff --git a/vdsm_api/process-schema.py b/vdsm_api/process-schema.py
index 8244995..5db6966 100755
--- a/vdsm_api/process-schema.py
+++ b/vdsm_api/process-schema.py
@@ -22,6 +22,11 @@
import sys
import re
import vdsmapi
+try:
+ from collections import OrderedDict
+ OrderedDict # make pyflakes happy
+except ImportError:
+ from ordereddict import OrderedDict
html_escape_table = {
"&": "&",
@@ -143,6 +148,18 @@
symbol[mode][name] = desc
# Track the name in case there is are multiple lines to append
last_arg = name
+ # check optional parameters
+ if desc.startswith('#optional '):
+ assert ('*' + name in symbol['data'].keys()), \
+ ('Define of %s optional parameter error:\n\t%s should '
+ 'start with *' % (symbol['name'], name))
+ if isinstance(symbol['data'], OrderedDict):
+ if '*' + name in symbol['data'].keys():
+ assert desc.startswith('#optional '), \
+ ('Description of %s optional parameter error:\n\t'
+ 'The description of optional parameter "%s" '
+ 'should start with "#optional"' %
+ (symbol['name'], name))
else:
# Just append it to the last one we added
symbol[mode][last_arg] += ' ' + line
--
To view, visit http://gerrit.ovirt.org/10446
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94f92459ee8787780a54a510b6f8cc074fb2a235
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
10 years
Change in vdsm[master]: [WIP] Add new repository management code
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: [WIP] Add new repository management code
......................................................................
[WIP] Add new repository management code
Change-Id: Ib09c89cf982b475f45d26b2428fe05e2f4565dab
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M tests/Makefile.am
A tests/imageMainuplatorTests.py
A tests/repositoryEngineTests.py
A vdsm/storage/imageRepository/engines/__init__.py
A vdsm/storage/imageRepository/engines/localfs/__init__.py
A vdsm/storage/imageRepository/imageManipulator.py
6 files changed, 1,339 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/6247/1
--
To view, visit http://gerrit.ovirt.org/6247
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib09c89cf982b475f45d26b2428fe05e2f4565dab
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
10 years
Change in vdsm[master]: svdsm: Remove superfluous unlinks
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: svdsm: Remove superfluous unlinks
......................................................................
svdsm: Remove superfluous unlinks
This causes races and is generally unnecessary
Bug-Id: https://bugzilla.redhat.com/910005
Change-Id: I6c3e1968666a34fdfc4b9df8d8c320bcc82c47ca
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/supervdsm.py
M vdsm/supervdsmServer.py
2 files changed, 48 insertions(+), 49 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/11989/1
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 10abae0..127dd78 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -112,10 +112,10 @@
return self._manager.open(*args, **kwargs)
def _cleanOldFiles(self):
- self._log.debug("Cleanning svdsm old files: %s, %s, %s",
+ self._log.debug("Cleanning svdsm old files: %s, %s",
self.pidfile, self.timestamp, self.address)
- for f in (self.pidfile, self.timestamp, self.address):
- utils.rmFile(f)
+ for f in (self.pidfile, self.timestamps):
+ utils.rmFile(str(f))
def _start(self):
self._authkey = str(uuid.uuid4())
@@ -194,7 +194,7 @@
def launch(self):
self._firstLaunch = False
self._start()
- utils.retry(self._connect, Exception, timeout=60)
+ utils.retry(self._connect, Exception, timeout=1)
def __getattr__(self, name):
return ProxyCaller(self, name)
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 83a5803..21cf579 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -366,57 +366,56 @@
log = logging.getLogger("SuperVdsm.Server")
+ log.debug("Making sure I'm root")
+ if os.geteuid() != 0:
+ sys.exit(errno.EPERM)
+
+ log.debug("Parsing cmd args")
+ authkey, parentPid, pidfile, timestamp, address, uid = sys.argv[1:]
+
+ log.debug("Creating PID and TIMESTAMP files: %s, %s",
+ pidfile, timestamp)
+ spid = os.getpid()
+ with open(pidfile, "w") as f:
+ f.write(str(spid) + "\n")
+ with open(timestamp, "w") as f:
+ f.write(str(misc.getProcCtime(spid) + "\n"))
+
+ log.debug("Cleaning old socket %s", address)
+ zombieReaper.registerSignalHandler()
+
+ log.debug("Setting up keep alive thread")
+
+ monThread = threading.Thread(target=__pokeParent,
+ args=[int(parentPid), address, log])
+ monThread.setDaemon(True)
+ monThread.start()
+
try:
- log.debug("Making sure I'm root")
- if os.geteuid() != 0:
- sys.exit(errno.EPERM)
-
- log.debug("Parsing cmd args")
- authkey, parentPid, pidfile, timestamp, address, uid = sys.argv[1:]
-
- log.debug("Creating PID and TIMESTAMP files: %s, %s",
- pidfile, timestamp)
- spid = os.getpid()
- with open(pidfile, "w") as f:
- f.write(str(spid) + "\n")
- with open(timestamp, "w") as f:
- f.write(str(misc.getProcCtime(spid) + "\n"))
-
- log.debug("Cleaning old socket %s", address)
- if os.path.exists(address):
- os.unlink(address)
-
- zombieReaper.registerSignalHandler()
-
- log.debug("Setting up keep alive thread")
-
- monThread = threading.Thread(target=__pokeParent,
- args=[int(parentPid), address, log])
- monThread.setDaemon(True)
- monThread.start()
-
+ log.debug("Creating remote object manager")
try:
- log.debug("Creating remote object manager")
- manager = _SuperVdsmManager(address=address, authkey=authkey)
- manager.register('instance', callable=_SuperVdsm)
+ os.unlink(address)
+ except (OSError, IOError) as e:
+ if e.errno != errno.ENOENT:
+ raise
- server = manager.get_server()
- servThread = threading.Thread(target=server.serve_forever)
- servThread.setDaemon(True)
- servThread.start()
+ manager = _SuperVdsmManager(address=address, authkey=authkey)
+ manager.register('instance', callable=_SuperVdsm)
- for f in (address, timestamp, pidfile):
- chown(f, int(uid), METADATA_GROUP)
+ server = manager.get_server()
+ servThread = threading.Thread(target=server.serve_forever)
+ servThread.setDaemon(True)
+ servThread.start()
- log.debug("Started serving super vdsm object")
+ for f in (address, timestamp, pidfile):
+ chown(f, int(uid), METADATA_GROUP)
- # Python bug of thread.join() will block signal
- # http://bugs.python.org/issue1167930
- while servThread.isAlive():
- servThread.join(5)
- finally:
- if os.path.exists(address):
- utils.rmFile(address)
+ log.debug("Started serving super vdsm object")
+
+ # Python bug of thread.join() will block signal
+ # http://bugs.python.org/issue1167930
+ while servThread.isAlive():
+ servThread.join(5)
except Exception:
log.error("Could not start Super Vdsm", exc_info=True)
--
To view, visit http://gerrit.ovirt.org/11989
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c3e1968666a34fdfc4b9df8d8c320bcc82c47ca
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
10 years
Change in vdsm[master]: Add create operation to qemu-img
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Add create operation to qemu-img
......................................................................
Add create operation to qemu-img
Change-Id: I078afcb0899792805584fc56832747d36908f18b
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/qemuImg.py
1 file changed, 29 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/6245/1
--
To view, visit http://gerrit.ovirt.org/6245
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I078afcb0899792805584fc56832747d36908f18b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
10 years
Change in vdsm[master]: [WIP] Continue moving VM code to it's own module
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: [WIP] Continue moving VM code to it's own module
......................................................................
[WIP] Continue moving VM code to it's own module
Change-Id: I374dae67449f65c7c55ed028bd301be8b6a01eb5
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/API.py
1 file changed, 16 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/7514/1
diff --git a/vdsm/API.py b/vdsm/API.py
index aab69cd..e6a1048 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -136,15 +136,18 @@
for methName in GUEST_AGENT_METHODS:
self.setattr(attrName, partial(guestTrampoline, methName))
+ def _getVmObject(self):
+ return self._cif.vmContainer.get(self._UUID)
+
def _runThinMethod(self, methodName, *args, **kwargs):
- v = self._cif.vmContainer.get(self._UUID)
+ v = self._getVmObject()
if not v:
return errCode['noVM']
return getattr(v, methodName)(*args, **kwargs)
def _runGuestAgentMethod(self, methodName, *args, **kwargs):
- v = self._cif.vmContainer.get(self._UUID)
+ v = self._getVmObject()
if v is None:
return errCode['noVM']
@@ -163,7 +166,7 @@
"""
vmParams['vmId'] = self._UUID
try:
- if self._cif.vmContainer.get(self._UUID) is not None:
+ if self._getVmObject() is not None:
self.log.warning('vm %s already exists' % vmParams['vmId'])
return errCode['exist']
@@ -286,7 +289,7 @@
"""
Obtain statistics of the specified VM
"""
- v = self._cif.vmContainer.get(self._UUID)
+ v = self._getVmObject()
if not v:
return errCode['noVM']
stats = v.getStats().copy()
@@ -364,7 +367,7 @@
"""
params['vmId'] = self._UUID
self.log.debug(params)
- v = self._cif.vmContainer.get(self._UUID)
+ v = self._getVmObject()
if v is None:
return errCode['noVM']
@@ -395,7 +398,7 @@
self.log.debug('Migration create - Failed')
return response
- v = self._cif.vmContainer.get(self._UUID)
+ v = self._getVmObject()
if not v.waitForMigrationDestinationPrepare():
return errCode['createErr']
@@ -921,12 +924,14 @@
return d
else:
return {'vmId': d['vmId'], 'status': d['status']}
- # To improve complexity, convert 'vms' to set(vms)
- vmSet = set(vmList)
+
+ if vmList:
+ vms = (self._cif.vmContainer.get(vm) for vm in vmList)
+ else:
+ vms = self._cif.vmContainer.getVMs()
+
return {'status': doneCode,
- 'vmList': [reportedStatus(v, fullStatus)
- for v in self._cif.vmContainer.getVMs()
- if not vmSet or v.id in vmSet]}
+ 'vmList': [reportedStatus(vm, fullStatus) for vm in vms]}
# Networking-related functions
def setupNetworks(self, networks={}, bondings={}, options={}):
--
To view, visit http://gerrit.ovirt.org/7514
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I374dae67449f65c7c55ed028bd301be8b6a01eb5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
10 years
Change in vdsm[master]: vdsm: Catch the destkopLock AttributeError on Migration
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vdsm: Catch the destkopLock AttributeError on Migration
......................................................................
vdsm: Catch the destkopLock AttributeError on Migration
During the migration, on the target the events for disconnected spice
channels are sent before VDSM is able to initialize the guestAgent
instance. In this case, we should not let the exception go through.
Change-Id: I5b6f6b2f2a3f049871902ee7777ae95ea9a52802
Bug-Url: https://bugzilla.redhat.com/955593
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/14395/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index ddb09c8..b0adc14 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -824,7 +824,10 @@
def _timedDesktopLock(self):
if not self.conf.get('clientIp', ''):
- self.guestAgent.desktopLock()
+ try:
+ self.guestAgent.desktopLock()
+ except AttributeError:
+ self.log.debug("Guest Agent not yet intialized")
def onDisconnect(self, detail=None):
self.conf['clientIp'] = ''
--
To view, visit http://gerrit.ovirt.org/14395
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b6f6b2f2a3f049871902ee7777ae95ea9a52802
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
10 years, 1 month
Change in vdsm[master]: [WIP] Added getStorageDevices verb.
by barumuga@redhat.com
Hello Ayal Baron, Timothy Asir, Saggi Mizrahi, Federico Simoncelli, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/3725
to review the following change.
Change subject: [WIP] Added getStorageDevices verb.
......................................................................
[WIP] Added getStorageDevices verb.
This verb is used to get list of storage devices in the node. Return
value is a dictionary, its keys are device names and values are
properties of those devices as dictionary.
{DEVNAME: {'container': CONTAINER_DEVNAME,
'contentType': CONTENT_TYPE_STRING,
'endSize': SIZE_MB,
'flagList': STRING_LIST,
'fsSize': SIZE_MB,
'fsSizeFree': SIZE_MB,
'fsType': STRING,
'fsUuid': UUID,
'members': DEVNAME_LIST,
'model': STRING,
'mountPoint': STRING,
'name': DEVNAME,
'origin': LV_DEVNAME,
'parent': PARENT_DEVNAME,
'partitions': DEVNAME_LIST,
'size': SIZE_MB,
'sizeFree': SIZE_MB,
'startSize': SIZE_MB,
'status': STATUS_STRING,
'tableType': DISK_TABLE_TYPE,
'type': TYPE_STRING,
'uuid': UUID,
'vendor': STRING},...}
here, property dictionary contains
container: If DEVNAME is used by another device eg. LVM PV, MD etc, name
of that device is set
contentType: This is determined by various other properties. Possible
value is one of 'SWAP', 'OS', 'DATA' and 'NA'
endSize: If DEVNAME is a partition, its end boundry is set. The value
is in MB
flagList: If DEVNAME is a partition, its flags(eg. boot,bios_grub etc)
are set as a list of strings
fsSize: If DEVNAME has a file system, its size is set. The value is
in MB
fsSizeFree: If DEVNAME is mounted, its free size is set. The value is in
MB
fsType: If DEVNAME is formatted, its file system type is set
fsUuid': If DEVNAME has file system, its UUID is set
members: If DEVNAME is a MD, LVM VG etc, its member device names are
set as list of strings
model: Model of DEVNAME is set as string
mountPoint: If DEVNAME is mounted, its mount point is set
name: DEVNAME is set here for completion
origin: If DEVNAME is a snapshot of LV, that LV name is set
parent: If DEVNAME is a partition, its disk name is set
partitions: If DEVNAME is a disk, its partition names are set as list of
strings
size: Size of DEVNAME is set. The value is in MB
sizeFree: If DEVNAME is VG, its size of free extents is set. If its a
partitioned disk, its unallocated size is set. The value is
in MB
startSize: If DEVNAME is a partition, its start boundry is set. The
value is in MB
status: This is determined by various other properites of the DEVNAME.
Possible value is one of 'UNINITIALIZED', 'NA', 'UNUSABLE',
'FORMAT_UNSUPPORTED', 'MOUNTED', 'FORMATTED' and 'PARTED'
tableType': If DEVNAME is a disk, its table(label) type is set as a string
type: This is determined value. Possible value is one of 'MD',
'LVM_VG', 'LVM_LV_SNAPSHOT', 'LVM_LV' and 'BLOCK'
uuid: UUID of DEVNAME
vendor: Vendor of DEVNAME is set as string
Change-Id: I2cb217321a7a8dfcd1b507c7cba2888f08612207
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vdsm.spec.in
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/Makefile.am
A vdsm/storage_device_utils.py
M vdsm_cli/vdsClient.py
6 files changed, 505 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/3725/1
--
To view, visit http://gerrit.ovirt.org/3725
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cb217321a7a8dfcd1b507c7cba2888f08612207
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
10 years, 1 month