Skip to content

Commit

Permalink
Fix Provisioning of disconnected VolumeTemplate
Browse files Browse the repository at this point in the history
Since provisioning from OpenStack Volumes was enabled, situation when original
Volume template can be disconnected from EMS by refresher can happen and it
doesn't look to be possible fix it on OpenStack side.

This PR allows EMS lookup fallback to options[:src_ems_id] when getting EMS
from source object fails.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1518381
  • Loading branch information
aufi committed Dec 5, 2017
1 parent 14fd2f9 commit 1a8b0aa
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
module ManageIQ::Providers::Openstack::CloudManager::Provision::Cloning
def find_destination_in_vmdb(ems_ref)
super
rescue NoMethodError => ex
# TODO: this should not be needed after we update refresh to not disconnect VmOrTemplate from EMS
_log.debug("Unable to find Provison Source ExtmanagementSystem: #{ex}")
_log.debug("Trying use attribute src_ems_id=#{options[:src_ems_id].try(:first)} instead.")
vm_model_class.find_by(:ems_id => options[:src_ems_id].try(:first), :ems_ref => ems_ref)
end

def do_clone_task_check(clone_task_ref)
connection_options = {:tenant_name => options[:cloud_tenant][1]} if options[:cloud_tenant].kind_of?(Array)
source.with_provider_connection(connection_options) do |openstack|
Expand Down

0 comments on commit 1a8b0aa

Please sign in to comment.