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

feature #1020: Moved and renamed vmwarelib to driver folder and name vmware_driver

This commit is contained in:
Ruben S. Montero 2011-12-26 00:33:01 +01:00
parent eafea8edbe
commit 9270b57ebb
9 changed files with 19 additions and 26 deletions

View File

@ -528,7 +528,6 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \
src/mad/ruby/ssh_stream.rb \
src/vnm_mad/one_vnm.rb \
src/mad/ruby/Ganglia.rb \
src/mad/ruby/vmwarelib.rb \
src/oca/ruby/OpenNebula.rb \
src/tm_mad/TMScript.rb \
src/authm_mad/remotes/ssh/ssh_auth.rb \
@ -618,7 +617,8 @@ VMM_EXEC_VMWARE_SCRIPTS="src/vmm_mad/remotes/vmware/cancel \
src/vmm_mad/remotes/vmware/save \
src/vmm_mad/remotes/vmware/poll \
src/vmm_mad/remotes/vmware/checkpoint \
src/vmm_mad/remotes/vmware/shutdown"
src/vmm_mad/remotes/vmware/shutdown \
src/vmm_mad/remotes/vmware/vmware_driver.rb"
#-------------------------------------------------------------------------------
# Information Manager Probes, to be installed under $REMOTES_LOCATION/im

View File

@ -27,11 +27,11 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
dfile = ARGV[0]
host = ARGV[1]
deploy_id = ARGV[0]
host = ARGV[1]
vmware_drv = VMwareDriver.new(host)
vmware_drv.cancel(dfile)
vmware_drv.cancel(deploy_id)

View File

@ -27,7 +27,7 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
dfile = ARGV[0]
host = ARGV[1]

View File

@ -28,7 +28,7 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
deploy_id = ARGV[0]
host = ARGV[1]

View File

@ -27,7 +27,7 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
deploy_id = ARGV[0]
host = ARGV[1]

View File

@ -27,7 +27,7 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
checkpoint_file = ARGV[0]
host = ARGV[1]

View File

@ -27,11 +27,11 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
deploy_id = ARGV[0]
file = ARGV[1]
host = ARGV[2]
deploy_id = ARGV[0]
file = ARGV[1]
host = ARGV[2]
vmware_drv = VMwareDriver.new(host)

View File

@ -27,10 +27,10 @@ end
$: << RUBY_LIB_LOCATION
$: << File.dirname(__FILE__)
require 'vmwarelib'
require 'vmware_driver'
deploy_id = ARGV[0]
host = ARGV[1]
host = ARGV[1]
vmware_drv = VMwareDriver.new(host)

View File

@ -91,9 +91,7 @@ class VMwareDriver
# Destroy the VM
rc, info = perform_action("virsh -c #{@uri} destroy #{deploy_id}")
if rc == false
exit info
end
exit info if rc == false
OpenNebula.log_debug("Successfully canceled domain #{deploy_id}.")
@ -105,12 +103,9 @@ class VMwareDriver
# Reboots a running VM #
# ------------------------------------------------------------------------ #
def reboot(deploy_id)
# Destroy the VM
rc, info = perform_action("virsh -c #{@uri} reboot #{deploy_id}")
if rc == false
exit info
end
exit info if rc == false
OpenNebula.log_debug("Domain #{deploy_id} successfully rebooted.")
end
@ -128,9 +123,7 @@ class VMwareDriver
def poll(deploy_id)
rc, info = do_action("virsh -c #{@uri} --readonly dominfo #{deploy_id}")
if rc == false
return "STATE=d"
end
return "STATE=d" if rc == false
state = ""