CLOUDSTACK-5883 Convert ovf file to proper format for ESXi
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/794d47c5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/794d47c5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/794d47c5

Branch: refs/heads/master
Commit: 794d47c5f279bc8cbd212d9dd87673b8302de9db
Parents: 98e529a
Author: Hugo Trippaers <htrippa...@schubergphilis.com>
Authored: Thu Jan 16 14:42:34 2014 +0100
Committer: Hugo Trippaers <htrippa...@schubergphilis.com>
Committed: Thu Jan 16 14:43:44 2014 +0100

----------------------------------------------------------------------
 tools/appliance/build.sh                     |  6 +++++-
 tools/appliance/convert_ovf_vbox_to_esx.xslt | 24 +++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/794d47c5/tools/appliance/build.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index 61ee793..9a201f9 100644
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -92,7 +92,11 @@ echo "$appliance exported for KVM: 
dist/$appliance-$build_date-$branch-kvm.qcow2
 vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-vmware.vmdk 
--format VMDK
 bzip2 $appliance-$build_date-$branch-vmware.vmdk
 echo "$appliance exported for VMWare: 
dist/$appliance-$build_date-$branch-vmware.vmdk.bz2"
-vboxmanage export $machine_uuid --output 
$appliance-$build_date-$branch-vmware.ova
+vboxmanage export $machine_uuid --output 
$appliance-$build_date-$branch-vmware.ovf
+mv $appliance-$build_date-$branch-vmware.ovf 
$appliance-$build_date-$branch-vmware.ovf-orig
+xsltproc convert_ovf_vbox_to_esx.xslt 
$appliance-$build_date-$branch-vmware.ovf-orig > 
$appliance-$build_date-$branch-vmware.ovf
+tar -cf $appliance-$build_date-$branch-vmware.ova 
$appliance-$build_date-$branch-vmware.ovf 
$appliance-$build_date-$branch-vmware-disk1.vmdk
+rm -f $appliance-$build_date-$branch-vmware.ovf 
$appliance-$build_date-$branch-vmware.ovf-orig 
$appliance-$build_date-$branch-vmware-disk1.vmdk
 echo "$appliance exported for VMWare: 
dist/$appliance-$build_date-$branch-vmware.ova"
 
 # Export for HyperV

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/794d47c5/tools/appliance/convert_ovf_vbox_to_esx.xslt
----------------------------------------------------------------------
diff --git a/tools/appliance/convert_ovf_vbox_to_esx.xslt 
b/tools/appliance/convert_ovf_vbox_to_esx.xslt
new file mode 100644
index 0000000..2aa1c7e
--- /dev/null
+++ b/tools/appliance/convert_ovf_vbox_to_esx.xslt
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:ovf="http://www.vmware.com/schema/ovf/1/envelope"; 
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData";
 
xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:vbox="http://www.virtualbox.org/ovf/machine";>
+
+    <xsl:template match="node()|@*">
+        <xsl:copy>
+            <xsl:apply-templates select="node()|@*"/>
+        </xsl:copy>
+    </xsl:template>
+
+    <xsl:template match="vssd:VirtualSystemType/text()">vmx-06</xsl:template>
+  
+    <xsl:template match="ovf:Item[./rasd:ResourceType/text()=20]">
+        <ovf:Item>
+        <xsl:copy-of select="rasd:Address"/>
+        <xsl:copy-of select="rasd:BusNumber"/>
+        <rasd:Caption>scsiController0</rasd:Caption>
+        <rasd:Description>SCSI Controller</rasd:Description>
+        <xsl:copy-of select="rasd:InstanceId"/>
+        <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
+        <rasd:ResourceType>6</rasd:ResourceType>
+        </ovf:Item>
+    </xsl:template>
+
+</xsl:stylesheet>

Reply via email to