Class: TemplateDriver
- Inherits:
-
VirtualMachineDriver
- Object
- ActionManager
- OpenNebulaDriver
- VirtualMachineDriver
- TemplateDriver
- Defined in:
- lib/VirtualMachineDriver.rb
Constant Summary
Constants inherited from VirtualMachineDriver
VirtualMachineDriver::ACTION, VirtualMachineDriver::HOST_ARG, VirtualMachineDriver::POLL_ATTRIBUTE, VirtualMachineDriver::VM_STATE
Constants included from DriverExecHelper
Instance Attribute Summary
Attributes inherited from OpenNebulaDriver
#local_scripts_base_path, #local_scripts_path, #remote_scripts_base_path, #remote_scripts_path
Instance Method Summary collapse
- #cancel(id, host, deploy_id, not_used) ⇒ Object
- #deploy(id, host, remote_dfile, not_used) ⇒ Object
-
#initialize ⇒ TemplateDriver
constructor
A new instance of TemplateDriver.
- #migrate(id, host, deploy_id, dest_host) ⇒ Object
- #poll(id, host, deploy_id, not_used) ⇒ Object
- #restore(id, host, deploy_id, file) ⇒ Object
- #save(id, host, deploy_id, file) ⇒ Object
- #shutdown(id, host, deploy_id, not_used) ⇒ Object
Methods inherited from VirtualMachineDriver
#attach_disk, #attach_nic, #backup, #backup_cancel, #cleanup, #decode, #detach_disk, #detach_nic, #disk_snapshot_create, #local_action, #reboot, #remotes_action, #reset, #resize, #resize_disk, #snapshot_create, #snapshot_delete, #snapshot_revert, #update_conf, #update_nic, #update_sg
Methods inherited from OpenNebulaDriver
#do_action, parse_actions_list, #start_driver
Methods included from DriverExecHelper
#action_command_line, #action_is_local?, #action_script_name, failed?, #get_info_from_execution, #initialize_helper, #log, #log_method, #read_configuration, #send_message
Methods inherited from ActionManager
#cancel_action, #register_action, #start_listener, #trigger_action
Constructor Details
#initialize ⇒ TemplateDriver
Returns a new instance of TemplateDriver.
360 361 362 363 364 |
# File 'lib/VirtualMachineDriver.rb', line 360 def initialize super('vmm/dummy', :concurrency => 15, :threaded => true) end |
Instance Method Details
#cancel(id, host, deploy_id, not_used) ⇒ Object
376 377 378 |
# File 'lib/VirtualMachineDriver.rb', line 376 def cancel(id, host, deploy_id, not_used) (ACTION[:cancel],RESULT[:success],id) end |
#deploy(id, host, remote_dfile, not_used) ⇒ Object
366 367 368 369 370 |
# File 'lib/VirtualMachineDriver.rb', line 366 def deploy(id, host, remote_dfile, not_used) #MUST return deploy_id if deployment was successfull deploy_id = "-" (ACTION[:deploy],RESULT[:success],id,deploy_id) end |
#migrate(id, host, deploy_id, dest_host) ⇒ Object
388 389 390 |
# File 'lib/VirtualMachineDriver.rb', line 388 def migrate(id, host, deploy_id, dest_host) (ACTION[:migrate],RESULT[:success],id) end |
#poll(id, host, deploy_id, not_used) ⇒ Object
392 393 394 395 396 397 398 399 |
# File 'lib/VirtualMachineDriver.rb', line 392 def poll(id, host, deploy_id, not_used) # monitor_info: string in the form "VAR=VAL VAR=VAL ... VAR=VAL" # known VAR are in POLL_ATTRIBUTES. VM states VM_STATES monitor_info = "#{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:active]} " \ "#{POLL_ATTRIBUTE[:nettx]}=12345" (ACTION[:poll],RESULT[:success],id,monitor_info) end |
#restore(id, host, deploy_id, file) ⇒ Object
384 385 386 |
# File 'lib/VirtualMachineDriver.rb', line 384 def restore(id, host, deploy_id , file) (ACTION[:restore],RESULT[:success],id) end |