Nir Soffer has uploaded a new change for review.
Change subject: vm: Support for non-ascii vm name
......................................................................
vm: Support for non-ascii vm name
Libvirt does not support non-ascii vm name, failing creation of such vm.
Use generated vm name based on vm id, used when vm name is not provided.
For easier debugging, we log he non-ascii name when starting a vm:
Non-ASCII vm name 'מכונה-ויראטואלית'
And also the generaed name (same when vm name is not provided):
Using generated vm name 'nb938182d-7f19-435b-9499-4cb8f1578e1b'
Note: this change may break engine side, if it expects the original vm
name in vdsm response. Fixing this on the engine side will avoid this
issue and may be better idea.
Tested with both jsonrpc and xmlrpc:
- Creating vm with non-ascii name
- Staring vm
- Opening spice console
- Stopping vm
- Restarting vdsm while vm is running
- Migrating to another host (broken with jsonrpc see bz1282054)
Change-Id: I2386c0f98aeb8161feaf19c2862be229f73eb0df
Bug-Url: https://bugzilla.redhat.com/1260131
Relates-To: https://bugzilla.redhat.com/1062943
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/48570/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index f9bc25c..a6d2bc8 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -299,8 +299,7 @@
self._devices = self._emptyDevMap()
self._connection = libvirtconnection.get(cif)
- if 'vmName' not in self.conf:
- self.conf['vmName'] = 'n%s' % self.id
+ self.conf['vmName'] = self._normalizedVmName(params)
self._guestSocketFile = self._makeChannelPath(_VMCHANNEL_DEVICE_NAME)
self._qemuguestSocketFile = self._makeChannelPath(_QEMU_GA_DEVICE_NAME)
self.guestAgent = guestagent.GuestAgent(
@@ -380,6 +379,22 @@
break
return str(idx)
+ def _normalizedVmName(self, params):
+ name = params.get('vmName')
+ if isinstance(name, unicode):
+ # Libvirt does not support non-ascii vm name
+ # See https://bugzilla.redhat.com/1260131
+ try:
+ name = name.encode('ascii')
+ except UnicodeEncodeError:
+ self.log.debug("Non-ASCII vm name '%s'", name.encode('utf8'))
+ name = None
+ if name is None:
+ # Missing or non-ascii name
+ name = 'n' + params['vmId']
+ self.log.debug("Using generated vm name %r", name)
+ return name
+
def _normalizeVdsmImg(self, drv):
drv['reqsize'] = drv.get('reqsize', '0') # Backward compatible
if 'device' not in drv:
--
To view, visit https://gerrit.ovirt.org/48570
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2386c0f98aeb8161feaf19c2862be229f73eb0df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: automation: Enable xunit report
......................................................................
automation: Enable xunit report
This used to segfault python in the past, but I think I fixed the root
cause long time ago.
Trying to use this again since it seems to give interesting output
like the time it took to run each test.
Change-Id: Ie8c09cf21e7cf4a97b7b006f2b3ebe4943ed72b9
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M automation/check-patch.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/46640/1
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
index 15707e8..1dba426 100755
--- a/automation/check-patch.sh
+++ b/automation/check-patch.sh
@@ -14,7 +14,7 @@
"
./autogen.sh --system --enable-hooks
-make check
+make check NOSE_WITH_XUNIT=1
./automation/build-artifacts.sh
--
To view, visit https://gerrit.ovirt.org/46640
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8c09cf21e7cf4a97b7b006f2b3ebe4943ed72b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: fileSD: Keep deleted images name unique
......................................................................
fileSD: Keep deleted images name unique
If an image delete fails, and same image is created again, the second
image cannot be deleted, since the first image occupy the deleted image
name.
We use now _remove_me_<imagid>_<taskid>. This make it easy to locate the
failed operation in vdsm or engine logs.
Change-Id: Ia0582896d7ede028e9096da1a688e3e449ab0258
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/fileSD.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/48032/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index dc4a68e..7d8074a 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -34,6 +34,7 @@
import outOfProcess as oop
from remoteFileHandler import Timeout
from persistentDict import PersistentDict, DictValidator
+from threadLocal import vars
from vdsm import constants
from vdsm.utils import stripNewLines
from vdsm import supervdsm
@@ -204,7 +205,8 @@
def deleteImage(self, sdUUID, imgUUID, volsImgs):
currImgDir = self.getImagePath(imgUUID)
dirName, baseName = os.path.split(currImgDir)
- toDelDir = os.path.join(dirName, sd.REMOVED_IMAGE_PREFIX + baseName)
+ newName = "%s%s_%s" % (sd.REMOVED_IMAGE_PREFIX, baseName, vars.task.id)
+ toDelDir = os.path.join(dirName, newName)
self.log.debug("Renaming dir %s to %s", currImgDir, toDelDir)
try:
self.oop.os.rename(currImgDir, toDelDir)
--
To view, visit https://gerrit.ovirt.org/48032
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0582896d7ede028e9096da1a688e3e449ab0258
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Ondřej Svoboda has uploaded a new change for review.
Change subject: ipv6 hook: support ipv6addrs
......................................................................
ipv6 hook: support ipv6addrs
Change-Id: I722d0007840060cdccdb12e4fba2a2066f33c62f
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M vdsm_hooks/ipv6/README
M vdsm_hooks/ipv6/ipv6.py
2 files changed, 12 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/39359/1
diff --git a/vdsm_hooks/ipv6/README b/vdsm_hooks/ipv6/README
index 05bd990..a96e2c2 100644
--- a/vdsm_hooks/ipv6/README
+++ b/vdsm_hooks/ipv6/README
@@ -5,13 +5,18 @@
Requirements:
* oVirt-3.5 (started supporting custom properties)
+New in version 4.18: (?)
+--------------------
+Multiple IPv6 addresses are now accepted, see Usage. Please use 'ipv6addrs'
+property instead of 'ipv6addr' which is deprecated.
+
Preparation on a host:
----------------------
yum install vdsm-hook-ipv6
Preparation on the engine side:
-------------------------------
-PROPERTIES='ipv6addr=.*;ipv6gateway=.*;ipv6autoconf=.*;dhcpv6=.*'
+PROPERTIES='ipv6addrs=.*;ipv6gateway=.*;ipv6autoconf=.*;dhcpv6=.*'
engine-config -s "UserDefinedNetworkCustomProperties=$PROPERTIES" --cver='3.5'
Don't forget to include the names of other custom network properties you may
@@ -20,9 +25,10 @@
Usage:
------
In the oVirt UI open the 'Setup Host Networks' dialog. Proceed to editing
-a desired logical network's properties. Among them you will find 'ipv6addr'
-and 'ipv6gateway', which accept custom IPv6 addresses, plus 'ipv6autoconf'
-and 'dhcpv6', which accept '0', '1' or 'false', 'true'.
+a desired logical network's properties. Among them you will find 'ipv6addrs'
+(which accepts a space-separated list of IPv6 addresses), 'ipv6gateway'
+(a single address), plus 'ipv6autoconf' and 'dhcpv6', which accept '0', '1' or
+'false', 'true'.
You may be warned that the network is in use when confirming the 'Setup Host
Networks' dialog. Make sure to stop any VMs that are using the network.
diff --git a/vdsm_hooks/ipv6/ipv6.py b/vdsm_hooks/ipv6/ipv6.py
index 6c00475..9385fab 100644
--- a/vdsm_hooks/ipv6/ipv6.py
+++ b/vdsm_hooks/ipv6/ipv6.py
@@ -34,7 +34,8 @@
def _process_network(attrs):
- for property_name in ('ipv6addr', 'ipv6gateway', 'ipv6autoconf', 'dhcpv6'):
+ for property_name in ('ipv6addrs', 'ipv6addr', 'ipv6gateway',
+ 'ipv6autoconf', 'dhcpv6'):
value = attrs['custom'].get(property_name)
if value is not None:
attrs[property_name] = value
--
To view, visit https://gerrit.ovirt.org/39359
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I722d0007840060cdccdb12e4fba2a2066f33c62f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: do not call before_vm_create in dehibernation
......................................................................
vm: do not call before_vm_create in dehibernation
For reasons unknown, VDSM calls the before_vm_create hook
also in the dehibernation path.
This is wasteful and useless at best, and most likely misleading
and wrong, because VDSM logs the XML it produced, which is *not* what is
gonna be used in the dehibernation path. The hook is fed with
phony data, and the output of the hook is discarded.
This patch dispel the lie and avoid to call the before_vm_create
hook in the dehibernation path.
Change-Id: I4c1377346b1ae63a1feb15e1458b5141c255c849
X-Backport-To: 3.6
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 0 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/45074/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index c54853a..b77b9df 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1887,8 +1887,6 @@
hooks.before_vm_dehibernate(srcDomXML, self.conf,
{'FROM_SNAPSHOT': str(fromSnapshot)})
- # TODO: this silliness is only to preserve the old behaviour
- hooks.before_vm_start(self._buildDomainXML(), self.conf)
# TODO: this is debug information. For 3.6.x we still need to
# see the XML even with 'info' as default level.
self.log.info(srcDomXML)
--
To view, visit https://gerrit.ovirt.org/45074
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c1377346b1ae63a1feb15e1458b5141c255c849
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: API: streamline and make setLogLevel correct
......................................................................
API: streamline and make setLogLevel correct
According to the schema, setLogLevel should accept
a log level string ('DEBUG', 'INFO',...). But the code
actually blindly casted the given value to int(), and this suggests
the code actually expected an integer value.
To make things a bit user friendlier and comformant to schema, change
the argument to actually be a log level in string format.
Along the way, this patch streamlines the implementation of setLogLevel
and makes it simpler.
Change-Id: Iaddbb12d13bdbaa7a02255ab209da11e42d2ea97
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/API.py
1 file changed, 21 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/38425/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 5cbda50..85478b1 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1369,13 +1369,22 @@
Doesn't survive a restart
"""
- logging.info('Setting loglevel to %s', level)
- handlers = logging.getLogger().handlers
- [fileHandler] = [h for h in handlers if
- isinstance(h, logging.FileHandler)]
- fileHandler.setLevel(int(level))
+ LEVELS = {
+ 'DEBUG': logging.DEBUG,
+ 'INFO': logging.INFO,
+ 'WARNING': logging.WARNING,
+ 'ERROR': logging.ERROR,
+ 'CRITICAL': logging.CRITICAL
+ }
- return {'status': doneCode}
+ try:
+ log_level = LEVELS[level]
+ except KeyError:
+ return errCode['unavail']
+ else:
+ logging.info('Setting loglevel to %s (%d)', level, log_level)
+ _set_log_level(logging.getLogger(), log_level)
+ return {'status': doneCode}
# VM-related functions
def getVMList(self, fullStatus=False, vmList=()):
@@ -1772,3 +1781,9 @@
logging.warn("options %s is deprecated. Use %s instead" %
(k, _translationMap[k]))
options[_translationMap[k]] = options.pop(k)
+
+
+def _set_log_level(logger, log_level):
+ for handler in logger.handlers:
+ if isinstance(handler, logging.FileHandler):
+ handler.setLevel(log_level)
--
To view, visit https://gerrit.ovirt.org/38425
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaddbb12d13bdbaa7a02255ab209da11e42d2ea97
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>