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

Fix for VMware reboot --hard operation

Prune unused code
This commit is contained in:
Tino Vazquez 2014-10-10 11:44:25 +02:00
parent 6fd81e8668
commit a55104fdf1
3 changed files with 19 additions and 15 deletions

View File

@ -27,11 +27,17 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmware_driver'
require 'vi_driver'
deploy_id = ARGV[0]
host = ARGV[1]
vmware_drv = VMwareDriver.new(host)
vmware_drv.reset(deploy_id)
begin
VIDriver::initialize(host, false)
vivm = VIDriver::VIVm.new(deploy_id, nil)
vivm.reset
rescue Exception => e
STDERR.puts "Reset of VM #{deploy_id} on host #{host} failed " +
"due to \"#{e.message}\""
exit -1
end

View File

@ -233,6 +233,15 @@ class VIVm
@vm.ReconfigVM_Task(:spec => spec).wait_for_completion
end
############################################################################
# Resets a VM
# @param deploy_id vcenter identifier of the VM
# @param hostname name of the host (equals the vCenter cluster)
############################################################################
def reset
@vm.ResetVM_Task.wait_for_completion
end
########################################################################
# Initialize the vm monitor information
########################################################################

View File

@ -136,17 +136,6 @@ class VMwareDriver
OpenNebula.log_debug("Domain #{deploy_id} successfully rebooted.")
end
# ------------------------------------------------------------------------ #
# Reset a running VM #
# ------------------------------------------------------------------------ #
def reset(deploy_id)
rc, info = do_action("virsh -c #{@uri} reset #{deploy_id}")
exit info if rc == false
OpenNebula.log_debug("Domain #{deploy_id} successfully reseted.")
end
# ------------------------------------------------------------------------ #
# Migrate #
# ------------------------------------------------------------------------ #