Change in vdsm[master]: vm: per-attribute monitor response check
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: per-attribute monitor response check
......................................................................
vm: per-attribute monitor response check
the responsiveness of the monitor is reported through a single
instance variable, which is updated after each libvirt call.
If one single call goes in timeout, while the others go well,
due to interplay between timeouts and polling interval, it can
happen that reported status bounces back and forth between 'Up'
and 'Not Responding'.
This patch address this behaviour by keeping track of the
timeouts per-dom-attribute instead of per-dom, and reports
the monitor as not respondig if, and until, at least one had
a timeout in the last call.
Change-Id: I32a98d34cde91fa9dc3d07f03c47a5f2f22da620
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/23138/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 55683f4..9d7ca03 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -853,11 +853,11 @@
def f(*args, **kwargs):
try:
ret = attr(*args, **kwargs)
- self._cb(False)
+ self._cb(False, name)
return ret
except libvirt.libvirtError as e:
if e.get_error_code() == libvirt.VIR_ERR_OPERATION_TIMEOUT:
- self._cb(True)
+ self._cb(True, name)
toe = TimeoutError(e.get_error_message())
toe.err = e.err
raise toe
@@ -1938,6 +1938,9 @@
if (self.arch not in ['ppc64', 'x86_64']):
raise RuntimeError('Unsupported architecture: %s' % self.arch)
+
+ self._attrTimeoutLock = threading.Lock()
+ self._attrTimeoutExperienced = {} # will keep track of timeout data
def _get_lastStatus(self):
PAUSED_STATES = ('Powering down', 'RebootInProgress', 'Up')
@@ -3631,11 +3634,13 @@
def _monitorDependentInit(self, timeout=None):
self.log.warning('unsupported by libvirt vm')
- def _timeoutExperienced(self, timeout):
- if timeout:
- self._monitorResponse = -1
- else:
- self._monitorResponse = 0
+ def _timeoutExperienced(self, timeout, attrName):
+ with self._attrTimeoutLock:
+ self._attrTimeoutExperienced[attrName] = timeout
+ if any(self._attrTimeoutExperienced.itervalues()):
+ self._monitorResponse = -1
+ else:
+ self._monitorResponse = 0
def _waitForIncomingMigrationFinish(self):
if 'restoreState' in self.conf:
--
To view, visit http://gerrit.ovirt.org/23138
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32a98d34cde91fa9dc3d07f03c47a5f2f22da620
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years
Change in vdsm[master]: vm: hyperv: hyperv enlightenment optimizations
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: hyperv: hyperv enlightenment optimizations
......................................................................
vm: hyperv: hyperv enlightenment optimizations
This patch the hyperv enlightenment optimizations.
The optimizations are both for stability and for performance, and they
are added on top of the HyperV support.
The parameters are hardcoded and not externally configurable because
they are not supposed to be changed very often, if changed at all;
moreover, this patch already implements the optimal recommended settings.
Change-Id: Ia10cb4ce254b6e6f560c045aff9e68846fe4771f
Bug-Url: https://bugzilla.redhat.com/1083529
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/vmTests.py
M vdsm/virt/vm.py
2 files changed, 18 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/29234/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 7ee2eb8..9317887 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -327,6 +327,8 @@
<acpi/>
<hyperv>
<relaxed state="on"/>
+ <vapic state="on"/>
+ <spinlocks retries="8191" state="on"/>
</hyperv>
</features>"""
conf = {'hypervEnable': 'true'}
@@ -382,7 +384,7 @@
def testHyperVClockXML(self):
clockXML = """
<clock adjustment="-3600" offset="variable">
- <timer name="rtc" tickpolicy="catchup" track="guest"/>
+ <timer name="hypervclock" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>"""
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index ec8ca12..4f3c531 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -717,13 +717,20 @@
<clock offset="variable" adjustment="-3600">
<timer name="rtc" tickpolicy="catchup">
</clock>
+
+ for hyperv:
+ <clock offset="variable" adjustment="-3600">
+ <timer name="hypervclock" tickpolicy="catchup">
+ </clock>
"""
+
+ clockName = 'hypervclock' if self._isHyperV() else 'rtc'
+ # 'hypervclock' does not support the 'track' attribute.
+ # libvirt docs is not very clear here.
m = XMLElement('clock', offset='variable',
adjustment=str(self.conf.get('timeOffset', 0)))
- rtc = m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup')
- if utils.tobool(self.conf.get('hypervEnable', 'false')):
- rtc.setAttrs(track='guest')
+ m.appendChildWithArgs('timer', name=clockName, tickpolicy='catchup')
m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
if self.arch == caps.Architecture.X86_64:
@@ -841,6 +848,11 @@
hyperv.appendChildWithArgs('relaxed', state='on')
# turns off an internal Windows watchdog, and by doing so avoids
# some high load BSODs.
+ hyperv.appendChildWithArgs('vapic', state='on')
+ hyperv.appendChildWithArgs(
+ 'spinlocks', state='on', retries='8191')
+ # performance optimization flags, that can improve the performance
+ # by 10% to much more (in extreme cases of resources overcommit).
def appendCpu(self):
"""
--
To view, visit http://gerrit.ovirt.org/29234
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia10cb4ce254b6e6f560c045aff9e68846fe4771f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years
Change in vdsm[master]: client: Add warning prompt on dangerous commands
by dkuznets@redhat.com
Dima Kuznetsov has uploaded a new change for review.
Change subject: client: Add warning prompt on dangerous commands
......................................................................
client: Add warning prompt on dangerous commands
Added a warning and confirmation prompt for the following commands:
* deactivateStorageDomain
* deleteImage
* deleteVolume
* deleteVolumeByDescr
* destroyStoragePool
* extendStorageDomain
* extendVolume
* forcedDetachStorageDomain
* formatStorageDomain
* mergeSnapshots
* moveImage
* moveMultiImage
* reconstructMaster
* releaseDomainLock
* removeVG
Also added '--force' flag to bypass warnings and prompts (intended for
scripts).
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1005923
Change-Id: Idea34ad7c3d5b66993bcb56b61e7edb0549ef9fb
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M client/vdsClient.py
M lib/vdsm/vdscli.py.in
M tests/vdsClientTests.py
3 files changed, 95 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/28174/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 0235837..0eb4aac 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -85,6 +85,7 @@
print "-m\tList supported methods and their params (Short help)"
print "-s [--truststore path]\tConnect to server with SSL."
print "-o, --oneliner\tShow the key-val information in one line."
+ print "--force\tDo not prompt on dangerous commands (not recommended)."
print "\tIf truststore path is not specified, use defaults."
print "\nCommands"
verbs = cmd.keys()
@@ -2070,11 +2071,12 @@
'Create a new VG from devices devlist (list of dev '
'GUIDs)'
)),
- 'removeVG': (serv.removeVG,
+ 'removeVG': (vdscli.request_confirmation(serv.removeVG),
('<vgUUID>',
'remove the VG identified by its UUID'
)),
- 'extendStorageDomain': (serv.extendStorageDomain,
+ 'extendStorageDomain': (vdscli.request_confirmation(
+ serv.extendStorageDomain),
('<sdUUID> <spUUID> <devlist>',
'Extend the Storage Domain by adding devices'
' devlist (list of dev GUIDs)'
@@ -2132,7 +2134,8 @@
('<spUUID> <sdUUID>',
'acquire storage domain lock'
)),
- 'releaseDomainLock': (serv.releaseDomainLock,
+ 'releaseDomainLock': (vdscli.request_confirmation(
+ serv.releaseDomainLock),
('<spUUID> <sdUUID>',
'release storage domain lock'
)),
@@ -2154,7 +2157,8 @@
('<spUUID> <vmUUID> [sdUUID]',
'Remove VM from pool or Backup domain'
)),
- 'reconstructMaster': (serv.reconstructMaster,
+ 'reconstructMaster': (vdscli.request_confirmation(
+ serv.reconstructMaster),
('<spUUID> <poolName> <masterDom> '
'<domDict>({sdUUID1=status,sdUUID2=status,...})'
' <masterVersion>, [<lockPolicy> '
@@ -2171,7 +2175,8 @@
'Create new storage pool with single/multiple '
'image data domain'
)),
- 'destroyStoragePool': (serv.destroyStoragePool,
+ 'destroyStoragePool': (vdscli.request_confirmation(
+ serv.destroyStoragePool),
('<spUUID> <id> <scsi-key>',
'Destroy storage pool',
'Parameter scsi-key is ignored (maintained '
@@ -2227,7 +2232,8 @@
'Activate a storage domain that is already '
'a member in a storage pool.'
)),
- 'deactivateStorageDomain': (serv.deactivateStorageDomain,
+ 'deactivateStorageDomain': (vdscli.request_confirmation(
+ serv.deactivateStorageDomain),
('<domain UUID> <pool UUID> <new master '
'domain UUID> <masterVer>',
'Deactivate a storage domain. '
@@ -2241,12 +2247,14 @@
' UUID> <masterVer>',
'Detach a storage domain from a storage pool.'
)),
- 'forcedDetachStorageDomain': (serv.forcedDetachStorageDomain,
+ 'forcedDetachStorageDomain': (vdscli.request_confirmation(
+ serv.forcedDetachStorageDomain),
('<domain UUID> <pool UUID>',
'Forced detach a storage domain from a '
'storage pool.'
)),
- 'formatStorageDomain': (serv.formatStorageDomain,
+ 'formatStorageDomain': (vdscli.request_confirmation(
+ serv.formatStorageDomain),
('<domain UUID> [<autoDetach>]',
'Format detached storage domain.'
)),
@@ -2269,7 +2277,8 @@
'<srcImgUUID> <srcVolUUID>',
'Creates new volume or snapshot'
)),
- 'extendVolumeSize': (serv.extendVolumeSize, (
+ 'extendVolumeSize': (vdscli.request_confirmation(
+ serv.extendVolumeSize), (
'<spUUID> <sdUUID> <imgUUID> <volUUID> <newSize>',
'Extend the volume size (virtual disk size seen by the guest).',
)),
@@ -2287,12 +2296,13 @@
'<Legality>',
'Set volume legality (ILLEGAL/LEGAL).'
)),
- 'deleteVolume': (serv.deleteVolume,
+ 'deleteVolume': (vdscli.request_confirmation(serv.deleteVolume),
('<sdUUID> <spUUID> <imgUUID> <volUUID>,...,<volUUID>'
' <postZero> [<force>]',
'Deletes an volume if its a leaf. Else returns error'
)),
- 'deleteVolumeByDescr': (serv.deleteVolumeByDescr,
+ 'deleteVolumeByDescr': (vdscli.request_confirmation(
+ serv.deleteVolumeByDescr),
('<part of description> <sdUUID> <spUUID> '
'<imgUUID>',
'Deletes list of volumes(only leafs) '
@@ -2391,11 +2401,11 @@
' <enabled = true/false>',
'Enable or disable Hosted Engine HA'
' maintenance')),
- 'deleteImage': (serv.deleteImage,
+ 'deleteImage': (vdscli.request_confirmation(serv.deleteImage),
('<sdUUID> <spUUID> <imgUUID> [<postZero>] [<force>]',
'Delete Image folder with all volumes.',
)),
- 'moveImage': (serv.moveImage,
+ 'moveImage': (vdscli.request_confirmation(serv.moveImage),
('<spUUID> <srcDomUUID> <dstDomUUID> <imgUUID> <vmUUID>'
' <op = COPY_OP/MOVE_OP> [<postZero>] [ <force>]',
'Move/Copy image between storage domains within same '
@@ -2423,7 +2433,7 @@
'Download an image from a remote endpoint using the specified',
'methodArgs.'
)),
- 'moveMultiImage': (serv.moveMultiImage,
+ 'moveMultiImage': (vdscli.request_confirmation(serv.moveMultiImage),
('<spUUID> <srcDomUUID> <dstDomUUID> '
'<imgList>({imgUUID=postzero,'
'imgUUID=postzero,...}) <vmUUID> [<force>]',
@@ -2439,7 +2449,7 @@
'Do it by collapse and copy the whole chain '
'(baseVolUUID->srcVolUUID)'
)),
- 'mergeSnapshots': (serv.mergeSnapshots,
+ 'mergeSnapshots': (vdscli.request_confirmation(serv.mergeSnapshots),
('<sdUUID> <spUUID> <vmUUID> <imgUUID> <Ancestor '
'Image uuid> <Successor Image uuid> [<postZero>]',
'Merge images from successor to ancestor.',
@@ -2574,8 +2584,8 @@
try:
opts, args = getopt.getopt(sys.argv[1:], "hmso", ["help", "methods",
"SSL", "truststore=",
- "oneliner"])
-
+ "oneliner", "force"])
+ vdscli.REQUEST_CONFIRMATION = True
for o, v in opts:
if o == "-h" or o == "--help":
usage(commands)
@@ -2589,6 +2599,8 @@
serv.truststore = v
if o == '-o' or o == '--oneliner':
serv.pretty = False
+ if o == '--force':
+ vdscli.REQUEST_CONFIRMATION = False
if len(args) < 2:
raise Exception("Need at least two arguments")
server, command = args[0:2]
diff --git a/lib/vdsm/vdscli.py.in b/lib/vdsm/vdscli.py.in
index 5fa7528..2ac21b2 100644
--- a/lib/vdsm/vdscli.py.in
+++ b/lib/vdsm/vdscli.py.in
@@ -21,6 +21,7 @@
import xmlrpclib
import subprocess
+import functools
import os
import re
import sys
@@ -165,3 +166,25 @@
d_useSSL, d_tsPath)
server = connect()
print server.getVdsCapabilities()
+
+
+USER_WARNING = """
+Please note that vdsClient is not a supported tool and should be used only with
+direct guidance from support representative.
+
+This operation might cause data corruption, would you like to proceed?
+[n][Y] """.lstrip()
+
+
+REQUEST_CONFIRMATION = False
+
+
+def request_confirmation(f):
+ @functools.wraps(f)
+ def wrapper(*args, **kwargs):
+ if REQUEST_CONFIRMATION:
+ resp = raw_input(USER_WARNING).decode('string_escape')
+ if resp != 'Y':
+ sys.exit(1)
+ return f(*args, **kwargs)
+ return wrapper
diff --git a/tests/vdsClientTests.py b/tests/vdsClientTests.py
index 41e93fc..8d9b943 100644
--- a/tests/vdsClientTests.py
+++ b/tests/vdsClientTests.py
@@ -22,12 +22,15 @@
from tempfile import mkstemp
from contextlib import contextmanager
import subprocess
+import sys
+import StringIO
from testrunner import VdsmTestCase as TestCaseBase
from monkeypatch import MonkeyPatch
import vdsClient
from vdsm.vdscli import __getLocalVdsName as getLocalVdsName
+import vdsm.vdscli as vdscli
@contextmanager
@@ -150,6 +153,7 @@
class vdscliTests(TestCaseBase):
+
@MonkeyPatch(subprocess, 'Popen', lambda *y, **x: _FakePopen(
'subject= /O=VDSM Certificate/CN=myhost\n'))
def test__getLocalVdsName1(self):
@@ -166,3 +170,42 @@
def test__getLocalVdsName3(self):
cn = getLocalVdsName('fake')
self.assertEquals('0', cn)
+
+
+class ConfirmationTests(TestCaseBase):
+ def testDefaultOff(self):
+ @vdscli.request_confirmation
+ def foobar():
+ return 101
+
+ self.assertEquals(foobar(), 101)
+
+ @MonkeyPatch(vdscli, 'REQUEST_CONFIRMATION', True)
+ @MonkeyPatch(sys, 'stdin', StringIO.StringIO('n\n'))
+ def testDenied(self):
+ lst = []
+
+ @vdscli.request_confirmation
+ def appent_to_lst():
+ lst.append(1)
+
+ try:
+ appent_to_lst()
+ except SystemExit:
+ pass
+ self.assertEquals(lst, [])
+
+ @MonkeyPatch(vdscli, 'REQUEST_CONFIRMATION', True)
+ @MonkeyPatch(sys, 'stdin', StringIO.StringIO('Y\n'))
+ def testConfirmed(self):
+ lst = []
+
+ @vdscli.request_confirmation
+ def appent_to_lst():
+ lst.append(1)
+
+ try:
+ appent_to_lst()
+ except SystemExit:
+ pass
+ self.assertEquals(lst, [1])
--
To view, visit http://gerrit.ovirt.org/28174
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idea34ad7c3d5b66993bcb56b61e7edb0549ef9fb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
9 years
Change in vdsm[master]: spice: support to agent file transfer disable
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: spice: support to agent file transfer disable
......................................................................
spice: support to agent file transfer disable
Spice has agent based file transfer support.
This option can be disabled in QEMU, and libvirt has support
to pass this flag to the underlying QEMU.
This patch expose this capability in VDSM, in the VM definition,
implementing the VDSM part of bz983019.
The new parameter is optional and enabled by default for backward
compatibility.
No XML changes are produced at all unless the new parameter is
specified.
Change-Id: Icc98a346baca4ab163ff30e891ae80535e49caa4
Bug-Url: https://bugzilla.redhat.com/983019
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M debian/control
M tests/vmTests.py
M vdsm.spec.in
M vdsm/virt/vm.py
M vdsm_api/vdsmapi-schema.json
5 files changed, 40 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/26917/1
diff --git a/debian/control b/debian/control
index 45c2b1c..ddbaab3 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,7 @@
python-cpopen (>= 1.3),
python-dmidecode,
python-ethtool (>=0.8),
- python-libvirt (>= 1.0.2),
+ python-libvirt (>= 1.2.2),
python-m2crypto,
python-netaddr,
python-nose,
@@ -81,8 +81,8 @@
libnl1,
libsanlock-client1 (>= 2.4),
libsanlock-dev (>= 2.4),
- libvirt-bin (>= 1.0.2),
- libvirt0 (>= 1.0.2),
+ libvirt-bin (>= 1.2.2),
+ libvirt0 (>= 1.2.2),
linux-image-generic (>= 3.6),
logrotate,
lvm2 (>= 2.02.95),
@@ -98,7 +98,7 @@
python-dmidecode,
python-ethtool (>= 0.8),
python-ethtool (>= 0.8),
- python-libvirt (>= 1.0.2),
+ python-libvirt (>= 1.2.2),
python-m2crypto,
python-netaddr,
python-parted,
@@ -294,7 +294,7 @@
Package: vdsm-hook-sriov
Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, python (>=2.7.3), vdsm (>= ${source:Version}), libvirt-bin (>= 1.0.2-1)
+Depends: ${shlibs:Depends}, ${misc:Depends}, python (>=2.7.3), vdsm (>= ${source:Version}), libvirt-bin (>= 1.2.2-1)
Description: sr-iov support for VDSM
sr-iov hook enable to add virtual functions exposed by the device
directly to a virtual machine.
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 91ee466..11695b3 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -421,6 +421,20 @@
passwdValidTo="1970-01-01T00:00:01" port="-1"
tlsPort="-1" type="spice">
<channel mode="secure" name="main"/>
+ </graphics>""",
+
+ """
+ <graphics autoport="yes" listen="0" passwd="*****"
+ passwdValidTo="1970-01-01T00:00:01" port="-1"
+ tlsPort="-1" type="spice">
+ <filetransfer enable="no"/>
+ </graphics>""",
+
+ """
+ <graphics autoport="yes" listen="0" passwd="*****"
+ passwdValidTo="1970-01-01T00:00:01" port="-1"
+ tlsPort="-1" type="spice">
+ <channel mode="secure" name="main"/>
</graphics>"""]
vmConfs = [
@@ -432,6 +446,16 @@
{'type': 'graphics', 'device': 'spice',
'specParams': {
'port': '-1', 'tlsPort': '-1',
+ 'spiceSecureChannels': 'smain'}},
+
+ {'type': 'graphics', 'device': 'spice',
+ 'specParams': {
+ 'port': '-1', 'tlsPort': '-1',
+ 'fileTransferEnable': 'false'}},
+
+ {'type': 'graphics', 'device': 'spice',
+ 'specParams': {
+ 'port': '-1', 'tlsPort': '-1',
'spiceSecureChannels': 'smain'}}]
self._verifyGraphicsXML(expectedXMLs, vmConfs, False)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index fd47bf6..af339e2 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -131,7 +131,7 @@
%endif
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18
-Requires: libvirt-daemon >= 1.0.2-1
+Requires: libvirt-daemon >= 1.2.2-1
Requires: libvirt-daemon-config-nwfilter
Requires: libvirt-daemon-driver-network
Requires: libvirt-daemon-driver-nwfilter
@@ -140,7 +140,7 @@
%if 0%{?rhel}
Requires: libvirt >= 0.10.2-29.el6_5.4
%else
-Requires: libvirt >= 1.0.2-1
+Requires: libvirt >= 1.2.2-1
%endif
%endif
Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index d68c292..27c2aab 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1415,6 +1415,10 @@
clipboard = XMLElement('clipboard', copypaste='no')
graphics.appendChild(clipboard)
+ if not utils.tobool(self.specParams.get('fileTransferEnable', True)):
+ filetransfer = XMLElement('filetransfer', enable='no')
+ graphics.appendChild(filetransfer)
+
# handle deprecated channel name in a smart way,
# not just chop 1st char!
if graphicsAttrs['type'] == 'spice':
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 0300a27..0a8c506 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2523,12 +2523,16 @@
# @copyPasteEnable: #optional Specify if copy and paste is enabled.
# Currently relevant for @spice devices only.
#
+# @fileTransferEnable: #optional Specify if file transfer is enabled.
+# Currently relevant for @qxl devices only.
+#
# Since: 4.15.0
##
{'type': 'VmGraphicsDeviceSpecParams',
'data': {'port': 'uint', '*tlsPort': 'uint', '*keyMap': 'str',
'*disableTicketing': 'bool', '*displayNetwork': 'str',
- '*spiceSecureChannels': 'str', '*copyPasteEnable': 'bool'}}
+ '*spiceSecureChannels': 'str', '*copyPasteEnable': 'bool',
+ '*fileTransferEnable': 'bool'}}
##
# @VmGraphicsDevice:
--
To view, visit http://gerrit.ovirt.org/26917
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc98a346baca4ab163ff30e891ae80535e49caa4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years
Change in vdsm[master]: vm: make new timekeeping revertable
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: make new timekeeping revertable
......................................................................
vm: make new timekeeping revertable
The commit Icb0752e54a4cb9ff609b8ddfaf5c8fe2ed5b9e72
implemented the new timekeeping options recommended
by QEMU developers.
In order to maximize the backward compatibility and
to deal with possible regression with old guests,
this patch makes the new timekeeping settings revertable
by exposing a new configuration variable.
The default is enabled because those settings, being
recommended, are supposed to be safe.
Change-Id: I471be44454dcae6e73c46a473eb1eee19a5275ab
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/vm.py
2 files changed, 8 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/24443/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 01590a1..075face 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -192,6 +192,9 @@
('transient_disks_repository', '@VDSMLIBDIR@/transient',
'Local path to the transient disks repository.'),
+
+ ('new_timekeeping_enable', 'true',
+ 'Enable the new recomended QEMU time keeping settings'),
]),
# Section: [ksm]
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 9371049..d3baca8 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -970,10 +970,12 @@
m = XMLElement('clock', offset='variable',
adjustment=str(self.conf.get('timeOffset', 0)))
m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup')
- m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
- if self.arch == caps.Architecture.X86_64:
- m.appendChildWithArgs('timer', name='hpet', present='no')
+ if config.getboolean('vars', 'new_timekeeping_enable'):
+ m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
+
+ if self.arch == caps.Architecture.X86_64:
+ m.appendChildWithArgs('timer', name='hpet', present='no')
self.dom.appendChild(m)
--
To view, visit http://gerrit.ovirt.org/24443
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I471be44454dcae6e73c46a473eb1eee19a5275ab
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: gluster: command to create a public key file
by dnarayan@redhat.com
Hello Bala.FA,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/17644
to review the following change.
Change subject: gluster: command to create a public key file
......................................................................
gluster: command to create a public key file
This executes the command to create a public key file
which will have public keys of all the hosts of source cluster.
This is needed for password-less communication between
slave cluster hosts during geo-replication
Change-Id: If8c979a89ce11a1622819c474b59dcf088733594
Signed-off-by: ndarshan <dnarayan(a)redhat.com>
---
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
2 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/17644/1
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index bac6d1c..64529ae 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -897,3 +897,12 @@
return _parseVolumeProfileInfo(xmltree, nfs)
except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
+
+@makePublic
+def createPublicKeyFile():
+ command = _getGlusterSystemCmd() + ["execute", "gsec_create"]
+ rc, out, err = _execGluster(command)
+ if rc:
+ raise ge.GlusterGeoRepPublicKeyFileCreationFailedException(rc, out, err)
+ else:
+ return True
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index c569a9e..1ee73bb 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -484,3 +484,14 @@
prefix = "%s: " % (action)
self.message = prefix + "Service action is not supported"
self.err = [self.message]
+
+#geo-replication
+class GlusterGeoRepException(GlusterException):
+ code = 4560
+ message = "Gluster Geo-Replication Exception"
+
+
+class GlusterGeoRepPublicKeyFileCreationFailedException(GlusterGeoRepException):
+ code = 4561
+ message = "Creation of public key file failed"
+
--
To view, visit http://gerrit.ovirt.org/17644
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If8c979a89ce11a1622819c474b59dcf088733594
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ndarshan <dnarayan(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: virt: Add a function to execute a qemu monitor command
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: virt: Add a function to execute a qemu monitor command
......................................................................
virt: Add a function to execute a qemu monitor command
Sometimes it is necessary to execute a monitor command directly (eg. if
libvirt does not yet support a certain qemu feature). Libvirt will mark
the VM as 'tainted' once this is done for the first time. The reason is
that making modifications to a VM using this facility could cause a
split-brain situation. It is generally harmless to execute monitor
commands which act in a read-only fashion. This function is also useful
as a utility for developers who are working on new features.
Change-Id: I3e9e07ba0c236c0938b129ae90af825f18f0e644
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/27950/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 9cc9958..de27a53 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -30,9 +30,11 @@
import threading
import time
import xml.dom.minidom
+import json
# 3rd party libs imports
import libvirt
+import libvirt_qemu
# vdsm imports
from vdsm import constants
@@ -4948,6 +4950,15 @@
if 'tlsPort' in dev:
self.conf['displaySecurePort'] = dev['tlsPort']
+ def _internalQMPMonitorCommand(self, cmdDict):
+ """
+ Execute a qemu monitor command directly.
+ WARNING: This will cause libvirt to mark the VM as tainted.
+ """
+ jsonCmd = json.dumps(cmdDict)
+ ret = libvirt_qemu.qemuMonitorCommand(self._dom, jsonCmd, 0)
+ return json.loads(ret)
+
def _getNetworkIp(network):
try:
--
To view, visit http://gerrit.ovirt.org/27950
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e9e07ba0c236c0938b129ae90af825f18f0e644
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: split vdsm-network restoration service from vdsmd
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: split vdsm-network restoration service from vdsmd
......................................................................
split vdsm-network restoration service from vdsmd
Right now the task of doing network restoration is delegated to the
vdsmd service initialization. This has the disadvantages of:
- Disabling vdsmd can render the machine unaccessible as the
vdsm networks will not be started upon boot.
- Not allowing to run it before network.target, making boot
slower (other services may configure the nets before the
restoration).
Change-Id: I70cdf1e8a1e7063ec850081ac6199728d4cde381
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M init/systemd/Makefile.am
A init/systemd/vdsm-network.service.in
M init/vdsmd_init_common.sh.in
M vdsm/vdsm-restore-net-config
4 files changed, 50 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/29441/1
diff --git a/init/systemd/Makefile.am b/init/systemd/Makefile.am
index 4a871df..07c4ae8 100644
--- a/init/systemd/Makefile.am
+++ b/init/systemd/Makefile.am
@@ -23,8 +23,9 @@
nodist_noinst_DATA = \
supervdsmd.service \
systemd-vdsmd \
- vdsm-tmpfiles.d.conf \
vdsmd.service \
+ vdsm-network.service \
+ vdsm-tmpfiles.d.conf \
$(NULL)
CLEANFILES = \
@@ -35,8 +36,9 @@
EXTRA_DIST = \
supervdsmd.service.in \
systemd-vdsmd.in \
- vdsm-tmpfiles.d.conf.in \
vdsmd.service.in \
+ vdsm-network.service.in \
+ vdsm-tmpfiles.d.conf.in \
$(NULL)
all-local: \
diff --git a/init/systemd/vdsm-network.service.in b/init/systemd/vdsm-network.service.in
new file mode 100644
index 0000000..97aa3e2
--- /dev/null
+++ b/init/systemd/vdsm-network.service.in
@@ -0,0 +1,20 @@
+[Unit]
+Description=Virtual Desktop Server Manager network restoration
+Wants=network.target
+Before=network.target network.service NetworkManager.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+EnvironmentFile=-/etc/sysconfig/vdsm
+ExecStartPre=@BINDIR@/vdsm-tool --vvverbose --append --logfile=@VDSMLOGDIR(a)/upgrade.log upgrade-unified-persistence
+ExecStartPre=@BINDIR@/vdsm-tool --vvverbose --append --logfile=@VDSMLOGDIR(a)/upgrade.log upgrade-3.0.0-networks
+ExecStart=@VDSMDIR@/vdsm-restore-net-config --conditional
+
+# With the following two directives, we make sure that using systemctl to
+# restart will actually restore the networks
+RemainAfterExit=yes
+ExecStopPost=rm @VDSMRUN@/nets_restored
+
+[Install]
+WantedBy=multi-user.target
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index e142470..327d2c3 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -189,15 +189,6 @@
}
-task_restore_nets(){
- local restoration_file="@VDSMRUNDIR@/nets_restored"
- if [ ! -f "${restoration_file}" ]; then
- "@PYTHON@" "@VDSMDIR@/vdsm-restore-net-config" || return 1
- touch "${restoration_file}"
- fi
- return 0
-}
-
task_unified_network_persistence_upgrade(){
"$VDSM_TOOL" ${UPGRADE_LOGGING_PARAMS} upgrade-unified-persistence
}
@@ -253,7 +244,6 @@
test_space \
test_lo \
unified_network_persistence_upgrade \
- restore_nets \
upgrade_300_nets \
"
;;
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 7adfcac..1c4a9eb 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/env python2
#
# Copyright 2011-2014 Red Hat, Inc.
#
@@ -18,10 +18,14 @@
#
# Refer to the README and COPYING files for full details of the license
#
+import argparse
import logging
import logging.config
+import os
+import sys
from vdsm.config import config
+from vdsm import constants, utils
# Ifcfg persistence restoration
from network.configurators import ifcfg
@@ -79,11 +83,20 @@
yield cls
-def restore():
- if config.get('vars', 'net_persistence') == 'unified':
- unified_restoration()
+def restore(conditional=False):
+ if conditional:
+ restoration_file = constants.P_RUN + 'nets_restored'
+ if not os.path.exists(restoration_file):
+ _restore()
+ utils.touchFile(restoration_file)
else:
- ifcfg_restoration()
+ _restore()
+
+
+if config.get('vars', 'net_persistence') == 'unified':
+ _restore = unified_restoration()
+else:
+ _restore = ifcfg_restoration()
if __name__ == '__main__':
@@ -95,4 +108,11 @@
level=logging.DEBUG)
logging.error('Could not init proper logging', exc_info=True)
- restore()
+ parser = argparse.ArgumentParser(
+ description="Copies the specified file to /config and then bindmounts "
+ "it back at it's original location. The file is stored with its full "
+ "path detail.")
+ parser.add_argument('--conditional', action='store_true', default=False)
+
+ arguments = parser.parse_args(sys.argv[1:])
+ restore(conditional=arguments.conditional)
--
To view, visit http://gerrit.ovirt.org/29441
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70cdf1e8a1e7063ec850081ac6199728d4cde381
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: storage: ignore missing pv metadata
by xfrancis@redhat.com
Xavi Francisco has uploaded a new change for review.
Change subject: storage: ignore missing pv metadata
......................................................................
storage: ignore missing pv metadata
Ignore missing metadata when trying to parse PV information from a
problematic LVM device.
When vdsm tries to read metadata from a LVM physical volume and
there's an error, the lvm command exits normally but no pv metadata
is retrieved and a message is printed in stderr. When this happens the
method getPV() in LVM returns None. This has to be checked whenever the
PV metadata is needed to avoid throwing an exception.
Change-Id: I9932b044c8b439dc8b1f09191a5d89f4bc44c38a
Bug-Url: https://bugzilla.redhat.com/1048696
Signed-off-by: Xavi Francisco <xfrancis(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/27442/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 377b132..c41e737 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -668,6 +668,10 @@
continue
pv = lvm.getPV(dev)
+ if not pv:
+ cls.log.warning("Could not get metadata from the device: %s",
+ dev)
+ continue
pvInfo = {}
pvInfo["guid"] = os.path.basename(pv.name)
pvInfo["uuid"] = pv.uuid
--
To view, visit http://gerrit.ovirt.org/27442
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9932b044c8b439dc8b1f09191a5d89f4bc44c38a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xavi Francisco <xfrancis(a)redhat.com>
9 years, 1 month
Change in vdsm[master]: task: refactor lock acquiring helper functions
by derez@redhat.com
Daniel Erez has uploaded a new change for review.
Change subject: task: refactor lock acquiring helper functions
......................................................................
task: refactor lock acquiring helper functions
Refactored 'getExclusiveLock' and 'getSharedLock' functions
on Task class:
* Both functions now gets a list of resources names
and a dictionary of options.
- The list of resources are joined by '_' character in
a new inner private function: '_acquireResource'
(i.e. the functions keep backwards compatibility).
- The options dictionary can be used for the optional
timeout value.
* Modified usages of both these functions accordingly on
'hsm -> removeVM/updateVM/deleteImage'.
Change-Id: Iac7eaa5ad577279a602651ab2df9e53ee58ac9d5
Signed-off-by: Daniel Erez <derez(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/task.py
2 files changed, 18 insertions(+), 23 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/29729/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 30767b4..0170d5d 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1341,7 +1341,7 @@
if not sdUUID or sdUUID == sd.BLANK_UUID:
sdUUID = pool.masterDomain.sdUUID
- vars.task.getExclusiveLock(STORAGE, "vms_" + sdUUID)
+ vars.task.getExclusiveLock(STORAGE, "vms", sdUUID)
pool.updateVM(vmList=vmList, sdUUID=sdUUID)
@public
@@ -1364,8 +1364,8 @@
if not sdUUID or sdUUID == sd.BLANK_UUID:
sdUUID = pool.masterDomain.sdUUID
- vars.task.getSharedLock(STORAGE, "vms_" + sdUUID)
- vars.task.getExclusiveLock(STORAGE, "vms_%s_%s" % (vmUUID, sdUUID))
+ vars.task.getSharedLock(STORAGE, "vms", sdUUID)
+ vars.task.getExclusiveLock(STORAGE, "vms", vmUUID, sdUUID)
pool.removeVM(vmUUID=vmUUID, sdUUID=sdUUID)
@public
@@ -1494,7 +1494,7 @@
# Taking an exclusive lock on both imgUUID and sdUUID since
# an image can exist on two SDs concurrently (e.g. during LSM flow);
# hence, we need a unique identifier.
- vars.task.getExclusiveLock(STORAGE, "%s_%s" % (imgUUID, sdUUID))
+ vars.task.getExclusiveLock(STORAGE, imgUUID, sdUUID)
vars.task.getSharedLock(STORAGE, sdUUID)
allVols = dom.getAllVolumes()
volsByImg = sd.getVolsOfImage(allVols, imgUUID)
diff --git a/vdsm/storage/task.py b/vdsm/storage/task.py
index f9ce837..d5849c3 100644
--- a/vdsm/storage/task.py
+++ b/vdsm/storage/task.py
@@ -439,6 +439,9 @@
class Task:
+
+ DEFAULT_TIMEOUT = config.getint('irs', 'task_resource_default_timeout')
+
# External Task info
fields = {
# field_name: type
@@ -1323,24 +1326,16 @@
return s
@misc.logskip("ResourceManager")
- def getExclusiveLock(
- self,
- namespace,
- resName,
- timeout=config.getint('irs',
- 'task_resource_default_timeout')):
- self.resOwner.acquire(namespace,
- resName,
- resourceManager.LockType.exclusive,
- timeout)
+ def getExclusiveLock(self, namespace, *resources, **options):
+ self._acquireResource(resourceManager.LockType.exclusive, namespace,
+ resources, options)
@misc.logskip("ResourceManager")
- def getSharedLock(self,
- namespace,
- resName,
- timeout=config.getint('irs',
- 'task_resource_default_timeout')):
- self.resOwner.acquire(namespace,
- resName,
- resourceManager.LockType.shared,
- timeout)
+ def getSharedLock(self, namespace, *resources, **options):
+ self._acquireResource(resourceManager.LockType.shared, namespace,
+ resources, options)
+
+ def _acquireResource(self, lock_type, namespace, resources, options):
+ resource_name = '_'.join(resources)
+ timeout = options.get('timeout', self.DEFAULT_TIMEOUT)
+ self.resOwner.acquire(namespace, resource_name, lock_type, timeout)
\ No newline at end of file
--
To view, visit http://gerrit.ovirt.org/29729
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac7eaa5ad577279a602651ab2df9e53ee58ac9d5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <derez(a)redhat.com>
9 years, 1 month