Antoni Segura Puimedon has uploaded a new change for review.
Change subject: [WIP] Don't fail silently when ifup fails.
......................................................................
[WIP] Don't fail silently when ifup fails.
Up until now we discarded ifup return codes and ignored
the possible errors present in ifup stdout. Use this
information to perform better error reporting.
Change-Id: I1cc9dcc0a6b55d36fc937e1d364bd9c256ecd70a
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/856737
---
M vdsm/configNetwork.py
M vdsm/neterrors.py
2 files changed, 28 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/8415/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index a114798..fb7cd94 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -29,6 +29,7 @@
from xml.sax.saxutils import escape
import glob
import shutil
+from functools import partial
import libvirt
import selinux
@@ -60,15 +61,23 @@
return rc
-def ifup(iface, async=False):
+def ifup(iface, async=False, final=None):
"Bring up an interface"
- _ifup = lambda netIf: execCmd([constants.EXT_IFUP, netIf], raw=True)
+ def _ifup(netIf, toCall=None):
+ rc, out, err = execCmd([constants.EXT_IFUP, netIf], raw=False)
+
+ if rc != 0:
+ # In /etc/sysconfig/network-scripts/ifup* the last line usually
+ # contains the error reason.
+ raise ConfigNetworkError(ne.ERR_FAILED_IFUP, out[-1])
+ elif toCall is not None:
+ toCall()
if async:
# wait for dhcp in another thread,
# so vdsm won't get stuck (BZ#498940)
t = threading.Thread(target=_ifup, name='ifup-waiting-on-dhcp',
- args=(iface,))
+ args=(iface, final))
t.daemon = True
t.start()
else:
@@ -899,6 +908,11 @@
nic = nics[0] if nics else None
iface = bonding or nic
blockingDhcp = utils.tobool(options.get('blockingdhcp'))
+ # Asynchronous top level ifup creation variables.
+ async = options['bootproto'] and blockingDhcp
+ libvirtNetworkCreation = partial(configWriter.createLibvirtNetwork,
+ network, bridged, iface)
+
# take down nics that need to be changed
vlanedIfaces = [v['iface'] for v in _netinfo.vlans.values()]
@@ -959,22 +973,27 @@
# Now we can run ifup for all interfaces
if bonding:
- ifup(bonding, bondBootproto == 'dhcp' and not blockingDhcp)
+ ifup(bonding, bondBootproto == 'dhcp' and not blockingDhcp,
+ libvirtNetworkCreation)
# NICs must be activated in the same order of boot time
# to expose the correct MAC address.
for nic in nicSort(nics):
- ifup(nic, options['bootproto'] and not blockingDhcp)
+ ifup(nic, options['bootproto'] and not blockingDhcp,
+ libvirtNetworkCreation)
# Now we can ifup VLAN interface, because bond and nic already up
if vlan:
- ifup(iface, vlanBootproto == 'dhcp' and not blockingDhcp)
+ ifup(iface, vlanBootproto == 'dhcp' and not blockingDhcp,
+ libvirtNetworkCreation)
if bridged:
- ifup(network, bridgeBootproto == 'dhcp' and not blockingDhcp)
+ ifup(network, bridgeBootproto == 'dhcp' and not blockingDhcp,
+ libvirtNetworkCreation)
# add libvirt network
- configWriter.createLibvirtNetwork(network, bridged, iface)
+ if not async:
+ libvirtNetworkCreation()
def assertBridgeClean(bridge, vlan, bonding, nics):
diff --git a/vdsm/neterrors.py b/vdsm/neterrors.py
index 65e2674..92faa59 100644
--- a/vdsm/neterrors.py
+++ b/vdsm/neterrors.py
@@ -27,4 +27,5 @@
ERR_BAD_VLAN = 26
ERR_BAD_BRIDGE = 27
ERR_USED_BRIDGE = 28
+ERR_FAILED_IFUP = 30
ERR_LOST_CONNECTION = 10 # noConPeer
--
To view, visit http://gerrit.ovirt.org/8415
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cc9dcc0a6b55d36fc937e1d364bd9c256ecd70a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Pradipta Banerjee has uploaded a new change for review.
Change subject: Add getOSName() method in deployUtil for OS detection
......................................................................
Add getOSName() method in deployUtil for OS detection
This patch improves the current detection of whether the running
host is RHEL6 based or Fedora by adding a new method getOSName()
Change-Id: Ifff9b08902cd234dfa03292136317d50e5e3d22b
Signed-off-by: Pradipta Kr. Banerjee <bpradip(a)in.ibm.com>
---
M vds_bootstrap/vds_bootstrap.py
M vdsm_reg/deployUtil.py.in
2 files changed, 24 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/8002/1
diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index 537953d..c6ae08e 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -66,11 +66,18 @@
(LOGDIR, "phase1", strftime("%Y%m%d%H%M%S")),
filemode='w')
-rhel6based = deployUtil.versionCompare(deployUtil.getOSVersion(), "6.0") >= 0
+#Detect RHEL6 or Fedora16 as min supported version
+rhel6based = False
+fedorabased = False
+if (deployUtil.getOSName().lower() == "redhat" and
+ deployUtil.versionCompare(deployUtil.getOSVersion(), "6.0")) >= 0:
+ rhel6based = True
-# TODO this is an infra-hackish heuristic for identifying Fedora
-# drop as soon as possible
-fedorabased = deployUtil.versionCompare(deployUtil.getOSVersion(), "16") >= 0
+if (deployUtil.getOSName().lower() == "fedora" and
+ deployUtil.versionCompare(deployUtil.getOSVersion(), "16")) >= 0:
+ fedorabased = True
+
+logging.debug("fedorabased=%d rhel6based=%d", fedorabased, rhel6based)
if rhel6based:
VDSM_NAME = "vdsm"
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index bbda70e..e410e32 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -451,6 +451,19 @@
logging.debug("OS Release Ver = %s", osVer[1])
return osVer[1]
+def getOSName():
+ """
+ Return the OS Name, Fedora, Redhat etc
+
+ Return "Unknown OS" on any failure.
+ """
+
+ # platform.linux_distribution returns a tuple (distname, version, id) or
+ # default as given in args in case of any failure
+ osName = platform.linux_distribution(distname='Unknown OS', version='')
+ logging.debug("OS Name = %s", osName[0])
+ return osName[0]
+
def getKernelVR():
"""Return current kernel version and release."""
--
To view, visit http://gerrit.ovirt.org/8002
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifff9b08902cd234dfa03292136317d50e5e3d22b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Pradipta Banerjee <bpradip(a)in.ibm.com>
Royce Lv has uploaded a new change for review.
Change subject: schema: nit fixes in vm definition
......................................................................
schema: nit fixes in vm definition
delete displayPort and displaySecurePort in vmdef
These two ports are selected by libvirt according to API.py
Add boot to vmDef
Change-Id: I14c8f2919390d65a6938b6aadfb09fb2419f74bc
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 5 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/8487/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index e3a1c2a..1c61e36 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2289,6 +2289,8 @@
#
# @acpiEnable: Indicates if ACPI is enabled inside the VM
#
+# @boot: #optional An alias for the type of device used to boot the VM
+#
# @clientIp: The IP address of the client connected to the display
#
# @cpuPinning: #optional Information about CPU pinning
@@ -2302,10 +2304,6 @@
# @display: The type of display
#
# @displayIp: The IP address to use for accessing the VM display
-#
-# @displayPort: The port in use for unencrypted display data
-#
-# @displaySecurePort: The port in use for encrypted display data
#
# @emulatedMachine: The specific machine specification being emulated
#
@@ -2345,8 +2343,9 @@
# Since: 4.10.0
##
{'type': 'VmFullStatus',
- 'data': {'acpiEnable': 'bool', 'clientIp': 'str', '*cpuPinning': 'CpuPinInfoMap',
- 'cpuType': 'str', 'custom': 'StringMap', 'devices': ['VmDevice'],
+ 'data': {'acpiEnable': 'bool', 'clientIp': 'str', '*boot': 'VmBootMode',
+ '*cpuPinning': 'CpuPinInfoMap', 'cpuType': 'str',
+ 'custom': 'StringMap', 'devices': ['VmDevice'],
'display': 'VmDisplayType', 'displayIp': 'str',
'displayPort': 'uint', 'displaySecurePort': 'uint',
'emulatedMachine': 'str', 'keyboardLayout': 'str',
--
To view, visit http://gerrit.ovirt.org/8487
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I14c8f2919390d65a6938b6aadfb09fb2419f74bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: supervdsmServer is down after failed operation (#851832)
......................................................................
supervdsmServer is down after failed operation (#851832)
https://bugzilla.redhat.com/show_bug.cgi?id=851832
After running operation that throws exception that we don't catch in
supervdsmServer, we catch it in ProxyCaller::__call__ method.
In this except code we reset supervdsmServer and call the same method
again.
If the exception is thrown again, we leave supervdsmServer down And this
is how supervdsmServer remains.
This patch omit the recall and leave the reset to keep on normal flow.
Change-Id: Idad4a622b82259b777851d1b0c1b37ec8da2b01e
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/supervdsm.py
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/7901/1
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 79e8d81..75e93e2 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -67,7 +67,6 @@
return callMethod()
except (IOError, socket.error, AuthenticationError):
self._supervdsmProxy._restartSupervdsm()
- return callMethod()
class SuperVdsmProxy(object):
--
To view, visit http://gerrit.ovirt.org/7901
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idad4a622b82259b777851d1b0c1b37ec8da2b01e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Royce Lv has uploaded a new change for review.
Change subject: add general test to be compatible for xmlrpc and rest
......................................................................
add general test to be compatible for xmlrpc and rest
this allow xmlrpc and rest to share common functional testcases
and different binding to handle their own interface
use def file to make test case dynamically changable
Change-Id: I00449f9c22800e2b00109990a7e535da986c5d48
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M configure.ac
M tests/functional/Makefile.am
A tests/functional/SampleDef/Makefile.am
A tests/functional/SampleDef/testBindingUp.def
A tests/functional/defLoader.py
A tests/functional/generalTest.py
M vdsm.spec.in
7 files changed, 121 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/5308/1
--
To view, visit http://gerrit.ovirt.org/5308
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I00449f9c22800e2b00109990a7e535da986c5d48
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Mark Wu has uploaded a new change for review.
Change subject: Fix duplicate emulated machines returned
......................................................................
Fix duplicate emulated machines returned
The old code use getElementsByTagName('machine') to collect machines
information, which will hit the default info for that arch and the
kvm domain's. This patch changes to collect machines information from
the node of kvm domain.
Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/caps.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8208/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 98b33ab..c00c957 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -98,15 +98,15 @@
def _getEmulatedMachines():
c = libvirtconnection.get()
caps = minidom.parseString(c.getCapabilities())
- guestTag = caps.getElementsByTagName('guest')
- # Guest element is missing if kvm modules are not loaded
- if len(guestTag) == 0:
+ for domainNode in caps.getElementsByTagName('domain'):
+ if domainNode.getAttribute('type') == 'kvm':
+ break
+ else:
+ # KVM domain is missing if kvm modules are not loaded
return []
- guestTag = guestTag[0]
-
return [m.firstChild.toxml()
- for m in guestTag.getElementsByTagName('machine')]
+ for m in domainNode.getElementsByTagName('machine')]
def _getAllCpuModels():
--
To view, visit http://gerrit.ovirt.org/8208
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: Specify the ACPI flag when shutting down VMs
......................................................................
Specify the ACPI flag when shutting down VMs
In commit e460308 has been introduced the qemu guest agent support.
When such agent channel is present the default shutdown method uses the
guest agent (which might be missing).
For consistency and to maintain the old behavior we should specify to
use ACPI to shutdown the guest.
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Change-Id: I6ca628ce6f4a5c7f6a937a14b12a5078b32e89dd
---
M vdsm/libvirtvm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/6996/1
--
To view, visit http://gerrit.ovirt.org/6996
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ca628ce6f4a5c7f6a937a14b12a5078b32e89dd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>