Change in vdsm[master]: spec: update sanlock dependencies
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: spec: update sanlock dependencies
......................................................................
spec: update sanlock dependencies
Forcing some old fedora installations to update sanlock to the latest
version. This is mostly to address:
- wdmd: dynamically select working watchdog device
which makes it possible to run sanlock on hardware (generally laptops)
with multiple watchdogs.
Change-Id: Ia9a28d7bf23ab93781bdf3d8cf5769fe149fdeb4
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/12292/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 38838ea..89da7af 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -107,7 +107,7 @@
Requires: device-mapper-multipath >= 0.4.9-52
Requires: e2fsprogs >= 1.41.12-11
Requires: kernel >= 2.6.32-279.9.1
-Requires: sanlock >= 2.3-4, sanlock-python
+Requires: sanlock >= 2.3-4
Requires: initscripts >= 9.03.31-2.el6_3.1
Requires: mom >= 0.3.0
Requires: selinux-policy-targeted >= 3.7.19-155
@@ -125,7 +125,7 @@
Requires: e2fsprogs >= 1.41.14
Requires: kernel >= 3.6
Requires: mom >= 0.3.0
-Requires: sanlock >= 2.4-2, sanlock-python
+Requires: sanlock >= 2.6-4
Requires: sed >= 4.2.1-10
Requires: selinux-policy-targeted >= 3.10.0-149
Requires: lvm2 >= 2.02.95
@@ -151,6 +151,7 @@
Requires: libselinux-python
Requires: %{name}-python = %{version}-%{release}
Requires: pyparted
+Requires: sanlock-python
Requires(post): /usr/sbin/saslpasswd2
Requires(post): /bin/hostname
--
To view, visit http://gerrit.ovirt.org/12292
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9a28d7bf23ab93781bdf3d8cf5769fe149fdeb4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
8 years, 9 months
Change in vdsm[master]: [WIP] Small objects repository file implementation
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: [WIP] Small objects repository file implementation
......................................................................
[WIP] Small objects repository file implementation
Change-Id: I3003f8652a58c68a966bc37e591c1d1d2308c164
---
M vdsm/storage/fileSD.py
M vdsm/storage/hsm.py
M vdsm/storage/outOfProcess.py
M vdsm/storage/sd.py
M vdsm/storage/sp.py
M vdsm_cli/vdsClient.py
6 files changed, 83 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/242/1
--
To view, visit http://gerrit.ovirt.org/242
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3003f8652a58c68a966bc37e591c1d1d2308c164
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: Add a chown implementation that looks up uid and gid
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: Add a chown implementation that looks up uid and gid
......................................................................
Add a chown implementation that looks up uid and gid
We already have a case in vdsm (configNetwork) where we need to use
a chown function that is capable to convert the owner and group names
to uid and gid. Going forward this can be reused for the deployment
utilities and to prepare the paths needed by vdsm (eg: /rhev and
/var/run/vdsm).
Change-Id: Iab6f67ba93a0d9cbac775992623f3bb2ab996555
---
M vdsm/configNetwork.py
M vdsm/utils.py
2 files changed, 21 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/387/1
--
To view, visit http://gerrit.ovirt.org/387
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab6f67ba93a0d9cbac775992623f3bb2ab996555
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: constants: unify the BLANK_UUID definition
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: constants: unify the BLANK_UUID definition
......................................................................
constants: unify the BLANK_UUID definition
Change-Id: Ib9260d74ae1da1382394a375843b2edff112e6f7
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M client/vdsClient.py
M lib/vdsm/constants.py.in
M vdsm/API.py
M vdsm/storage/misc.py
M vdsm/storage/sd.py
M vdsm/storage/volume.py
6 files changed, 11 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/15442/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 332b438..0aabd5b 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -26,13 +26,13 @@
import pprint as pp
from vdsm import vdscli
+from vdsm.constants import BLANK_UUID
+
try:
import vdsClientGluster as ge
_glusterEnabled = True
except ImportError:
_glusterEnabled = False
-
-BLANK_UUID = '00000000-0000-0000-0000-000000000000'
STATUS_ERROR = {'status': {'code': 100, 'message': "ERROR"}}
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 63771f6..c750462 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -53,6 +53,7 @@
SUPPORTED_DOMAIN_VERSIONS = DOMAIN_VERSIONS
UUID_GLOB_PATTERN = '*-*-*-*-*'
+BLANK_UUID = '00000000-0000-0000-0000-000000000000'
MEGAB = 2 ** 20 # = 1024 ** 2 = 1 MiB
diff --git a/vdsm/API.py b/vdsm/API.py
index e04e894..0eb23b4 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -104,6 +104,8 @@
class VM(APIBase):
ctorArgs = ['vmID']
+ BLANK_UUID = constants.BLANK_UUID
+
def __init__(self, UUID):
APIBase.__init__(self)
self._UUID = UUID
@@ -676,7 +678,7 @@
SHARED = storage.volume.SHARED_VOL
LEAF = storage.volume.LEAF_VOL
- BLANK_UUID = storage.volume.BLANK_UUID
+ BLANK_UUID = constants.BLANK_UUID
def __init__(self, UUID, spUUID, sdUUID, imgUUID):
APIBase.__init__(self)
@@ -747,7 +749,7 @@
class Image(APIBase):
ctorArgs = ['imageID', 'storagepoolID', 'storagedomainID']
- BLANK_UUID = storage.volume.BLANK_UUID
+ BLANK_UUID = constants.BLANK_UUID
class DiskTypes:
UNKNOWN = storage.image.UNKNOWN_DISK_TYPE
@@ -855,7 +857,7 @@
ISO = storage.sd.ISO_DOMAIN
BACKUP = storage.sd.BACKUP_DOMAIN
- BLANK_UUID = storage.sd.BLANK_UUID
+ BLANK_UUID = constants.BLANK_UUID
def __init__(self, UUID):
APIBase.__init__(self)
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index e5ba760..a107fb6 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -433,7 +433,6 @@
UUID_REGEX = re.compile("^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$")
-UUID_BLANK = "00000000-0000-0000-0000-000000000000"
def validateUUID(uuid, name="uuid", blank=True):
@@ -455,7 +454,7 @@
if m is None:
raise se.InvalidParameterException(name, uuid)
- if not blank and uuid == UUID_BLANK:
+ if not blank and uuid == constants.BLANK_UUID:
raise se.InvalidParameterException(name, uuid)
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 8c55c09..0f71b3d 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -133,7 +133,7 @@
ImgsPar = namedtuple("ImgsPar", "imgs,parent")
ISO_IMAGE_UUID = '11111111-1111-1111-1111-111111111111'
-BLANK_UUID = '00000000-0000-0000-0000-000000000000'
+BLANK_UUID = constants.BLANK_UUID
REMOVED_IMAGE_PREFIX = "_remove_me_"
ZEROED_IMAGE_PREFIX = REMOVED_IMAGE_PREFIX + "ZERO_"
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 36e8d30..737f24e 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -68,7 +68,7 @@
SHARED_VOL: 'SHARED', INTERNAL_VOL: 'INTERNAL',
LEAF_VOL: 'LEAF'}
-BLANK_UUID = misc.UUID_BLANK
+BLANK_UUID = constants.BLANK_UUID
# Volume meta data fields
SIZE = "SIZE"
--
To view, visit http://gerrit.ovirt.org/15442
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9260d74ae1da1382394a375843b2edff112e6f7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: Decouple images and volumes from pool path
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Decouple images and volumes from pool path
......................................................................
Decouple images and volumes from pool path
Change-Id: Ibde0becf2600ddf2390d12a4e854e1abbd3b1e40
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/fileSD.py
M vdsm/storage/fileVolume.py
M vdsm/storage/hsm.py
M vdsm/storage/image.py
M vdsm/storage/resourceFactories.py
M vdsm/storage/sd.py
M vdsm/storage/sp.py
7 files changed, 31 insertions(+), 34 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/16055/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index d5ae707..039a2a0 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -325,12 +325,8 @@
Fetch the list of the Image UUIDs
"""
# Get Volumes of an image
- pattern = os.path.join(self.storage_repository,
- # ISO domains don't have images,
- # we can assume single domain
- self.getPools()[0],
- self.sdUUID, sd.DOMAIN_IMAGES)
- pattern = os.path.join(pattern, constants.UUID_GLOB_PATTERN)
+ imgsPath = os.path.join(self._getRepoPath(), sd.DOMAIN_IMAGES)
+ pattern = os.path.join(imgsPath, constants.UUID_GLOB_PATTERN)
files = self.oop.glob.glob(pattern)
imgList = []
for i in files:
@@ -546,7 +542,7 @@
templateImage = tImgs[0]
relinkImgs = tuple(tImgs[1:])
repoPath = self._getRepoPath()
- basePath = os.path.join(repoPath, self.sdUUID, sd.DOMAIN_IMAGES)
+ basePath = os.path.join(repoPath, sd.DOMAIN_IMAGES)
volFiles = [volUUID, volUUID + fileVolume.META_FILEEXT]
if self.hasVolumeLeases():
volFiles.append(volUUID + fileVolume.LEASE_FILEEXT)
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 8b0a33e..2706e52 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -355,8 +355,7 @@
not including the shared base (template)
"""
# Get Volumes of an image
- pattern = os.path.join(repoPath, sdUUID, sd.DOMAIN_IMAGES,
- imgUUID, "*.meta")
+ pattern = os.path.join(repoPath, sd.DOMAIN_IMAGES, imgUUID, "*.meta")
files = oop.getProcessPool(sdUUID).glob.glob(pattern)
volList = []
for i in files:
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 7b9ed70..df5ff6c 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1485,8 +1485,7 @@
# we should use the new resource system to synchronize the process
# an eliminate all race conditions
if needFake:
- img = image.Image(os.path.join(self.storage_repository,
- spUUID))
+ img = image.Image(dom.domaindir)
tName = volsByImg.iterkeys()[0]
tParams = dom.produceVolume(imgUUID, tName).getVolumeParams()
img.createFakeTemplate(sdUUID=sdUUID, volParams=tParams)
@@ -1556,8 +1555,8 @@
tImgUUID = e.absentTemplateImageUUID
tParams = srcDom.produceVolume(tImgUUID,
tName).getVolumeParams()
- image.Image(os.path.join(self.storage_repository, spUUID)
- ).createFakeTemplate(dstDom.sdUUID, tParams)
+ image.Image(dstDom.domaindir).createFakeTemplate(dstDom.sdUUID,
+ tParams)
domains = [srcDomUUID, dstDomUUID]
domains.sort()
@@ -1636,7 +1635,7 @@
tImgUUID = e.absentTemplateImageUUID
tParams = srcDom.produceVolume(tImgUUID,
tName).getVolumeParams()
- image.Image(os.path.join(self.storage_repository, spUUID)
+ image.Image(dstDom.domaindir
).createFakeTemplate(dstDom.sdUUID, tParams)
domains = sorted([srcDomUUID, dstDomUUID])
@@ -3152,11 +3151,10 @@
"""
vars.task.getSharedLock(STORAGE, sdUUID)
- img = image.Image(os.path.join(self.storage_repository, spUUID))
- imgVolumes = img.prepare(sdUUID, imgUUID, volUUID)
-
chain = []
dom = sdCache.produce(sdUUID=sdUUID)
+ img = image.Image(dom.domaindir)
+ imgVolumes = img.prepare(sdUUID, imgUUID, volUUID)
for vol in imgVolumes:
volInfo = {'domainID': sdUUID, 'imageID': imgUUID,
@@ -3194,7 +3192,8 @@
"""
vars.task.getSharedLock(STORAGE, sdUUID)
- img = image.Image(os.path.join(self.storage_repository, spUUID))
+ dom = sdCache.produce(sdUUID=sdUUID)
+ img = image.Image(dom.domaindir)
img.teardown(sdUUID, imgUUID, volUUID)
@public
@@ -3221,10 +3220,9 @@
images = [imgUUID]
uuidlist = []
- repoPath = os.path.join(self.storage_repository, spUUID)
for img in images:
uuidlist += (dom.getVolumeClass().
- getImageVolumes(repoPath, sdUUID, img))
+ getImageVolumes(dom.domaindir, sdUUID, img))
self.log.info("List of volumes is %s", uuidlist)
return dict(uuidlist=uuidlist)
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index e2c28cd..c54894f 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -115,8 +115,7 @@
'sdUUID' - storage domain UUID
'imgUUID' - image UUID
"""
- imageDir = os.path.join(self.repoPath, sdUUID, sd.DOMAIN_IMAGES,
- imgUUID)
+ imageDir = os.path.join(self.repoPath, sd.DOMAIN_IMAGES, imgUUID)
if not os.path.isdir(imageDir):
self.log.info("Create placeholder %s for image's volumes",
imageDir)
@@ -131,7 +130,7 @@
"""
Return image directory
"""
- return os.path.join(self.repoPath, sdUUID, sd.DOMAIN_IMAGES, imgUUID)
+ return os.path.join(self.repoPath, sd.DOMAIN_IMAGES, imgUUID)
def deletedVolumeName(self, uuid):
"""
diff --git a/vdsm/storage/resourceFactories.py b/vdsm/storage/resourceFactories.py
index 98c362b..708cce7 100644
--- a/vdsm/storage/resourceFactories.py
+++ b/vdsm/storage/resourceFactories.py
@@ -18,7 +18,6 @@
# Refer to the README and COPYING files for full details of the license
#
-import os
from vdsm.config import config
import logging
import lvm
@@ -96,7 +95,6 @@
"""
This factory produce resources for images
"""
- storage_repository = config.get('irs', 'repository')
# Resource timeouts are in seconds. It's written in ms in the config for
# backward competability reasons
resource_default_timeout = config.getint('irs',
@@ -116,7 +114,7 @@
template = None
dom = sdCache.produce(sdUUID=self.sdUUID)
# Get the list of the volumes
- repoPath = os.path.join(self.storage_repository, dom.getPools()[0])
+ repoPath = dom.domaindir
try:
chain = image.Image(repoPath).getChain(sdUUID=self.sdUUID,
imgUUID=resourceName)
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 8c55c09..baba500 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -656,7 +656,7 @@
raise se.ImagesNotSupportedError()
# If it has a repo we don't have multiple domains. Assume single pool
- return os.path.join(self.storage_repository, self.getPools()[0])
+ return self.domaindir
def getIsoDomainImagesDir(self):
"""
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 052bbf0..83a1f2b 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1759,7 +1759,8 @@
rmanager.acquireResource(dstImageResourcesNamespace,
dstImgUUID, rm.LockType.exclusive)
):
- dstUUID = image.Image(self.poolPath).copy(
+ dom = sdCache.produce(sdUUID=sdUUID)
+ dstUUID = image.Image(dom.domaindir).copy(
sdUUID, vmUUID, srcImgUUID, srcVolUUID, dstImgUUID,
dstVolUUID, descr, dstSdUUID, volType, volFormat, preallocate,
postZero, force)
@@ -1806,7 +1807,8 @@
imgUUID, srcLock),
rmanager.acquireResource(dstImageResourcesNamespace,
imgUUID, rm.LockType.exclusive)):
- image.Image(self.poolPath).move(srcDomUUID, dstDomUUID, imgUUID,
+ dom = sdCache.produce(sdUUID=srcDomUUID)
+ image.Image(dom.domaindir).move(srcDomUUID, dstDomUUID, imgUUID,
vmUUID, op, postZero, force)
def cloneImageStructure(self, sdUUID, imgUUID, dstSdUUID):
@@ -1833,7 +1835,8 @@
)))
with nested(*resList):
- image.Image(self.poolPath).cloneStructure(
+ dom = sdCache.produce(sdUUID=sdUUID)
+ image.Image(dom.domaindir).cloneStructure(
sdUUID, imgUUID, dstSdUUID)
def syncImageData(self, sdUUID, imgUUID, dstSdUUID, syncType):
@@ -1861,7 +1864,8 @@
)))
with nested(*resList):
- image.Image(self.poolPath).syncData(
+ dom = sdCache.produce(sdUUID=sdUUID)
+ image.Image(dom.domaindir).syncData(
sdUUID, imgUUID, dstSdUUID, syncType)
def moveMultipleImages(self, srcDomUUID, dstDomUUID, imgDict, vmUUID,
@@ -1899,7 +1903,8 @@
dstImageResourcesNamespace, imgUUID, rm.LockType.exclusive))
with nested(*resourceList):
- image.Image(self.poolPath).multiMove(
+ dom = sdCache.produce(sdUUID=srcDomUUID)
+ image.Image(dom.domaindir).multiMove(
srcDomUUID, dstDomUUID, imgDict, vmUUID, force)
def mergeSnapshots(self, sdUUID, vmUUID, imgUUID, ancestor, successor,
@@ -1925,7 +1930,8 @@
with rmanager.acquireResource(imageResourcesNamespace, imgUUID,
rm.LockType.exclusive):
- image.Image(self.poolPath).merge(
+ dom = sdCache.produce(sdUUID=sdUUID)
+ image.Image(dom.domaindir).merge(
sdUUID, vmUUID, imgUUID, ancestor, successor, postZero)
def createVolume(self, sdUUID, imgUUID, size, volFormat, preallocate,
@@ -2097,7 +2103,8 @@
self.log.warning("SP %s SD %s img %s Vol %s - teardown failed")
def validateVolumeChain(self, sdUUID, imgUUID):
- image.Image(self.poolPath).validateVolumeChain(sdUUID, imgUUID)
+ dom = sdCache.produce(sdUUID=sdUUID)
+ image.Image(dom.domaindir).validateVolumeChain(sdUUID, imgUUID)
def extendSD(self, sdUUID, devlist, force):
sdCache.produce(sdUUID).extend(devlist, force)
--
To view, visit http://gerrit.ovirt.org/16055
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibde0becf2600ddf2390d12a4e854e1abbd3b1e40
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: Remove StoragePool.createVolume().
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Remove StoragePool.createVolume().
......................................................................
Remove StoragePool.createVolume().
Change-Id: I45186ab45d075d764c0a630e6b7a483baef1e45b
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/sp.py
2 files changed, 7 insertions(+), 55 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/16325/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 5a5b4fb..ef354e0 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1379,8 +1379,6 @@
diskType, volUUID, desc,
srcImgUUID, srcVolUUID))
vars.task.setDefaultException(se.VolumeCreationError(argsStr))
- # Validates that the pool is connected. WHY?
- pool = self.getPool(spUUID)
sdDom = self.validateSdUUID(sdUUID)
misc.validateUUID(imgUUID, 'imgUUID')
misc.validateUUID(volUUID, 'volUUID')
@@ -1399,9 +1397,13 @@
sdDom.validateCreateVolumeParams(volFormat, preallocate, srcVolUUID)
vars.task.getSharedLock(STORAGE, sdUUID)
- self._spmSchedule(spUUID, "createVolume", pool.createVolume, sdUUID,
- imgUUID, size, volFormat, preallocate, diskType,
- volUUID, desc, srcImgUUID, srcVolUUID)
+ imageResourcesNamespace = sd.getNamespace(sdUUID, IMAGE_NAMESPACE)
+ with rmanager.acquireResource(imageResourcesNamespace, imgUUID,
+ rm.LockType.exclusive):
+ self._spmSchedule(spUUID, "createVolume_%s" % volUUID,
+ sdDom.createVolume, imgUUID, size, volFormat,
+ preallocate, diskType, volUUID, desc,
+ srcImgUUID, srcVolUUID)
@public
def deleteVolume(self, sdUUID, spUUID, imgUUID, volumes, postZero=False,
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 9b154f4..4a9fa05 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -49,7 +49,6 @@
from resourceFactories import IMAGE_NAMESPACE
from storageConstants import STORAGE
import resourceManager as rm
-import volume
import mount
from domainMonitor import DomainMonitor
@@ -1897,55 +1896,6 @@
rm.LockType.exclusive):
image.Image(self.poolPath).merge(
sdUUID, vmUUID, imgUUID, ancestor, successor, postZero)
-
- def createVolume(self, sdUUID, imgUUID, size, volFormat, preallocate,
- diskType, volUUID=None, desc="",
- srcImgUUID=volume.BLANK_UUID,
- srcVolUUID=volume.BLANK_UUID):
- """
- Creates a new volume.
-
- .. note::
- If the *imgUUID* is **identical** to the *srcImgUUID* the new
- volume will be logically considered a snapshot of the old volume.
- If the *imgUUID* is **different** from the *srcImgUUID* the old
- volume will be logically considered as a template of the new
- volume.
-
- :param sdUUID: The UUID of the storage domain that contains the volume.
- :type sdUUID: UUID
- :param imgUUID: The UUID of the image that the new volume will have.
- :type imgUUID: UUID
- :param size: The size of the new volume in bytes.
- :type size: int
- :param volFormat: The format of the new volume.
- :type volFormat: some enum ?!
- :param preallocate: Should the volume be preallocated.
- :type preallocate: bool
- :param diskType: The disk type of the new volume.
- :type diskType: :class:`API.Image.DiskTypes`
- :param volUUID: The UUID of the new volume that will be created.
- :type volUUID: UUID
- :param desc: A human readable description of the new volume.
- :param srcImgUUID: The UUID of the image that resides on the volume
- that will be the base of the new volume.
- :type srcImgUUID: UUID
- :param srcVolUUID: The UUID of the volume that will be the base of the
- new volume.
- :type srcVolUUID: UUID
-
- :returns: a dict with the UUID of the new volume.
- :rtype: dict
- """
- imageResourcesNamespace = sd.getNamespace(sdUUID, IMAGE_NAMESPACE)
-
- with rmanager.acquireResource(imageResourcesNamespace, imgUUID,
- rm.LockType.exclusive):
- uuid = sdCache.produce(sdUUID).createVolume(
- imgUUID=imgUUID, size=size, volFormat=volFormat,
- preallocate=preallocate, diskType=diskType, volUUID=volUUID,
- desc=desc, srcImgUUID=srcImgUUID, srcVolUUID=srcVolUUID)
- return dict(uuid=uuid)
def deleteVolume(self, sdUUID, imgUUID, volumes, postZero, force):
"""
--
To view, visit http://gerrit.ovirt.org/16325
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I45186ab45d075d764c0a630e6b7a483baef1e45b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: Move fenceNode out of API.py
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Move fenceNode out of API.py
......................................................................
Move fenceNode out of API.py
The actual details of how the response is mangles is part of the
bindings so API.py really doesn't serve a purpose.
This is the first step in a general trend of moving the logic out of
API.py to dedicated modules and move the response mangling to the
binding wrappers.
Change-Id: Idaba551333a0f289abaff11dc113e09c426d591a
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/API.py
M vdsm/BindingXMLRPC.py
2 files changed, 25 insertions(+), 38 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/7191/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 5826d81..4fdc7e7 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -37,7 +37,6 @@
from vdsm.define import doneCode, errCode, Kbytes, Mbytes
import caps
from vdsm.config import config
-import fenceAgent
import supervdsm
@@ -972,40 +971,6 @@
APIBase.__init__(self)
# General Host functions
- def fenceNode(self, addr, port, agent, username, password, action,
- secure=False, options=''):
- """Send a fencing command to a remote node.
-
- agent is one of (rsa, ilo, drac5, ipmilan, etc)
- action can be one of (status, on, off, reboot)."""
-
- 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)
-
- secure = utils.tobool(secure)
- port = int(port)
-
- 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:
- fenceAgent.fenceNode(addr, port, agent, username, password, secure,
- options, self._cif.shutdownEvent)
-
- return {'status': doneCode}
-
- except fenceAgent.UnsupportedFencingAgentError:
- return errCode['fenceAgent']
-
def ping(self):
"Ping the server. Useful for tests"
return {'status': doneCode}
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 48f4723..7eee29e 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -32,6 +32,8 @@
from vdsm.define import doneCode, errCode
import API
from vdsm.exception import VdsmException
+import fenceAgent
+
try:
from gluster.api import getGlusterMethods
_glusterEnabled = True
@@ -355,9 +357,29 @@
def fenceNode(self, addr, port, agent, username, password, action,
secure=False, options=''):
- api = API.Global()
- return api.fenceNode(addr, port, agent, username, password,
- action, secure, options)
+
+ secure = utils.tobool(secure)
+ port = int(port)
+
+ 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:
+ fenceAgent.fenceNode(addr, port, agent, username, password, secure,
+ options, self.cif.shutdownEvent)
+
+ return {'status': doneCode}
+
+ except fenceAgent.UnsupportedFencingAgentError:
+ return errCode['fenceAgent']
def setLogLevel(self, level):
api = API.Global()
--
To view, visit http://gerrit.ovirt.org/7191
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idaba551333a0f289abaff11dc113e09c426d591a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: More safe startSpm().
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: More safe startSpm().
......................................................................
More safe startSpm().
Change-Id: I1e6b32bdf1dd8dc36f6633306d4edef89d542e31
---
M vdsm/storage/sp.py
1 file changed, 16 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/451/1
--
To view, visit http://gerrit.ovirt.org/451
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e6b32bdf1dd8dc36f6633306d4edef89d542e31
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: [WIP] Add a releaseHostId option to stop the DomainMonitorTh...
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: [WIP] Add a releaseHostId option to stop the DomainMonitorThread
......................................................................
[WIP] Add a releaseHostId option to stop the DomainMonitorThread
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=851151
Change-Id: I83458fb4146de7e402606916615533da305bd867
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/domainMonitor.py
M vdsm/storage/sp.py
2 files changed, 19 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/7581/1
diff --git a/vdsm/storage/domainMonitor.py b/vdsm/storage/domainMonitor.py
index 95e2f7b..c1ec5a9 100644
--- a/vdsm/storage/domainMonitor.py
+++ b/vdsm/storage/domainMonitor.py
@@ -84,14 +84,14 @@
# The domain should be added only after it succesfully started
self._domains[sdUUID] = domainThread
- def stopMonitoring(self, sdUUID):
+ def stopMonitoring(self, sdUUID, releaseHostId=False):
# The domain monitor issues events that might become raceful if
# stopMonitoring doesn't stop until the thread exits.
# Eg: when a domain is detached the domain monitor is stopped and
# the host id is released. If the monitor didn't actually exit it
# might respawn a new acquire host id.
try:
- self._domains[sdUUID].stop()
+ self._domains[sdUUID].stop(releaseHostId=releaseHostId)
except KeyError:
return
@@ -100,13 +100,15 @@
def getStatus(self, sdUUID):
return self._domains[sdUUID].getStatus()
- def close(self):
+ def close(self, releaseHostId=False):
for sdUUID in self._domains.keys():
- self.stopMonitoring(sdUUID)
+ self.stopMonitoring(sdUUID, releaseHostId=releaseHostId)
class DomainMonitorThread(object):
log = logging.getLogger('Storage.DomainMonitorThread')
+
+ RELEASE_HOSTID_DEFAULT = False
def __init__(self, sdUUID, hostId, interval):
self.thread = Thread(target=self._monitorLoop)
@@ -121,16 +123,20 @@
self.nextStatus = DomainMonitorStatus()
self.isIsoDomain = None
self.lastRefresh = time()
+ self.releaseHostId = self.RELEASE_HOSTID_DEFAULT
self.refreshTime = \
config.getint("irs", "repo_stats_cache_refresh_timeout")
def start(self):
self.thread.start()
- def stop(self, wait=True):
+ def stop(self, wait=True, releaseHostId):
+ self.releaseHostId = releaseHostId
+
self.stopEvent.set()
if wait:
self.thread.join()
+
self.domain = None
def getStatus(self):
@@ -151,13 +157,17 @@
# If this is an ISO domain we didn't acquire the host id and releasing
# it is superfluous.
- if not self.isIsoDomain:
+ if not self.isIsoDomain and self.releaseHostId:
try:
self.domain.releaseHostId(self.hostId, unused=True)
except:
self.log.debug("Unable to release the host id %s for domain "
"%s", self.hostId, self.sdUUID, exc_info=True)
+ # Resetting the releaseHostId value to its default just to be sure in
+ # case in the future we want to recycle the DomainMonitor objects.
+ self.releaseHostId = self.RELEASE_HOSTID_DEFAULT
+
def _monitorDomain(self):
self.nextStatus.clear()
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 40de20a..e8c59f3 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -647,8 +647,8 @@
@unsecured
- def stopMonitoringDomains(self):
- self.domainMonitor.close()
+ def stopMonitoringDomains(self, releaseHostId=False):
+ self.domainMonitor.close(releaseHostId=releaseHostId)
return True
@@ -675,7 +675,7 @@
if os.path.exists(self.poolPath):
fileUtils.cleanupdir(self.poolPath)
- self.stopMonitoringDomains()
+ self.stopMonitoringDomains(releaseHostId=True)
return True
--
To view, visit http://gerrit.ovirt.org/7581
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83458fb4146de7e402606916615533da305bd867
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
8 years, 10 months
Change in vdsm[master]: multipath: Remove unused 'deduceType'
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: multipath: Remove unused 'deduceType'
......................................................................
multipath: Remove unused 'deduceType'
Change-Id: I37a94c3d67641f1c78d8fbecd63cbf1480c6e1b0
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/multipath.py
1 file changed, 0 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/13363/1
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index 94801ca..5fdaa27 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -184,13 +184,6 @@
raise se.MultipathRestartError()
-def deduceType(a, b):
- if a == b:
- return a
- else:
- return DEV_MIXED
-
-
def getDeviceBlockSizes(dev):
devName = os.path.basename(dev)
logical = int(file(os.path.join("/sys/block/", devName,
--
To view, visit http://gerrit.ovirt.org/13363
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I37a94c3d67641f1c78d8fbecd63cbf1480c6e1b0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
8 years, 10 months