Change in vdsm[master]: Related to BZ#719516: Make list nicer and include listNames ...
by erez@redhat.com
Erez Sh has posted comments on this change.
Change subject: Related to BZ#719516: Make list nicer and include listNames inside.
......................................................................
Patch Set 7: Looks good to me, but someone else must approve
--
To view, visit http://gerrit.usersys/676
To unsubscribe, visit http://gerrit.usersys/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0753685d3032e79cc3f5de888b8ee7e865954d9c
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: David Naori <dnaori(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: David Naori <dnaori(a)redhat.com>
Gerrit-Reviewer: Erez Sh <erez(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
12 years, 11 months
[NEW PATCH] Related to BZ#719516: Make list nicer and include listNames inside. (via gerrit-bot)
by David Naori
New patch submitted by David Naori (dnaori(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/676
commit b2bf639c6d47e89b4eef9c87345e63a7c142433b
Author: David Naori <dnaori(a)redhat.com>
Date: Thu Jul 7 16:21:15 2011 +0300
Related to BZ#719516: Make list nicer and include listNames inside.
Change-Id: I0753685d3032e79cc3f5de888b8ee7e865954d9c
diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py
index 38640cc..3aa88ec 100755
--- a/vdsm_cli/vdsClient.py
+++ b/vdsm_cli/vdsClient.py
@@ -173,47 +173,40 @@ class service:
return self.ExecAndExit(self.s.changeFloppy(vmId, file))
def do_list(self, args):
- table=False
- if len(args):
- if args[0] == 'table':
- table=True
- response = self.s.list(True)
- if response['status']['code'] != 0:
- print response['status']['message']
- else:
- if table:
+ vmListViews = ['table', 'long', 'ids']
+ view = 'long' #Default view
+
+ if args:
+ view = args[0]
+ if view not in vmListViews:
+ raise ValueError()
+ if view == 'table':
allStats = {}
for s in self.s.getAllVmStats()['statsList']:
- allStats[s['vmId']] = s
- for conf in response['vmList']:
- if table:
- id = conf['vmId']
- if id not in allStats:
- continue
- status = conf['status']
- if allStats[id].get('monitorResponse') == '-1':
- status += '*'
- print "%-36s %6s %-20s %-20s %-20s" % (id,
- conf.get('pid', 'none'),
- conf.get('vmName', '<< NO NAME >>'),
- status, allStats[id].get('guestIPs', '') )
- else:
- if 'sysprepInf' in conf:
- conf['sysprepInf'] = '<<exists>>'
- printConf(conf)
- sys.exit(response['status']['code'])
+ allStats[ s['vmId'] ] = s
+
+ response = self.s.list(True)
+ for conf in response['vmList']:
+ if view == 'long':
+ if 'sysprepInf' in conf:
+ conf['sysprepInf'] = '<<exists>>'
+ printConf(conf)
+
+ elif view == 'table':
+ vmId = conf['vmId']
+ if vmId not in allStats:
+ continue
+ status = conf['status']
+ if allStats[vmId].get('monitorResponse') == '-1':
+ status += '*'
+ print "%-36s %6s %-20s %-20s %-20s" % ( vmId,
+ conf.get('pid', 'none'),
+ conf.get('vmName', '<< NO NAME >>'),
+ status, allStats[vmId].get('guestIPs', '') )
+
+ elif view == 'ids':
+ print conf['vmId']
- def do_listNames(self, args):
- response = self.s.list()
- if response['status']['code'] != 0:
- print response['status']['message']
- else:
- names = []
- for conf in response['vmList']:
- names.append(conf['vmId'])
- names.sort()
- if names:
- print '\n'.join(names)
sys.exit(response['status']['code'])
def do_destroy(self, args):
@@ -1525,12 +1518,12 @@ if __name__ == '__main__':
'Stops the emulation and graceful shutdown the virtual machine.'
)),
'list' : ( serv.do_list,
- ('[table]',
- 'Lists all available machines on the specified server and all available configuration info',
- 'If table modifier added then show table with the fields: vmId vmName Status IP'
- )),
- 'listNames' : ( serv.do_listNames,
- ('Lists all available machines on the specified server',''
+ ('[view]',
+ 'Lists all available machines on the specified server.',
+ 'Optional views:',
+ ' "long" all available configuration info (Default).',
+ ' "table" table output with the fields: vmId, vmName, Status and IP.',
+ ' "ids" all vmIds.'
)),
'pause' : ( serv.do_pause,
('<vmId>',
12 years, 11 months
[NEW PATCH] Related to BZ#719516 vdsClient: Make list nicer. (via gerrit-bot)
by David Naori
New patch submitted by David Naori (dnaori(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/676
commit f63d90a13ce03681ed284a632498f9345a8bbc75
Author: David Naori <dnaori(a)redhat.com>
Date: Thu Jul 7 16:21:15 2011 +0300
Related to BZ#719516 vdsClient: Make list nicer.
Change-Id: I0753685d3032e79cc3f5de888b8ee7e865954d9c
diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py
index 38640cc..f539fc2 100755
--- a/vdsm_cli/vdsClient.py
+++ b/vdsm_cli/vdsClient.py
@@ -173,47 +173,40 @@ class service:
return self.ExecAndExit(self.s.changeFloppy(vmId, file))
def do_list(self, args):
- table=False
- if len(args):
- if args[0] == 'table':
- table=True
- response = self.s.list(True)
- if response['status']['code'] != 0:
- print response['status']['message']
- else:
- if table:
+ vmListViews = ['table', 'long', 'ids']
+ view = 'long' #Default view
+
+ if args:
+ view = args[0]
+ if view not in vmListViews:
+ raise ValueError
+ if view == 'table':
allStats = {}
for s in self.s.getAllVmStats()['statsList']:
- allStats[s['vmId']] = s
- for conf in response['vmList']:
- if table:
- id = conf['vmId']
- if id not in allStats:
- continue
- status = conf['status']
- if allStats[id].get('monitorResponse') == '-1':
- status += '*'
- print "%-36s %6s %-20s %-20s %-20s" % (id,
- conf.get('pid', 'none'),
- conf.get('vmName', '<< NO NAME >>'),
- status, allStats[id].get('guestIPs', '') )
- else:
- if 'sysprepInf' in conf:
- conf['sysprepInf'] = '<<exists>>'
- printConf(conf)
- sys.exit(response['status']['code'])
+ allStats[ s['vmId'] ] = s
+
+ response = self.s.list(True)
+ for conf in response['vmList']:
+ if view == 'long':
+ if 'sysprepInf' in conf:
+ conf['sysprepInf'] = '<<exists>>'
+ printConf(conf)
+
+ elif view == 'table':
+ vmId = conf['vmId']
+ if vmId not in allStats:
+ continue
+ status = conf['status']
+ if allStats[vmId].get('monitorResponse') == '-1':
+ status += '*'
+ print "%-36s %6s %-20s %-20s %-20s" % ( vmId,
+ conf.get('pid', 'none'),
+ conf.get('vmName', '<< NO NAME >>'),
+ status, allStats[vmId].get('guestIPs', '') )
+
+ elif view == 'ids':
+ print conf['vmId']
- def do_listNames(self, args):
- response = self.s.list()
- if response['status']['code'] != 0:
- print response['status']['message']
- else:
- names = []
- for conf in response['vmList']:
- names.append(conf['vmId'])
- names.sort()
- if names:
- print '\n'.join(names)
sys.exit(response['status']['code'])
def do_destroy(self, args):
@@ -1525,12 +1518,12 @@ if __name__ == '__main__':
'Stops the emulation and graceful shutdown the virtual machine.'
)),
'list' : ( serv.do_list,
- ('[table]',
- 'Lists all available machines on the specified server and all available configuration info',
- 'If table modifier added then show table with the fields: vmId vmName Status IP'
- )),
- 'listNames' : ( serv.do_listNames,
- ('Lists all available machines on the specified server',''
+ ('[view]',
+ 'Lists all available machines on the specified server.',
+ 'Optional views:',
+ ' "long" all available configuration info (Default).',
+ ' "table" table output with the fields: vmId, vmName, Status and IP.',
+ ' "ids" all vmIds.'
)),
'pause' : ( serv.do_pause,
('<vmId>',
12 years, 11 months
[NEW PATCH] BZ#699976 Related, use RHEVM leasetime and timeout (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/677
commit 3aa8424b78c3cd4c591c0234836122dea053ef90
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Thu Jul 7 14:04:05 2011 +0000
BZ#699976 Related, use RHEVM leasetime and timeout
Use the values provided by RHEV-M for LOCK_RENEWAL_INTERVAL, LEASE_TIME,
LEASE_RETRIES and IO_OP_TIMEOUT.
Change-Id: If326eb1955e771e303f4a39943142b3007187c6c
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 41363ba..4422487 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -192,7 +192,7 @@ def sizeStr2Int(size_str):
def intOrDefault(default, val):
try:
- int(val)
+ return int(val)
except ValueError:
return default
@@ -388,6 +388,12 @@ class StorageDomain:
def acquireClusterLock(self, hostID):
self.refresh()
+ self._clusterLock.setParams(
+ self.getMetaParam(DMDK_LOCK_RENEWAL_INTERVAL_SEC),
+ self.getMetaParam(DMDK_LEASE_TIME_SEC),
+ self.getMetaParam(DMDK_LEASE_RETRIES),
+ self.getMetaParam(DMDK_IO_OP_TIMEOUT_SEC)
+ )
self._clusterLock.acquire(hostID)
def releaseClusterLock(self):
12 years, 11 months
[NEW PATCH] BZ#717952 - Fix race in moveImage with overwrite of VM with several disks on NFS domains (via gerrit-bot)
by Igor Lvovsky
New patch submitted by Igor Lvovsky (ilvovsky(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/646
commit f8e9eccdad40b074e4eb9a24f038635bbba2c48b
Author: Igor Lvovsky <ilvovsky(a)redhat.com>
Date: Tue Jul 5 16:00:21 2011 +0300
BZ#717952 - Fix race in moveImage with overwrite of VM with several disks on NFS domains
Change-Id: I367e83a700e84be0e4cb0ca5b7a02416cb54ac25
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 51e237b..c1e3ec9 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -378,6 +378,10 @@ class Image:
# Avoid relink templates for SAN domains
if destDom.getStorageType() in [ sd.NFS_DOMAIN ]:
vol = destDom.produceVolume(imgUUID=imgUUID, volUUID=volUUID)
+ # Relink templates only
+ if not vol.isShared():
+ self.log.debug("Doesn't relink regular volume %s of image %s", volUUID, imgUUID)
+ return
chList = vol.getAllChildrenList(self.repoPath, destDom.sdUUID, imgUUID, volUUID)
for ch in chList:
# Remove hardlink of this template
12 years, 11 months
[NEW PATCH] Related to BZ#717952 - Use 'with' instead of old lock.acquire and avoid unneeded SDF.produce(sdUUID) (via gerrit-bot)
by Igor Lvovsky
New patch submitted by Igor Lvovsky (ilvovsky(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/680
commit a0d0fb1a2d79c7f0b4ba15a888e1fc78cc8c751f
Author: Igor Lvovsky <ilvovsky(a)redhat.com>
Date: Tue Jul 5 16:03:30 2011 +0300
Related to BZ#717952 - Use 'with' instead of old lock.acquire and avoid unneeded SDF.produce(sdUUID)
Change-Id: Ia236b673cd1887b094e5a56cacaf09ee1430ffd4
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 40a82c9..51e237b 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -50,7 +50,7 @@ class Image:
Consist from chain of volumes.
"""
log = logging.getLogger('Storage.Image')
- _lock = threading.Lock()
+ _fakeTemplateLock = threading.Lock()
@classmethod
def createImageRollback(cls, taskObj, imageDir):
@@ -371,15 +371,14 @@ class Image:
self.log.error("Unexpected error", exc_info=True)
raise se.CouldNotValideTemplateOnTargetDomain("Template %s Destination domain %s: %s" % (pimg, dstSdUUID, str(e)))
- def __templateRelink(self, sdUUID, imgUUID, volUUID):
+ def __templateRelink(self, destDom, imgUUID, volUUID):
"""
Relink all hardlinks of the template 'volUUID' in all VMs based on it
"""
- destDom = SDF.produce(sdUUID)
# Avoid relink templates for SAN domains
if destDom.getStorageType() in [ sd.NFS_DOMAIN ]:
vol = destDom.produceVolume(imgUUID=imgUUID, volUUID=volUUID)
- chList = vol.getAllChildrenList(self.repoPath, sdUUID, imgUUID, volUUID)
+ chList = vol.getAllChildrenList(self.repoPath, destDom.sdUUID, imgUUID, volUUID)
for ch in chList:
# Remove hardlink of this template
v = destDom.produceVolume(imgUUID=ch['imgUUID'], volUUID=volUUID)
@@ -387,7 +386,7 @@ class Image:
# Now we should re-link deleted hardlink, if exists
newVol = destDom.produceVolume(imgUUID=imgUUID, volUUID=volUUID)
- imageDir = self.getImageDir(sdUUID, ch['imgUUID'])
+ imageDir = self.getImageDir(destDom.sdUUID, ch['imgUUID'])
newVol.share(imageDir)
else:
self.log.debug("Doesn't relink templates non-NFS domain %s", destDom.sdUUID)
@@ -396,8 +395,7 @@ class Image:
"""
Create fake template (relevant for Backup domain only)
"""
- try:
- self._lock.acquire()
+ with self._fakeTemplateLock:
try:
destDom = SDF.produce(sdUUID)
volclass = destDom.getVolumeClass()
@@ -417,14 +415,12 @@ class Image:
# Mark fake volume as shared
vol.setShared()
# Now we should re-link all hardlinks of this template in all VMs based on it
- self.__templateRelink(sdUUID, volParams['imgUUID'], volParams['volUUID'])
+ self.__templateRelink(destDom, volParams['imgUUID'], volParams['volUUID'])
self.log.debug("Succeeded to create fake image %s in domain %s", volParams['imgUUID'], destDom.sdUUID)
except Exception:
self.log.error("Failure to create fake image %s in domain %s", volParams['imgUUID'],
destDom.sdUUID, exc_info=True)
- finally:
- self._lock.release()
def isLegal(self, sdUUID, imgUUID):
"""
@@ -763,7 +759,7 @@ class Image:
if force:
# Now we should re-link all deleted hardlinks, if exists
- self.__templateRelink(dstSdUUID, dstImgUUID, dstVolUUID)
+ self.__templateRelink(destDom, dstImgUUID, dstVolUUID)
except se.StorageException, e:
self.log.error("Unexpected error", exc_info=True)
raise
12 years, 11 months
[NEW PATCH] Revert "BZ#701398 Set monitorResponse using controlInfo" (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/681
commit 18e6933884d7411a359d01fe58289ae528597df0
Author: Dan Kenigsberg <danken(a)redhat.com>
Date: Sun Jul 10 19:13:01 2011 +0300
Revert "BZ#701398 Set monitorResponse using controlInfo"
This reverts commit e1a615c9ad91fe5f7fe147cded028954e80ccf08.
Libvirt-0.9.3 is not yet ready for our consumption; Furthermore, the
reverted commit does not solve the case of blocked libvirtd.
Change-Id: I1e6286db657b2532835f0d9cc82d6379b2b8aeee
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 8f01acc..f805602 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -28,7 +28,7 @@ Requires: psmisc >= 22.6-15.el6_0.1
Requires: fence-agents
Requires: bridge-utils
Requires: sos
-Requires: libvirt >= 0.9.3
+Requires: libvirt >= 0.8.7-5
Requires: libvirt-python
Requires: dosfstools
Requires: policycoreutils-python
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 0516c3b..40567a5 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -283,6 +283,35 @@ class MigrationSourceThread(vm.MigrationSourceThread):
if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL:
monitorThread.stop()
+class TimeoutError(libvirt.libvirtError): pass
+
+class NotifyingVirDomain:
+ # virDomain wrapper that notifies vm when a method raises an exception with
+ # get_error_code() = VIR_ERR_OPERATION_TIMEOUT
+
+ def __init__(self, dom, tocb):
+ self._dom = dom
+ self._cb = tocb
+
+ def __getattr__(self, name):
+ attr = getattr(self._dom, name)
+ if not callable(attr):
+ return attr
+ def f(*args, **kwargs):
+ try:
+ ret = attr(*args, **kwargs)
+ self._cb(False)
+ return ret
+ except libvirt.libvirtError, e:
+ if e.get_error_code() == libvirt.VIR_ERR_OPERATION_TIMEOUT:
+ self._cb(True)
+ toe = TimeoutError(e.get_error_message())
+ toe.err = e.err
+ raise toe
+ raise
+ return f
+
+
class _DomXML:
def __init__(self, conf, log):
"""
@@ -888,7 +917,9 @@ class LibvirtVm(vm.Vm):
domxml = hooks.before_vm_start(self._buildCmdLine(), self.conf)
self.log.debug(domxml)
if 'recover' in self.conf:
- self._dom = self._connection.lookupByUUIDString(self.id)
+ self._dom = NotifyingVirDomain(
+ self._connection.lookupByUUIDString(self.id),
+ self._timeoutExperienced)
elif 'restoreState' in self.conf:
hooks.before_vm_dehibernate(self.conf.pop('_srcDomXML'), self.conf)
@@ -898,14 +929,18 @@ class LibvirtVm(vm.Vm):
finally:
self.cif._teardownVolumePath(self.conf['restoreState'])
- self._dom = self._connection.lookupByUUIDString(self.id)
+ self._dom = NotifyingVirDomain(
+ self._connection.lookupByUUIDString(self.id),
+ self._timeoutExperienced)
else:
flags = libvirt.VIR_DOMAIN_NONE
if 'launchPaused' in self.conf:
flags |= libvirt.VIR_DOMAIN_START_PAUSED
self.conf['pauseCode'] = 'NOERR'
del self.conf['launchPaused']
- self._dom = self._connection.createXML(domxml, flags)
+ self._dom = NotifyingVirDomain(
+ self._connection.createXML(domxml, flags),
+ self._timeoutExperienced)
if self._dom.UUIDString() != self.id:
raise Exception('libvirt bug 603494')
hooks.after_vm_start(self._dom.XMLDesc(0), self.conf)
@@ -933,25 +968,11 @@ class LibvirtVm(vm.Vm):
def _monitorDependentInit(self, timeout=None):
self.log.warning('unsupported by libvirt vm')
- def _getMonitorResponse(self):
- if not self._dom:
- return 0
-
- state, details, stateTime = self._dom.controlInfo(0)
- stateTime /= 1000.0
-
- if (state == libvirt.VIR_DOMAIN_CONTROL_OCCUPIED and
- stateTime > config.getint('vars', 'vm_command_timeout')):
- return -1
-
- return 0
-
- def _setMonitorResponse(self, value):
- if value != 0:
- self.log.debug("failed to set monitorResponse to %s",
- value, exc_info=True)
-
- _monitorResponse = property(_getMonitorResponse, _setMonitorResponse)
+ def _timeoutExperienced(self, timeout):
+ if timeout:
+ self._monitorResponse = -1
+ else:
+ self._monitorResponse = 0
def _waitForIncomingMigrationFinish(self):
if 'restoreState' in self.conf:
@@ -965,7 +986,9 @@ class LibvirtVm(vm.Vm):
try:
# Would fail if migration isn't successful,
# or restart vdsm if connection to libvirt was lost
- self._dom = self._connection.lookupByUUIDString(self.id)
+ self._dom = NotifyingVirDomain(
+ self._connection.lookupByUUIDString(self.id),
+ self._timeoutExperienced)
except Exception, e:
# Improve description of exception
if not self._incomingMigrationFinished.isSet():
diff --git a/vdsm/utils.py b/vdsm/utils.py
index bd62925..89f786f 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -407,16 +407,20 @@ class StatsThread(threading.Thread):
pass
def run(self):
+ import libvirtvm
try:
# wait a bit before starting to sample
time.sleep(self.SAMPLE_INTERVAL_SEC)
while not self._stopEvent.isSet():
if not self._paused:
- sample = self.sample()
- self._samples.append(sample)
- self._lastSampleTime = sample.timestamp
- if len(self._samples) > self.AVERAGING_WINDOW:
- self._samples.pop(0)
+ try:
+ sample = self.sample()
+ self._samples.append(sample)
+ self._lastSampleTime = sample.timestamp
+ if len(self._samples) > self.AVERAGING_WINDOW:
+ self._samples.pop(0)
+ except libvirtvm.TimeoutError:
+ self._log.error(traceback.format_exc())
self._stopEvent.wait(self.SAMPLE_INTERVAL_SEC)
except:
if not self._stopEvent.isSet():
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 3653d82..ecc8e70 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -796,6 +796,10 @@ class Vm(object):
try:
if self._vmStats:
decStats = self._vmStats.get()
+ if (not self._migrationSourceThread.isAlive()
+ and decStats['statsAge'] > config.getint('vars',
+ 'vm_command_timeout')):
+ stats['monitorResponse'] = '-1'
except:
self.log.error("Error fetching vm stats", exc_info=True)
for var in decStats:
12 years, 11 months
[NEW PATCH] BZ#705058 - Don't start monitoring domains when reconstructing master (via gerrit-bot)
by Yotam Oron
New patch submitted by Yotam Oron (yoron(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/634
commit c4bac51ca8afabd41144097bed81068e76b75f44
Author: Yotam Oron <yoron(a)redhat.com>
Date: Mon Jun 27 15:22:39 2011 +0300
BZ#705058 - Don't start monitoring domains when reconstructing master
During master recostruction there is no point in updating the repo stats
monitoring threads (this is cause a repo stats thread reference not to
be inserted to the list of monitoring threads and hence it leaks)
Change-Id: I05914b8c3a8f304e0acda5463e1ad00630c3233b
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index c377ee4..543984c 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1156,7 +1156,6 @@ class StoragePool:
del domDict[sdUUID]
self.setMetaParam(PMDK_DOMAINS, domDict)
self.log.info("Set storage pool domains: %s", domDict)
- self.updateMonitoringThreads()
if refresh:
self.refresh()
12 years, 11 months
[NEW PATCH] BZ#717952 - Fix race in moveImage with overwrite of VM with several disks on NFS domains (via gerrit-bot)
by Igor Lvovsky
New patch submitted by Igor Lvovsky (ilvovsky(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/646
commit 64badb305015f011ee2f0d84daa39563f3f17db4
Author: Igor Lvovsky <ilvovsky(a)redhat.com>
Date: Tue Jul 5 16:00:21 2011 +0300
BZ#717952 - Fix race in moveImage with overwrite of VM with several disks on NFS domains
Change-Id: I367e83a700e84be0e4cb0ca5b7a02416cb54ac25
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index 51e237b..c1e3ec9 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -378,6 +378,10 @@ class Image:
# Avoid relink templates for SAN domains
if destDom.getStorageType() in [ sd.NFS_DOMAIN ]:
vol = destDom.produceVolume(imgUUID=imgUUID, volUUID=volUUID)
+ # Relink templates only
+ if not vol.isShared():
+ self.log.debug("Doesn't relink regular volume %s of image %s", volUUID, imgUUID)
+ return
chList = vol.getAllChildrenList(self.repoPath, destDom.sdUUID, imgUUID, volUUID)
for ch in chList:
# Remove hardlink of this template
12 years, 11 months