Class: Xen::VBD
Class Method Summary collapse
-
.create(dev, vm, vdi, host) ⇒ Object
Creates a new VBD.
Instance Method Summary collapse
-
#destroy! ⇒ Object
Destroys the VBD.
-
#humanize ⇒ Object
Gives a nice description.
-
#vdi ⇒ Object
Gets the connected VDI.
Methods inherited from Base
#initialize, #record, #to_s, #uuid
Constructor Details
This class inherits a constructor from Xen::Base
Class Method Details
.create(dev, vm, vdi, host) ⇒ Object
Creates a new VBD. Required paramters are the device (‘hda1’), the vm object, the vdi object and the host
15 16 17 18 19 20 21 |
# File 'lib/xen/vbd.rb', line 15 def self.create(dev, vm, vdi, host) o = @initial_config.merge({:device => dev, :VM => vm.uuid, :VDI => vdi.uuid}) uuid = host.get_value("VBD.create", o) self.new(uuid, host) end |
Instance Method Details
#destroy! ⇒ Object
Destroys the VBD
29 30 31 |
# File 'lib/xen/vbd.rb', line 29 def destroy! @host.call('VBD.destroy', self.uuid) end |
#humanize ⇒ Object
Gives a nice description
34 35 36 37 |
# File 'lib/xen/vbd.rb', line 34 def humanize r = self.record "VBD #{self.uuid} is disk '#{r['device']}' in the VM, connected to VDI #{self.vdi}\n" + self.vdi.humanize('\--') end |