Bug 1478520 - VM Migrate doesn't create notifications or log messages when migrations fail.
Summary: VM Migrate doesn't create notifications or log messages when migrations fail.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.8.3
Assignee: William Fitzgerald
QA Contact: Shveta
URL:
Whiteboard:
Depends On: 1478462
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-04 18:12 UTC by Satoe Imaishi
Modified: 2022-07-09 09:07 UTC (History)
7 users (show)

Fixed In Version: 5.8.3.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1478462
Environment:
Last Closed: 2018-02-28 13:04:21 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0374 0 normal SHIPPED_LIVE Important: Red Hat CloudForms security, bug fix, and enhancement update 2018-02-28 18:04:37 UTC

Comment 2 CFME Bot 2017-08-04 18:18:10 UTC
New commit detected on ManageIQ/manageiq-content/fine:
https://github.com/ManageIQ/manageiq-content/commit/b8bfb5d7602baba2ae2aa11fba5a71ef180b29e6

commit b8bfb5d7602baba2ae2aa11fba5a71ef180b29e6
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Thu Jun 29 16:50:13 2017 -0400
Commit:     Satoe Imaishi <simaishi>
CommitDate: Fri Aug 4 14:13:04 2017 -0400

    Merge pull request #125 from billfitzgerald0120/vm_migrate
    
    Enhanced messaging and error notification for update_migration_status method.
    (cherry picked from commit 7a789402519c390e8b21c64f0fe5566f4987ff54)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1478520

 .../__methods__/update_migration_status.rb         | 64 +++++++++++++++++----
 .../__methods__/update_migration_status_spec.rb    | 65 ++++++++++++++++++++++
 2 files changed, 119 insertions(+), 10 deletions(-)
 create mode 100644 spec/content/automate/ManageIQ/Infrastructure/VM/Migrate/StateMachines/VMMigrate.class/__methods__/update_migration_status_spec.rb

Comment 3 Shveta 2017-08-29 05:51:06 UTC
Create a Migrate VM request for a VM .
Didn't fill options for host .
Logs show error but UI shows request status - "Migrated"

Appliance : https://10.8.199.115

