Class: Virt::VMWare::Volume

Inherits:
Virt::Volume show all
Defined in:
lib/virt/vmware/volume.rb

Instance Attribute Summary

Attributes inherited from Virt::Volume

#allocated_size, #key, #name, #pool, #size, #template_path, #type, #xml_desc

Instance Method Summary collapse

Methods inherited from Virt::Volume

#destroy, #initialize, #new?, #save

Methods included from Util

#to_gb, #xml

Constructor Details

This class inherits a constructor from Virt::Volume

Instance Method Details

#default_template_pathObject



8
9
10
# File 'lib/virt/vmware/volume.rb', line 8

def default_template_path
  "vmware/volume.xml.erb"
end

#default_typeObject



4
5
6
# File 'lib/virt/vmware/volume.rb', line 4

def default_type
  "raw"
end

#name=(name) ⇒ Object



16
17
18
19
# File 'lib/virt/vmware/volume.rb', line 16

def name= name
  super name
  @name += ".vmdk" unless name.match(/.*\.vmdk$/)
end

#pathObject



12
13
14
# File 'lib/virt/vmware/volume.rb', line 12

def path
  "[#{pool.name}] #{self}"
end

#to_sObject



21
22
23
# File 'lib/virt/vmware/volume.rb', line 21

def to_s
  "#{title}/#{name}"
end