Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2V] Expose virt-v2v-wrapper error message in progress.states #514

Conversation

ghost
Copy link

@ghost ghost commented Mar 18, 2019

When the disk conversion fails, the error message is really vague: Disk Transformation failed, so the user needs to look into the wrapper and virt-v2v logs to identify the cause. Since recently, virt-v2v-wrapper provides a human-readable error message based on virt-v2v log. An example is below

    {
      "started": true,
      "disks": [
        {
          "path": "[datastore13] tg-mini2/tg-mini2_3.vmdk",
          "progress": 100
        },
        {
          "path": "[datastore13] tg-mini2/tg-mini2_4.vmdk",
          "progress": 100
        }
      ],
      "pid": 30375,
      "disk_count": 2,
      "return_code": 0,
      "failed": true,
      "finished": true,
      "last_message": {
        "message": "Failed to create port",
        "type": "error"
      }
    }

The VMCheckTransformed state of the transformation state machine is responsible for setting the error message in the ae_state_progress state variable. The error message is set in the task options hash by the backend. This PR makes the method raise with the error message, which is caught in the rescue statement. Then, the WeightedUpdateStatus message will set it as the state message in task[:options][:progress]["states"]. This will allow the UI to expose the message.

Not relying only on the :virtv2v_message in the backend allows to leverage a more generic approach where the last message is always in task[:options][:progress]["states"][task[:options][:progress]["current_state"]]["message"].

Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1595365
Depends On: ManageIQ/manageiq#18564

@ghost
Copy link
Author

ghost commented Mar 18, 2019

@miq-bot add_label transformation, enhancement, hammer/yes
@miq-bot add_reviewer @gmcculloug

@coveralls
Copy link

coveralls commented Mar 18, 2019

Pull Request Test Coverage Report for Build 2834

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.906%

Totals Coverage Status
Change from base Build 2831: 0.0%
Covered Lines: 2819
Relevant Lines: 2909

💛 - Coveralls

@tinaafitz tinaafitz self-requested a review March 18, 2019 16:42
@miq-bot
Copy link
Member

miq-bot commented Mar 18, 2019

Checked commit fabiendupont@b5d5255 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@tinaafitz tinaafitz requested a review from lfu March 19, 2019 16:01
@gmcculloug gmcculloug merged commit 23c5ae2 into ManageIQ:master Mar 22, 2019
@tinaafitz tinaafitz added this to the Sprint 108 Ending Apr 1, 2019 milestone Apr 2, 2019
simaishi pushed a commit that referenced this pull request Apr 4, 2019
…e_virtv2v_message

[V2V] Expose virt-v2v-wrapper error message in progress.states

(cherry picked from commit 23c5ae2)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693747
@simaishi
Copy link
Contributor

simaishi commented Apr 4, 2019

Hammer backport details:

$ git log -1
commit 3d9d3b3200615edb89b8b2650996cbf3b68985cc
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Fri Mar 22 13:57:02 2019 -0400

    Merge pull request #514 from fdupont-redhat/v2v_error_reporting_expose_virtv2v_message
    
    [V2V] Expose virt-v2v-wrapper error message in progress.states
    
    (cherry picked from commit 23c5ae2a7f9c63dba96bf9f07654d666cb2e7357)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants