Dan Kenigsberg has uploaded a new change for review.
Change subject: Avoid re-setting <boot> element when updating nic properties
......................................................................
Avoid re-setting <boot> element when updating nic properties
Mentioning <boot> in the vnicxml passed to updateDevice explodes for
libvirt < 19.el6.
Change-Id: Ib81e1476e3ed31c9b07738cad1e45887f858d842
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/18796/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 4e2a696..fc8d3e9 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -3089,6 +3089,8 @@
link = xml.dom.minidom.Element('link')
vnicXML.appendChildWithArgs(link)
link.setAttribute('state', linkValue)
+ # drop <boot> element from vnicXML until libvirt rhbz#895294 is solved
+ vnicXML.firstChild.removeChild(vnicXML.getElementsByTagName('boot')[0])
vnicStrXML = vnicXML.toprettyxml(encoding='utf-8')
try:
try:
--
To view, visit http://gerrit.ovirt.org/18796
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib81e1476e3ed31c9b07738cad1e45887f858d842
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Removing has_systemd from sysv script
......................................................................
Removing has_systemd from sysv script
After separating sysv and systemd common code, there is no need for
has_systemd parts in sysv init script, as it doesn't in use at all over
systemd.
Change-Id: Ief9be5503c84e2cf960e722e5097dbdc05b888a6
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M init/sysvinit/vdsmd.init.in
1 file changed, 2 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/18806/1
diff --git a/init/sysvinit/vdsmd.init.in b/init/sysvinit/vdsmd.init.in
index b023fb9..ce6237e 100755
--- a/init/sysvinit/vdsmd.init.in
+++ b/init/sysvinit/vdsmd.init.in
@@ -150,11 +150,6 @@
stop() {
echo $"Shutting down vdsm daemon: "
- if has_systemd; then
- kill_instance
- return 0
- fi
-
trap cleanup SIGINT SIGHUP SIGTERM
if [ -f "$LOCK_FILE" ]; then
if ! pidofproc -p "$RESPAWNPIDFILE" >/dev/null; then
@@ -207,11 +202,7 @@
case "$1" in
start)
- if has_systemd; then
- start
- else
- locked_start
- fi
+ locked_start
RETVAL=$?
;;
stop)
@@ -224,7 +215,7 @@
if [ "$RETVAL" -eq 0 ]; then
echo "VDS daemon server is running"
else
- if ! has_systemd && [ -f "$LOCK_FILE" ]; then
+ if [ -f "$LOCK_FILE" ]; then
printf "VDS daemon dead but subsys locked"
else
printf "VDS daemon is not running"
--
To view, visit http://gerrit.ovirt.org/18806
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief9be5503c84e2cf960e722e5097dbdc05b888a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: vm: new parameter 'protected' for vm creation
......................................................................
vm: new parameter 'protected' for vm creation
Setting the new parameter 'protected' to true when creating a VM
enables sanlock protection for the VM resources (disks).
As a result few operations on the VM are blocked as they're not
supported yet.
Change-Id: I9429ead45caac1178957a33393642817db59508f
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M client/vdsClient.py
M vdsm/storage/hsm.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
4 files changed, 45 insertions(+), 22 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/17714/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index c52256a..c65531c 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1822,7 +1822,9 @@
'name:val}]} : add a fully specified device',
'o cpuPinning={vcpuid:pinning} cpu pinning in '
'libvirt-like format. see '
- 'http://libvirt.org/formatdomain.html#elementsCPUTuning'
+ 'http://libvirt.org/formatdomain.html#elementsCPUTuning',
+ 'o protected=<true/false> whether the vm resources '
+ '(disks) should be protected using sanlock',
)),
'vmUpdateDevice': (serv.vmUpdateDevice,
('<vmId> <devicespec>',
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index c754ee8..2112693 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3235,17 +3235,16 @@
'volumeID': vol.volUUID, 'path': vol.getVolumePath(),
'vmVolInfo': vol.getVmVolumeInfo()}
- if config.getboolean('irs', 'use_volume_leases'):
- leasePath, leaseOffset = dom.getVolumeLease(vol.imgUUID,
- vol.volUUID)
+ leasePath, leaseOffset = \
+ dom.getVolumeLease(vol.imgUUID, vol.volUUID)
- if leasePath and leaseOffset is not None:
- volInfo.update({
- 'leasePath': leasePath,
- 'leaseOffset': leaseOffset,
- 'shared': (vol.getVolType() ==
- volume.type2name(volume.SHARED_VOL)),
- })
+ if leasePath and leaseOffset is not None:
+ volInfo.update({
+ 'leasePath': leasePath,
+ 'leaseOffset': leaseOffset,
+ 'shared': (vol.getVolType() ==
+ volume.type2name(volume.SHARED_VOL)),
+ })
chain.append(volInfo)
diff --git a/vdsm/vm.py b/vdsm/vm.py
index dc52909..1b86eb7 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -2073,6 +2073,9 @@
def isDisksStatsCollectionEnabled(self):
return self._volumesPrepared
+ def isProtected(self):
+ return utils.tobool(self.conf.get('protected', 'false'))
+
def preparePaths(self, drives):
domains = set()
for drive in drives:
@@ -2685,21 +2688,19 @@
self._appendDevices(domxml)
- for drive in self._devices[DISK_DEVICES][:]:
- if not hasattr(drive, 'volumeChain'):
- continue
+ if (config.getboolean('irs', 'use_volume_leases')
+ or self.isProtected()):
- for volInfo in drive.volumeChain:
- if ('leasePath' not in volInfo or
- 'leaseOffset' not in volInfo or
- volInfo['shared']):
+ for drive in self._devices[DISK_DEVICES][:]:
+ if not hasattr(drive, 'volumeChain'):
continue
- leaseElem = self._buildLease(
- drive.domainID, volInfo['volumeID'], volInfo['leasePath'],
- volInfo['leaseOffset'])
+ for volInfo in drive.volumeChain:
+ leaseElem = self._buildLease(
+ drive.domainID, volInfo['volumeID'],
+ volInfo['leasePath'], volInfo['leaseOffset'])
- domxml._devices.appendChild(leaseElem)
+ domxml._devices.appendChild(leaseElem)
return domxml.toxml()
@@ -3224,6 +3225,9 @@
return {'status': doneCode, 'vmList': self.status()}
def hotplugDisk(self, params):
+ if self.isProtected():
+ return errCode['noimpl']
+
if self.isMigrating():
return errCode['migInProgress']
@@ -3271,6 +3275,9 @@
return {'status': doneCode, 'vmList': self.status()}
def hotunplugDisk(self, params):
+ if self.isProtected():
+ return errCode['noimpl']
+
if self.isMigrating():
return errCode['migInProgress']
@@ -3551,6 +3558,9 @@
disks = xml.dom.minidom.Element('disks')
newDrives = {}
+ if self.isProtected():
+ return errCode['noimpl']
+
if self.isMigrating():
return errCode['migInProgress']
@@ -3726,6 +3736,9 @@
def merge(self, mergeDrives):
"""Live merge command"""
+ if self.isProtected():
+ return errCode['noimpl']
+
# Check if there is a merge still in progress
for mergeStatus in self.conf.get('liveMerge', []):
if mergeStatus['status'] == MERGESTATUS.IN_PROGRESS:
@@ -3834,6 +3847,9 @@
del srcDrive.diskReplicate
def diskReplicateStart(self, srcDisk, dstDisk):
+ if self.isProtected():
+ return errCode['noimpl']
+
try:
srcDrive = self._findDriveByUUIDs(srcDisk)
except LookupError:
@@ -3882,6 +3898,9 @@
return {'status': doneCode}
def diskReplicateFinish(self, srcDisk, dstDisk):
+ if self.isProtected():
+ return errCode['noimpl']
+
try:
srcDrive = self._findDriveByUUIDs(srcDisk)
except LookupError:
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 4495dc5..8a9d325 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2717,6 +2717,9 @@
#
# @nice: The host scheduling priority
#
+# @protected: Whether the VM resources must be protected using
+# sanlock or not
+#
# @smp: The number of CPUs presented to the VM
#
# @smpCoresPerSocket: #optional Indicates the number of CPU cores per socket
--
To view, visit http://gerrit.ovirt.org/17714
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9429ead45caac1178957a33393642817db59508f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Federico Simoncelli has posted comments on this change.
Change subject: vdsm: Add tuneBlockDevIo interface
......................................................................
Patch Set 14: Code-Review-1
(3 comments)
....................................................
File vdsm/vm.py
Line 4326: # persist the target value to make it consistent after recovery
Line 4327: self.saveState()
Line 4328: return {'status': doneCode}
Line 4329:
Line 4330: def _getTuneBlkDevIoInfo(self):
This might be useless. More info below.
Line 4331: # Only tuned disk IO information is returned.
Line 4332: results = {}
Line 4333: for device in self.conf['devices']:
Line 4334: if device.get('device') == 'disk' and device.get('name'):
Line 4350: invalidParamNames = ', '.join(invalidParams)
Line 4351: raise ValueError('Parameter %s name(s) are invalid' %
Line 4352: invalidParamNames)
Line 4353:
Line 4354: def _checkIoTuneCategories(self, params):
I am not a big fan of checks re-writes. If this is already checked by libvirt then let's just wait for it to fail when we call setBlockIoTune.
Line 4355: categories = ("bytes", "iops")
Line 4356: for category in categories:
Line 4357: if params.get('total_' + category + '_sec', 0) and \
Line 4358: (params.get('read_' + category + '_sec', 0) or
Line 4406: errMsg = 'Get new block I/O Tune params failed after setting'
Line 4407: self.log.exception(errMsg)
Line 4408: return getErrCode('tuneBlkDevIoErr', errMsg)
Line 4409: else:
Line 4410: for device in self.conf['devices']:
I'm not sure I like this because if we crash between setBlockIoTune and saveState loop we basically lose this information.
Best thing here would probably be add blockIoTune in the vm stats thread (and forget about persisting these values). Therefore _getTuneBlkDevIoInfo might be useless and could be removed.
Line 4411: if device.get('name') == dev or device.get('path') == dev:
Line 4412: device.setdefault('specParams', {})
Line 4413: device['specParams']['ioTune'] = info
Line 4414:
--
To view, visit http://gerrit.ovirt.org/14394
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Icb33510a081d221af0f69d4dd2d55adf0b79efd2
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck(a)redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes