class documentation

class OVFExporter(Converter):

View In Hierarchy

Converter from Ganeti config file to OVF

Method Parse Parses the data and creates a structure containing all required info.
Method Save Saves the gathered configuration in an apropriate format.
Instance Variable config_parser parser for the config.ini file
Instance Variable input_dir directory in which the config.ini file resides
Instance Variable input_path complete path to the config.ini file
Instance Variable output_dir directory to which the results of conversion shall be written
Instance Variable output_path complete path to .ovf file
Instance Variable ovf_writer Undocumented
Instance Variable packed_dir if we want OVA package, this points to the real (i.e. not temp) output directory
Instance Variable reference_files files referenced in the ovf file
Instance Variable references_files Undocumented
Instance Variable results_disk list of dictionaries of disk options from config.ini
Instance Variable results_ganeti dictionary of Ganeti-specific options from config.ini
Instance Variable results_memory RAM memory in MB
Instance Variable results_name name of the instance
Instance Variable results_network list of dictionaries of network options form config.ini
Instance Variable results_vcpus number of VCPUs
Instance Variable temp_dir Undocumented
Static Method _PrepareTarFile Creates tarfile from the files in OVF package.
Method _GetDiskOptions Convert the disk and gather disk info for .ovf file.
Method _ParseDisks Parses disk data from config file.
Method _ParseGaneti Parses Ganeti data from config file.
Method _ParseMemory Parses vcpus number from config file.
Method _ParseName Parses name from command line options or config file.
Method _ParseNetworks Parses network data from config file.
Method _ParseVCPUs Parses vcpus number from config file.
Method _PrepareManifest Creates manifest for all the files in OVF package.
Method _ReadInputData Reads the data on which the conversion will take place.

Inherited from Converter:

Method __init__ Initialize the converter.
Method Cleanup Cleans the temporary directory, if one was created.
Instance Variable options options parsed from the command line
Instance Variable temp_file_manager container for temporary files created during conversion
Static Method _GetDiskQemuInfo Figures out some information of the disk using qemu-img.
Method _CompressDisk Performs (de)compression on the disk and returns the new path
Method _ConvertDisk Performes conversion to specified format.
def Parse(self):

Parses the data and creates a structure containing all required info.

def Save(self):

Saves the gathered configuration in an apropriate format.

Raises
errors.OpPrereqErrorif unable to create output directory

parser for the config.ini file

input_dir: string =

directory in which the config.ini file resides

input_path: string =

complete path to the config.ini file

output_dir: string =

directory to which the results of conversion shall be written

output_path: string =

complete path to .ovf file

ovf_writer =

Undocumented

packed_dir: string =

if we want OVA package, this points to the real (i.e. not temp) output directory

reference_files: list =

files referenced in the ovf file

references_files: list =

Undocumented

results_disk: list =

list of dictionaries of disk options from config.ini

results_ganeti: dict =

dictionary of Ganeti-specific options from config.ini

results_memory: string =

RAM memory in MB

results_name: string =

name of the instance

results_network: list =

list of dictionaries of network options form config.ini

results_vcpus: string =

number of VCPUs

temp_dir =

Undocumented

@staticmethod
def _PrepareTarFile(tar_path, files_list):

Creates tarfile from the files in OVF package.

Parameters
tar_path:stringpath to the resulting file
files_list:listlist of files in the OVF package
def _GetDiskOptions(self, disk_file, compression):

Convert the disk and gather disk info for .ovf file.

Parameters
disk_file:stringname of the disk (without the full path)
compression:boolwhether the disk should be compressed or not
Raises
errors.OpPrereqErrorwhen disk image does not exist
def _ParseDisks(self):

Parses disk data from config file.

Returns
listlist of dictionaries of disk options
def _ParseGaneti(self):

Parses Ganeti data from config file.

Returns
dictionarydictionary of Ganeti-specific options
def _ParseMemory(self):

Parses vcpus number from config file.

Returns
intamount of memory in MB
Raises
errors.OpPrereqErrorif amount of memory equals 0
def _ParseName(self):

Parses name from command line options or config file.

Returns
stringname of Ganeti instance
Raises
errors.OpPrereqErrorif name of the instance is not provided
def _ParseNetworks(self):

Parses network data from config file.

Returns
listlist of dictionaries of network options
Raises
errors.OpPrereqErrorthen network mode is not recognized
def _ParseVCPUs(self):

Parses vcpus number from config file.

Returns
intnumber of virtual CPUs
Raises
errors.OpPrereqErrorif number of VCPUs equals 0
def _PrepareManifest(self, path):

Creates manifest for all the files in OVF package.

Parameters
path:stringpath to manifesto file
Raises
errors.OpPrereqErrorif error occurs when writing file
def _ReadInputData(self, input_path):

Reads the data on which the conversion will take place.

Parameters
input_path:stringabsolute path to the config.ini input file
Raises
errors.OpPrereqErrorerror when reading the config file