ShaoHe Feng has posted comments on this change.
Change subject: dump the core of a VM
......................................................................
Patch Set 5: (6 inline comments)
test this patch.
http://www.ovirt.org/Vdsm_Standalone
after the vm is create and start.
dumpPath = '/tmp/test.dump'
dumpPara = {"crash": False, "live": False, "bypass-cache":
False, "reset": False, "memory-only": False}
then call
s.coreDump(vmId, dumpPath, dumpPara)
....................................................
File vdsm_api/vdsmapi-schema.json
Line 5449: # @reset: #optional Reset the domain after core dump
Line 5450: #
Line 5451: # @memory-only: #optional Dump domain's memory only
Line 5452: #
Line 5453: # Since: 4.10.4
"return" is expected
Line 5454: #
Line 5455: ##
Line 5456: {'type': 'DumpParams',
Line 5457: 'data': {'*crash': 'bool', '*live':
'bool',
....................................................
File vdsm/libvirtvm.py
Line 519:
Line 520: class DoCoreDumpThread(vm.DoCoreDumpThread):
Line 521:
Line 522: def _setupDumpParams(self):
Line 523: vm.DoCoreDumpThread._setupDumpParams(self)
should this be removed?
Line 524:
Line 525: def _startUnderlyingDump(self):
Line 526: try:
Line 527: self._vm._dom.coreDump(self.dumpfile, self.dumpflag)
....................................................
File vdsm/vm.py
Line 312: fileTotal, fileProcessed, _) = self._vm._dom.jobInfo()
Line 313:
Line 314: dataProgress = (100 - 100 * dataRemaining / dataTotal
Line 315: if dataTotal else 0)
Line 316: self._vm.log.info('dump status: job type: %d, dump Progress: '
this can use "self.log" directly.
Line 317: 'dataRemaining = %d, dataTotal=%d, %s%%
processed'
Line 318: % (jobType, dataRemaining, dataTotal, dataProgress))
Line 319: if self.isAlive():
Line 320: return self.status
Line 314: dataProgress = (100 - 100 * dataRemaining / dataTotal
Line 315: if dataTotal else 0)
Line 316: self._vm.log.info('dump status: job type: %d, dump Progress: '
Line 317: 'dataRemaining = %d, dataTotal=%d, %s%%
processed'
Line 318: % (jobType, dataRemaining, dataTotal, dataProgress))
should the log be removed?
Line 319: if self.isAlive():
Line 320: return self.status
Line 321: else:
Line 322: status = self.status
Line 319: if self.isAlive():
Line 320: return self.status
Line 321: else:
Line 322: status = self.status
Line 323: self.status = {'status': {'code': 0,
'message': 'noJob'}}
if self.status "finished", after getStat is called, it should be change to
"noJob".
noJob: there is no core dump job.
finished: the core dump job is finished.
ongoing: the core dump is in process.
"memory-only" dump can not be expressed as a percentage.
Line 324: return status
Line 325:
Line 326: def _setupDumpParams(self):
Line 327: params = {"crash": libvirt.VIR_DUMP_CRASH,
Line 1278:
Line 1279: def migrate(self, params):
Line 1280: self._acquireCpuLockWithTimeout()
Line 1281: try:
Line 1282: if self.isDoingDump():
for the coredump also call migrate, so conflict with migrating.
Line 1283: self.log.warning('vm is doing coredump, '
Line 1284: 'conflict with migrating')
Line 1285: return errCode['exist']
Line 1286: if self.isMigrating():
--
To view, visit
http://gerrit.ovirt.org/7329
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If4aac9e747dc7aa64a6ff5ef256a7a4375aa2bb5
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Ryan Harper <ryanh(a)us.ibm.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server