commit open-ovf for openSUSE:Factory
Hello community, here is the log from the commit of package open-ovf for openSUSE:Factory checked in at Mon Nov 2 12:41:34 CET 2009. -------- New Changes file: --- /dev/null 2009-09-30 08:50:26.000000000 +0200 +++ /mounts/work_src_done/STABLE/open-ovf/open-ovf.changes 2009-10-22 17:31:14.000000000 +0200 @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Thu Oct 22 09:30:38 MDT 2009 - jfehlig@novell.com + +- spec file cleanup + +------------------------------------------------------------------- +Wed Jul 22 15:54:54 MDT 2009 - jfehlig@novell.com + +- Initial packaging of open-ovf + calling whatdependson for head-i586 New: ---- README.SuSE fix-libvirtxml.patch open-ovf-0.1.tar.bz2 open-ovf.changes open-ovf.spec output-libvirtxml-file.patch python2.6.patch use-before-define.patch xenfv-libvirtxml.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ open-ovf.spec ++++++ # # spec file for package open-ovf (Version 0.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: open-ovf Version: 0.1 Release: 1 Summary: Tool for importing and exporting OVF Url: http://open-ovf.wiki.sourceforge.net/ License: EPL Group: Development/Libraries/Python Source0: %{name}-%{version}.tar.bz2 Source1: README.SuSE Patch0: output-libvirtxml-file.patch Patch1: xenfv-libvirtxml.patch Patch2: use-before-define.patch Patch3: fix-libvirtxml.patch Patch4: python2.6.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python python-devel BuildArch: noarch %description Open-OVF project is an open source library and tools designed to promote adoption of the OVF (Open Virtual Machine Format) specification as an industry standard. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %build python setup.py build %install python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT --record-rpm=INSTALLED_FILES #rm -f $RPM_BUILD_ROOT/%{py_sitedir}/*.egg-info mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}/ install -m 644 %SOURCE1 $RPM_BUILD_ROOT%{_docdir}/%{name}/ %files -f INSTALLED_FILES %defattr(-,root,root) %doc %dir %{_docdir}/%{name} %doc %{_docdir}/%{name}/README.SuSE %changelog ++++++ README.SuSE ++++++ README for the open-ovf package =============================== This file contains SUSE-specific instructions and suggestions for using Open-OVF. For more in-depth documentation of using Open-OVF, consult the online documentation at Open-OVF project page http://open-ovf.wiki.sourceforge.net/ About ----- Open-OVF project is an open source library and tools designed to promote adoption of the OVF (Open Virtual Machine Format) specification as an industry standard. It provides complete support for creating, using and maintaining OVF appliances. It aims to establish itself as a de-facto standard toolkit for working with OVF. Open-ovf is under EPL (Eclipse Public License) and plans to build an open community around OVF. Development resources from all across will be leveraged to create the common plumbing, this will help build cross-hypervisor components and prevent fragmentation of the OVF across industry. It promotes the usage of OVF and its adoption as a standard VM appliance format. What is OVF ----------- The Distributed Management Task Force (DMTF) has defined a vendor-neutral standard for packaging virtual appliances enabling automated installation, configuration and activation of any virtualization platform. Open Virtual Machine Format (OVF) specification describes an open, secure, portable, efficient and extensible format for packaging and distribution of virtual machines. Some of the main features of OVF are - DMTF standard, Open Packaging format for Virtual Appliances - XML encoded - Security and licensing features - Enable cross-hypervisor Appliance portability - Enables a neutral appliance ecosystem The latest OVF specification and schema documents (1.0.0d) are located at the DMTF Published Documents page http://www.dmtf.org/standards/published_documents/. - OVF Specification: http://www.dmtf.org/standards/published_documents/DSP0243_1.0.0.pdf - OVF Envelope Schema: http://schemas.dmtf.org/ovf/envelope/1/dsp8023.xsd - OVF Environment Schema: http://schemas.dmtf.org/ovf/environment/1/dsp8027.xsd OVF-based Virtual Appliances ---------------------------- OVF's have three phases: creation, deployment, and activation. The creation phase starts with the initial generation of an OVF and includes the modification of the image by software partners. The state of the OVF is still generic at this point as the image has not been customized for a particular site. The deployment phase is initiated by the system administrator, who in general follows the setup procedures defined by the author of the virtual appliance. The system administrator defines site specific information such as DNS settings, Gateways, and Passwords. The administrator may also make policy decisions such as the virtual platform type as well as the class of machines to be used. Basically, anything that has been parameterized within the OVF may be modified. This information is recorded in the OVF environment file which is created during this step. The OVF may be further customized by the end user. Activation of the OVF marks the final phase. The OVF is launched during this phase by the end user who is asked to accept the license agreement. The virtual machine is allocated, installed, and started during this phase. A handle of some kind is provided to the user, so that he may connect a virtual terminal with the virtual server. In this way, he can monitor the progress of the virtual server as it boots and login to the virtual server if he wants. For creation purpose, commands are needed to create, show, change, and remove data from the OVF. For deployment purposes, commands are needed to show and change data in the OVF, create the environment file, validate the OVF, and build and publish an OVA. For activation purposes, commands are needed to show information in the OVF. The OVF is not modified. OVF Package ----------- An OVF package shall include an OVF file and zero or more optional files. The standard discusses a few additional files such as the manifest file and certificate file. An OVF package can be stored as a single file using the TAR format. In this case, the file extension should be .ova and is referred to as an OVA file. Creating an OVF --------------- The OVF may describe one or more virtual servers which together define a virtual appliance. This is done incrementally with repeated calls to the mkovf command. The mkovf command contains a number of subcommands, which are individually used to build different sections of the OVF. These commands closely parallel the standard, so ambiguity regarding the significance or value of arguments may be determined by looking at the OVF specification. The following is an example of how to create an OVF for a SLES-based virtual appliance that targets the Xen hypervisor, using the mkovf command. # Create the Envelope, or root node, for the OVF file. All other sub-sections # are attached to the Envelope mkovf --init -f sles11.ovf # Add an external file (e.g. the appliance disk image) to the Reference section mkovf --efile -f sles11.ovf --ovfID disk0 -n sles11.img -s 4294967296 # Append the specified disk information to the Disk section mkovf --disk -f sles11.ovf -i disk0 -c 4294967296 -F "Raw Image" --info \ "Virtual Disks" -s 4294967296 --fileRef disk0 # Append the specified network information to the Network section mkovf --net -f sles11.ovf --networkName br0 -i 1 -d "Bridged network" \ --info "Networks used by appliance" # Add a virtual system. The --id parameter can specify eitehr the id of # virtual system collection to which this new collection should be attached # or the parent section for the virtual system mkovf --vs -f sles11.ovf -i SLES11-vm -m "Single-VM, SLES11-based virtual appliance" # Create an OperatingSystem Section. It is only valid for Virtual Servers. # secID specifies the os type. This is an enumeration defined by # CIM_OperatingSystem.osType mkovf --os -f sles11.ovf --id SLES11-vm --info "SuSE Linux Enterprise Server" \ --description "Linux 2.6.x" --secID 103 # Add a virtual hardware section to a virtual system. At least one virtual # hardware section must be specified for each virtual system. Multiple virtual # hardware sections can be specified for a virtual system. This section can not # be specified for a virtual hardware collection mkovf --virthw -f sles11.ovf --id SLES11-vm --type xenpv --secID vh0 --info \ "Virtual Hardware Requirements: 512Mb, 4 CPUs, 1 disk, 1 nic" --instanceID 1 \ --elementName "sles11-xen" # Add virtual resource elements to the VirtualHardware Section # CPUs mkovf --resource -f sles11.ovf --id vh0 --caption "4 VCPUs" \ --description "Number of VCPUs" --resourceID 1 --resourceType 3 \ --virtualQuantity 4 --elementName "virtual CPUs" # Memory mkovf --resource -f sles11.ovf --id vh0 --allocUnits MegaBytes \ --caption "512MB of memory" --description "Memory size" --resourceID 2 \ --resourceType 4 --virtualQuantity 512 --elementName "Memory" # NIC mkovf --resource -f sles11.ovf --id vh0 --automaticAllocation True \ --caption "Ethernet adapter on bridge network" --description "Ethernet" \ --resourceID 3 --resourceType 10 --elementName "eth0" # Disk mkovf --resource -f sles11.ovf --id vh0 --caption "Disk1" \ --description "Harddisk" --hostResource ovf://disk/sles11.img \ --resourceID 4 --resourceType 17 --elementName "xvda" Creating an OVA --------------- An appliance consists of the ovf file and zero or more optional files that can include a manifest file and a certificate file. The manifest and sign subcommands of the ova command create these two optional files if they are desired. Furthermore, an appliance may be distributed as a set of files or a single tar file with the file extension .ova. The pack subcommand handles the packing of an appliance into this OVA file. # Create an ova with no manifest or certificate file ova --pack -f sles11.ovf -o sles10sp2-hvm.ova --no-manifest --no-certificate Activating an OVA ----------------- An ova can be activated on target system using the ova runtime subcommand. Open-OVF will produce libvirt XML from the ovf and start the virtual appliance. Alternatively, libvirt XML can be extracted to an output file using the --ofile option for later activation using for example 'virsh create <libvirt-xml-output>' # First, the ova must be unpacked ova --unpack -f sles11.ova # Next, extract libvirt XML to a file ova --runtime -f sles11.ovf --virt xenpv --ofile sles11-libvirt.xml # Finally, activate the guest using libvirt's virsh command virsh create sles11-libvirt.xml Alternatively, once unpacked, the appliance can be activated directly using the ova runtime subcommand by not specifying the --ofile option: ova --runtime -f sles11.ovf --virt xenpv ++++++ fix-libvirtxml.patch ++++++ Index: open-ovf-0.1/py/ovf/OvfLibvirt.py =================================================================== --- open-ovf-0.1.orig/py/ovf/OvfLibvirt.py +++ open-ovf-0.1/py/ovf/OvfLibvirt.py @@ -448,7 +448,7 @@ def clockElement(sync): """ document = Document() elem = document.createElement('clock') - elem.setAttribute('sync', sync) + elem.setAttribute('offset', sync) return elem def devicesElement(*devices): ++++++ output-libvirtxml-file.patch ++++++ Index: open-ovf-0.1/py/ovf/OvfSet.py =================================================================== --- open-ovf-0.1.orig/py/ovf/OvfSet.py +++ open-ovf-0.1/py/ovf/OvfSet.py @@ -398,7 +398,7 @@ class OvfSet(object): raise # Libvirt Interface - def boot(self, virtPlatform = None, configId=None, installLoc=None, envDirectory=None): + def boot(self, virtPlatform = None, ofile=None, configId=None, installLoc=None, envDirectory=None): """ Boots OvfSet as libvirt domain(s). @@ -422,8 +422,15 @@ class OvfSet(object): virtPlatform, configId, envDirectory) - # queue domains with action: domains[id].create() - schedule = OvfLibvirt.getSchedule(startup, domains) + if ofile: + fd = os.open(ofile, os.O_RDWR | os.O_CREAT | os.O_TRUNC) + for domain in domains.values(): + os.write(fd, domain) + os.write(fd, "\n\n") + os.close(fd) + else: + # queue domains with action: domains[id].create() + schedule = OvfLibvirt.getSchedule(startup, domains) - schedule.run() + schedule.run() Index: open-ovf-0.1/py/scripts/ova =================================================================== --- open-ovf-0.1.orig/py/scripts/ova +++ open-ovf-0.1/py/scripts/ova @@ -578,7 +578,8 @@ def run(options, args): ovf.writeAsDir(installLoc) # Boot Virtual Machines - ovf.boot(options.virtPlatform, None, installLoc, options.envDir) + ovf.boot(options.virtPlatform, options.ofile, None, installLoc, + options.envDir) sys.exit(0) else: @@ -698,6 +699,11 @@ COMMANDS = { 'help' : "Virtualization Platform"} }, { + 'flags' : ['-o', '--ofile'], + 'parms': {'dest' : 'ofile', + 'help' : "Output file for libvirt XML"} + }, + { "flags" : ["-e", "--environment"], "parms" : {"dest" : "envDir", 'default' : None, "help" : "Path to environment files"} ++++++ python2.6.patch ++++++ Index: open-ovf-0.1/py/ovf/Ovf.py =================================================================== --- open-ovf-0.1.orig/py/ovf/Ovf.py +++ open-ovf-0.1/py/ovf/Ovf.py @@ -16,7 +16,7 @@ Module for interfacing to an OVF and XML """ import os -import sha +import hashlib from xml.dom import Node def createTextDescriptionOfNodeList(nodeList): @@ -589,7 +589,7 @@ def sha1sumFile(path): else: fd = path - digested = sha.new() + digested = hashlib.sha1() while 1: buf = fd.read(4096) if buf == "": ++++++ use-before-define.patch ++++++ Index: open-ovf-0.1/py/ovf/OvfLibvirt.py =================================================================== --- open-ovf-0.1.orig/py/ovf/OvfLibvirt.py +++ open-ovf-0.1/py/ovf/OvfLibvirt.py @@ -1073,10 +1073,10 @@ def getOvfDisks(virtualHardware, dir, re source = None hostResource = ovfDisk['rasd:HostResource'] resourceId = hostResource.rsplit('/', 1).pop() + hostResources = [] if hostResource.startswith('ovf://disk/'): diskList = Ovf.getDict(diskSection)['children'] - hostResources = [] for child in diskList: #Create a tuple (file hostResource, diskId, referred?) #flag to check if the disk is referred @@ -1209,7 +1209,7 @@ def getOvfNetworks(virtualHardware, conf # also assume that the network currently exists. The default network # is "default". for netDevice in ovfNetDeviceList: - netAttach = 'default' + netConnect = 'default' if netDevice.has_key('rasd:Connection'): netConnect = netDevice['rasd:Connection'] netList.append(dict(interfaceType = 'network', sourceName = netConnect)) ++++++ xenfv-libvirtxml.patch ++++++ Index: open-ovf-0.1/py/ovf/OvfLibvirt.py =================================================================== --- open-ovf-0.1.orig/py/ovf/OvfLibvirt.py +++ open-ovf-0.1/py/ovf/OvfLibvirt.py @@ -341,6 +341,8 @@ def bootElements(domain, domainType): if domainType == 'qemu' or domainType == 'kqemu' or \ domainType == 'kvm' or domainType == 'xenfv': bootDict = dict(type = 'hvm', devices=['hd', 'cdrom']) + if domainType == 'xenfv': + bootDict['loader'] = '/usr/lib/xen/boot/hvmloader' elif domainType == 'xenpv': bootDict = dict(bootloader = '/usr/bin/pygrub', type = 'linux') @@ -1292,7 +1294,10 @@ def getOvfDomains(ovf, path, hypervisor= clock = clockElement('utc') #features - features = featuresElement(acpi=True) + if hypervisor == 'xenfv': + features = featuresElement(pae=True, acpi=True, apic=True) + else: + features = featuresElement(acpi=True) #life cycle onPowerOff = onPowerOffElement('destroy') ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de