Change in vdsm[master]: Improve the _validateIoTuneParams so the params are passed a...
by Martin Sivak
Martin Sivák has uploaded a new change for review.
Change subject: Improve the _validateIoTuneParams so the params are passed as argument
......................................................................
Improve the _validateIoTuneParams so the params are passed as argument
Change-Id: I08e8bd5a25320f45501b35bb0c9cae507200eb8b
Signed-off-by: Martin Sivak <msivak(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 7 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/28713/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index a1b034f..b4d142e 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1375,9 +1375,8 @@
return devname.get(self.iface, 'hd') + (devindex or 'a')
- def _checkIoTuneCategories(self):
+ def _checkIoTuneCategories(self, ioTuneParamsInfo):
categories = ("bytes", "iops")
- ioTuneParamsInfo = self.specParams['ioTune']
for category in categories:
if ioTuneParamsInfo.get('total_' + category + '_sec', 0) and \
(ioTuneParamsInfo.get('read_' + category + '_sec', 0) or
@@ -1386,15 +1385,15 @@
' read/write value for %s_sec can not be'
' set at the same time' % category)
- def _validateIoTuneParams(self):
+ def _validateIoTuneParams(self, params):
ioTuneParams = ('total_bytes_sec', 'read_bytes_sec',
'write_bytes_sec', 'total_iops_sec',
'write_iops_sec', 'read_iops_sec')
- for key, value in self.specParams['ioTune'].iteritems():
+ for key, value in params.iteritems():
try:
if key in ioTuneParams:
- self.specParams['ioTune'][key] = int(value)
- if self.specParams['ioTune'][key] >= 0:
+ params[key] = int(value)
+ if params[key] >= 0:
continue
else:
raise Exception('parameter %s name is invalid' % key)
@@ -1406,7 +1405,7 @@
raise ValueError('parameter %s value should be'
' equal or greater than zero' % key)
- self._checkIoTuneCategories()
+ self._checkIoTuneCategories(params)
def getLeasesXML(self):
"""
@@ -1514,7 +1513,7 @@
diskelem.appendChildWithArgs('driver', **driverAttrs)
if hasattr(self, 'specParams') and 'ioTune' in self.specParams:
- self._validateIoTuneParams()
+ self._validateIoTuneParams(self.specParams['ioTune'])
iotune = XMLElement('iotune')
for key, value in self.specParams['ioTune'].iteritems():
iotune.appendChildWithArgs(key, text=str(value))
--
To view, visit http://gerrit.ovirt.org/28713
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08e8bd5a25320f45501b35bb0c9cae507200eb8b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msivak(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: Fix the API definition for cpu tune methods
by Martin Sivak
Martin Sivák has uploaded a new change for review.
Change subject: Fix the API definition for cpu tune methods
......................................................................
Fix the API definition for cpu tune methods
Change-Id: I236af8141e0981a9af680e35860183579f916609
Signed-off-by: Martin Sivak <msivak(a)redhat.com>
---
M vdsm/rpc/vdsmapi-schema.json
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/29497/1
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 8a114df..73b23f9 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -7480,6 +7480,8 @@
#
# Set the vCpu quota tune parameter to the VM
#
+# @vmID: The UUID of the VM
+#
# @quota: a number representing the quota to be set
# Returns:
# Status code
@@ -7487,7 +7489,7 @@
# Since: 4.15.0
##
{'command': {'class': 'VM', 'name': 'setCpuTuneQuota'},
- 'data': {'quota': 'int'},
+ 'data': {'vmID': 'UUID', 'quota': 'int'},
'returns': 'TasksStatus'}
@@ -7496,6 +7498,8 @@
#
# Set the vCpu period tune parameter to the VM
#
+# @vmID: The UUID of the VM
+#
# @period: a number representing the period to be set
# Returns:
# Status code
@@ -7503,7 +7507,7 @@
# Since: 4.15.0
##
{'command': {'class': 'VM', 'name': 'setCpuTunePeriod'},
- 'data': {'period': 'int'},
+ 'data': {'vmID': 'UUID', 'period': 'int'},
'returns': 'TasksStatus'}
##
--
To view, visit http://gerrit.ovirt.org/29497
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I236af8141e0981a9af680e35860183579f916609
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msivak(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: LiveMerge: Add liveMerge capability to vdsCaps
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: LiveMerge: Add liveMerge capability to vdsCaps
......................................................................
LiveMerge: Add liveMerge capability to vdsCaps
It is desirable for engine to know up front if a host can support live
merge so the UI can either enable or disable the 'Delete' snapshot
command based on presence of the feature.
Change-Id: Iac66c679166b5687ed3940e517fe6827fe10e258
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/caps.py
M vdsm/rpc/vdsmapi-schema.json
M vdsm/virt/vm.py
3 files changed, 32 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/28998/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 68851c9..e8c4844 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -246,6 +246,26 @@
@utils.memoized
+def getLiveMergeSupport():
+ """
+ Determine if libvirt provides the necessary features to enable live merge.
+ We check for the existence of several libvirt flags to serve as indicators:
+
+ VIR_DOMAIN_BLOCK_COMMIT_RELATIVE indicates that libvirt can maintain
+ relative backing file path names when rewriting a backing chain.
+
+ VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 indicates that libvirt can pass a drive
+ name (ie. vda) rather than a path to the block job event callback.
+ """
+ for flag in ('VIR_DOMAIN_BLOCK_COMMIT_RELATIVE',
+ 'VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2'):
+ if not hasattr(libvirt, flag):
+ logging.debug("libvirt is missing '%s': live merge disabled", flag)
+ return False
+ return True
+
+
+(a)utils.memoized
def getNumaTopology():
capabilities = _getCapsXMLStr()
caps = minidom.parseString(capabilities)
@@ -609,6 +629,7 @@
liveSnapSupported = _getLiveSnapshotSupport(targetArch)
if liveSnapSupported is not None:
caps['liveSnapshot'] = str(liveSnapSupported).lower()
+ caps['liveMerge'] = str(getLiveMergeSupport()).lower()
caps['kdumpStatus'] = _getKdumpStatus()
return caps
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 2ccf963..486a7cb 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -1155,6 +1155,11 @@
# @kdumpStatus: The current status of kdump configuration for the host:
# enabled (1), disabled(0), unknown(-1)
# (new in version 4.15.0)
+#
+# @liveMerge: #optional Indicates if live merge is supported on this
+# host.
+# (new in version 4.15.0)
+#
# Since: 4.15.0
#
# Notes: Since ovirt-engine cannot parse software versions in 'x.y.z' format,
@@ -1179,7 +1184,7 @@
'numaNodeDistance': 'NumaNodeDistanceMap',
'autoNumaBalancing': 'AutoNumaBalancingStatus',
'selinux': 'SELinuxStatus', '*liveSnapshot': 'bool',
- 'kdumpStatus': 'int'}}
+ 'kdumpStatus': 'int', '*liveMerge': 'bool'}}
##
# @Host.getCapabilities:
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index abdd9b0..216d2a7 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -5476,6 +5476,10 @@
return jobs
def merge(self, driveSpec, baseVolUUID, topVolUUID, bandwidth, jobUUID):
+ if not caps.getLiveMergeSupport():
+ self.log.error("Live merge is not supported on this host")
+ return errCode['mergeErr']
+
bandwidth = int(bandwidth)
if jobUUID is None:
jobUUID = str(uuid.uuid4())
@@ -5519,12 +5523,7 @@
# Indicate that we expect libvirt to maintain the relative paths of
# backing files. This is necessary to ensure that a volume chain is
# visible from any host even if the mountpoint is different.
- try:
- flags = libvirt.VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
- except AttributeError:
- self.log.error("Libvirt missing VIR_DOMAIN_BLOCK_COMMIT_RELATIVE. "
- "Unable to perform live merge.")
- return errCode['mergeErr']
+ flags = libvirt.VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
if topVolUUID == drive.volumeID:
# Pass a flag to libvirt to indicate that we expect a two phase
--
To view, visit http://gerrit.ovirt.org/28998
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac66c679166b5687ed3940e517fe6827fe10e258
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: sriov hook: allow VFs with nonzero pci domain
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: sriov hook: allow VFs with nonzero pci domain
......................................................................
sriov hook: allow VFs with nonzero pci domain
This patch is the smallest change needed to expose a host nic with non-zero pci
domain to a guest.
The hook does a questionable detour via libvirt in order to extract the pci
address of the specified nic. This begs for simplification in a follow up patch.
Change-Id: Ie2b75134a7f6bdb10f8d808b4dcda6856befe705
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm_hooks/sriov/before_vm_start.py
1 file changed, 9 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/28162/1
diff --git a/vdsm_hooks/sriov/before_vm_start.py b/vdsm_hooks/sriov/before_vm_start.py
index c23797b..e3b1de1 100755
--- a/vdsm_hooks/sriov/before_vm_start.py
+++ b/vdsm_hooks/sriov/before_vm_start.py
@@ -26,7 +26,7 @@
def getDeviceDetails(addr):
''' investigate device by its address and return
- [bus, slot, function] list
+ [domain, bus, slot, function] list
'''
connection = libvirtconnection.get(None)
@@ -34,6 +34,8 @@
devXml = minidom.parseString(nodeDevice.XMLDesc(0))
+ domain = hex(int(
+ devXml.getElementsByTagName('domain')[0].firstChild.nodeValue))
bus = hex(int(devXml.getElementsByTagName('bus')[0].firstChild.nodeValue))
slot = hex(int(
devXml.getElementsByTagName('slot')[0]
@@ -45,10 +47,10 @@
sys.stderr.write('sriov: bus=%s slot=%s function=%s\n' %
(bus, slot, function))
- return (bus, slot, function)
+ return (domain, bus, slot, function)
-def createSriovElement(domxml, bus, slot, function):
+def createSriovElement(domxml, domain, bus, slot, function):
'''
create host device element for libvirt domain xml:
@@ -69,7 +71,7 @@
address = domxml.createElement('address')
address.setAttribute('type', 'pci')
- address.setAttribute('domain', '0')
+ address.setAttribute('domain', domain)
address.setAttribute('bus', bus)
address.setAttribute('slot', slot)
address.setAttribute('function', function)
@@ -139,9 +141,10 @@
devpath = os.path.realpath(SYS_NIC_PATH % nic + '/device')
addr = getPciAddress(devpath)
- bus, slot, function = getDeviceDetails(addr)
+ domain, bus, slot, function = getDeviceDetails(addr)
- interface = createSriovElement(domxml, bus, slot, function)
+ interface = createSriovElement(
+ domxml, domain, bus, slot, function)
sys.stderr.write('sriov: VF %s xml: %s\n' %
(nic, interface.toxml()))
--
To view, visit http://gerrit.ovirt.org/28162
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2b75134a7f6bdb10f8d808b4dcda6856befe705
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: vdsm: Shuting down protocol detector fails
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: Shuting down protocol detector fails
......................................................................
Patch Set 1:
Another cleaner solution, but require little more code:
- Remove the racy self._is_running flag
- The acceptor thread will stop only when receiving the byte "1" from the wakeup pipe
- We don't have to ignore EPIPE - this can not happen only when stopping twice.
--
To view, visit http://gerrit.ovirt.org/29556
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82119a61835fe335f2aa5da29fb8d3f2b8ae33fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 10 months
Change in vdsm[master]: vdsm: Shuting down protocol detector fails
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: Shuting down protocol detector fails
......................................................................
Patch Set 1:
MainThread::DEBUG::2014-07-01 16:44:59,935::vdsm::58::vds::(sigtermHandler) Received signal 15
MainThread::DEBUG::2014-07-01 16:44:59,935::protocoldetector::158::vds.MultiProtocolAcceptor::(stop) Stopping Acceptor
Detector thread::DEBUG::2014-07-01 16:44:59,935::protocoldetector::129::vds.MultiProtocolAcceptor::(_cleanup) Cleaning Acceptor
MainThread::ERROR::2014-07-01 16:44:59,936::vdsm::134::vds::(run) Exception raised
Traceback (most recent call last):
File "/usr/share/vdsm/vdsm", line 132, in run
serve_clients(log)
File "/usr/share/vdsm/vdsm", line 90, in serve_clients
cif.prepareForShutdown()
File "/usr/share/vdsm/clientIF.py", line 234, in prepareForShutdown
self._acceptor.stop()
File "/usr/share/vdsm/protocoldetector.py", line 160, in stop
self.wakeup()
File "/usr/share/vdsm/protocoldetector.py", line 164, in wakeup
os.write(self._write_fd, '1')
OSError: [Errno 32] Broken pipe
--
To view, visit http://gerrit.ovirt.org/29556
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82119a61835fe335f2aa5da29fb8d3f2b8ae33fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 10 months
Change in vdsm[master]: vdsm: Shuting down protocol detector fails
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: Shuting down protocol detector fails
......................................................................
Patch Set 1:
I looked at the log myself, and there was no double stop.
This looks like a race in the shutdown procedure:
1. vdsm get SIGTERM
2. main thread wakes up and start shutdown procedure
3. main thread invoke MultiProtocolAcceptor.stop setting
self._is_running to False
4. acceptor threads wakes up, probably because of the received
signal, and find that self._is_running is False.
5. acceptor thread cleans up, closing the pipe
6. main thread try to write to closed pipe
So it seems that the correct solution would be to ignore EPIPE which
means "already stopped".
--
To view, visit http://gerrit.ovirt.org/29556
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82119a61835fe335f2aa5da29fb8d3f2b8ae33fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 10 months
Change in vdsm[master]: vdsm: Shuting down protocol detector fails
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: Shuting down protocol detector fails
......................................................................
Patch Set 1: Code-Review-1
(2 comments)
Wrong fix.
Even worse - I don't believe you can get this error during normal operation. The only way to get this would be to stop the acceptor twice.
Please check the log in the bug and find why the acceptor was stopped twice, and fix the bad code doing this.
http://gerrit.ovirt.org/#/c/29556/1/vdsm/protocoldetector.py
File vdsm/protocoldetector.py:
Line 163: try:
Line 164: os.write(self._write_fd, '1')
Line 165: except OSError as e:
Line 166: if e.errno == errno.EPIPE:
Line 167: pass
This will not work.
You will pass, and then move to line 168, go into the elif on line 170, and raise in line 171
Line 168: if e.errno == errno.EINTR:
Line 169: self.wakeup()
Line 170: elif e.errno not in (errno.EAGAIN, errno.EWOULDBLOCK):
Line 171: raise
Line 166: if e.errno == errno.EPIPE:
Line 167: pass
Line 168: if e.errno == errno.EINTR:
Line 169: self.wakeup()
Line 170: elif e.errno not in (errno.EAGAIN, errno.EWOULDBLOCK):
> unrelated question: why do we swallow EAGAIN error? Why not try again?
EPIPE should be here with EGAIN - these are the errors we can handle.
Why we should ignore EAGAIN: This pipe receive no writes until you call stop, and there is no chance that it would block. If it does, then the other side must be readable and the socket will wakeup without this write.
Line 171: raise
Line 172:
Line 173: def _cleanup_wakeup_pipe(self):
Line 174: try:
--
To view, visit http://gerrit.ovirt.org/29556
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82119a61835fe335f2aa5da29fb8d3f2b8ae33fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 10 months