Class: VagrantPlugins::XenServer::Action::CloneDisk

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-xenserver/action/clone_disk.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ CloneDisk

Returns a new instance of CloneDisk.



11
12
13
14
# File 'lib/vagrant-xenserver/action/clone_disk.rb', line 11

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("vagrant::xenserver::actions::clone_disk")
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/vagrant-xenserver/action/clone_disk.rb', line 16

def call(env)
  vdi_ref = env[:box_vdi]

  clone = env[:xc].VDI.clone(vdi_ref, {})

  env[:my_vdi] = clone

  @logger.info("clone VDI=#{clone}")

  @app.call(env)
end