Package ganeti :: Module ovf :: Class OVFWriter
[hide private]
[frames] | no frames]

Class OVFWriter

source code


Writer class for OVF files.

Instance Methods [hide private]
 
__init__(self, has_gnt_section)
Initialize the writer - set the top element.
source code
 
SaveDisksData(self, disks)
Convert disk information to certain OVF sections.
source code
 
SaveNetworksData(self, networks)
Convert network information to NetworkSection.
source code
 
SaveGanetiData(self, ganeti, networks)
Convert Ganeti-specific information to GanetiSection.
source code
 
SaveVirtualSystemData(self, name, vcpus, memory)
Convert virtual system information to OVF sections.
source code
string
PrettyXmlDump(self)
Formatter of the XML file.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_SaveNameAndParams(root, data)
Save name and parameters information under root using data.
source code
Instance Variables [hide private]
list hardware_list
list of items prepared for VirtualHardwareSection
int next_instance_id
next instance id to be used when creating elements on hardware_list
ET.ElementTree tree
XML tree that we are constructing
string virtual_system_type
value of vssd:VirtualSystemType, for external usage in VMWare this requires to be vmx
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, has_gnt_section)
(Constructor)

source code 

Initialize the writer - set the top element.

Parameters:
  • has_gnt_section (bool) - if the Ganeti schema should be added - i.e. this means that Ganeti section will be present
Overrides: object.__init__

SaveDisksData(self, disks)

source code 

Convert disk information to certain OVF sections.

Parameters:
  • disks (list) - list of dictionaries of disk options from config.ini

SaveNetworksData(self, networks)

source code 

Convert network information to NetworkSection.

Parameters:
  • networks (list) - list of dictionaries of network options form config.ini

_SaveNameAndParams(root, data)
Static Method

source code 

Save name and parameters information under root using data.

Parameters:
  • root (ET.Element) - root element for the Name and Parameters
  • data (dict) - data from which we gather the values

SaveGanetiData(self, ganeti, networks)

source code 

Convert Ganeti-specific information to GanetiSection.

Parameters:
  • ganeti (dict) - dictionary of Ganeti-specific options from config.ini
  • networks (list) - list of dictionaries of network options form config.ini

SaveVirtualSystemData(self, name, vcpus, memory)

source code 

Convert virtual system information to OVF sections.

Parameters:
  • name (string) - name of the instance
  • vcpus (int) - number of VCPUs
  • memory (int) - RAM memory in MB

PrettyXmlDump(self)

source code 

Formatter of the XML file.

Returns: string
XML tree in the form of nicely-formatted string