Sha256: 0a7c22b2ab1925317387b8b308e2edf2abebbce08b92f825f680bd4f7436877f

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

module VagrantPlugins
  module VCenter
    module Action
      # This class resumes the VM when it's suspended.
      class Resume
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_vcenter::action::resume')
        end

        def call(env)
          cfg = env[:machine].provider_config

          vm = cfg.vmfolder.findByUuid(env[:machine].id) or
               fail Errors::VMNotFound,
                    :vm_name => env[:machine].name

          # Poweroff VM
          env[:ui].info('Powering on VM...')
          vm.PowerOnVM_Task.wait_for_completion

          @app.call env
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-vcenter-0.3.3 lib/vagrant-vcenter/action/resume.rb