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>
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>
Eduardo has uploaded a new change for review.
Change subject: Fill volume children info.
......................................................................
Fill volume children info.
In spite that they are no consumers for 'children' key in
Volume.getInfo() result adding the children set for correcteness.
Change-Id: Ibf374e6abe81962619baecf96fffa0f817ce5dcb
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/volume.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/20004/1
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index c19ec2f..96b84d7 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -903,7 +903,7 @@
# Both engine and dumpStorageTable don't use this option so
# only keeping it to not break existing scripts that look for the key
- info['children'] = []
+ info['children'] = list(self.getChildren())
# If image was set to illegal, mark the status same
# (because of VDC constraints)
--
To view, visit http://gerrit.ovirt.org/20004
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf374e6abe81962619baecf96fffa0f817ce5dcb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>