Change in vdsm[master]: storage: introducing vdsm-dump-chains script
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script
......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
9 years, 2 months
Change in vdsm[master]: api: make _should_keep_bridge robust against missing running...
by ibarkan@redhat.com
Ido Barkan has posted comments on this change.
Change subject: api: make _should_keep_bridge robust against missing running/persistent cfg
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.ovirt.org/38239
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I13a225f406e6140463e1ded2008de8444fc4e9e0
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 2 months
Change in vdsm[ovirt-3.5]: network: store non-Vdsm ifcfgs with unified persistence
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: network: store non-Vdsm ifcfgs with unified persistence
......................................................................
network: store non-Vdsm ifcfgs with unified persistence
Unified restoration first removes everything in the running config and
then tries to regenerate everything that's in the persisted config,
problem is, that original devices are not persisted.
In this patch we (temporarily) use ifcfg persistence for non-Vdsm devices
(even when unified persistence is set), so we are able to restore them.
Change-Id: Iaac0d82863334238e6db71b4a6a4f6b76a260223
Bug-Url: https://bugzilla.redhat.com/1188251
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/37453
Reviewed-by: Ondřej Svoboda <osvoboda(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/network/configurators/ifcfg.py
M vdsm/vdsm-restore-net-config
M vdsm/vdsm-store-net-config.in
3 files changed, 25 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/38240/1
diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 87fd849..d1f65a4 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -358,6 +358,9 @@
self._atomicBackup(filename)
if config.get('vars', 'net_persistence') != 'unified':
self._persistentBackup(filename)
+ elif not self._ownedIfcfg(filename):
+ # Backup non-VDSM network devices (BZ#1188251)
+ self._persistentBackup(filename)
def _atomicBackup(self, filename):
"""
@@ -472,19 +475,23 @@
logging.info('Loaded %s', fpath)
+ def _ownedIfcfg(self, fpath):
+ if not os.path.isfile(fpath):
+ return False
+ try:
+ with open(fpath) as confFile:
+ content = confFile.readline()
+ except IOError as e:
+ if e.errno == os.errno.ENOENT:
+ return False
+ else:
+ raise
+ if content.startswith(self.CONFFILE_HEADER_BASE):
+ return True
+
def _ownedFiles(self):
for fpath in glob.iglob(netinfo.NET_CONF_DIR + '/*'):
- if not os.path.isfile(fpath):
- continue
- try:
- with open(fpath) as confFile:
- content = confFile.read()
- except IOError as e:
- if e.errno == os.errno.ENOENT:
- continue
- else:
- raise
- if content.startswith(self.CONFFILE_HEADER_BASE):
+ if self._ownedIfcfg(fpath):
yield fpath
def loadBackups(self):
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 4eddf49..974ffc8 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -61,6 +61,10 @@
for configurator_cls in _get_all_configurators():
configurator_cls().flush()
+ # Restore non-VDSM network devices (BZ#1188251)
+ configWriter = ifcfg.ConfigWriter()
+ configWriter.restorePersistentBackup()
+
persistentConfig = PersistentConfig()
nets, bonds = _filter_nets_bonds(persistentConfig.networks,
persistentConfig.bonds)
diff --git a/vdsm/vdsm-store-net-config.in b/vdsm/vdsm-store-net-config.in
index 94e658b..c19d5e0 100755
--- a/vdsm/vdsm-store-net-config.in
+++ b/vdsm/vdsm-store-net-config.in
@@ -46,6 +46,9 @@
}
unified_nonnode_persist() {
+ # Remove stored non-VDSM network devices (BZ#1188251)
+ ifcfg_nonnode_persist
+
# Atomic directory copy by using the atomicity of overwriting a link
# (rename syscall).
TIMESTAMP=$(date +%s%N)
--
To view, visit https://gerrit.ovirt.org/38240
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaac0d82863334238e6db71b4a6a4f6b76a260223
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: api: correct the order of parameters in _bridge_reconfigured
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: api: correct the order of parameters in _bridge_reconfigured
......................................................................
api: correct the order of parameters in _bridge_reconfigured
The wrong order was harmless because both parameters are passed to !=
which is commutative.
Change-Id: I2326fffabaffeadc796b492ffe575a669a46b727
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M vdsm/network/api.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/38256/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 2706cfe..45c16c7 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -752,9 +752,9 @@
(k, v) for k, v in conf.iteritems()
if k not in ('bonding', 'nic', 'mtu'))
- def _bridge_reconfigured(required_conf, current_conf):
- return (_bridge_only_config(required_conf) !=
- _bridge_only_config(current_conf))
+ def _bridge_reconfigured(current_conf, required_conf):
+ return (_bridge_only_config(current_conf) !=
+ _bridge_only_config(required_conf))
if currently_bridged and _bridge_reconfigured(network_running_config,
network_attrs):
--
To view, visit https://gerrit.ovirt.org/38256
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2326fffabaffeadc796b492ffe575a669a46b727
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: tests: Add missing empty line
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: tests: Add missing empty line
......................................................................
tests: Add missing empty line
Change-Id: I332a1a6b9323e00dd8e62eefc969e5d52660b9f0
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M tests/miscTests.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/38248/1
diff --git a/tests/miscTests.py b/tests/miscTests.py
index 3b8c850..3917fe8 100644
--- a/tests/miscTests.py
+++ b/tests/miscTests.py
@@ -882,6 +882,7 @@
@expandPermutations
class ReadSpeed(TestCaseBase):
+
@permutations([
("1 byte (1 B) copied, 1 s, 1 B/s",
"1", "1"),
--
To view, visit https://gerrit.ovirt.org/38248
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I332a1a6b9323e00dd8e62eefc969e5d52660b9f0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: hooks: vm: graphics console listen on all ifs
by fkobzik@redhat.com
Frank Kobzik has uploaded a new change for review.
Change subject: hooks: vm: graphics console listen on all ifs
......................................................................
hooks: vm: graphics console listen on all ifs
This hook makes the graphics console device listen on all interfaces (instead
of listening on display network).
The configuration is described in the hook itself.
Signed-off-by: Frantisek Kobzik <fkobzik(a)redhat.com>
Change-Id: I512586497209cb631e684c5f09084dcecfca0ec3
---
A vdsm_hooks/console_listen_on_all_ifs/before_vm_start.py
1 file changed, 101 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/35661/1
diff --git a/vdsm_hooks/console_listen_on_all_ifs/before_vm_start.py b/vdsm_hooks/console_listen_on_all_ifs/before_vm_start.py
new file mode 100755
index 0000000..a26f50e
--- /dev/null
+++ b/vdsm_hooks/console_listen_on_all_ifs/before_vm_start.py
@@ -0,0 +1,101 @@
+#!/usr/bin/python
+
+import os
+import ConfigParser
+import sys
+import hooking
+import traceback
+from xml.dom import minidom
+from vdsm.config import config
+
+#
+# Placed in before_vm_start
+#
+# This hook makes graphics console server listen on all interfaces (instead of
+# on one dedicated display network).
+#
+# Configuration:
+# in /etc/vdsm.conf add this line:
+# console_listen_on_all_ifs = true
+#
+# Example input:
+# <domain>
+# <devices>
+# <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
+# <listen type='address' address='127.0.0.1'/>
+# </graphics>
+# </devices>
+# </domain>
+# Corresponding output:
+# <domain>
+# <devices>
+# <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
+# <listen type='address' address='0'/>
+# </graphics>
+# </devices>
+# </domain>
+#
+
+
+def wipe_listen_children(elem):
+ listens = elem.getElementsByTagName('listen')
+ for listen in listens:
+ elem.removeChild(listen)
+
+
+def add_promiscuous_listen(elem, doc):
+ listen = doc.createElement('listen')
+ listen.setAttribute('type', 'address')
+ listen.setAttribute('address', '0')
+ elem.appendChild(listen)
+
+
+def adjust_graphics(domxml):
+ for graphics in domxml.getElementsByTagName('graphics'):
+ wipe_listen_children(graphics)
+ add_promiscuous_listen(graphics, domxml)
+
+
+def main():
+ try:
+ if config.getboolean('vars', 'console_listen_on_all_ifs'):
+ sys.stderr.write('console_listen_on_all_ifs: '
+ 'starting to modify vm \n')
+ domxml = hooking.read_domxml()
+ adjust_graphics(domxml)
+ hooking.write_domxml(domxml)
+ except ConfigParser.NoOptionError:
+ sys.stderr.write('console_listen_on_all_ifs: WARN : '
+ 'Couldn\'t read configuration.')
+ except:
+ sys.stderr.write('console_listen_on_all_ifs: ERROR %s\n' %
+ traceback.format_exc())
+ sys.exit(2)
+
+
+def test():
+ domxml = minidom.parseString("""
+ <domain>
+ <devices>
+ <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
+ <listen type='address' address='127.0.0.1'/>
+ </graphics>
+ </devices>
+ </domain>
+ """)
+ print "Domain before applying hook: %s" % \
+ domxml.toxml(encoding='UTF-8')
+ adjust_graphics(domxml)
+ print "Graphics console after applying hook: %s" % \
+ domxml.toxml(encoding='UTF-8')
+
+
+if __name__ == '__main__':
+ try:
+ if '--test' in sys.argv:
+ test()
+ else:
+ main()
+ except:
+ hooking.exit_hook('extnet hook: [unexpected error]: %s\n' %
+ traceback.format_exc())
--
To view, visit http://gerrit.ovirt.org/35661
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I512586497209cb631e684c5f09084dcecfca0ec3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkobzik(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: vdsm-tool: vdsm-id: add force option to force generate id
by Alon Bar-Lev
Alon Bar-Lev has uploaded a new change for review.
Change subject: vdsm-tool: vdsm-id: add force option to force generate id
......................................................................
vdsm-tool: vdsm-id: add force option to force generate id
this is handy to hide the existence and usage of /etc/vdsm/vdsm.id from
users (other components).
Change-Id: I89f1e29c9cdad0cadb32545fa27c1702ad2e116a
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M lib/vdsm/tool/vdsm-id.py
M lib/vdsm/utils.py
2 files changed, 35 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/20808/1
diff --git a/lib/vdsm/tool/vdsm-id.py b/lib/vdsm/tool/vdsm-id.py
index 109c382..01f94a9 100644
--- a/lib/vdsm/tool/vdsm-id.py
+++ b/lib/vdsm/tool/vdsm-id.py
@@ -17,9 +17,13 @@
# Refer to the README and COPYING files for full details of the license
#
+
+import sys
+import argparse
+
+
from vdsm.utils import getHostUUID
from vdsm.tool import expose
-import sys
@expose("vdsm-id")
@@ -27,7 +31,19 @@
"""
Printing host uuid
"""
- hostUUID = getHostUUID(False)
+ parser = argparse.ArgumentParser('vdsm-tool configure')
+ parser.add_argument(
+ '--force',
+ dest='force',
+ default=False,
+ action='store_true',
+ help='Generate vdsmid if not available',
+ )
+ args = parser.parse_args(sys.argv[2:])
+ hostUUID = getHostUUID(
+ legacy=False,
+ force=args.force,
+ )
if hostUUID is None:
raise RuntimeError('Cannot retrieve host UUID')
sys.stdout.write(hostUUID)
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 78d055e..d38a273 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -48,6 +48,7 @@
import subprocess
import threading
import time
+import uuid
from cpopen import CPopen as BetterPopen
import constants
@@ -599,7 +600,7 @@
__hostUUID = None
-def getHostUUID(legacy=True):
+def getHostUUID(legacy=True, force=False):
global __hostUUID
if __hostUUID:
return __hostUUID
@@ -624,6 +625,14 @@
if p.returncode == 0 and 'Not' not in out:
#Avoid error string - 'Not Settable' or 'Not Present'
__hostUUID = out.strip()
+ elif force:
+ hostid = str(uuid.uuid4())
+ with open(constants.P_VDSM_NODE_ID, 'w') as f:
+ f.write("%s\n", hostid)
+ if isOvirtNode():
+ from ovirtnode import ovirtfunctions
+ ovirtfunctions.ovirt_store_config(constants.P_VDSM_NODE_ID)
+ __hostUUID = hostid
else:
logging.warning('Could not find host UUID.')
@@ -877,3 +886,10 @@
logging.error("Panic: %s", msg, exc_info=True)
os.killpg(0, 9)
sys.exit(-3)
+
+
+def isOvirtNode():
+ return (
+ os.path.exists('/etc/rhev-hypervisor-release') or
+ glob.glob('/etc/ovirt-node-*-release')
+ )
--
To view, visit http://gerrit.ovirt.org/20808
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I89f1e29c9cdad0cadb32545fa27c1702ad2e116a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: api: make _should_keep_bridge robust against missing running...
by osvoboda@redhat.com
Ondřej Svoboda has posted comments on this change.
Change subject: api: make _should_keep_bridge robust against missing running/persistent cfg
......................................................................
Patch Set 2: Verified+1
Confirming again that the patch fixes the error.
--
To view, visit https://gerrit.ovirt.org/38239
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I13a225f406e6140463e1ded2008de8444fc4e9e0
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 2 months
Change in vdsm[master]: api: make _should_keep_bridge robust against missing running...
by osvoboda@redhat.com
Ondřej Svoboda has posted comments on this change.
Change subject: api: make _should_keep_bridge robust against missing running/persistent cfg
......................................................................
Patch Set 1:
(2 comments)
https://gerrit.ovirt.org/#/c/38239/1/vdsm/network/api.py
File vdsm/network/api.py:
Line 750: return dict(
Line 751: (k, v) for k, v in conf.iteritems()
Line 752: if k not in ('bonding', 'nic', 'mtu'))
Line 753:
Line 754: # isn't the parameter order wrong?!
> the order is indeed wrong
Thanks.
Line 755: def _bridge_reconfigured(required_conf, current_conf):
Line 756: # we know nothing about the running/persistent configuration because
Line 757: # it has been removed e.g. by shell_helper's emergency_net_cleanup
Line 758: if current_conf is None or required_conf is None:
Line 755: def _bridge_reconfigured(required_conf, current_conf):
Line 756: # we know nothing about the running/persistent configuration because
Line 757: # it has been removed e.g. by shell_helper's emergency_net_cleanup
Line 758: if current_conf is None or required_conf is None:
Line 759: return False
> but let's return True an throw away the bridge just in case, because we don
Corrected now. I think I misundestood _bridge_reconfigured's semantics.
Line 760:
Line 761: return (_bridge_only_config(required_conf) !=
Line 762: _bridge_only_config(current_conf))
Line 763:
--
To view, visit https://gerrit.ovirt.org/38239
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I13a225f406e6140463e1ded2008de8444fc4e9e0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 2 months