class OVFImporter(Converter):
Converter from OVF to Ganeti config file.
Method |
|
Parses the data and creates a structure containing all required info. |
Method |
|
Saves all the gathered information in a constant.EXPORT_CONF_FILE file. |
Instance Variable | input |
directory in which the .ovf file resides |
Instance Variable | input |
complete path to the .ovf file |
Instance Variable | output |
directory to which the results of conversion shall be written |
Instance Variable | ovf |
OVF reader instance collects data from .ovf file |
Instance Variable | results |
backend information gathered from .ovf file or command line arguments |
Instance Variable | results |
disk information gathered from .ovf file or command line arguments |
Instance Variable | results |
hypervisor information gathered from .ovf file or command line arguments |
Instance Variable | results |
name of imported instance |
Instance Variable | results |
network information gathered from .ovf file or command line arguments |
Instance Variable | results |
operating system information gathered from .ovf file or command line arguments |
Instance Variable | results |
string containing instance-specific tags |
Instance Variable | results |
disk template read from .ovf file or command line arguments |
Instance Variable | results |
version as required by Ganeti import |
Instance Variable | temp |
Undocumented |
Static Method | _ |
Get information about some section - e.g. disk, network, hypervisor. |
Method | _ |
Gathers information about disks used by instance, perfomes conversion. |
Method | _ |
Parses backend options given in command line. |
Method | _ |
Parses disk options given in a command line. |
Method | _ |
Parses hypervisor options given in a command line. |
Method | _ |
Returns name if one was given in command line. |
Method | _ |
Parses network options given in a command line or as a dictionary. |
Method | _ |
Parses OS options given in command line. |
Method | _ |
Returns tags list given in command line. |
Method | _ |
Returns disk template if one was given in command line. |
Method | _ |
Reads the data on which the conversion will take place. |
Method | _ |
Unpacks the .ova package into temporary directory. |
Inherited from Converter
:
Method | __init__ |
Initialize the converter. |
Method |
|
Cleans the temporary directory, if one was created. |
Instance Variable | options |
options parsed from the command line |
Instance Variable | temp |
container for temporary files created during conversion |
Static Method | _ |
Figures out some information of the disk using qemu-img. |
Method | _ |
Performs (de)compression on the disk and returns the new path |
Method | _ |
Performes conversion to specified format. |
ganeti.ovf.Converter.Parse
Parses the data and creates a structure containing all required info.
The method reads the information given either as a command line option or as a part of the OVF description.
Raises | |
errors.OpPrereqError | if some required part of the description of virtual instance is missing or unable to create output directory |
ganeti.ovf.Converter.Save
Saves all the gathered information in a constant.EXPORT_CONF_FILE file.
Raises | |
errors.OpPrereqError | when saving to config file failed |
ganeti.ovf.Converter.output_dir
directory to which the results of conversion shall be written
hypervisor information gathered from .ovf file or command line arguments
Get information about some section - e.g. disk, network, hypervisor.
Parameters | |
name:string | name of the section |
cmd | command line argument specific for section 'name' |
cmd | function to call if 'cmd_args' exists |
nocmd | function to call if 'cmd_args' is not there |
ignore | Undocumented |
Gathers information about disks used by instance, perfomes conversion.
Returns | |
dict | dictionary of disk-related options |
Raises | |
errors.OpPrereqError | disk is not in the same directory as .ovf file |
Parses backend options given in command line.
Returns | |
dict | dictionary containing vcpus, memory and auto-balance options |
Parses disk options given in a command line.
Returns | |
dict | dictionary of disk-related options |
Raises | |
errors.OpPrereqError | disk description does not contain size information or size information is invalid or creation failed |
Parses hypervisor options given in a command line.
Returns | |
dict | dictionary containing name of the chosen hypervisor and all the options |
Parses network options given in a command line or as a dictionary.
Returns | |
dict | dictionary of network-related options |
Parses OS options given in command line.
Returns | |
dict | dictionary containing name of chosen OS and all its options |
ganeti.ovf.Converter._ReadInputData
Reads the data on which the conversion will take place.
Parameters | |
input | absolute path to the .ovf or .ova input file |
Raises | |
errors.OpPrereqError | if input file is neither .ovf nor .ova |
Unpacks the .ova package into temporary directory.
Parameters | |
input | path to the .ova package file |
Raises | |
errors.OpPrereqError | if file is not a proper tarball, one of the files in the archive seem malicious (e.g. path starts with '../') or .ova package does not contain .ovf file |