Skip to content

Commit 794d47c

Browse files
committed
CLOUDSTACK-5883 Convert ovf file to proper format for ESXi
1 parent 98e529a commit 794d47c

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

tools/appliance/build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2
9292
vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-vmware.vmdk --format VMDK
9393
bzip2 $appliance-$build_date-$branch-vmware.vmdk
9494
echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.vmdk.bz2"
95-
vboxmanage export $machine_uuid --output $appliance-$build_date-$branch-vmware.ova
95+
vboxmanage export $machine_uuid --output $appliance-$build_date-$branch-vmware.ovf
96+
mv $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware.ovf-orig
97+
xsltproc convert_ovf_vbox_to_esx.xslt $appliance-$build_date-$branch-vmware.ovf-orig > $appliance-$build_date-$branch-vmware.ovf
98+
tar -cf $appliance-$build_date-$branch-vmware.ova $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware-disk1.vmdk
99+
rm -f $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware.ovf-orig $appliance-$build_date-$branch-vmware-disk1.vmdk
96100
echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova"
97101

98102
# Export for HyperV
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<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">
3+
4+
<xsl:template match="node()|@*">
5+
<xsl:copy>
6+
<xsl:apply-templates select="node()|@*"/>
7+
</xsl:copy>
8+
</xsl:template>
9+
10+
<xsl:template match="vssd:VirtualSystemType/text()">vmx-06</xsl:template>
11+
12+
<xsl:template match="ovf:Item[./rasd:ResourceType/text()=20]">
13+
<ovf:Item>
14+
<xsl:copy-of select="rasd:Address"/>
15+
<xsl:copy-of select="rasd:BusNumber"/>
16+
<rasd:Caption>scsiController0</rasd:Caption>
17+
<rasd:Description>SCSI Controller</rasd:Description>
18+
<xsl:copy-of select="rasd:InstanceId"/>
19+
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
20+
<rasd:ResourceType>6</rasd:ResourceType>
21+
</ovf:Item>
22+
</xsl:template>
23+
24+
</xsl:stylesheet>

0 commit comments

Comments
 (0)