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>
9 years, 11 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>
9 years, 11 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>
9 years, 11 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>
9 years, 11 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>
9 years, 11 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>
9 years, 11 months
Change in vdsm[master]: Adding monitorDomains.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Adding monitorDomains.
......................................................................
Adding monitorDomains.
Making repoStats pool independent.
Change-Id: I9f148764ac030730c93bfd9c8da25a7ea434dc33
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/14674/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index d3e1beb..3fb0c30 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -40,6 +40,7 @@
from vdsm.config import config
import sp
+import domainMonitor
import sd
import blockSD
import nfsSD
@@ -93,6 +94,7 @@
QEMU_READABLE_TIMEOUT = 30
+HSM_DOM_MON_LOCK = "HsmDomainMonitorLock"
def public(f=None, **kwargs):
if f is None:
@@ -395,6 +397,9 @@
name="storageRefresh")
storageRefreshThread.daemon = True
storageRefreshThread.start()
+
+ monitorInterval = config.getint('irs', 'sd_health_check_delay')
+ self.domainMonitor = domainMonitor.DomainMonitor(monitorInterval)
def _hsmSchedule(self, name, func, *args):
self.taskMng.scheduleJob("hsm", self.tasksDir, vars.task,
@@ -934,7 +939,10 @@
"spUUID=%s, msdUUID=%s, masterVersion=%s, hostID=%s, "
"scsiKey=%s" % (spUUID, msdUUID, masterVersion,
hostID, scsiKey)))
- return self._connectStoragePool(spUUID, hostID, scsiKey, msdUUID,
+ with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
+ rm.LockType.exclusive):
+ self.domainMonitor.close()
+ return self._connectStoragePool(spUUID, hostID, scsiKey, msdUUID,
masterVersion, options)
def _connectStoragePool(self, spUUID, hostID, scsiKey, msdUUID,
@@ -3578,3 +3586,13 @@
result[d] = repo_stats[d]['result']
return result
+
+ @public
+ def monitorDomains(self, sdUUIDs, hostID, options=None):
+ with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
+ rm.LockType.exclusive):
+ if self.pools:
+ raise se.StoragePoolConnected()
+ self.domainMonitor.close()
+ for sdUUID in sdUUIDs:
+ self.domainMonitor.startMonitoring(sdUUID, hostId)
--
To view, visit http://gerrit.ovirt.org/14674
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f148764ac030730c93bfd9c8da25a7ea434dc33
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: Initial commit of the tool for starting VM without the manag...
by Pablo Iranzo Gómez
Pablo Iranzo Gómez has uploaded a new change for review.
Change subject: Initial commit of the tool for starting VM without the manager being available
......................................................................
Initial commit of the tool for starting VM without the manager being available
Change-Id: I9a70b31ce0730194880406701316f219c9f92ceb
Signed-off-by: Pablo <Pablo.Iranzo(a)gmail.com>
---
A contrib/forceVMstart/vdsEmergency-1.0.0.py
1 file changed, 490 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/9473/1
diff --git a/contrib/forceVMstart/vdsEmergency-1.0.0.py b/contrib/forceVMstart/vdsEmergency-1.0.0.py
new file mode 100644
index 0000000..41fe068
--- /dev/null
+++ b/contrib/forceVMstart/vdsEmergency-1.0.0.py
@@ -0,0 +1,490 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 Red Hat, Inc.
+#
+# Licensed to you under 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.
+#
+# Require Packages: python-iniparse
+
+import getopt
+import sys
+import commands
+import os
+import socket
+from xml.dom.minidom import parse, parseString
+
+try:
+ from iniparse import ConfigParser
+except:
+ print "Package python-iniparse is required, please install"
+ print "#yum install python-iniparse -y"
+ sys.exit(1)
+
+
+# Adding vdsm .pyc libraries to python path
+sys.path.append("/usr/share/vdsm")
+
+try:
+ import vdscli
+except:
+ print "Cannot import vdscli, please contact Red Hat support"
+ sys.exit(1)
+
+try:
+ import vdsClient
+except:
+ print "Cannot import vdsClient, please contact Red Hat support"
+ sys.exit(1)
+
+# General Macros
+VERSION = "1.0.0"
+VDSM_PORT = "54321"
+
+#DEBUG MODE
+DEBUG = "False" # True or False
+
+#########################################################################
+
+class vdsmEmergency:
+
+ ##########################################################################
+ # __init__() #
+ # Description: Initialize method #
+ ##########################################################################
+ def __init__(self):
+ sslRet = self.checkSSLvdsm()
+ self.useSSL = sslRet
+ self.truststore = None
+
+ ##########################################################################
+ # do_connect() #
+ # Description: Do a connection with vdsm daemon #
+ ##########################################################################
+ def do_connect(self, server, port):
+ print "Trying to connect to vdsmd host (%s).." % server
+
+ # Connection Validation
+ sk = socket.socket()
+ try:
+ sk.connect((server, int(VDSM_PORT)))
+ except Exception, e:
+ print "Unable to connect %s" % server
+ sk.close()
+ return -1
+
+ self.s = vdscli.connect(server + ':' + port, self.useSSL, self.truststore)
+
+ print "OK, Connected to vdsmd!"
+ return 0
+
+ ##########################################################################
+ # checkRoot() #
+ # Description: check if the user running the script is root #
+ ##########################################################################
+ def checkRoot(self):
+ if os.geteuid() != 0:
+ print "You must be root to run this script."
+ sys.exit(2)
+
+ ##########################################################################
+ # getIpRHEVM() #
+ # Description: get the IP from RHEVM Interface #
+ ##########################################################################
+ def getIpRHEVM(self):
+
+ # TODO: avoid this kind of hack, find a better approach (vdsClient provide the IP of rhevm interface?)
+ strCmd = "ifconfig rhevm | grep \"inet addr\" | cut -d \':\' -f 2 | cut -d \' \' -f 1"
+ retCmd = commands.getstatusoutput(strCmd)
+ if retCmd[0] != 0:
+ print "Error getting IP from rhevm interface"
+ sys.exit(1)
+
+ return retCmd[1]
+ ##########################################################################
+ # checkSSLvdsm() #
+ # Description: check if vdsm is running as SSL or without it #
+ ##########################################################################
+ def checkSSLvdsm(self):
+
+ cfg = ConfigParser()
+ cfg.read('/etc/vdsm/vdsm.conf')
+ cfg.get('vars', 'ssl')
+
+ return cfg.data.vars.ssl
+
+
+ ##########################################################################
+ # checkVmRunning() #
+ # Description: check if the vms are running #
+ ##########################################################################
+ def checkVmRunning(self, otherHostsList, VmsToStart):
+
+ hosts = None
+ vms = None
+ i = 0
+ j = 0
+
+ if otherHostsList == None:
+ return -1
+
+ if VmsToStart == None:
+ return -1
+
+ vms = VmsToStart.split(",")
+ hosts = otherHostsList.split(",")
+
+ # Let's check if all other Hosts are running the VirtualMachine
+ while (i <> len(hosts)):
+ ret = VE.do_connect(hosts[i], VDSM_PORT)
+ if ret < 0:
+ sys.exit(1)
+ response = self.s.list()
+ if response['status']['code'] != 0:
+ print "cannot execute list operation, err:" + response['status']['message']
+
+ # Checking VM status
+ for s in self.s.getAllVmStats()['statsList']:
+ j = 0
+
+ # print all vms in each host
+ while j < len(vms):
+ if DEBUG == "True":
+ print len(vms)
+ print s['vmId']
+ print hosts[i]
+ print vms[j]
+
+ vmIdCurr = self.getVmId(vms[j])
+
+ if DEBUG == "True":
+ print vmIdCurr
+ print s['vmId']
+
+ if s['vmId'] == vmIdCurr and s['status'] == "Up":
+ print "Cannot continue, the VM %s is running in host %s" % (vms[j], hosts[i])
+ sys.exit(1)
+ j = j + 1
+
+ # counter for hosts
+ i = i + 1
+
+ print "OK, the vm(s) specified are not running on the host(s) informed, continuing.."
+
+ ##########################################################################
+ # checkSPM() #
+ # Description: check if the host which is running this script is the SPM #
+ ##########################################################################
+ def checkSPM(self):
+ self.spUUID = None
+ self.spmStatus = None
+
+ ip_rhevm_interface = self.getIpRHEVM()
+ self.do_connect(ip_rhevm_interface, VDSM_PORT)
+
+ try:
+ list = self.s.getConnectedStoragePoolsList()
+ except:
+ print "Cannot execute getConnectedStoragePoolsList()"
+ sys.exit(1)
+
+ for entry in list['poollist']:
+ self.spUUID = entry
+
+ if not self.spUUID:
+ print "Cannot locate Storage Pools List.. aborting!"
+ sys.exit(1)
+
+ try:
+ status = self.s.getSpmStatus(self.spUUID)
+ except:
+ print "Cannot execute getSpmStatus()"
+ sys.exit(1)
+
+ self.spmStatus = status['spm_st']['spmStatus']
+
+ if self.spmStatus <> "SPM":
+ print "This host is not the current SPM, status [%s]" % self.spmStatus
+ sys.exit(1)
+
+
+ ######################################################################
+ # getVmId() #
+ # Description: get the vmId from the vmName used as argument #
+ ######################################################################
+ def getVmId(self, vmName):
+ path = "/rhev/data-center/%s/vms" % (self.spUUID)
+
+ # First verify which domainID contain de XML files
+ try:
+ dirList = os.listdir(path)
+ except:
+ print "Cannot locate the dir with ovf files.. aborting!"
+ sys.exit(1)
+
+ #Read all content of xml(s) file(s)
+ for fname in dirList:
+
+ pathOVF = path + "/" + fname + "/" + fname + ".ovf"
+
+ dom = parse(pathOVF)
+
+ # Getting vmId field
+ i = 0
+ attr = 0
+ for node in dom.getElementsByTagName('Section'):
+ while ( i < len(node.attributes)):
+ attr = node.attributes.items()
+ if attr[i][0] == "ovf:id":
+ vmId = attr[i][1]
+ i = i + 1
+
+ # Getting vmName field
+ for node in dom.getElementsByTagName('Content'):
+ if node.childNodes[0].firstChild <> None:
+ if node.childNodes[0].firstChild.nodeValue == vmName:
+ return vmId
+
+
+
+ def _parseDriveSpec(self, spec):
+ if ',' in spec:
+ d = {}
+ for s in spec.split(','):
+ k, v = s.split(':', 1)
+ if k == 'domain': d['domainID'] = v
+ if k == 'pool': d['poolID'] = v
+ if k == 'image': d['imageID'] = v
+ if k == 'volume': d['volumeID'] = v
+ if k == 'boot': d['boot'] = v
+ if k == 'format': d['format'] = v
+ return d
+ return spec
+
+ ######################################################################
+ # readXML() #
+ # Description: read all xml available pointed to Direcory path and #
+ # parse for specific fields #
+ ######################################################################
+ def readXML(self, VmsStotart, destHostStart):
+
+ # number of Vms found
+ nrmVms = 0
+ cmd = {}
+ # Path to XML files
+ # example default path:
+ # /rhev/data-center/1a516f64-f091-4785-9278-362037513408/vms
+ path = "/rhev/data-center/%s/vms" % (self.spUUID)
+
+ # First verify which domainID contain de XML files
+ try:
+ dirList = os.listdir(path)
+ except:
+ print "Cannot locate the dir with ovf files.. aborting!"
+ sys.exit(1)
+
+ #Read all content of xml(s) file(s)
+ for fname in dirList:
+
+ pathOVF = path + "/" + fname + "/" + fname + ".ovf"
+ cmd['display']="vnc"
+ cmd['kvmEnable']="True"
+ cmd['tabletEnable']="True"
+ cmd['vmEnable']="True"
+ cmd['irqChip']="True"
+ cmd['nice']=0
+ cmd['keyboardLayout']="en-us"
+ cmd['acpiEnable']="True"
+ cmd['tdf']="True"
+
+ dom = parse(pathOVF)
+
+ # Getting vmId field
+ i = 0
+ attr = 0
+ for node in dom.getElementsByTagName('Section'):
+ while ( i < len(node.attributes)):
+ attr = node.attributes.items()
+ if attr[i][0] == "ovf:id":
+ cmd["vmId"] = attr[i][1]
+ i = i + 1
+
+ # Getting vmName field
+ for node in dom.getElementsByTagName('Content'):
+ if node.childNodes[0].firstChild <> None:
+ self.vmName = node.childNodes[0].firstChild.nodeValue
+ cmd['vmName'] = self.vmName
+
+ # Getting image and volume
+ i = 0
+ attr = 0
+ for node in dom.getElementsByTagName('Disk'):
+ while (i <> len(node.attributes)):
+ attr = node.attributes.items()
+ if attr[i][0] == "ovf:fileRef":
+ storage = attr[i][1]
+ data = storage.split("/")
+ image = data[0]
+ volume = data[1]
+ i += 1
+
+ # Getting VM format, boot
+ i = 0
+ attr =0
+ for node in dom.getElementsByTagName('Disk'):
+ while (i <> len(node.attributes)):
+ attr = node.attributes.items()
+ if attr[i][0] == "ovf:volume-format":
+ format = attr[i][1]
+
+ if attr[i][0] == "ovf:boot":
+ vmBoot = attr[i][1]
+
+ if attr[i][0] == "ovf:disk-interface":
+ ifFormat = attr[i][1]
+
+ i += 1
+
+ if format == "COW":
+ vmFormat = ":cow"
+ elif format == "RAW":
+ vmFormat = ":raw"
+
+
+ if ifFormat == "VirtIO":
+ ifDisk = "virtio"
+ elif ifFormat == "IDE":
+ ifDisk = "ide"
+ drives = []
+ # Getting Drive, bridge, memSize, macAddr, smp, smpCoresPerSocket
+ for node in dom.getElementsByTagName('Item'):
+ # Getting Drive
+ if node.childNodes[0].firstChild <> None:
+ str = node.childNodes[0].firstChild.nodeValue
+ if str.find("Drive") > -1:
+
+ tmp = "pool:" + self.spUUID + ",domain:" + node.childNodes[7].firstChild.nodeValue + ",image:" + image + ",volume:" + volume + ",boot:" + vmBoot + ",format" + vmFormat + ",if:" + ifDisk
+ #param,value = tmp.split("=",1)
+ drives += [self._parseDriveSpec(tmp)]
+ cmd['drives'] = drives
+
+ # Getting bridge
+ nicMod = None
+ if node.childNodes[0].firstChild.nodeValue == "Ethernet adapter on rhevm":
+ if node.childNodes[3].firstChild.nodeValue == "3":
+ nicMod = "pv" #VirtIO
+ elif node.childNodes[3].firstChild.nodeValue == "2":
+ nicMod = "e1000" #e1000
+ elif node.childNodes[3].firstChild.nodeValue == "1":
+ nicMod = "rtl8139" #rtl8139
+
+ cmd['nicModel'] = nicMod
+ cmd['bridge'] = node.childNodes[4].firstChild.nodeValue
+
+ # Getting memSize field
+ str = node.childNodes[0].firstChild.nodeValue
+ if str.find("MB of memory") > -1:
+ cmd['memSize'] = node.childNodes[5].firstChild.nodeValue
+
+ # Getting smp and smpCoresPerSocket fields
+ str = node.childNodes[0].firstChild.nodeValue
+ if str.find("virtual cpu") > -1:
+ cmd["smp="] = node.childNodes[4].firstChild.nodeValue
+ cmd["smpCoresPerSocket"] = node.childNodes[5].firstChild.nodeValue
+
+ # Getting macAddr field
+ if node.childNodes[0].firstChild.nodeValue == "Ethernet adapter on rhevm":
+ if len(node.childNodes) > 6:
+ cmd['macAddr'] = node.childNodes[6].firstChild.nodeValue
+
+ # if node.childNodes < 6 it`s a template entry, so ignore
+ if len(node.childNodes) > 6:
+ # print only vms to start
+ try:
+ checkvms = VmsToStart.split(",")
+ except:
+ print "Please use , between vms name, avoid space"
+ self.usage()
+
+ i = 0
+ while (i <> len(checkvms)):
+ if self.vmName == checkvms[i]:
+ nrmVms = nrmVms + 1
+ self.startVM(cmd, destHostStart)
+ i += 1
+
+ print "Total VMs found: %s" % nrmVms
+
+ ######################################################################
+ # startVM() #
+ # Description: start the VM #
+ ######################################################################
+ def startVM(self, cmd, destHostStart):
+
+ self.do_connect(destHostStart, VDSM_PORT)
+ #print cmd
+ #cmd1 = dict(cmd)
+ #print cmd1
+ ret = self.s.create(cmd)
+ #print ret
+ print "Triggered VM [%s]" % self.vmName
+
+ ######################################################################
+ # usage() #
+ # Description: shows the program params #
+ ######################################################################
+ def usage(self):
+ print "Usage: " + sys.argv[0] + " [OPTIONS]"
+ print "\t--destHost \t RHEV-H host which will start the VM"
+ print "\t--otherHostsList\t All RHEV-H hosts"
+ print "\t--vms \t Specify the Names of which VMs to start"
+ print "\t--version \t List version release"
+ print "\t--help \t This help menu\n"
+
+ print "Example:"
+ print "\t" + sys.argv[0] + " --destHost LinuxSrv1 --otherHostsList Megatron,Jerry --vms vm1,vm2,vm3,vm4"
+ sys.exit(1)
+
+
+if __name__ == "__main__":
+
+ otherHostsList = ''
+ VmsToStart = None
+ destHostStart = None
+
+ VE = vdsmEmergency()
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "Vd:ho:v:", ["destHost=", "otherHostsList=", "vms=", "help", "version"])
+ except getopt.GetoptError, err:
+ # print help information and exit:
+ print(err) # will print something like "option -a not recognized"
+ VE.usage()
+ sys.exit(2)
+ for o, a in opts:
+ if o in ("-d", "--destHost"):
+ destHostStart = a
+ print ""
+ elif o in ("-h", "--help"):
+ VE.usage()
+ sys.exit()
+ elif o in ("-o", "--otherHostsList"):
+ otherHostsList = a
+ elif o in ("-v", "--vms"):
+ VmsToStart = a
+ elif o in ("-V", "--version"):
+ print VERSION
+ else:
+ assert False, "unhandled option"
+
+ argc = len(sys.argv)
+ if argc < 2:
+ VE.usage()
+
+ VE.checkSPM()
+
+ # Include the destHost to verify
+ otherHostsList += ",%s" % destHostStart
+ VE.checkVmRunning(otherHostsList, VmsToStart)
+
+ VE.readXML(VmsToStart, destHostStart)
--
To view, visit http://gerrit.ovirt.org/9473
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a70b31ce0730194880406701316f219c9f92ceb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Pablo Iranzo Gómez <Pablo.Iranzo(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: (Schema) Change ConnectionRef actions to work on a single co...
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: (Schema) Change ConnectionRef actions to work on a single connection
......................................................................
(Schema) Change ConnectionRef actions to work on a single connection
This was the original intention of the API. The reason we started
supporting multiple connections in a single call is because of the
overhead inherent in XML-RPC. The new API can multiplex calls and has
practically no overhead per call.
Also, refID is not an UUID
Change-Id: I5747f2161d039cfaa82c0797e63ff58dbffbe8ac
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 21 insertions(+), 44 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/7148/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index e782613..b103b28 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2250,16 +2250,16 @@
{'command': {'class': 'Global', 'name': 'setSafeNetworkConfig'}}
-## Category: @ConnectionRefs ##################################################
+## Category: @ConnectionRef ##################################################
##
-# @ConnectionRefs.init:
+# @ConnectionRef.init:
#
-# Initialize a ConnectionRefs API object.
+# Initialize a ConnectionRef API object.
#
# Since: 4.10.0
# XXX: Extension: object constructors
##
-{'init': 'ConnectionRefs'}
+{'init': 'ConnectionRef'}
##
# @IscsiPortal:
@@ -2444,60 +2444,37 @@
'connectionInfo': 'ConnectionRefParameters'}}
##
-# @ConnectionRefArgsMap:
-#
-# A mapping of connection arguments indexed by ConnectionRef UUID.
-#
-# Since: 4.10.0
-##
-{'map': 'ConnectionRefArgsMap',
- 'key': 'UUID', 'value': 'ConnectionRefArgs'}
-
-##
-# @ConnectionRefArgsStatusMap:
-#
-# A mapping of status codes indexed by ConnectionRef UUID.
-#
-# Since: 4.10.0
-##
-{'map': 'ConnectionRefArgsStatusMap',
- 'key': 'UUID', 'value': 'int'}
-
-##
-# @ConnectionRefs.acquire:
+# @ConnectionRef.acquire:
#
# Acquire one or more new storage connection references.
#
-# @conRefArgs: Connection parameters
+# @refID: The identifier to be assigned to the new connection reference.
+# Users are encouraged to mangle they information into the string
+# to prevent collisions and declare ownership.
+# eg.
+# ENGINE_CONNECTION_3213
#
-# Returns:
-# @results: A dictionary of status codes indexed by the same @UUID values in
-# @conRefArgs.
+# This way managers can tell which connections are owned by whome.
+# @conRefArgs: Connection parameters.
#
# Since: 4.10.0
# XXX: Extension: map data type ['key type', 'val type']
##
-{'command': {'class': 'ConnectionRefs', 'name': 'acquire'},
- 'data': {'conRefArgs': 'ConnectionRefArgsMap'},
- 'returns': {'results': 'ConnectionRefArgsStatusMap'}}
+{'command': {'class': 'ConnectionRef', 'name': 'acquire'},
+ 'data': {'refID', 'str', 'conRefArgs': 'ConnectionRefArgs'}}
##
-# @ConnectionRefs.release:
+# @ConnectionRef.release:
#
# Release one or more storage connection references.
#
-# @refIDs: A list of @UUID values
-#
-# Returns:
-# @results: A dictionary of status codes indexed by the same @UUID values that
-# were passed in @0.
+# @refIDs: A list of string values.
#
# Since: 4.10.0
# XXX: Extension: list data type
##
-{'command': {'class': 'ConnectionRefs', 'name': 'release'},
- 'data': {'refIDs': ['UUID']},
- 'returns': {'results': 'ConnectionRefArgsStatusMap'}}
+{'command': {'class': 'ConnectionRef', 'name': 'release'},
+ 'data': {'refID': 'str'}}
##
# @ConnectionRefMap:
@@ -2507,10 +2484,10 @@
# Since: 4.10.0
##
{'map': 'ConnectionRefMap',
- 'key': 'UUID', 'value': 'ConnectionRef'}
+ 'key': 'str', 'value': 'ConnectionRef'}
##
-# @ConnectionRefs.statuses:
+# @ConnectionRef.statuses:
#
# Get information about all registered storage connection references.
#
@@ -2519,7 +2496,7 @@
#
# Since: 4.10.0
##
-{'command': {'class': 'ConnectionRefs', 'name': 'statuses'},
+{'command': {'class': 'ConnectionRef', 'name': 'statuses'},
'returns': {'connectionslist': 'ConnectionRefMap'}}
## Category: @ISCSIConnection ##################################################
--
To view, visit http://gerrit.ovirt.org/7148
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5747f2161d039cfaa82c0797e63ff58dbffbe8ac
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: Logging shouldn't reach the terminal console
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: Logging shouldn't reach the terminal console
......................................................................
Logging shouldn't reach the terminal console
In this patch:
* Change the log facility to LOG_DAEMON for SysLogHandler
* Remove the handler_console (it's unused now but we don't want anyone
to start using it)
* Few format cleanups
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Change-Id: I749a58362db5daec44ed5b0f7f116e14eadd6043
---
M vdsm/logger.conf.in
1 file changed, 6 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/80/7980/1
diff --git a/vdsm/logger.conf.in b/vdsm/logger.conf.in
index edd4616..f523306 100644
--- a/vdsm/logger.conf.in
+++ b/vdsm/logger.conf.in
@@ -2,7 +2,7 @@
keys=root,vds,Storage,metadata,SuperVdsm
[handlers]
-keys=console,syslog,logfile,metadata
+keys=syslog,logfile,metadata
[formatters]
keys=long,simple,none,sysform
@@ -40,7 +40,7 @@
level=WARNING
class=handlers.SysLogHandler
formatter=sysform
-args=('/dev/log', handlers.SysLogHandler.LOG_USER)
+args=('/dev/log', handlers.SysLogHandler.LOG_DAEMON)
[handler_logfile]
class=logging.handlers.WatchedFileHandler
@@ -55,25 +55,14 @@
level=WARNING
formatter=long
-[handler_console]
-class: StreamHandler
-args: []
-formatter: none
-
[formatter_simple]
-format: %(name)s:%(levelname)s: %(message)s
+format=%(name)s:%(levelname)s: %(message)s
[formatter_none]
-format: %(message)s
+format=%(message)s
[formatter_long]
-format: %(threadName)s::%(levelname)s::%(asctime)s::%(module)s::%(lineno)d::%(name)s::(%(funcName)s) %(message)s
+format=%(threadName)s::%(levelname)s::%(asctime)s::%(module)s::%(lineno)d::%(name)s::(%(funcName)s) %(message)s
[formatter_sysform]
-format= vdsm %(name)s %(levelname)s %(message)s
-datefmt=
-
-
-
-
-
+format=vdsm %(name)s %(levelname)s %(message)s
--
To view, visit http://gerrit.ovirt.org/7980
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I749a58362db5daec44ed5b0f7f116e14eadd6043
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 11 months