module documentation

Converter tools between ovf and ganeti config file

Class ConfigParserWithDefaults This is just a wrapper on ConfigParser, that uses default values
Class Converter Converter class for OVF packages.
Class OVFExporter Converter from Ganeti config file to OVF
Class OVFImporter Converter from OVF to Ganeti config file.
Class OVFReader Reader class for OVF files.
Class OVFWriter Writer class for OVF files.
Function CheckQemuImg Make sure that qemu-img is present before performing operations.
Function LinkFile Create link with a given prefix and suffix.
Function SubElementText This is just a wrapper on ET.SubElement that always has text content.
Constant ALLOCATION_UNITS Undocumented
Constant ALLOWED_ACTIONS Undocumented
Constant ALLOWED_FORMATS Undocumented
Constant AUTO_BALANCE Undocumented
Constant CERT_EXT Undocumented
Constant COMPRESS Undocumented
Constant COMPRESSION_EXT Undocumented
Constant COMPRESSION_TYPE Undocumented
Constant CONVERT_UNITS_TO_MB Undocumented
Constant COW Undocumented
Constant DECOMPRESS Undocumented
Constant DISK_FORMAT Undocumented
Constant DISK_TEMPLATE Undocumented
Constant FILE_EXTENSIONS Undocumented
Constant GANETI_SCHEMA Undocumented
Constant HYPERV Undocumented
Constant INSTANCE_ID Undocumented
Constant MEMORY Undocumented
Constant MF_EXT Undocumented
Constant NAME Undocumented
Constant NO_COMPRESSION Undocumented
Constant OS Undocumented
Constant OVA_EXT Undocumented
Constant OVF_EXT Undocumented
Constant OVF_SCHEMA Undocumented
Constant RASD_SCHEMA Undocumented
Constant RASD_TYPE Undocumented
Constant RAW Undocumented
Constant SCSI_SUBTYPE Undocumented
Constant TAGS Undocumented
Constant VCPUS Undocumented
Constant VERSION Undocumented
Constant VMDK Undocumented
Constant VS_TYPE Undocumented
Constant VSSD_SCHEMA Undocumented
Constant XML_SCHEMA Undocumented
def CheckQemuImg():

Make sure that qemu-img is present before performing operations.

Raises
errors.OpPrereqErrorwhen qemu-img was not found in the system
def LinkFile(old_path, prefix=None, suffix=None, directory=None):

Create link with a given prefix and suffix.

This is a wrapper over os.link. It tries to create a hard link for given file, but instead of rising error when file exists, the function changes the name a little bit.

Parameters
old_path:stringpath to the file that is to be linked
prefix:stringprefix of filename for the link
suffix:stringsuffix of the filename for the link
directory:stringdirectory of the link
Raises
errors.OpPrereqErrorwhen error on linking is different than "File exists"
def SubElementText(parent, tag, text, attrib={}, **extra):

This is just a wrapper on ET.SubElement that always has text content.

ALLOCATION_UNITS: dict =

Undocumented

Value
{'b': ['bytes', 'b'],
 'kb': ['kilobytes', 'kb', 'byte * 2^10', 'kibibytes', 'kib'],
 'mb': ['megabytes', 'mb', 'byte * 2^20', 'mebibytes', 'mib'],
 'gb': ['gigabytes', 'gb', 'byte * 2^30', 'gibibytes', 'gib']}
ALLOWED_ACTIONS =

Undocumented

Value
[COMPRESS, DECOMPRESS]
ALLOWED_FORMATS =

Undocumented

Value
[RAW, COW, VMDK]
AUTO_BALANCE: str =

Undocumented

Value
'auto_balance'
CERT_EXT: str =

Undocumented

Value
'.cert'
COMPRESS: str =

Undocumented

Value
'compression'
COMPRESSION_EXT: str =

Undocumented

Value
'.gz'
COMPRESSION_TYPE: str =

Undocumented

Value
'gzip'
CONVERT_UNITS_TO_MB =

Undocumented

Value
{'b': (lambda x: x // (1024 * 1024)),
 'kb': (lambda x: x // 1024),
 'mb': (lambda x: x),
 'gb': (lambda x: x * 1024)}
COW: str =

Undocumented

Value
'cow'
DECOMPRESS: str =

Undocumented

Value
'decompression'
DISK_FORMAT =

Undocumented

Value
{RAW: 'http://en.wikipedia.org/wiki/Byte',
 VMDK: 'http://www.vmware.com/interfaces/specifications/vmdk.html#monolithicSpar
se',
 COW: 'http://www.gnome.org/~markmc/qcow-image-format.html'}
DISK_TEMPLATE: str =

Undocumented

Value
'disk_template'
FILE_EXTENSIONS =

Undocumented

Value
[OVF_EXT, MF_EXT, CERT_EXT]
GANETI_SCHEMA: str =

Undocumented

Value
'http://ganeti'
HYPERV: str =

Undocumented

Value
'hypervisor'
INSTANCE_ID: dict[str, int] =

Undocumented

Value
{'system': 0, 'vcpus': 1, 'memory': 2, 'scsi': 3}
MEMORY: str =

Undocumented

Value
'memory'
MF_EXT: str =

Undocumented

Value
'.mf'
NAME: str =

Undocumented

Value
'name'
NO_COMPRESSION: list =

Undocumented

Value
[None, 'identity']
OS: str =

Undocumented

Value
'os'
OVA_EXT: str =

Undocumented

Value
'.ova'
OVF_EXT: str =

Undocumented

Value
'.ovf'
OVF_SCHEMA: str =

Undocumented

Value
'http://schemas.dmtf.org/ovf/envelope/1'
RASD_SCHEMA: str =

Undocumented

Value
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSetting
Data'
RASD_TYPE: dict[str, str] =

Undocumented

Value
{'vcpus': '3',
 'memory': '4',
 'scsi-controller': '6',
 'ethernet-adapter': '10',
 'disk': '17'}
RAW: str =

Undocumented

Value
'raw'
SCSI_SUBTYPE: str =

Undocumented

Value
'lsilogic'
TAGS: str =

Undocumented

Value
'tags'
VCPUS: str =

Undocumented

Value
'vcpus'
VERSION: str =

Undocumented

Value
'version'
VMDK: str =

Undocumented

Value
'vmdk'
VS_TYPE: dict[str, str] =

Undocumented

Value
{'ganeti': 'ganeti-ovf', 'external': 'vmx-04'}
VSSD_SCHEMA: str =

Undocumented

Value
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData'
XML_SCHEMA: str =

Undocumented

Value
'http://www.w3.org/2001/XMLSchema-instance'