Class: VagrantPlugins::VMM::Action::Import
- Inherits:
-
Object
- Object
- VagrantPlugins::VMM::Action::Import
- Defined in:
- lib/vagrant-vmm/action/import.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Import
constructor
A new instance of Import.
Constructor Details
#initialize(app, env) ⇒ Import
Returns a new instance of Import.
9 10 11 12 |
# File 'lib/vagrant-vmm/action/import.rb', line 9 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant::VMM::import") end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/vagrant-vmm/action/import.rb', line 14 def call(env) vmm_server_address = env[:machine].provider_config.vmm_server_address # generate options = { vmm_server_address: vmm_server_address, proxy_server_address: env[:machine].provider_config.proxy_server_address, vm_name: env[:machine].config.vm.hostname, vm_template_name: env[:machine].provider_config.vm_template_name, vm_host_group_name: env[:machine].provider_config.vm_host_group_name, ad_server: env[:machine].provider_config.ad_server, ad_source_path: env[:machine].provider_config.ad_source_path, ad_target_path: env[:machine].provider_config.ad_target_path } # env[:ui].detail("Creating and registering VM in the VMM (#{vmm_server_address})...") if [:ad_server] && [:ad_source_path] && [:ad_target_path] env[:ui].detail(" ..and moving it under #{options[:ad_target_path]} after it's created.") end server = env[:machine].provider.driver.import() env[:ui].detail("Successfully created the VM with name: #{server['name']}") env[:machine].id = server["id"] @app.call(env) end |