Francesco Romani has uploaded a new change for review.
Change subject: hypervisor autodetection for the vdsm capabilities
......................................................................
hypervisor autodetection for the vdsm capabilities
This is a follow up and an extension of the
Change I79f4ab08: add and use hypervisor autodetection in bootstrap.
(see http://gerrit.ovirt.org/#/c/7657 )
The vdsm capability reporting code is enhanced to autonomously
autodetect and report if the vdsm is running under an hypervisor,
thus if the virtualization support has to be emulated.
The hypervisor detection code is the same as the patch mentioned
above, updated following the comment received so far.
The autodetection code is moved in a separate little module
(`cpu_utils.py') which can be shared both by the vdsm and the
vds_bootstrap code.
So far, the two patches are independent and so they use independent
(duplicated) detection code, but a further patch (or an extension
of the current one, if preferred) is planned in order to share
the same module, minimizing the duplication to the point which I believe
is the minimum possible.
With this change and the one mentioned above both applied, there
is no longer need of the `fake_kvm_support' configuration variable.
In the proposed patch it is left as last resort/fallback option,
but it can be removed with a further patch, planned as well.
Change-Id: I565ef639e1f74bdbaef93060f4f25c75085d361b
Signed-off-by: Francesco Romani <fromani(a)gmail.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
M vdsm/caps.py
A vdsm/cpu_utils.py
4 files changed, 82 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/7884/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index bb6730e..fb8bb01 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -559,6 +559,7 @@
%{_datadir}/%{vdsm_name}/blkid.py*
%{_datadir}/%{vdsm_name}/caps.py*
%{_datadir}/%{vdsm_name}/clientIF.py*
+%{_datadir}/%{vdsm_name}/cpu_utils.py*
%{_datadir}/%{vdsm_name}/API.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/hooks.py*
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 96c8a56..662190d 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -31,6 +31,7 @@
caps.py \
clientIF.py \
configNetwork.py \
+ cpu_utils.py \
debugPluginClient.py \
guestIF.py \
hooking.py \
diff --git a/vdsm/caps.py b/vdsm/caps.py
index f1641ff..afc88dd 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -41,6 +41,7 @@
from vdsm import utils
from vdsm import constants
import storage.hba
+import cpu_utils
# For debian systems we can use python-apt if available
try:
@@ -228,11 +229,18 @@
return __osversion
+(a)utils.memoized
+def _getHypervisorName():
+ return cpu_utils.findHypervisor()
+
+
def get():
caps = {}
+ fake_kvm = bool(_getHypervisorName()) or \
+ config.getboolean('vars', 'fake_kvm_support')
caps['kvmEnabled'] = \
- str(config.getboolean('vars', 'fake_kvm_support') or
+ (str(fake_kvm) or
os.path.exists('/dev/kvm')).lower()
cpuInfo = CpuInfo()
@@ -243,7 +251,7 @@
caps['cpuSockets'] = str(cpuInfo.sockets())
caps['cpuSpeed'] = cpuInfo.mhz()
- if config.getboolean('vars', 'fake_kvm_support'):
+ if fake_kvm:
caps['cpuModel'] = 'Intel(Fake) CPU'
flags = set(cpuInfo.flags() + ['vmx', 'sse2', 'nx'])
caps['cpuFlags'] = ','.join(flags) + 'model_486,model_pentium,' \
@@ -276,6 +284,7 @@
config.getint('vars', 'host_mem_reserve') +
config.getint('vars', 'extra_mem_reserve'))
caps['guestOverhead'] = config.get('vars', 'guest_ram_overhead')
+ caps['hypervisorName'] = _getHypervisorName()
return caps
diff --git a/vdsm/cpu_utils.py b/vdsm/cpu_utils.py
new file mode 100644
index 0000000..c3f402e
--- /dev/null
+++ b/vdsm/cpu_utils.py
@@ -0,0 +1,69 @@
+#
+# Copyright 2008-2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+"""
+A module containing miscellaneous cpu detection functions
+used by various vdsm components.
+"""
+
+import struct
+import logging
+import traceback
+
+
+def cpuHypervisorID():
+ # we cannot (yet) use _cpuid because of the different
+ # unpack format.
+ HYPERVISOR_CPUID_LEAF = 0x40000000
+ with open('/dev/cpu/0/cpuid') as f:
+ f.seek(HYPERVISOR_CPUID_LEAF)
+ c = struct.unpack('I12s', f.read(16))
+ return c[1].strip('\x00')
+ return ''
+
+def cpuModelName():
+ with open('/proc/cpuinfo') as f:
+ for line in f:
+ if ':' in line:
+ k, v = line.split(':', 1)
+ k = k.strip()
+ if k == 'model name':
+ return v.strip()
+ return ''
+
+def findHypervisor():
+ name = ''
+ try:
+ hid = cpuHypervisorID()
+ if hid == 'VMwareVMware':
+ name = 'vmware'
+ elif hid == 'Microsoft Hv':
+ name = 'hyperv'
+ elif hid == 'XenVMMXenVMM':
+ name = 'xen'
+ elif hid == 'KVMKVMKVM':
+ name = 'kvm'
+ elif 'QEMU' in cpuModelName():
+ name = 'qemu'
+ logging.debug('detected hypervisor: %s', name)
+ except:
+ logging.error(traceback.format_exc())
+ return name
+
--
To view, visit http://gerrit.ovirt.org/7884
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I565ef639e1f74bdbaef93060f4f25c75085d361b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)gmail.com>
Fernando Granha Jeronimo has uploaded a new change for review.
Change subject: Avoid race condition with vdsm-reg during firstboot
......................................................................
Avoid race condition with vdsm-reg during firstboot
In the vdsm-config script, the vdsm-reg service is disabled to
avoid race conditions, once it is intended to be executed just
before the node is rebooted and the registration process should
take place only after reboot.
Change-Id: I2a215bbe6c467d10cf414b09cdaee5340092198e
Signed-off-by: Fernando Granha Jeronimo <fgranha(a)linux.vnet.ibm.com>
---
M vdsm_reg/vdsm-config
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8200/1
diff --git a/vdsm_reg/vdsm-config b/vdsm_reg/vdsm-config
index 968d78c..0a030d1 100755
--- a/vdsm_reg/vdsm-config
+++ b/vdsm_reg/vdsm-config
@@ -14,6 +14,16 @@
echo "vdsm-config: starting" | tee $LOG
+ # Disable vdsm-reg service to avoid race condition
+ # when parameters are written to config file and the
+ # service is running. This is necessary, because the
+ # registration process can take place only after reboot.
+ if [ -x /bin/systemctl ] ; then
+ /bin/systemctl stop vdsm-reg.service > /dev/null 2>&1
+ elif [ -x /sbin/service ] ; then
+ /sbin/service vdsm-reg stop > /dev/null 2>&1
+ fi
+
set_vars() {
echo "[vars]" >> $VDSM_CONFIG #Adding ts for the coming scripts.
echo "trust_store_path = " `$GETCONFITEM $VDSM_CONFIG vars trust_store_path /etc/pki/vdsm` >> $VDSM_CONFIG
--
To view, visit http://gerrit.ovirt.org/8200
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a215bbe6c467d10cf414b09cdaee5340092198e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Fernando Granha Jeronimo <fgranha(a)linux.vnet.ibm.com>
Royce Lv has uploaded a new change for review.
Change subject: [WIP]change startup process for vdsm and supervdsm
......................................................................
[WIP]change startup process for vdsm and supervdsm
Using vdsmService to take care of start up and respawn process of
vdsm and supervdsm. Remove the function of vdsm to start previlege
supervdsm process.
Change-Id: I69aae6b0b9529c80291d90c6ad14ff82b21aea53
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
M vdsm/storage/misc.py
M vdsm/supervdsm.py
M vdsm/supervdsmServer.py
M vdsm/vdsm
A vdsm/vdsmService
M vdsm/vdsmd.init.in
M vdsm_reg/Makefile.am
9 files changed, 208 insertions(+), 63 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/4145/1
--
To view, visit http://gerrit.ovirt.org/4145
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I69aae6b0b9529c80291d90c6ad14ff82b21aea53
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Eduardo has uploaded a new change for review.
Change subject: Related to BZ# - One shot prepare.
......................................................................
Related to BZ# - One shot prepare.
The number of storage accesses is reduced to 1 or none instead of
the recursive volume images produces.
Change-Id: Id47db9c53199385dd5d08586e4782ea23885eb72
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/4220/1
--
To view, visit http://gerrit.ovirt.org/4220
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id47db9c53199385dd5d08586e4782ea23885eb72
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
Dan Kenigsberg has uploaded a new change for review.
Change subject: hack: disable NetworkManager on installation
......................................................................
hack: disable NetworkManager on installation
When vdsm is told to own an interface (or bond) it takes it down, marks
it as NM_CONTROLLED=no, and takes it up again.
NetworkManager "unmanages" the device asynchronously, and then takes the
device down. Thus we may end up with a disconnected network
Until we find a smarter way to circuvent this unpredictable behavior
( https://bugzilla.redhat.com/879180 ), we have to turn off
NetworkManager when Vdsm is installed.
Change-Id: Ic248fb49711f991615abbb4debc0f1d91e47067b
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
M vdsm/vdsmd.service
2 files changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/10187/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 68126fd..4826fcd 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -505,6 +505,7 @@
%else
if [ "$1" -eq 1 ] ; then
/bin/systemctl enable vdsmd.service >/dev/null 2>&1 || :
+ /bin/systemctl --no-reload disable NetworkManager.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
exit 0
@@ -542,6 +543,7 @@
if [ "$1" -eq 0 ]; then
/bin/systemctl --no-reload disable vdsmd.service > /dev/null 2>&1 || :
/bin/systemctl stop vdsmd.service > /dev/null 2>&1 || :
+ /bin/systemctl enable NetworkManager.service > /dev/null 2>&1 || :
fi
exit 0
%endif
diff --git a/vdsm/vdsmd.service b/vdsm/vdsmd.service
index 6a650f4..01224dc 100644
--- a/vdsm/vdsmd.service
+++ b/vdsm/vdsmd.service
@@ -1,7 +1,7 @@
[Unit]
Description=Virtual Desktop Server Manager
Requires=multipathd.service libvirtd.service ntpd.service
-Conflicts=libvirt-guests.service
+Conflicts=libvirt-guests.service NetworkManager.service
[Service]
Type=forking
--
To view, visit http://gerrit.ovirt.org/10187
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic248fb49711f991615abbb4debc0f1d91e47067b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Eduardo has uploaded a new change for review.
Change subject: Related to BZ#769502 - One shot prepare.
......................................................................
Related to BZ#769502 - One shot prepare.
The number of storage accesses is reduced to 1 or none instead of
the recursive volume images produces.
Change-Id: I4b6a4e99cf3a657affb4f5e96aa1ac1978a297da
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/image.py
2 files changed, 5 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/4234/1
--
To view, visit http://gerrit.ovirt.org/4234
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b6a4e99cf3a657affb4f5e96aa1ac1978a297da
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: deployUtil: Add logging.error() to CPU virt check
......................................................................
deployUtil: Add logging.error() to CPU virt check
Adding logging.error() msg to help users in case CPU
virt support is disable in BIOS.
Change-Id: I3baff7594ad2cfcf4844a30586a2e4a4313a1972
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm_reg/deployUtil.py.in
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/3549/1
--
To view, visit http://gerrit.ovirt.org/3549
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3baff7594ad2cfcf4844a30586a2e4a4313a1972
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>