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

Use the new VM's ems_ref instead of an annotation #408

Merged

Conversation

agrare
Copy link
Member

@agrare agrare commented Jun 27, 2019

Instead of setting a UUID to the annotations field check for the new
vm's ems_ref.

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

Instead of setting a UUID to the annotations field check for the new
vm's ems_ref.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1724751
@agrare agrare added the bug label Jun 27, 2019
@agrare agrare requested a review from gmcculloug June 27, 2019 20:04
@agrare agrare changed the title Use the new VM's ems_ref instead of an annotation [WIP] Use the new VM's ems_ref instead of an annotation Jun 27, 2019
It is possible that EmsRefresh can have a really early view of the VM
without all final data populated by the time the CloneVM_Task completes
which can lead to post-provision tasks failing if they depend on some
data in the vm record.

Waiting until the Ems' inventory date is at least as recent as the
CloneVM_Task completeTime we guarantee that the VM record represents the
final VM state.
@agrare agrare force-pushed the bz_1724751_use_vm_ems_ref_to_find_in_vmdb branch from 98e837b to 3c45a85 Compare June 28, 2019 14:07
@agrare agrare changed the title [WIP] Use the new VM's ems_ref instead of an annotation Use the new VM's ems_ref instead of an annotation Jun 28, 2019
@agrare
Copy link
Member Author

agrare commented Jun 28, 2019

@gmcculloug @Fryguy updated to include waiting for the ems last_inventory_date to be at least as new as the CloneVM_Task completeTime

@agrare
Copy link
Member Author

agrare commented Jul 10, 2019

@Fryguy @gmcculloug thoughts?

@gmcculloug gmcculloug self-assigned this Jul 11, 2019
task_props = ["info.state", "info.error", "info.result", "info.progress", "info.completeTime"]
task = vim.getMoProp(clone_task_mor, task_props)

case task&.info&.state
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good. Since we are referencing task&.info in 5 places we should set that to a variable to avoid the lookup each time: task_info = task&.info

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will do

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end
# Check that the EMS inventory is as up to date as the CloneVM_Task completeTime
# to prevent issues with post-provision depending on data that isn't in VMDB yet
return if source.ext_management_system.last_inventory_date < phase_context[:clone_vm_task_completion_time]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@miq-bot
Copy link
Member

miq-bot commented Jul 23, 2019

Checked commits agrare/manageiq-providers-vmware@e9604ba~...e91a334 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@gmcculloug gmcculloug merged commit 1875eb5 into ManageIQ:master Jul 23, 2019
@gmcculloug gmcculloug added this to the Sprint 116 Ending Jul 22, 2019 milestone Jul 23, 2019
@agrare agrare deleted the bz_1724751_use_vm_ems_ref_to_find_in_vmdb branch July 23, 2019 14:37
@agrare agrare modified the milestones: Sprint 116 Ending Jul 22, 2019, Sprint 117 Ending Aug 5, 2019 Jul 24, 2019
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.

3 participants