Logs 
==============
[----] I, [2017-08-29T01:48:54.271334 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) <AEMethod [/ManageIQ/Infrastructure/VM/Migrate/StateMachines/VMMigrate/update_migration_status]> Ending
[----] I, [2017-08-29T01:48:54.271554 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Method exited with rc=MIQ_OK
[----] I, [2017-08-29T01:48:54.272239 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Processing State=[EmailOwner]
[----] I, [2017-08-29T01:48:54.272670 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Following Relationship [miqaedb:/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete?event=vm_migrated#create]
[----] I, [2017-08-29T01:48:54.324733 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Updated namespace [miqaedb:/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete?event=vm_migrated#create  ManageIQ/Infrastructure/VM/Migrate]
[----] I, [2017-08-29T01:48:54.389090 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Updated namespace [Infrastructure/VM/Migrate/Email/vmmigratetask_complete  ManageIQ/Infrastructure/VM/Migrate]
[----] I, [2017-08-29T01:48:54.403571 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Invoking [inline] method [/ManageIQ/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete] with inputs [{}]
[----] I, [2017-08-29T01:48:54.404906 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) <AEMethod [/ManageIQ/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete]> Starting 
[----] I, [2017-08-29T01:48:55.116751 #2115:5938898]  INFO -- : Q-task_id([vm_migrate_task_36]) <AEMethod vmmigratetask_complete> Inspecting miq_task: #<MiqAeServiceVmMigrateTask:0x5be43d0 @object=#<VmMigrateTask id: 36, description: "VM Migrate for: nansari_report - Storage: NFS-Data...", state: "migrated", request_type: "vm_migrate", userid: "admin", options: {:src_ids=>["21"], :miq_request_dialog_name=>"vm_migrate_dialogs", :current_tab_key=>:environment, :owner_phone=>nil, :owner_country=>nil, :owner_phone_mobile=>nil, :owner_title=>nil, :owner_first_name=>nil, :owner_manager=>nil, :owner_address=>nil, :owner_company=>nil, :owner_last_name=>nil, :owner_manager_mail=>nil, :owner_city=>nil, :owner_department=>nil, :owner_load_ldap=>nil, :owner_manager_phone=>nil, :owner_state=>nil, :owner_office=>nil, :owner_zip=>nil, :owner_email=>"sshveta", :request_notes=>nil, :placement_cluster_name=>[nil, nil], :cluster_filter=>[nil, nil], :host_filter=>[nil, nil], :ds_filter=>[nil, nil], :placement_host_name=>[nil, nil], :placement_ds_name=>[1, "NFS-Datastore-1"], :rp_filter=>[nil, nil], :placement_rp_name=>[nil, nil], :placement_dc_name=>[nil, nil], :schedule_type=>["immediately", "Immediately on Approval"], :schedule_time=>Wed, 30 Aug 2017 00:00:00 UTC +00:00, :disk_format=>["unchanged", "Default"], :start_date=>"8/30/2017", :start_hour=>"00", :start_min=>"00", :src_vm_id=>[nil, nil], :tag_ids=>[], :requester_group=>"EvmGroup-super_administrator", :owner_group=>nil, :delivered_on=>2017-08-29 05:47:59 UTC}, created_on: "2017-08-29 05:48:00", updated_on: "2017-08-29 05:48:54", message: "Emailing Owner", status: "Ok", type: "VmMigrateTask", miq_request_id: 26, source_id: 21, source_type: "Vm", destination_id: nil, destination_type: nil, miq_request_task_id: nil, phase: nil, phase_context: {}, tenant_id: 2>, @virtual_columns=["href_slug", "region_description", "region_number"], @associations=["destination", "miq_request", "miq_request_task", "miq_request_tasks", "source", "tenant"]>
[----] I, [2017-08-29T01:48:55.132718 #2115:5938898]  INFO -- : Q-task_id([vm_migrate_task_36]) <AEMethod vmmigratetask_complete> VM Owner: nil
[----] E, [2017-08-29T01:48:55.134167 #2115:5938898] ERROR -- : Q-task_id([vm_migrate_task_36]) <AEMethod vmmigratetask_complete> The following error occurred during method evaluation:
[----] E, [2017-08-29T01:48:55.137094 #2115:5938898] ERROR -- : Q-task_id([vm_migrate_task_36]) <AEMethod vmmigratetask_complete>   NoMethodError: undefined method `email' for nil:NilClass
[----] E, [2017-08-29T01:48:55.138437 #2115:5938898] ERROR -- : Q-task_id([vm_migrate_task_36]) <AEMethod vmmigratetask_complete>   
[----] E, [2017-08-29T01:48:55.146281 #2115:5938898] ERROR -- : Q-task_id([vm_migrate_task_36]) Method STDERR: /ManageIQ/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete:30:in `<main>': undefined method `email' for nil:NilClass (NoMethodError)
[----] I, [2017-08-29T01:48:55.180660 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) <AEMethod [/ManageIQ/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete]> Ending
[----] E, [2017-08-29T01:48:55.181573 #2115:4b1130] ERROR -- : Q-task_id([vm_migrate_task_36]) Aborting instantiation (unknown method return code) because [Method exited with rc=Unknown RC: [1]]
[----] E, [2017-08-29T01:48:55.182485 #2115:4b1130] ERROR -- : Q-task_id([vm_migrate_task_36]) State=<EmailOwner> running  raised exception: <Method exited with rc=Unknown RC: [1]>
[----] W, [2017-08-29T01:48:55.182741 #2115:4b1130]  WARN -- : Q-task_id([vm_migrate_task_36]) Error in State=[EmailOwner]
[----] I, [2017-08-29T01:48:55.183083 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) In State=[EmailOwner], invoking [on_error] method=[update_migration_status(status => 'Error Emailing Owner')]
[----] I, [2017-08-29T01:48:55.943187 #2115:4b1130]  INFO -- : Q-task_id([vm_migrate_task_36]) Updated namespace [Infrastructure/VM/Migrate/StateMachines/VMMigrate/update_migration_status  ManageIQ/Infrastructure/VM/Migrate/StateMachines]
[----] I

Comment 4 William Fitzgerald 2017-09-19 19:41:03 UTC
Shveta,

You need this PR when it is merged.

https://github.com/ManageIQ/manageiq-content/pull/177

This fixes the Vm Migrate email error you are getting.

I will update this ticket when it is merged.

Thanks

Billy

Comment 5 William Fitzgerald 2017-09-20 15:52:57 UTC
Shveta,


The PR was merged and once it is backported, this should work.

Thanks

Billy

Comment 6 Shveta 2017-09-20 17:17:22 UTC
Will check in next 5.8 build .

Comment 9 Shveta 2018-02-22 18:27:15 UTC
VM migration succeeded when no host was specified , only datastore was given.
Is that expected ? 

No error in logs .

Comment 10 William Fitzgerald 2018-02-22 18:39:50 UTC
Shveta, 

Can I access your appliance ?

Thanks

Billy

Comment 11 Shveta 2018-02-22 19:01:48 UTC
Appliance : https://10.8.197.124

Comment 12 Shveta 2018-02-22 19:11:39 UTC
Appliance : https://10.8.197.124
Request 6 and 9 .

Comment 13 William Fitzgerald 2018-02-22 20:50:55 UTC
Shveta,

I was able to migrate a vm on my appliance using just the datastore.
It was successful and I verified that the Vm was moved to the datastore that I selected.

Thanks

Billy

Comment 14 Shveta 2018-02-22 21:28:38 UTC
Yes just wanted to confirm the result.
Verified on 5.8.3.4.20180221165627_8efa813

Comment 17 errata-xmlrpc 2018-02-28 13:04:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0374


Note You need to log in before you can comment on or make changes to this bug.