Lukas Bednar has uploaded a new change for review.
Change subject: hsm.py: volUUID is not member of HSM class
......................................................................
hsm.py: volUUID is not member of HSM class
Change-Id: I5adc1fb40d54b7a887a4aba44c8884c876d5613a
Signed-off-by: Lukas Bednar <lbednar(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/24313/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 9420931..41917f3 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -692,7 +692,7 @@
volFormat = volToExtend.getFormat()
if not volToExtend.isLeaf():
- raise se.VolumeNonWritable(self.volUUID)
+ raise se.VolumeNonWritable(volUUID)
if volFormat != volume.COW_FORMAT:
# This method is used only with COW volumes (see docstring),
--
To view, visit http://gerrit.ovirt.org/24313
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5adc1fb40d54b7a887a4aba44c8884c876d5613a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lukas Bednar <lbednar(a)redhat.com>
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: Makefile.am: create vdsm logs on make install
......................................................................
Makefile.am: create vdsm logs on make install
Currently during the RPM install vdsm creates the below logs files:
/var/log/vdsm/{metadata.log,mom.log,supervdsm.log,vdsm.log}
and we should do the same for non rpm distro.
Change-Id: I7f5dc4ca01fecddc5226255e37b0bab68b8c479f
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm/Makefile.am
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/23882/1
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 66b9af5..5e7f2cf 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -167,6 +167,10 @@
$(MKDIR_P) $(DESTDIR)$(vdsmlibdir)/upgrade
$(MKDIR_P) $(DESTDIR)$(vdsmbackupdir)
$(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channels
+ touch $(DESTDIR)$(vdsmlogdir)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+ chmod 0644 $(DESTDIR)$(vdsmlogdir)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+ chown $(VDSMUSER):$(VDSMGROUP) $(DESTDIR)$(vdsmlogdir)/{metadata.log,mom.log,vdsm.log}
+ chown root:root $(DESTDIR)$(vdsmlogdir)/supervdsm.log
uninstall-local: \
uninstall-data-dhclient-hooks \
--
To view, visit http://gerrit.ovirt.org/23882
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f5dc4ca01fecddc5226255e37b0bab68b8c479f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: sp: improve pool creation error handling
......................................................................
sp: improve pool creation error handling
Change-Id: I0cce08e368dec092222c081609d0663d7990ab10
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 17 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/22818/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 4f4765e..247973c 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -620,27 +620,30 @@
# lock
# TBD: create will receive only master domain and further attaches
# should be done under SPM
-
- # Master domain was already attached (in createMaster),
- # no need to reattach
- for sdUUID in domList:
- # No need to attach the master
- if sdUUID != msdUUID:
- self.attachSD(sdUUID)
+ try:
+ for sdUUID in domList:
+ # Master domain was already attached (in createMaster)
+ if sdUUID != msdUUID:
+ self.attachSD(sdUUID)
+ except Exception:
+ # FIXME: detachSD will fail for the master domain, we need a
+ # special handling (master must be detached from the pool).
+ self.__cleanupDomains(domList, msdUUID, masterVersion)
except Exception:
- self.log.error("Create pool %s canceled ", poolName, exc_info=True)
+ self.log.exception('create pool %s canceled', self.spUUID)
try:
fileUtils.cleanupdir(self.poolPath)
- self.__cleanupDomains(domList, msdUUID, masterVersion)
- except:
- self.log.error("Cleanup failed due to an unexpected error",
- exc_info=True)
+ except Exception:
+ self.log.exception('pool %s cleanup failed', self.spUUID)
raise
finally:
self._setUnsafe()
-
self._releaseTemporaryClusterLock(msdUUID)
- self.stopMonitoringDomains()
+ # stopMonitoringDomains needs masterDomain and the monitoring
+ # domains threads are started only if the master was properly
+ # initialized and set
+ if self.masterDomain:
+ self.stopMonitoringDomains()
return True
--
To view, visit http://gerrit.ovirt.org/22818
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cce08e368dec092222c081609d0663d7990ab10
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Martin Polednik has uploaded a new change for review.
Change subject: vmDevices: introduce VmDeviceContainer
......................................................................
vmDevices: introduce VmDeviceContainer
EARLY WORK IN PROGRESS: VmDeviceContainer is structure that will allow
us to store devices as a class instances while keeping backwards
compatibility with old self.conf['devices']
Change-Id: I65debd35115da078df0c0cb6f50c57feb984c5a3
Signed-off-by: Martin Polednik <mpoledni(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/21138/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 5ae54d7..36cdbb1 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1727,6 +1727,39 @@
return m
+class VmDeviceContainer(dict):
+ @property
+ def legacy(self):
+ """
+ Return list of device dicts that represents backwards-compatible
+ self.conf['devices']
+
+ [..., {..., 'type': 'disk', ...}, ...]
+ """
+ deviceList = []
+ for key in self.keys():
+ for device in self[key]:
+ # loop through devices __slots__ and return all set attributes
+ deviceList.append(dict((attr, getattr(device, attr))
+ for attr in device.__slots__
+ if hasattr(device, attr)))
+
+ return deviceList
+
+ def restoreLegacy(self, state):
+ """
+ Reconstruct container using old self.conf['devices'] structure of
+
+ [..., {..., 'type': 'disk', ...}, ...]
+ to
+
+ VmDeviceContainer[DISK_DEVICES] =
+ [..., {..., 'type': 'disk', ...}, ...]
+ """
+ for device in state:
+ self[device['type']] = device
+
+
class Vm(object):
"""
Used for abstracting communication between various parts of the
--
To view, visit http://gerrit.ovirt.org/21138
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I65debd35115da078df0c0cb6f50c57feb984c5a3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni(a)redhat.com>
Aravinda VK has uploaded a new change for review.
Change subject: gluster: [WIP]Get size information of gluster volume
......................................................................
gluster: [WIP]Get size information of gluster volume
Change-Id: I358d4f3bf793ecc1a01e0592d68919d1405f6e19
Signed-off-by: Aravinda VK <avishwan(a)redhat.com>
---
M client/vdsClientGluster.py
M vdsm.spec.in
M vdsm/gluster/Makefile.am
M vdsm/gluster/__init__.py
M vdsm/gluster/api.py
A vdsm/gluster/gfapi.py
6 files changed, 100 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/17822/1
diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index 90af83e..644bfe3 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -424,6 +424,17 @@
pp.pprint(status)
return status['status']['code'], status['status']['message']
+ def do_glusterVolumeSize(self, args):
+ params = self._eqSplit(args)
+ try:
+ volumeName = params.get('volumeName', '')
+ except:
+ raise ValueError
+
+ status = self.s.glusterVolumeSize(volumeName)
+ pp.pprint(status)
+ return status['status']['code'], status['status']['message']
+
def getGlusterCmdDict(serv):
return \
@@ -705,4 +716,9 @@
'not set'
'(swift, glusterd, smb, memcached)'
)),
+ 'glusterVolumeSize': (
+ serv.do_glusterVolumeSize,
+ ('volumeName=<volume name>',
+ 'Returns total, available and used space status of gluster volume'
+ )),
}
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 21b3565..e49e102 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1271,6 +1271,7 @@
%doc COPYING
%{_datadir}/%{vdsm_name}/gluster/api.py*
%{_datadir}/%{vdsm_name}/gluster/vdsmapi-gluster-schema.json
+%{_datadir}/%{vdsm_name}/gluster/gfapi.py*
%{_datadir}/%{vdsm_name}/gluster/hooks.py*
%{_datadir}/%{vdsm_name}/gluster/services.py*
%endif
diff --git a/vdsm/gluster/Makefile.am b/vdsm/gluster/Makefile.am
index dd5434d..9c2989f 100644
--- a/vdsm/gluster/Makefile.am
+++ b/vdsm/gluster/Makefile.am
@@ -26,6 +26,7 @@
api.py \
cli.py \
exception.py \
+ gfapi.py \
hooks.py \
hostname.py \
services.py \
diff --git a/vdsm/gluster/__init__.py b/vdsm/gluster/__init__.py
index bec70ea..e5a2fd6 100644
--- a/vdsm/gluster/__init__.py
+++ b/vdsm/gluster/__init__.py
@@ -22,7 +22,7 @@
import tempfile
from functools import wraps
-MODULE_LIST = ('cli', 'hooks', 'services')
+MODULE_LIST = ('cli', 'hooks', 'services', 'gfapi')
def makePublic(func):
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 4bd8308..89546c1 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -287,6 +287,22 @@
status = self.svdsmProxy.glusterServicesGet(serviceNames)
return {'services': status}
+ @exportAsVerb
+ def volumeSize(self, volumeName, options=None):
+ data = self.svdsmProxy.glusterVolumeStatvfs(volumeName)
+ # f_blocks = Total number of blocks
+ # f_bfree = Total number of blocks free
+ # f_bavail = Total number of blocks available for non root user
+ # total blocks available = f_blocks - (f_bfree - f_bavail)
+ total_blocks_available = data['f_blocks'] - \
+ (data['f_bfree'] - data['f_bavail'])
+ return {
+ 'total': total_blocks_available * data.f_bsize / 1024,
+ 'free': data['f_bavail'] * data['f_bsize'] / 1024,
+ 'used': (total_blocks_available - data['f_bavail']) * \
+ data['f_bsize'] / 1024
+ }
+
def getGlusterMethods(gluster):
l = []
diff --git a/vdsm/gluster/gfapi.py b/vdsm/gluster/gfapi.py
new file mode 100644
index 0000000..abfdabd
--- /dev/null
+++ b/vdsm/gluster/gfapi.py
@@ -0,0 +1,65 @@
+#
+# Copyright 2013 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
+#
+from ctypes import *
+
+# import exception as ge
+from . import makePublic
+
+GLUSTER_VOL_PROTOCAL='tcp'
+GLUSTER_VOL_HOST='localhost'
+GLUSTER_VOL_PORT=24007
+
+class Stat (Structure):
+ _fields_ = [
+ ('f_bsize', c_ulong),
+ ('f_frsize', c_ulong),
+ ('f_blocks', c_ulong),
+ ('f_bfree', c_ulong),
+ ('f_bavail', c_ulong),
+ ('f_files', c_ulong),
+ ('f_ffree', c_ulong),
+ ('f_favail', c_ulong),
+ ('f_fsid', c_ulong),
+ ('f_flag', c_ulong),
+ ('f_namemax', c_ulong),
+ ('__f_spare', c_int * 6),
+ ]
+
+
+api = CDLL("libgfapi.so",RTLD_GLOBAL)
+api.glfs_statvfs.restype = c_int
+api.glfs_statvfs.argtypes = [c_void_p, c_char_p, POINTER(Stat)]
+
+@makePublic
+def volumeStatvfs(volumeId):
+ path = "/"
+ fs = api.glfs_new(volumeId)
+ api.glfs_set_volfile_server(fs,
+ GLUSTER_VOL_PROTOCAL,
+ GLUSTER_VOL_HOST,
+ GLUSTER_VOL_PORT)
+ api.glfs_init(fs)
+
+ x = Stat()
+ rc = api.glfs_statvfs(fs, path, byref(x))
+ statvfsData = {}
+ for k in x._fields_:
+ statvfsData[k[0]] = getattr(x, k[0])
+ return statvfsData
--
To view, visit http://gerrit.ovirt.org/17822
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I358d4f3bf793ecc1a01e0592d68919d1405f6e19
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Aravinda VK <avishwan(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: xmlrpc: Fix connection reset on Python 2.6
......................................................................
xmlrpc: Fix connection reset on Python 2.6
When request is aborted before the reading the entire request, closing the
socket cause the other side to receive connection reset, and loose the response
data. Python 2.7 introduced the shutdown_request method, fixing this issue.
This patch check if SimpleXMLRPCServer has the shutdown_request method, and if
not, do a clean request shutdwon in close_request.
Change-Id: Id77a32bb0d4fff13ee680eade52a2f60e4e808b5
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/24026/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 9429308..eeea5d4 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -158,6 +158,23 @@
logRequests, allow_none, encoding,
bind_and_activate)
+ # Fix for connection reset issue when running on Python 2.6. This happens
+ # when request is aborted before the reading the entire request. Closing
+ # the socket cause the other side to receive connection reset, and loose
+ # the response data. Python 2.7 introduced the shutdown_request method,
+ # fixing this issue. If we run on a version without this method, we will do
+ # a clean shutdown in close_request instead.
+ if not hasattr(SimpleXMLRPCServer, 'shutdown_request'):
+ def close_request(self, request):
+ # From Python 2.7 SocketServer.TCPServer.shutdown_request
+ try:
+ # Explicitly shutdown. socket.close() merely releases the
+ # socket and waits for GC to perform the actual close.
+ request.shutdown(socket.SHUT_WR)
+ except socket.error:
+ pass # Some platforms may raise ENOTCONN here
+ SimpleXMLRPCServer.close_request(self, request)
+
#Threaded version of SimpleXMLRPCServer
class SimpleThreadedXMLRPCServer(SocketServer.ThreadingMixIn,
--
To view, visit http://gerrit.ovirt.org/24026
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id77a32bb0d4fff13ee680eade52a2f60e4e808b5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Sergey Gotliv has uploaded a new change for review.
Change subject: sp: Remove redundant validation
......................................................................
sp: Remove redundant validation
Before deactivating storage domain we validate that this domain is a
member of the pool. It seems that we performed that validation twice,
first time by calling validatePoolSD and second time by checking in the
list of the pooled domains.
Change-Id: I7bd94c40655c08ace5262d39b3087edc542f94b1
Signed-off-by: Sergey Gotliv <sgotliv(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 1 insertion(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/24453/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index a020e1e..638dfc7 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1052,10 +1052,6 @@
self.validatePoolSD(sdUUID)
self.log.info("sdUUID=%s spUUID=%s newMsdUUID=%s", sdUUID, self.spUUID,
newMsdUUID)
- domList = self.getDomains()
-
- if sdUUID not in domList:
- raise se.StorageDomainNotInPool(self.spUUID, sdUUID)
try:
dom = sdCache.produce(sdUUID)
@@ -1095,6 +1091,7 @@
self.log.error("Can't umount masterDir %s for domain "
"%s", masterDir, dom)
+ domList = self.getDomains()
domList[sdUUID] = sd.DOM_ATTACHED_STATUS
self._backend.setDomainsMap(domList)
self.updateMonitoringThreads()
--
To view, visit http://gerrit.ovirt.org/24453
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bd94c40655c08ace5262d39b3087edc542f94b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgotliv(a)redhat.com>