Change in vdsm[master]: generate quemu-kvm coredumps using abrt
by mtayer@redhat.com
mooli tayer has uploaded a new change for review.
Change subject: generate quemu-kvm coredumps using abrt
......................................................................
generate quemu-kvm coredumps using abrt
Change-Id: I1acb287cdfcc9b8c05569fe1fc01e88957309ff9
Signed-off-by: Mooli Tayer <mtayer(a)redhat.com>
---
M init/vdsmd_init_common.sh.in
M vdsm.spec.in
2 files changed, 1 insertion(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/20751/1
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 43a86ef..6a55818 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -25,11 +25,6 @@
task_configure_coredump() {
local conf_file="@CONFDIR(a)/vdsm.conf"
local getconfitem="@VDSMDIR@/get-conf-item"
-
- if "${getconfitem}" "${conf_file}" vars core_dump_enable false |
- tr A-Z a-z | grep -q true; then
- echo "/var/log/core/core.%p.%t.dump" > /proc/sys/kernel/core_pattern
- fi
}
task_run_init_hooks(){
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 34bdc2d..fd8023c 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -107,6 +107,7 @@
Requires: libguestfs-tools-c
Requires: %{name}-xmlrpc = %{version}-%{release}
Requires: mom >= 0.3.2-3
+Requires: abrt-addon-ccpp
%ifarch x86_64
Requires: python-dmidecode
--
To view, visit http://gerrit.ovirt.org/20751
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1acb287cdfcc9b8c05569fe1fc01e88957309ff9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
9 years, 12 months
Change in vdsm[ovirt-3.3]: vm: Decrease log spam for expected errors
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: vm: Decrease log spam for expected errors
......................................................................
vm: Decrease log spam for expected errors
Getting a libvirt error is not exceptional event that requires logging
an exception. This patch log such error as errors instead of exception.
Change-Id: I8405f74a0a17e8c3b330bd6110e58f900c38f7c3
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/22576/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 2d0cece..2732298 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -521,6 +521,9 @@
vmDrive.apparentsize, capacity, alloc, physical)
self._vm.extendDriveVolume(vmDrive)
+ except libvirt.libvirtError as e:
+ self._log.error("%s/%s: %s", vmDrive.domainID,
+ vmDrive.volumeID, e)
except Exception:
self._log.exception("%s/%s", vmDrive.domainID,
vmDrive.volumeID)
--
To view, visit http://gerrit.ovirt.org/22576
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8405f74a0a17e8c3b330bd6110e58f900c38f7c3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: Rescan FC when rescanning for new multipath devices
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Rescan FC when rescanning for new multipath devices
......................................................................
Rescan FC when rescanning for new multipath devices
Change-Id: Idec939222676a24452e8825b36db68839bfd2bbc
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M lib/vdsm/utils.py
M tests/utilsTests.py
M vdsm/storage/Makefile.am
A vdsm/storage/fc.py
M vdsm/storage/multipath.py
5 files changed, 61 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/19539/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index f06cad2..e273514 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -793,6 +793,24 @@
return functools.partial(self.__call__, obj)
+def tee_async(data, outputFiles=[], append=False):
+ cmd = ["tee"]
+ if append:
+ cmd.append("--append")
+
+ cmd.extend(outputFiles)
+ proc = execCmd(cmd, sync=False)
+ proc.stdin.write(data)
+
+ def parser(rc, out, err):
+ if rc != 0:
+ raise OSError(-1, err)
+
+ return out
+
+ return AsyncProcessOperation(proc, parser)
+
+
def validateMinimalKeySet(dictionary, reqParams):
if not all(key in dictionary for key in reqParams):
raise ValueError
diff --git a/tests/utilsTests.py b/tests/utilsTests.py
index 656c121..5b83ec0 100644
--- a/tests/utilsTests.py
+++ b/tests/utilsTests.py
@@ -18,11 +18,14 @@
# Refer to the README and COPYING files for full details of the license
#
import errno
+import time
+import tempfile
+import shutil
+import os
from testrunner import VdsmTestCase as TestCaseBase
from vdsm import utils
from storage import misc
-import time
class RetryTests(TestCaseBase):
@@ -63,6 +66,33 @@
sproc.wait()
+class TeeTests(TestCaseBase):
+ def setUp(self):
+ self.dir = tempfile.mkdtemp()
+
+ def tearDown(self):
+ shutil.rmtree(self.dir)
+
+ def test(self):
+ d = self.dir
+ n = 10
+ files = []
+ for i in range(n):
+ files.append(os.path.join(d, "%d.tmp" % i))
+
+ data = "hello"
+ res = utils.tee_async(data, files).result()
+ self.assertEquals((data, None), res)
+ for fname in files:
+ with open(fname, "r") as f:
+ self.assertEquals(data, f.read())
+
+ def testError(self):
+ res, err = utils.tee_async("hello", ["/"]).result()
+ self.assertEquals(res, None)
+ self.assertNotEquals(err, None)
+
+
class CommandPathTests(TestCaseBase):
def testExisting(self):
cp = utils.CommandPath('sh', 'utter nonsense', '/bin/sh')
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index 2d3e9a6..a367c9b 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -33,6 +33,7 @@
fileSD.py \
fileUtils.py \
fileVolume.py \
+ fc.py \
fuser.py \
glusterSD.py \
glusterVolume.py \
diff --git a/vdsm/storage/fc.py b/vdsm/storage/fc.py
new file mode 100644
index 0000000..96aa710
--- /dev/null
+++ b/vdsm/storage/fc.py
@@ -0,0 +1,8 @@
+from glob import glob
+from vdsm import utils
+
+
+def rescan():
+ """Issue command to discover new ports if the fc driver supports it"""
+ # Use tee to make sure we don't do that IO directly
+ utils.tee_async("1", glob("/sys/class/fc_host/host*/issue_lip"))
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index 6d6fcbd..076bfca 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -36,6 +36,7 @@
import iscsi
import supervdsm
import devicemapper
+import fc
import storage_exception as se
@@ -106,7 +107,8 @@
Should only be called from hsm._rescanDevices()
"""
- # First ask iSCSI to rescan all its sessions
+ # First ask fc and iSCSI to rescan all of their sessions
+ fc.rescan()
iscsi.rescan()
# Now let multipath daemon pick up new devices
--
To view, visit http://gerrit.ovirt.org/19539
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idec939222676a24452e8825b36db68839bfd2bbc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: vm: allow live snapshot to any volume descendant
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: vm: allow live snapshot to any volume descendant
......................................................................
vm: allow live snapshot to any volume descendant
When a live snapshot fails qemu might not be using the newly-created
leaf and the volume cleanup is at management discrection (sometime too
risky or even impossible).
In this particular situation (active layer not being the volume leaf)
a subsequent live snapshot would have failed as the baseVolumeID was
not the expected one.
This patch relaxes the volumes checks allowing a live snapshot on the
volume leaf even when it's not the direct descendant of the current
active layer.
Similarly also the check in hotunplugDisk has been relaxed so that
it's now possible to hotunplug a disk with a failed live snapshot.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1018867
Change-Id: Ib50243c93665b9ab47ae70c779b7a1eb37c5e473
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 31 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/20986/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index e716870..14e6a0c 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -3409,7 +3409,7 @@
diskParams['path'] = self.cif.prepareVolumePath(diskParams)
try:
- drive = self._findDriveByUUIDs(diskParams)
+ drive = self._findDriveByImage(diskParams)
except LookupError:
self.log.error("Hotunplug disk failed - Disk not found: %s",
diskParams)
@@ -3535,19 +3535,25 @@
return device
raise LookupError("No such drive: '%s'" % name)
+ def _findDriveByImage(self, drive):
+ """Find a drive given is domainID and imageID"""
+ tgetDrv = (drive["domainID"], drive["imageID"])
+
+ for device in self._devices[DISK_DEVICES][:]:
+ if not hasattr(device, "domainID"):
+ continue
+ if (device.domainID, device.imageID) == tgetDrv:
+ return device
+
+ raise LookupError("No such drive: '%s'" % drive)
+
def _findDriveByUUIDs(self, drive):
"""Find a drive given its definition"""
if "domainID" in drive:
- tgetDrv = (drive["domainID"], drive["imageID"],
- drive["volumeID"])
-
- for device in self._devices[DISK_DEVICES][:]:
- if not hasattr(device, "domainID"):
- continue
- if (device.domainID, device.imageID,
- device.volumeID) == tgetDrv:
- return device
+ device = self._findDriveByImage(drive)
+ if device.volumeID == drive.get("volumeID", None):
+ return device
elif "GUID" in drive:
for device in self._devices[DISK_DEVICES][:]:
@@ -3697,10 +3703,10 @@
continue # Next drive
try:
- vmDrive = self._findDriveByUUIDs(baseDrv)
+ vmDrive = self._findDriveByImage(baseDrv)
except LookupError:
- # The volume we want to snapshot doesn't exist
- self.log.error("The base volume doesn't exist: %s", baseDrv)
+ # The disk we want to snapshot doesn't exist
+ self.log.error("The disk doesn't exist: %s", baseDrv)
return errCode['snapshotErr']
if vmDrive.hasVolumeLeases:
@@ -3711,6 +3717,18 @@
self.log.error("Disk %s is a transient disk", vmDrive.name)
return errCode['transientErr']
+ volumeInfo = self.cif.irs.getVolumeInfo(
+ tgetDrv['domainID'], vmDrive.poolID, tgetDrv['imageID'],
+ tgetDrv['volumeID'])
+
+ if volumeInfo.get("status", {}).get("code") != 0:
+ self.log.error("Unable to get volume info for: %s", tgetDrv)
+ return errCode["snapshotErr"]
+
+ if volumeInfo["info"]["voltype"] != "LEAF":
+ self.log.error("Volume %s is not a volume leaf", tgetDrv)
+ return errCode["snapshotErr"]
+
vmDevName = vmDrive.name
newDrives[vmDevName] = tgetDrv.copy()
--
To view, visit http://gerrit.ovirt.org/20986
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib50243c93665b9ab47ae70c779b7a1eb37c5e473
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: cleanup: Networking code logging and docstring fixes
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: cleanup: Networking code logging and docstring fixes
......................................................................
cleanup: Networking code logging and docstring fixes
Change-Id: Ia50c60e6cd4aab0a4ef49d1d9a2d43b52b187ce2
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/netmodels.py
M vdsm/sourceRoute.py
2 files changed, 19 insertions(+), 21 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/20553/1
diff --git a/vdsm/netmodels.py b/vdsm/netmodels.py
index 554ce4b..e6feeb5 100644
--- a/vdsm/netmodels.py
+++ b/vdsm/netmodels.py
@@ -139,7 +139,7 @@
class Bridge(NetDevice):
- '''This class represents traditional kernel bridges.'''
+ """This class represents traditional kernel bridges."""
MAX_NAME_LEN = 15
ILLEGAL_CHARS = frozenset(':. \t')
@@ -270,7 +270,7 @@
@classmethod
def validateOptions(cls, bonding, bondingOptions):
- 'Example: BONDING_OPTS="mode=802.3ad miimon=150"'
+ """Example: BONDING_OPTS="mode=802.3ad miimon=150\""""
with cls._validationBond(bonding) as bond:
try:
for option in bondingOptions.split():
@@ -348,7 +348,7 @@
@classmethod
def validateGateway(cls, gateway):
- '''Validates the gateway form.'''
+ """Validates the gateway form."""
try:
cls.validateAddress(gateway)
except ConfigNetworkError as cne:
diff --git a/vdsm/sourceRoute.py b/vdsm/sourceRoute.py
index 73fe075..72519d9 100644
--- a/vdsm/sourceRoute.py
+++ b/vdsm/sourceRoute.py
@@ -65,7 +65,7 @@
def configure(self, ipaddr, mask, gateway):
if gateway in (None, '0.0.0.0') or not ipaddr or not mask:
- logging.error("ipaddr, mask or gateway not received")
+ logging.error('ipaddr, mask or gateway not received')
return
self.ipaddr = ipaddr
@@ -75,10 +75,10 @@
network = netaddr.IPNetwork(str(self.ipaddr) + '/' + str(self.mask))
self.network = "%s/%s" % (network.network, network.prefixlen)
- logging.info(("Configuring gateway - ip: %s, network: %s, " +
- "subnet: %s, gateway: %s, table: %s, device: %s") %
- (self.ipaddr, self.network, self.mask, self.gateway,
- self.table, self.device))
+ logging.info('Configuring gateway - ip: %s, network: %s, subnet: %s, '
+ 'gateway: %s, table: %s, device: %s', self.ipaddr,
+ self.network, self.mask, self.gateway, self.table,
+ self.device)
self.routes = self._buildRoutes()
self.rules = self._buildRules()
@@ -87,8 +87,8 @@
self.configurator.configureSourceRoute(self.routes, self.rules,
self.device)
except IPRoute2Error as e:
- logging.error('ip binary failed during source route configuration',
- ': %s' % e.message)
+ logging.error('ip binary failed during source route configuration'
+ ': %s', e.message)
def remove(self):
self.configurator.removeSourceRoute(None, None, self.device)
@@ -116,13 +116,11 @@
try:
route = Route.fromText(entry)
except ValueError:
- logging.debug("Could not parse route %s" % entry)
+ logging.debug('Could not parse route %s', entry)
else:
if route.device == device:
- """
- When displaying routes from a table, the table is omitted,
- so add it back again
- """
+ # When displaying routes from a table, the table is
+ # omitted, so add it back again
route.table = table
routes.append(route)
@@ -133,7 +131,7 @@
if rules:
return rules[0].table
else:
- logging.error("Table not found")
+ logging.error('Table not found')
return None
@staticmethod
@@ -151,7 +149,7 @@
try:
rule = Rule.fromText(entry)
except ValueError:
- logging.debug("Could not parse rule %s" % entry)
+ logging.debug('Could not parse rule %s', entry)
else:
allRules.append(rule)
@@ -159,7 +157,7 @@
rules = [rule for rule in allRules if rule.srcDevice == device]
if not rules:
- logging.error("Routing rules not found for device %s" % device)
+ logging.error('Routing rules not found for device %s', device)
return
# Extract its destination network
@@ -172,7 +170,7 @@
return rules
def remove(self):
- logging.info("Removing gateway - device: %s" % self.device)
+ logging.info('Removing gateway - device: %s', self.device)
rules = self._getRules(self.device)
if rules:
@@ -184,7 +182,7 @@
self.device)
except IPRoute2Error as e:
logging.error('ip binary failed during source route '
- 'removal: %s' % e.message)
+ 'removal: %s', e.message)
def _isLibvirtInterfaceFallback(self):
"""
@@ -209,7 +207,7 @@
except libvirtError: # libvirt might not be started or it just fails
logging.error('Libvirt failed to answer. It might be the case that'
' this script is being run before libvirt startup. '
- ' Thus, check if vdsm owns %s an alternative way' %
+ ' Thus, check if vdsm owns %s an alternative way',
self.device)
return self._isLibvirtInterfaceFallback()
trackedInterfaces = [network.get('bridge') or network.get('iface')
--
To view, visit http://gerrit.ovirt.org/20553
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia50c60e6cd4aab0a4ef49d1d9a2d43b52b187ce2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: Move fencing logic out of API.py
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Move fencing logic out of API.py
......................................................................
Move fencing logic out of API.py
API.py should not contain logic.
In this patch I also:
- Separate the `status` action to a different function because it does
something completely different from the other action and has different
logic.
- Refactor for better code reusability readability.
- Use real exception internally and have the API layer translate them to
actual exceptions.
- Don't support port strings in methods, just in the interface.
- Don't support string booleans in the methods, just in the interface.
- Added shutdownEvent to ClientIF so there is a public standard way of
inspecting vdsm shutdown.
- Make the fencing logic use betterPopen
Change-Id: I944c6548a42612f705a410fb4290215451bca035
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm.spec.in
M vdsm/API.py
M vdsm/Makefile.am
M vdsm/clientIF.py
4 files changed, 25 insertions(+), 72 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/7190/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 23afd6b..f122cb5 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -558,6 +558,7 @@
%{_datadir}/%{vdsm_name}/caps.py*
%{_datadir}/%{vdsm_name}/clientIF.py*
%{_datadir}/%{vdsm_name}/API.py*
+%{_datadir}/%{vdsm_name}/fenceAgent.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/hooks.py*
%{_datadir}/%{vdsm_name}/libvirtev.py*
diff --git a/vdsm/API.py b/vdsm/API.py
index ae04e01..5826d81 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -19,12 +19,9 @@
#
import os
-import signal
import copy
-import subprocess
import pickle
import time
-import threading
import logging
from vdsm import utils
@@ -40,6 +37,7 @@
from vdsm.define import doneCode, errCode, Kbytes, Mbytes
import caps
from vdsm.config import config
+import fenceAgent
import supervdsm
@@ -981,82 +979,32 @@
agent is one of (rsa, ilo, drac5, ipmilan, etc)
action can be one of (status, on, off, reboot)."""
- def waitForPid(p, inp):
- """ Wait until p.pid exits. Kill it if vdsm exists before. """
- try:
- p.stdin.write(inp)
- p.stdin.close()
- while p.poll() is None:
- if not self._cif._enabled:
- self.log.debug('killing fence script pid %s', p.pid)
- os.kill(p.pid, signal.SIGTERM)
- time.sleep(1)
- try:
- # improbable race: p.pid may now belong to another
- # process
- os.kill(p.pid, signal.SIGKILL)
- except:
- pass
- return
- time.sleep(1)
- self.log.debug('rc %s inp %s out %s err %s', p.returncode,
- hidePasswd(inp),
- p.stdout.read(), p.stderr.read())
- except:
- self.log.error("Error killing fence script", exc_info=True)
-
- def hidePasswd(text):
- cleantext = ''
- for line in text.splitlines(True):
- if line.startswith('passwd='):
- line = 'passwd=XXXX\n'
- cleantext += line
- return cleantext
-
self.log.debug('fenceNode(addr=%s,port=%s,agent=%s,user=%s,' +
'passwd=%s,action=%s,secure=%s,options=%s)', addr, port, agent,
username, 'XXXX', action, secure, options)
- if action not in ('status', 'on', 'off', 'reboot'):
- raise ValueError('illegal action ' + action)
+ secure = utils.tobool(secure)
+ port = int(port)
- script = constants.EXT_FENCE_PREFIX + agent
+ if action == "status":
+ try:
+ power = fenceAgent.getFenceStatus(addr, port, agent, username,
+ password, secure, options)
+
+ return {'status': doneCode,
+ 'power': power}
+
+ except fenceAgent.FenceStatusCheckError as e:
+ return {'status': {'code': 1, 'message': str(e)}}
try:
- p = subprocess.Popen([script], stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- close_fds=True)
- except OSError, e:
- if e.errno == os.errno.ENOENT:
- return errCode['fenceAgent']
- raise
+ fenceAgent.fenceNode(addr, port, agent, username, password, secure,
+ options, self._cif.shutdownEvent)
- inp = ('agent=fence_%s\nipaddr=%s\nlogin=%s\noption=%s\n' +
- 'passwd=%s\n') % (agent, addr, username, action, password)
- if port != '':
- inp += 'port=%s\n' % (port,)
- if utils.tobool(secure):
- inp += 'secure=yes\n'
- inp += options
- if action == 'status':
- out, err = p.communicate(inp)
- self.log.debug('rc %s in %s out %s err %s', p.returncode,
- hidePasswd(inp), out, err)
- if not 0 <= p.returncode <= 2:
- return {'status': {'code': 1,
- 'message': out + err}}
- message = doneCode['message']
- if p.returncode == 0:
- power = 'on'
- elif p.returncode == 2:
- power = 'off'
- else:
- power = 'unknown'
- message = out + err
- return {'status': {'code': 0, 'message': message},
- 'power': power}
- threading.Thread(target=waitForPid, args=(p, inp)).start()
- return {'status': doneCode}
+ return {'status': doneCode}
+
+ except fenceAgent.UnsupportedFencingAgentError:
+ return errCode['fenceAgent']
def ping(self):
"Ping the server. Useful for tests"
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 62ba982..4a7bc57 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -32,6 +32,7 @@
clientIF.py \
configNetwork.py \
debugPluginClient.py \
+ fenceAgent.py \
guestIF.py \
hooking.py \
hooks.py \
@@ -52,7 +53,8 @@
tc.py \
vdsmDebugPlugin.py \
vmChannels.py \
- vm.py
+ vm.py \
+ $(NULL)
dist_vdsmpylib_PYTHON = \
__init__.py \
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 8ba25a7..8760437 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -96,6 +96,7 @@
self.lastRemoteAccess = 0
self._memLock = threading.Lock()
self._enabled = True
+ self.shutdownEvent = threading.Event()
self._netConfigDirty = False
self._prepareMOM()
threading.Thread(target=self._recoverExistingVms,
@@ -219,6 +220,7 @@
for binding in self.bindings.values():
binding.prepareForShutdown()
self._enabled = False
+ self.shutdownEvent.set()
self.channelListener.stop()
self._hostStats.stop()
if self.mom:
--
To view, visit http://gerrit.ovirt.org/7190
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I944c6548a42612f705a410fb4290215451bca035
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: Use more fine lock for hsm.deleteImage().
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Use more fine lock for hsm.deleteImage().
......................................................................
Use more fine lock for hsm.deleteImage().
When removing an image from a specific SD, lock the image in this
SD exclusively.
Related to: BZ#960952.
Change-Id: Iab04d548610cd86eb70e1fd13a29a3508778cc1d
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/16413/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 5639c13..09c5404 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1437,7 +1437,8 @@
self.getPool(spUUID) # Validates that the pool is connected. WHY?
dom = self.validateSdUUID(sdUUID)
- vars.task.getExclusiveLock(STORAGE, imgUUID)
+ imageResourcesNamespace = sd.getNamespace(sdUUID, IMAGE_NAMESPACE)
+ vars.task.getExclusiveLock(imageResourcesNamespace, imgUUID)
vars.task.getSharedLock(STORAGE, sdUUID)
allVols = dom.getAllVolumes()
volsByImg = sd.getVolsOfImage(allVols, imgUUID)
--
To view, visit http://gerrit.ovirt.org/16413
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab04d548610cd86eb70e1fd13a29a3508778cc1d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: [WIP] metaSize calculation as a module function.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: [WIP] metaSize calculation as a module function.
......................................................................
[WIP] metaSize calculation as a module function.
Change-Id: If90ba75d11c4962f2e52150e5f381cd93d0e8f35
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 23 insertions(+), 23 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/11690/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 9b9674e..aa4059a 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -269,6 +269,27 @@
return
+def metaSize(vgName):
+ ''' Calc the minimal meta volume size in MB'''
+ # In any case the metadata volume cannot be less than 512MB for the
+ # case of 512 bytes per volume metadata, 2K for domain metadata and
+ # extent size of 128MB. In any case we compute the right size on line.
+ vg = lvm.getVG(vgName)
+ minmetasize = (SD_METADATA_SIZE / sd.METASIZE * int(vg.extent_size) +
+ (1024 * 1024 - 1)) / (1024 * 1024)
+ metaratio = int(vg.extent_size) / sd.METASIZE
+ metasize = (int(vg.extent_count) * sd.METASIZE +
+ (1024 * 1024 - 1)) / (1024 * 1024)
+ metasize = max(minmetasize, metasize)
+ if metasize > int(vg.free) / (1024 * 1024):
+ raise se.VolumeGroupSizeError("volume group has not enough extents %s"
+ " (Minimum %s), VG may be too small" %
+ (vg.extent_count,
+ (1024 * 1024) / sd.METASIZE))
+ log.info("size %s MB (metaratio %s)" % (metasize, metaratio))
+ return metasize
+
+
class VGTagMetadataRW(object):
log = logging.getLogger("storage.Metadata.VGTagMetadataRW")
METADATA_TAG_PREFIX = "MDT_"
@@ -449,27 +470,6 @@
lvmActivationNamespace)
@classmethod
- def metaSize(cls, vgroup):
- ''' Calc the minimal meta volume size in MB'''
- # In any case the metadata volume cannot be less than 512MB for the
- # case of 512 bytes per volume metadata, 2K for domain metadata and
- # extent size of 128MB. In any case we compute the right size on line.
- vg = lvm.getVG(vgroup)
- minmetasize = (SD_METADATA_SIZE / sd.METASIZE * int(vg.extent_size) +
- (1024 * 1024 - 1)) / (1024 * 1024)
- metaratio = int(vg.extent_size) / sd.METASIZE
- metasize = (int(vg.extent_count) * sd.METASIZE +
- (1024 * 1024 - 1)) / (1024 * 1024)
- metasize = max(minmetasize, metasize)
- if metasize > int(vg.free) / (1024 * 1024):
- raise se.VolumeGroupSizeError(
- "volume group has not enough extents %s (Minimum %s), VG may "
- "be too small" % (vg.extent_count,
- (1024 * 1024) / sd.METASIZE))
- cls.log.info("size %s MB (metaratio %s)" % (metasize, metaratio))
- return metasize
-
- @classmethod
def create(cls, sdUUID, domainName, domClass, vgUUID, storageType,
version):
""" Create new storage domain
@@ -509,7 +509,7 @@
raise se.StorageDomainIsMadeFromTooManyPVs()
# Create metadata service volume
- metasize = cls.metaSize(vgName)
+ metasize = metaSize(vgName)
lvm.createLV(vgName, sd.METADATA, "%s" % (metasize))
# Create the mapping right now so the index 0 is guaranteed
# to belong to the metadata volume. Since the metadata is at
@@ -721,7 +721,7 @@
lvm.extendVG(self.sdUUID, devices, force)
self.updateMapping()
- newsize = self.metaSize(self.sdUUID)
+ newsize = metaSize(self.sdUUID)
lvm.extendLV(self.sdUUID, sd.METADATA, newsize)
def mapMetaOffset(self, vol_name, slotSize):
--
To view, visit http://gerrit.ovirt.org/11690
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If90ba75d11c4962f2e52150e5f381cd93d0e8f35
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: image: transform getImageDir into a function
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: image: transform getImageDir into a function
......................................................................
image: transform getImageDir into a function
Change-Id: I8153cb7377d5ea353142647956ff27cda3f63b22
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/blockVolume.py
M vdsm/storage/fileVolume.py
M vdsm/storage/image.py
3 files changed, 8 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/26919/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index d9bbf15..12556d5 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -412,8 +412,8 @@
"""
Block SD supports lazy image dir creation
"""
- imageDir = image.Image(self.repoPath).getImageDir(self.sdUUID,
- self.imgUUID)
+ imageDir = image.getImagePath(self.repoPath, self.sdUUID,
+ self.imgUUID)
if not os.path.isdir(imageDir):
try:
os.mkdir(imageDir, 0o755)
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index f2a93d6..7d7e1ee 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -482,8 +482,8 @@
In the file volume repositories,
the image dir must exists after creation its first volume.
"""
- imageDir = image.Image(self.repoPath).getImageDir(self.sdUUID,
- self.imgUUID)
+ imageDir = image.getImagePath(self.repoPath, self.sdUUID,
+ self.imgUUID)
if not self.oop.os.path.isdir(imageDir):
raise se.ImagePathError(imageDir)
if not self.oop.os.access(imageDir, os.R_OK | os.W_OK | os.X_OK):
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 2cf8e7a..0c8232b 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -87,6 +87,10 @@
dom.deleteImage(dom.sdUUID, imgUUID, imgVols)
+def getImagePath(repoPath, sdUUID, imgUUID):
+ return os.path.join(repoPath, sdUUID, sd.DOMAIN_IMAGES, imgUUID)
+
+
class Image:
""" Actually represents a whole virtual disk.
Consist from chain of volumes.
@@ -127,12 +131,6 @@
[imageDir]))
os.mkdir(imageDir)
return imageDir
-
- def getImageDir(self, sdUUID, imgUUID):
- """
- Return image directory
- """
- return os.path.join(self.repoPath, sdUUID, sd.DOMAIN_IMAGES, imgUUID)
def deletedVolumeName(self, uuid):
"""
--
To view, visit http://gerrit.ovirt.org/26919
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8153cb7377d5ea353142647956ff27cda3f63b22
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: [WIP]add createVm support of cputune
by lvroyce@linux.vnet.ibm.com
Royce Lv has uploaded a new change for review.
Change subject: [WIP]add createVm support of cputune
......................................................................
[WIP]add createVm support of cputune
allow engine to pass other cputune params through vm create,
createVm now uses nice to config vm share value,
this patch uses 'shares' in vmdef directly (1024 by default)
Change-Id: I76e9b9d291d4801965163774ba45d15b39a77471
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm/libvirtvm.py
1 file changed, 13 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/8445/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index fd80c69..9b38a36 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -737,10 +737,13 @@
self.dom.appendChild(cpu)
def appendTunable(self):
- #CPU-pinning support
- # see http://www.ovirt.org/wiki/Features/Design/cpu-pinning
+ cputune = self.doc.createElement('cputune')
+ cputuneParams = {'shares':1024}
+ if 'cputune' in self.conf:
+ cputuneParam = self.conf['cputune']
if 'cpuPinning' in self.conf:
- cputune = self.doc.createElement('cputune')
+ #CPU-pinning support
+ # see http://www.ovirt.org/wiki/Features/Design/cpu-pinning
cpuPinning = self.conf.get('cpuPinning')
try:
emulatorset = cpuPinning.pop('emulator')
@@ -754,7 +757,13 @@
vcpupin.setAttribute('vcpu', cpuPin)
vcpupin.setAttribute('cpuset', cpuPinning[cpuPin])
cputune.appendChild(vcpupin)
- self.dom.appendChild(cputune)
+
+ for item in cputuneParams.keys():
+ m = self.doc.createElement(item)
+ m.appendChild(self.doc.createTextNode(cputuneParams[item]))
+ cputune.appendChild(m)
+
+ self.dom.appendChild(cputune)
def _appendAgentDevice(self, path, name):
"""
@@ -1338,13 +1347,6 @@
if self._initTimePauseCode == 'ENOSPC':
self.cont()
self.conf['pid'] = self._getPid()
-
- nice = int(self.conf.get('nice', '0'))
- nice = max(min(nice, 19), 0)
- try:
- self._dom.setSchedulerParameters({'cpu_shares': (20 - nice) * 51})
- except:
- self.log.warning('failed to set Vm niceness', exc_info=True)
def _run(self):
self.log.info("VM wrapper has started")
--
To view, visit http://gerrit.ovirt.org/8445
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I76e9b9d291d4801965163774ba45d15b39a77471
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
9 years, 12 months