Class: VagrantPlugins::VCloud::Action::Resume

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vcloud/action/resume.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Resume

Returns a new instance of Resume.



8
9
10
11
# File 'lib/vagrant-vcloud/action/resume.rb', line 8

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("vagrant_vcloud::action::resume")
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vagrant-vcloud/action/resume.rb', line 13

def call(env)

  cfg = env[:machine].provider_config
  cnx = cfg.vcloud_cnx.driver

  vAppId = env[:machine].get_vapp_id
  vmId = env[:machine].id
  vmName = env[:machine].name

  env[:ui].info("Powering on VM...")
  task_id = cnx.poweron_vm(vmId)
  wait = cnx.wait_task_completion(task_id)

  true

  @app.call env
end