Francesco Romani has uploaded a new change for review.
Change subject: stats: report detailed VM down status ......................................................................
stats: report detailed VM down status
When a VM goes down it reports exitCode == 1 (ERROR), and the exitMessage is passed verbarim to the VM log.
In order to have translatable messages, a more detailed error code is needed. This patch introduces a new explicit errorCode value, to be filled with the detailed status code.
The new detailed value is added separately for backward compatibility with the existing interface.
Change-Id: I8d7064fe79d1cd34499fbb32ed0644757cbe05dd Bug-Url: https://bugzilla.redhat.com/557125 Signed-off-by: Francesco Romani fromani@redhat.com --- M lib/vdsm/define.py M vdsm/vm.py M vdsm_api/vdsmapi-schema.json 3 files changed, 50 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/22631/1
diff --git a/lib/vdsm/define.py b/lib/vdsm/define.py index df8bbf4..50b65c3 100644 --- a/lib/vdsm/define.py +++ b/lib/vdsm/define.py @@ -145,3 +145,10 @@ #exitCodes ERROR = 1 NORMAL = 0 + + +class VMDownErrorCode: + Success = 0 + GenericError = 1 + LostQEMUConnection = 2 + LibvirtStartFailed = 3 diff --git a/vdsm/vm.py b/vdsm/vm.py index 534705d..c34c47c 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -43,7 +43,7 @@ from vdsm import utils from vdsm import vdscli from vdsm.config import config -from vdsm.define import ERROR, NORMAL, doneCode, errCode +from vdsm.define import ERROR, NORMAL, doneCode, errCode, VMDownErrorCode from vdsm.netinfo import DUMMY_BRIDGE from storage import outOfProcess as oop from storage import sd @@ -2116,7 +2116,7 @@ def _startUnderlyingVm(self): self.log.debug("Start") try: - self.memCommit() + self.memCommit() # can raise: ValueError, ConfigParser.Error self._ongoingCreations.acquire() self.log.debug("_ongoingCreations acquired") self._vmCreationEvent.set() @@ -2162,7 +2162,7 @@ self.log.info("Skipping errors on recovery", exc_info=True) else: self.log.error("The vm start process failed", exc_info=True) - self.setDownStatus(ERROR, str(e)) + self.setDownStatus(ERROR, str(e), VMDownErrorCode.GenericError)
def _incomingMigrationPending(self): return 'migrationDest' in self.conf or 'restoreState' in self.conf @@ -2184,6 +2184,7 @@ # A destroy request has been issued, exit early break drive['path'] = self.cif.prepareVolumePath(drive, self.id) + # can raise: VolumeError if drive['device'] == 'disk' and isVdsmImage(drive): domains.append(drive['domainID']) else: @@ -2206,7 +2207,8 @@ elif self.user_destroy: self.setDownStatus(NORMAL, 'User shut down') else: - self.setDownStatus(ERROR, "Lost connection with qemu process") + self.setDownStatus(ERROR, "Lost connection with qemu process", + VMDownErrorCode.LostQEMUConnection)
def _loadCorrectedTimeout(self, base, doubler=20, load=None): """ @@ -2604,7 +2606,8 @@
utils.rmFile(self._guestSocketFile)
- def setDownStatus(self, code, reason): + def setDownStatus(self, code, reason, + errorCode=VMDownErrorCode.GenericError): try: self.lastStatus = 'Down' with self._confLock: @@ -2614,6 +2617,8 @@ "Wake up from hibernation failed") else: self.conf['exitMessage'] = reason + if code == ERROR: + self.conf['errorCode'] = errorCode self.log.debug("Changed state to Down: " + reason) except DoubleDownError: pass @@ -2662,6 +2667,8 @@ stats['exitMessage'] = self.conf['exitMessage'] if 'timeOffset' in self.conf: stats['timeOffset'] = self.conf['timeOffset'] + if 'errorCode' in self.conf: + stats['errorCode'] = self.conf['errorCode'] return stats
stats = { @@ -2970,9 +2977,10 @@ self.log.info("VM wrapper has started") self.conf['smp'] = self.conf.get('smp', '1') devices = self.buildConfDevices() + # can raise: ValueError, RuntimeError, ConfigParser.Error
if not 'recover' in self.conf: - self.preparePaths(devices[DISK_DEVICES]) + self.preparePaths(devices[DISK_DEVICES]) # can raise: VolumeError self._prepareTransientDisks(devices[DISK_DEVICES]) # Update self.conf with updated devices # For old type vmParams, new 'devices' key will be @@ -2988,7 +2996,7 @@ # saving we will fail in inconsistent state during recovery. # So, to get proper device objects during VM recovery flow # we must to have updated conf before VM run - self.saveState() + self.saveState() # can raise: OSError, IOError else: for drive in devices[DISK_DEVICES]: if drive['device'] == 'disk' and isVdsmImage(drive): @@ -3006,13 +3014,14 @@ return if not 'recover' in self.conf: domxml = hooks.before_vm_start(self._buildCmdLine(), self.conf) + # can raise: HookError self.log.debug(domxml) if 'recover' in self.conf: self._dom = NotifyingVirDomain( self._connection.lookupByUUIDString(self.id), self._timeoutExperienced) # Reinitialize the merge statuses - self._checkMerge() + self._checkMerge() # can raise: OSError, IOError elif 'restoreState' in self.conf: fromSnapshot = self.conf.get('restoreFromSnapshot', False) srcDomXML = self.conf.pop('_srcDomXML') @@ -3020,6 +3029,7 @@ srcDomXML = self._correctDiskVolumes(srcDomXML) hooks.before_vm_dehibernate(srcDomXML, self.conf, {'FROM_SNAPSHOT': str(fromSnapshot)}) + # can raise: HookError
fname = self.cif.prepareVolumePath(self.conf['restoreState']) try: @@ -3050,7 +3060,8 @@ dev.custom)
if not self._dom: - self.setDownStatus(ERROR, 'failed to start libvirt vm') + self.setDownStatus(ERROR, 'failed to start libvirt vm', + VMDownErrorCode.LibvirtStartFailed) return self._domDependentInit()
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json index 77ca409..8a1ee8a 100644 --- a/vdsm_api/vdsmapi-schema.json +++ b/vdsm_api/vdsmapi-schema.json @@ -5220,6 +5220,25 @@ {'enum': 'VmExitCode', 'data': ['NORMAL', 'ERROR']}
## +# @VmErrorCode: +# +# An enumeration of VM error codes if VM exit status code is ERROR. +# +# @success: The VM has exited gracefully +# +# @generic error: Unspecified error code. +# +# @lost qemu connection: The VM has lost the connection with QEMU +# +# @libvirt start failed: The VM failed to start thorugh libvirt +# +# Since: 4.13.0 +## +{'enum': 'VmErrorCode', + 'data': ['success', 'generic error', + 'lost qemu connection', 'libvirt start failed']} + +## # @ExitedVmStats: # # Statistics about a VM that no longer running. @@ -5232,11 +5251,14 @@ # # @timeOffset: #optional The time difference from host to the VM in seconds # +# @errorCode: #optional The specific error code if the VM is exited +# with error (new in version 4.13.0) +# # Since: 4.10.0 ## {'type': 'ExitedVmStats', 'data': {'exitCode': 'VmExitCode', 'status': 'VmStatus', 'exitMessage': 'str', - '*timeOffset': 'int'}} + '*timeOffset': 'int', '*errorCode': 'VmErrorCode'}}
## # @VmDiskStats:
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6231/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5444/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6337/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 1: Code-Review-1
This patch is a preliminary draft which laids the ground for a complete resolution of bz557125.
This is a draft patch because quite a lot of possible error codes are coalesced into a GenericError error code.
To properly add an error code for possible error code path we need to get rid of the generic exception handling clause
except Exception as e:
at vdsm/vm.py:2160, but this is a quite invasive change which I believe should be performed very gradually.
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 2: Code-Review-1
Still a draft, thus marked as -1.
Changes:
* rephrased and expanded the commit message. * moved the enum into vm.py.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6404/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5511/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6307/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6408/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5515/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6321/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 3: Verified+1
verified against running VM.
changes since last patchset:
* log the errorCode only if the VM was down for error. * drop exception annotations.
Yaniv Bronhaim has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 3: Code-Review+1
Adding Saggi to review json api part, and allon to see if not requires any engine's changes as all is optional
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 4: Verified+1
fixed typo in the commit message
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6410/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5517/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6323/ : SUCCESS
Federico Simoncelli has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 4: Code-Review+1
(3 comments)
http://gerrit.ovirt.org/#/c/22631/4/vdsm/vm.py File vdsm/vm.py:
Line 233: Line 234: def _finishSuccessfully(self): Line 235: self.status['progress'] = 100 Line 236: if self._mode != 'file': Line 237: self._vm.setDownStatus(NORMAL, "Migration succeeded") You probably want a code for this as well (so that it can be internationalized). Line 238: self.status['status']['message'] = 'Migration done' Line 239: else: Line 240: # don't pickle transient params Line 241: for ignoreParam in ('displayIp', 'display', 'pid'):
Line 248: pickle.dump(self._machineParams, f) Line 249: finally: Line 250: self._vm.cif.teardownVolumePath(self._dstparams) Line 251: Line 252: self._vm.setDownStatus(NORMAL, "SaveState succeeded") Same, etc... Line 253: self.status['status']['message'] = 'SaveState done' Line 254: Line 255: def _patchConfigForLegacy(self): Line 256: """
Line 1746: m.appendChildWithArgs('target', type='virtio', port='0') Line 1747: return m Line 1748: Line 1749: Line 1750: class DownErrorCode: You probably want this also for regular messages (not error only). You could rename it to DownMessageCode. Line 1751: Success = 0 Line 1752: GenericError = 1 Line 1753: LostQEMUConnection = 2 Line 1754: LibvirtStartFailed = 3
Federico Simoncelli has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 4: -Code-Review
(Oops sorry, it wasn't a +1)
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 5:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6088/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6875/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6981/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 5:
changes:
* followed Federico's advice and made the reason code generic * renamed it to VMExitReason * rebased against master
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 6:
Patch set 6: fixes after bad rebase.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 6:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6114/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7007/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6901/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 6: Verified+1
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 6:
Verified: * NORMAL down exit reasons are logged (thus reported) for migration suceeded and shutdown
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7:
Patch Set v7: * rebased against master * add specific exit reason for migration failed, start to fill it.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6142/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7035/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6929/ : SUCCESS
Michal Skrivanek has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7:
(1 comment)
http://gerrit.ovirt.org/#/c/22631/7/vdsm_api/vdsmapi-schema.json File vdsm_api/vdsmapi-schema.json:
Line 5388: user make it a bit clearer the admin shutdown is the one triggered from the UI, user shutdown is when run from within the guest
Antoni Segura Puimedon has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7: Code-Review-1
(1 comment)
constants should go in UPPER_CASE
http://gerrit.ovirt.org/#/c/22631/7/vdsm/vm.py File vdsm/vm.py:
Line 88: MigrationSucceeded = 4 Line 89: SaveStateSucceeded = 5 Line 90: AdminShutdown = 6 Line 91: UserShutdown = 7 Line 92: MigrationFailed = 8 All these are constants. They should be completely uppercase:
SUCCESS GENERIC_ERROR ... MIGRATION_FAILED
And I would probably not have a class for it but a module (for consistency with the error code declaration of vdsm/neterrors.py) Line 93: Line 94: Line 95: def isVdsmImage(drive): Line 96: """
Federico Simoncelli has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7: Code-Review+1
Ok for me when you address Antoni's request.
Antoni Segura Puimedon has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7:
(1 comment)
http://gerrit.ovirt.org/#/c/22631/7/vdsm_api/vdsmapi-schema.json File vdsm_api/vdsmapi-schema.json:
Line 5388: user
make it a bit clearer the admin shutdown is the one triggered from the UI,
If I'm not mistaken: s/an user/a user/
As the u in this case has a consonant behavior in its first phoneme.
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 7:
(1 comment)
http://gerrit.ovirt.org/#/c/22631/7/vdsm_api/vdsmapi-schema.json File vdsm_api/vdsmapi-schema.json:
Line 5388: user
make it a bit clearer the admin shutdown is the one triggered from the UI,
Done both
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 8:
Patch Set 8: * renamed constants and moved to a module * made exitReason mandatory in ExitedVmStats * added very basic tests
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 8: Code-Review-1 Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6281/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7171/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7060/ : UNSTABLE
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 8:
patch set 9: fix spacing
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 9: Code-Review-1
Build Unstable
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6282/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7172/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7061/ : UNSTABLE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 9: -Code-Review
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6285/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7175/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7064/ : SUCCESS
Antoni Segura Puimedon has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 9: Code-Review-1
(1 comment)
Minor nit (sorry I didn't see it before).
http://gerrit.ovirt.org/#/c/22631/9/tests/vmTests.py File tests/vmTests.py:
Line 642: if not k.startswith('__')]) Line 643: def testExitReasonNormal(self, exitReason): Line 644: fake = vm.Vm(None, {'vmId': 'TESTING'}) Line 645: fake.setDownStatus(define.NORMAL, "testing", exitReason) Line 646: assert fake.getStats()['exitReason'] == exitReason IIRC self.assertEqual(a, b)
gives better output than:
assert a == b
So I'd replace it here and in 655. Line 647: Line 648: @MonkeyPatch(constants, 'P_VDSM_RUN', '/tmp/') Line 649: @MonkeyPatch(libvirtconnection, 'get', lambda x: ConnectionMock()) Line 650: @permutations([[getattr(vmexitreason, k)] for k in dir(vmexitreason)
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 10:
patch set 10: - added the missing packaging bits (sorry, sometimes me and the git index mismatch :( ) - addressed Toni's comment about assertEqual - since exitReason is now always present, dropped stale if into stats reporting
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 10:
reviewers also please be aware that I know the added tests do have the same issue addressed in the review of http://gerrit.ovirt.org/#/c/24252/ and I'll update this changeset accordigly once the proper solution is sorted out on 24252.
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 10:
(1 comment)
http://gerrit.ovirt.org/#/c/22631/10/tests/vmTests.py File tests/vmTests.py:
Line 635: Line 636: Line 637: @expandPermutations Line 638: class TestVmExit(TestCaseBase): Line 639: @MonkeyPatch(constants, 'P_VDSM_RUN', '/tmp/') Same problem here as http://gerrit.ovirt.org/#/c/24252/ ; once 24252 is fixed I'll fix this change as well, Line 640: @MonkeyPatch(libvirtconnection, 'get', lambda x: ConnectionMock()) Line 641: @permutations([[getattr(vmexitreason, k)] for k in dir(vmexitreason) Line 642: if not k.startswith('__')]) Line 643: def testExitReasonNormal(self, exitReason):
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 10:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6298/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7188/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7077/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/340/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 9:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6282/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7172/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7092/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 9:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6282/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7172/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7093/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 10:
Verification: re-tested against an unaware engine (which doesn't fetch the new attribute), all OK
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 11: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7335/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6433/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7217/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/348/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 11:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/351/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7352/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6450/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 11:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/353/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6464/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7248/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7366/ : FAILURE
Federico Simoncelli has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 11: Code-Review+2
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 12:
I hate to burn a +2, but I had to. Patch Set v12: * rebased * fixed a typo which defeated the last change to derive the exitMessage from the exitReason for the common case * added test to catch the error above * cleaned out the tests properly using permutations
Verification: verified no regression for creation/shutdown, migration, QEMU killed outside vdsm (kill -KILL...)
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 12: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6514/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/356/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7298/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7416/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 12:
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6515/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/357/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7299/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7417/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 12: Verified+1
verified various down status against running VDSMs
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 12:
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6518/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/358/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7302/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7420/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 12:
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6531/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/359/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7315/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7433/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 13: Verified+1
Generic Error split will be handled enterily in separate patches. Verified.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 13: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7328/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6544/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/362/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7446/ : FAILURE
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 13: -Verified
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 14:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7329/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6545/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/363/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7447/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 14: Verified+1
ok, *now* actually verified (previously I had some remnants of what then evolved in http://gerrit.ovirt.org/#/c/25164/. My bad, failed with some git commit juggling)
- verified various setDownStatus scenarios, on each one message was constructed correctly from the exitReason and the exitReason is reported.
Antoni Segura Puimedon has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 14: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 14: Code-Review+2
(1 comment)
http://gerrit.ovirt.org/#/c/22631/14/tests/vmTests.py File tests/vmTests.py:
Line 654: @contextmanager Line 655: def FakeVM(params=None): Line 656: with namedTemporaryDir() as tmpDir: Line 657: with MonkeyPatchScope([(constants, 'P_VDSM_RUN', tmpDir)]): Line 658: with MonkeyPatchScope([(libvirtconnection, 'get', MonkeyPatchScope accepts a *list* of patches to make. Make use of it, and save us an indentation. Line 659: lambda x: ConnectionMock())]): Line 660: vmParams = {'vmId': 'TESTING'} Line 661: vmParams.update({} if params is None else params) Line 662: yield vm.Vm(None, vmParams)
Dan Kenigsberg has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 15: Verified+1 Code-Review+2
Copying scores
Dan Kenigsberg has submitted this change and it was merged.
Change subject: stats: report detailed VM down status ......................................................................
stats: report detailed VM down status
When a VM goes down it reports an exitCode and an exitMessage which is passed verbatim to the VM log.
In order to have translatable messages, a more detailed exit reason code is needed. This patch is the first step towards an explicit, detailed exit reason value. It laids the ground for a full resolution.
A new explicit exit reason code field is introduced in the response, to be filled with the detailed status code. The field is added separately for backward compatibility with the existing interface.
Future work will split the GenericError code into detailed codes.
Change-Id: I8d7064fe79d1cd34499fbb32ed0644757cbe05dd Bug-Url: https://bugzilla.redhat.com/557125 Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: http://gerrit.ovirt.org/22631 Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Dan Kenigsberg danken@redhat.com --- M debian/vdsm.install M tests/vmTests.py M vdsm.spec.in M vdsm/Makefile.am M vdsm/vm.py A vdsm/vmexitreason.py M vdsm_api/vdsmapi-schema.json 7 files changed, 146 insertions(+), 17 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 15:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/7435/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/6642/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/377/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/7544/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: stats: report detailed VM down status ......................................................................
Patch Set 15:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_install_rpm_sanity_gerrit/378/ : SUCCESS
vdsm-patches@lists.fedorahosted.org