From 27bbd26d30362e4637cc7830de0c15166a66313a Mon Sep 17 00:00:00 2001 From: mcabrerizo Date: Mon, 17 Apr 2017 16:56:46 +0200 Subject: [PATCH] F #4913: Remove instantiate to persistent logic from vmm shutdown action --- src/vmm_mad/remotes/vcenter/shutdown | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/vmm_mad/remotes/vcenter/shutdown b/src/vmm_mad/remotes/vcenter/shutdown index 2c5ccb8844..7578fd2203 100755 --- a/src/vmm_mad/remotes/vcenter/shutdown +++ b/src/vmm_mad/remotes/vcenter/shutdown @@ -49,17 +49,8 @@ if !["SHUTDOWN", "SHUTDOWN_POWEROFF", "SHUTDOWN_UNDEPLOY"].include?(lcm_state_st exit -1 end -# Get disk elements from drv_action -disks = drv_action.retrieve_xmlelements("VM/TEMPLATE/DISK") - ## TODO copy_template -# Manage instantiate to persistent -instantiate_to_persistent = - !drv_action['/VMM_DRIVER_ACTION_DATA/VM/TEMPLATE/CLONING_TEMPLATE_ID'].nil? - -template_id = drv_action['/VMM_DRIVER_ACTION_DATA/VM/TEMPLATE/TEMPLATE_ID'] - begin vi_client = VCenterDriver::VIClient.new_from_host(host_id) @@ -67,21 +58,6 @@ begin vm.shutdown #Undeploy, Poweroff or Terminate - # If Terminate action has been called - if lcm_state_str == "SHUTDOWN" - - # If the VM was instantiated to persistent keep the VM - if instantiate_to_persistent - vm.mark_as_template #Convert VM to template in vCenter - - # Create new Opennebula template and set VCENTER_TEMPLATE_REF - new_template = OpenNebula::Template.new_with_id(template_id, - OpenNebula::Client.new) - new_template.info - new_template.update("VCENTER_TEMPLATE_REF= #{vm.item._ref}", true) - end - end - rescue Exception => e STDERR.puts "Shutdown of VM #{vm_ref} on vCenter cluster "\ "#{vc_cluster_name} failed due to "\