1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-27 10:50:10 +03:00

F : Improve error messages on vcenter deploy ()

Signed-off-by: Carlos J. Herrera Matos <cherrera@opennebula.systems>
This commit is contained in:
Carlos J. Herrera 2019-07-12 10:16:01 -04:00 committed by Tino Vázquez
parent d6237309ba
commit 51fbf27b4c

@ -78,6 +78,23 @@ rescue StandardError => e
message = "Deploy of VM #{vm_id} on vCenter cluster #{cluster_name} " \
"with #{dfile} failed due to \"#{e.message}\"" \
"on the final attempt."
if e.message.include?('ManagedObjectNotFound')
template_id = drv_action['TEMPLATE/TEMPLATE_ID'].to_i
client = OpenNebula::Client.new
resource = OpenNebula::Template.new_with_id(template_id, client)
rc = resource.info
if OpenNebula.is_error?(rc)
message << "\n#{rc.message}"
else
template_name = resource.name
message << "\nVerify inside vCenter cluster #{cluster_name} " \
"that the template #{template_name} currently " \
'exists and has not been deleted'
end
end
end
OpenNebula.log_error(message)
STDERR.puts "#{message} #{e.backtrace}" if VCenterDriver::CONFIG[:debug_information]