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:
parent
6fd81e8668
commit
a55104fdf1
@ -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
|
||||
|
@ -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
|
||||
########################################################################
|
||||
|
@ -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 #
|
||||
# ------------------------------------------------------------------------ #
|
||||
|
Loading…
x
Reference in New Issue
Block a user