Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

[In Progress Cards] Migration should fail when denied due to lack of conversion host #786

Closed
michaelkro opened this issue Nov 9, 2018 · 8 comments

Comments

@michaelkro
Copy link
Contributor

michaelkro commented Nov 9, 2018

If a migration is kicked off where there is no conversion host configured in the target environment, the request will be denied.

We need to investigate what happens in this case and make sure that the In Progress Card goes away and the proper notification(s) are shown to the user

https://bugzilla.redhat.com/show_bug.cgi?id=1640816

Duplicate of #739

@michaelkro
Copy link
Contributor Author

Tried to investigate this on an appliance (cf-osp...). And need some help setting up test scenario. Here is what I observed

  1. When creating a mapping, it appears that none of the target clusters have conversion hosts configured due to the warning icon
  2. Created mapping
  3. Created plan with the mapping and initiated migration
  4. Migration request is approved, despite there being no configured conversion host
  5. Drilling down into the active plan, I see that the task is polling in the Acquiring Conversion Host state

@fdupont-redhat, @bthurber

@bthurber
Copy link

@michaelkro I believe on this build that is to be expected but going forward if a conversion host isn't available and the user decided to try a migration it should be denied and fail.

@fdupont-redhat let us know if that is your understanding based on our conversation last week. It likely will require a code change to meet this behavior.

@ghost
Copy link

ghost commented Nov 13, 2018

@michaelkro I confirm @bthurber's interpretation. In current build, it won't be denied. But with the following PRs merged, it should be in next one:

So, the code change should only be on UI side, to reflect the fact that the request is denied. And the reason in available in request's message.

@michaelkro
Copy link
Contributor Author

Awesome, thanks @bthurber and @fdupont-redhat!

@michaelkro
Copy link
Contributor Author

michaelkro commented Nov 13, 2018

@fdupont-redhat I'm testing out denied requests and wanted to double check some things with you :)

  1. I created a mapping using a target cluster with no conversion host. Then I created and ran a plan with that mapping
  2. As expected, the request was never approved. I am using simulate_queue_worker in dev, and indeed, its activity quickly stops shortly after initiating the migration
  3. However, the request's attributes do not seem to get updated to indicate that it has been denied.
[#<ServiceTemplateTransformationPlanRequest:0x00007f82d443f568
  id: 42000000000071,
  description: "Test",
  approval_state: "pending_approval",
  type: "ServiceTemplateTransformationPlanRequest",
  fulfilled_on: nil,
  requester_id: 42000000000001,
  requester_name: "Administrator",
  request_type: "transformation_plan",
  request_state: "pending",
  message: "VM Transformations - Request Created",
  status: "Ok",
  ...
  userid: "admin",
  source_id: 42000000000007,
  source_type: "ServiceTemplate",
  destination_id: nil,
  destination_type: nil,
  tenant_id: 42000000000001,
  service_order_id: 42000000000009,
  process: true,
  cancelation_status: nil>]
  1. I also looked at the associated MiqApproval
// ServiceTemplateTransformationPlan.find('42000000000007').miq_requests.first.miq_approvals

[#<MiqApproval:0x00007f82d437e2f0
  id: 42000000000071,
  description: "Default Approval",
  state: "pending",
  reason: nil,
  miq_request_id: 42000000000071,
  stamped_on: nil,
  stamper_name: nil,
  stamper_id: nil,
  approver_id: nil,
  approver_type: nil,
  approver_name: nil,
  created_on: Tue, 13 Nov 2018 22:55:48 UTC +00:00,
  updated_on: Tue, 13 Nov 2018 22:55:48 UTC +00:00>]

I am wondering if maybe this is due to the development environment and worker?

@mturley
Copy link
Contributor

mturley commented Nov 16, 2018

@ghost
Copy link

ghost commented Nov 18, 2018

@michaelkro You're probably hitting ManageIQ/manageiq-content#473. It is fixed and should be part of next build. With that, request.state will be denied and request.message will have the error message.

@mturley
Copy link
Contributor

mturley commented Nov 20, 2018

Marked this as a duplicate of #739, but since we've had comments in both issues, I'll leave both open for now.

michaelkro added a commit that referenced this issue Nov 21, 2018
[#786] Handle denied state of a plan request (no conversion hosts configured)
simaishi pushed a commit that referenced this issue Nov 26, 2018
[#786] Handle denied state of a plan request (no conversion hosts configured)

(cherry picked from commit e8e89d1)

https://bugzilla.redhat.com/show_bug.cgi?id=1640816
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants