* [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file
@ 2021-12-14 16:17 Henning Schild
2021-12-14 16:17 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:17 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Instead of placing just one static template into a file coming via a
package, fetch that template file. That allows a choice in template
files, or any kind of modification in layers. Where people might not
find our template to be sufficient.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img.bbclass | 8 +++++---
.../vm-img}/vm-template.ovf.tmpl | 0
.../vm-template/vm-template_0.1.bb | 16 ----------------
3 files changed, 5 insertions(+), 19 deletions(-)
rename meta/{recipes-devtools/vm-template/files => classes/vm-img}/vm-template.ovf.tmpl (100%)
delete mode 100644 meta/recipes-devtools/vm-template/vm-template_0.1.bb
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index b230af247357..79f3b7e45e83 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -7,8 +7,10 @@
inherit buildchroot
inherit wic-img
-IMAGER_BUILD_DEPS += "vm-template"
-IMAGER_INSTALL += "qemu-utils gawk uuid-runtime vm-template"
+FILESPATH_prepend := "${LAYERDIR_core}/classes/vm-img:"
+SRC_URI += "file://vm-template.ovf.tmpl"
+
+IMAGER_INSTALL += "qemu-utils gawk uuid-runtime"
# virtual machine disk settings
SOURCE_IMAGE_FILE ?= "${IMAGE_FULLNAME}.wic.img"
@@ -100,7 +102,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat /usr/share/vm-template/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
# VirtualBox needs here a manifest file. VMware does accept that format.
diff --git a/meta/recipes-devtools/vm-template/files/vm-template.ovf.tmpl b/meta/classes/vm-img/vm-template.ovf.tmpl
similarity index 100%
rename from meta/recipes-devtools/vm-template/files/vm-template.ovf.tmpl
rename to meta/classes/vm-img/vm-template.ovf.tmpl
diff --git a/meta/recipes-devtools/vm-template/vm-template_0.1.bb b/meta/recipes-devtools/vm-template/vm-template_0.1.bb
deleted file mode 100644
index 1d474cd5d8d7..000000000000
--- a/meta/recipes-devtools/vm-template/vm-template_0.1.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-# This software is a part of ISAR.
-#
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-inherit dpkg-raw
-
-SRC_URI += "file://vm-template.ovf.tmpl"
-
-do_install() {
- TARGET=${D}/usr/share/vm-template
- install -m 0755 -d ${TARGET}
- install -m 0740 ${WORKDIR}/vm-template.ovf.tmpl \
- ${TARGET}/vm-template.ovf.tmpl
-}
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox
2021-12-14 16:17 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
@ 2021-12-14 16:17 ` Henning Schild
2021-12-14 16:18 ` [PATCH v2 3/7] vm-img: shorten code by using variables we have Henning Schild
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:17 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Both vmware and virtualbox have their own dialects of "ovf", there is no
common way to describe things. That combined template was trying by
mixing both dialects into one file. But the result caused parsing error
on recent vmware.
Instead of trying one size fits all, this patch introduces two
templates. Both derived from ovf exports done on recent version of
vmware and virtualbox. Because of the vmdk sub-format it was anyways not
possible to build one ova image that would work for both VMMs.
We also now set the uppercase version of OVA_FIRMWARE, which is needed
for virtualbox. Before it was called OVA_FIRMWARE_VIRTUALBOX but was not
set.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta-isar/conf/machine/vmware.conf | 2 +
meta/classes/vm-img.bbclass | 6 +-
...te.ovf.tmpl => vm-img-virtualbox.ovf.tmpl} | 132 +++++++-----------
meta/classes/vm-img/vm-img-vmware.ovf.tmpl | 127 +++++++++++++++++
4 files changed, 185 insertions(+), 82 deletions(-)
rename meta/classes/vm-img/{vm-template.ovf.tmpl => vm-img-virtualbox.ovf.tmpl} (54%)
create mode 100644 meta/classes/vm-img/vm-img-vmware.ovf.tmpl
diff --git a/meta-isar/conf/machine/vmware.conf b/meta-isar/conf/machine/vmware.conf
index 5832b29955b5..9bf1fd96c5cc 100644
--- a/meta-isar/conf/machine/vmware.conf
+++ b/meta-isar/conf/machine/vmware.conf
@@ -11,5 +11,7 @@ WKS_FILE ?= "sdimage-efi"
IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
+OVF_TEMPLATE_FILE ?= "vm-img-vmware.ovf.tmpl"
+
VMDK_SUBFORMAT = "streamOptimized"
IMAGE_FSTYPES ?= "vm-img"
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index 79f3b7e45e83..debdf3b2fdf8 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -8,7 +8,8 @@ inherit buildchroot
inherit wic-img
FILESPATH_prepend := "${LAYERDIR_core}/classes/vm-img:"
-SRC_URI += "file://vm-template.ovf.tmpl"
+OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
+SRC_URI += "file://${OVF_TEMPLATE_FILE}"
IMAGER_INSTALL += "qemu-utils gawk uuid-runtime"
@@ -93,6 +94,7 @@ do_create_ova() {
export SECONDARY_MAC=$(macgen)
export DISK_NAME=$(basename -s .vmdk ${VIRTUAL_MACHINE_DISK})
export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
+ export OVA_FIRMWARE_UPPERCASE=$(echo ${OVA_FIRMWARE} | tr '[a-z]' '[A-Z]')
image_do_mounts
@@ -102,7 +104,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat ${PP_WORK}/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/${OVF_TEMPLATE_FILE} | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
# VirtualBox needs here a manifest file. VMware does accept that format.
diff --git a/meta/classes/vm-img/vm-template.ovf.tmpl b/meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
similarity index 54%
rename from meta/classes/vm-img/vm-template.ovf.tmpl
rename to meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
index e6b53058c1c7..c9561a2c3e53 100644
--- a/meta/classes/vm-img/vm-template.ovf.tmpl
+++ b/meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Envelope ovf:version="1.0" xml:lang="en-US" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" 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">
<References>
- <File ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}" ovf:id="file1"/>
+ <File ovf:id="file1" ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}"/>
</References>
<DiskSection>
<Info>List of the virtual disks used in the package</Info>
@@ -29,7 +29,6 @@
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
</System>
<Item>
- <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Caption>${OVA_NUMBER_OF_CPU} virtual CPU</rasd:Caption>
<rasd:Description>Number of virtual CPUs</rasd:Description>
<rasd:ElementName>${OVA_NUMBER_OF_CPU} virtual CPU</rasd:ElementName>
@@ -64,92 +63,65 @@
<rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
- <Item>
- <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
- <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
- <rasd:Connection>NAT</rasd:Connection>
- <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
- <rasd:InstanceID>5</rasd:InstanceID>
- <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
- <rasd:ResourceType>10</rasd:ResourceType>
- </Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Caption>disk1</rasd:Caption>
<rasd:Description>Disk Image</rasd:Description>
<rasd:ElementName>disk1</rasd:ElementName>
<rasd:HostResource>/disk/vmdisk1</rasd:HostResource>
- <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:InstanceID>5</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</Item>
- <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="${OVA_FIRMWARE}"/>
- <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
- <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
- <vmw:ExtraConfig ovf:required="false" vmw:key="virtualHW.productCompatibility" vmw:value="hosted"/>
- </VirtualHardwareSection>
- <vbox:Machine ovf:required="false" version="1.12-linux" uuid="{${VM_UUID}}" name="${OVA_NAME}" OSType="Debian_64" snapshotFolder="Snapshots" lastStateChange="${LAST_CHANGE}">
- <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
- <Hardware>
- <CPU count="${OVA_NUMBER_OF_CPU}">
- <PAE enabled="true"/>
- <HardwareVirtExLargePages enabled="false"/>
- </CPU>
- <Memory RAMSize="${OVA_MEMORY}"/>
- <Firmware type="${OVA_FIRMWARE_VIRTUALBOX}"/>
- <Boot>
- <Order position="1" device="HardDisk"/>
- <Order position="2" device="None"/>
- <Order position="3" device="None"/>
- <Order position="4" device="None"/>
- </Boot>
- <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
- <VideoRecording enabled="false" file="Test.webm" horzRes="640" vertRes="480"/>
- <RemoteDisplay enabled="false" authType="Null"/>
- <BIOS>
- <IOAPIC enabled="${OVA_ACPI}"/>
- </BIOS>
- <USBController enabled="false" enabledEhci="false"/>
- <Network>
- <Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" speed="0" type="virtio">
- <DisabledModes/>
- <NAT>
- <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
- <Alias logging="false" proxy-only="false" use-same-ports="false"/>
- </NAT>
- </Adapter>
- </Network>
- <LPT>
- <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
- </LPT>
- <AudioAdapter driver="Pulse" enabled="false"/>
- <RTC localOrUTC="local"/>
- <SharedFolders/>
- <Clipboard mode="Disabled"/>
- <DragAndDrop mode="Disabled"/>
- <IO>
- <IoCache enabled="true" size="5"/>
- <BandwidthGroups/>
- </IO>
- <HostPci>
- <Devices/>
- </HostPci>
- <EmulatedUSB>
- <CardReader enabled="false"/>
- </EmulatedUSB>
- <Guest memoryBalloonSize="0"/>
- <GuestProperties/>
- </Hardware>
- <StorageControllers>
- <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
- <AttachedDevice type="HardDisk" port="0" device="0">
- <Image uuid="{${DISK_UUID}}"/>
- </AttachedDevice>
- </StorageController>
- </StorageControllers>
- </vbox:Machine>
+ <Item>
+ <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+ <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
+ <rasd:Connection>NAT</rasd:Connection>
+ <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
+ <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:ResourceType>10</rasd:ResourceType>
+ </Item>
+ </VirtualHardwareSection>
+ <vbox:Machine ovf:required="false" version="1.12-linux" uuid="{${VM_UUID}}" name="${OVA_NAME}" OSType="Debian_64" snapshotFolder="Snapshots" lastStateChange="${LAST_CHANGE}">
+ <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
+ <Hardware>
+ <CPU count="${OVA_NUMBER_OF_CPU}">
+ <PAE enabled="true"/>
+ <HardwareVirtExLargePages enabled="false"/>
+ </CPU>
+ <Memory RAMSize="${OVA_MEMORY}"/>
+ <Firmware type="${OVA_FIRMWARE_UPPERCASE}"/>
+ <Boot>
+ <Order position="1" device="HardDisk"/>
+ <Order position="2" device="None"/>
+ <Order position="3" device="None"/>
+ <Order position="4" device="None"/>
+ </Boot>
+ <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
+ <RemoteDisplay enabled="false"/>
+ <BIOS>
+ <IOAPIC enabled="${OVA_ACPI}"/>
+ </BIOS>
+ <USBController enabled="false" enabledEhci="false"/>
+ <Network>
+ <Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" type="virtio">
+ <NAT/>
+ </Adapter>
+ </Network>
+ <LPT>
+ <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
+ </LPT>
+ <AudioAdapter driver="Pulse" enabled="false"/>
+ <Clipboard/>
+ <GuestProperties/>
+ </Hardware>
+ <StorageControllers>
+ <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
+ <AttachedDevice type="HardDisk" port="0" device="0">
+ <Image uuid="{${DISK_UUID}}"/>
+ </AttachedDevice>
+ </StorageController>
+ </StorageControllers>
+ </vbox:Machine>
</VirtualSystem>
</Envelope>
diff --git a/meta/classes/vm-img/vm-img-vmware.ovf.tmpl b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
new file mode 100644
index 000000000000..5280f33509b4
--- /dev/null
+++ b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <References>
+ <File ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}" ovf:id="file1"/>
+ </References>
+ <DiskSection>
+ <Info>Virtual disk information</Info>
+ <Disk ovf:capacity="${DISK_SIZE_BYTES}" ovf:capacityAllocationUnits="byte" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#${VMDK_SUBFORMAT}"/>
+ </DiskSection>
+ <NetworkSection>
+ <Info>The list of logical networks</Info>
+ <Network ovf:name="nat">
+ <Description>The nat network</Description>
+ </Network>
+ </NetworkSection>
+ <VirtualSystem ovf:id="vm">
+ <Info>A virtual machine</Info>
+ <Name>${OVA_NAME}</Name>
+ <OperatingSystemSection ovf:id="1" vmw:osType="otherGuest">
+ <Info>The kind of installed guest operating system</Info>
+ </OperatingSystemSection>
+ <VirtualHardwareSection>
+ <Info>Virtual hardware requirements</Info>
+ <System>
+ <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
+ <vssd:InstanceID>0</vssd:InstanceID>
+ <vssd:VirtualSystemIdentifier>${OVA_NAME}</vssd:VirtualSystemIdentifier>
+ <vssd:VirtualSystemType>vmx-18</vssd:VirtualSystemType>
+ </System>
+ <Item>
+ <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
+ <rasd:Description>Number of Virtual CPUs</rasd:Description>
+ <rasd:ElementName>${OVA_NUMBER_OF_CPU} virtual CPU(s)</rasd:ElementName>
+ <rasd:InstanceID>1</rasd:InstanceID>
+ <rasd:ResourceType>3</rasd:ResourceType>
+ <rasd:VirtualQuantity>${OVA_NUMBER_OF_CPU}</rasd:VirtualQuantity>
+ </Item>
+ <Item>
+ <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
+ <rasd:Description>Memory Size</rasd:Description>
+ <rasd:ElementName>${OVA_MEMORY}MB of memory</rasd:ElementName>
+ <rasd:InstanceID>2</rasd:InstanceID>
+ <rasd:ResourceType>4</rasd:ResourceType>
+ <rasd:VirtualQuantity>${OVA_MEMORY}</rasd:VirtualQuantity>
+ </Item>
+ <Item>
+ <rasd:Address>0</rasd:Address>
+ <rasd:Description>IDE Controller</rasd:Description>
+ <rasd:ElementName>ideController0</rasd:ElementName>
+ <rasd:InstanceID>3</rasd:InstanceID>
+ <rasd:ResourceType>5</rasd:ResourceType>
+ </Item>
+ <Item>
+ <rasd:AddressOnParent>0</rasd:AddressOnParent>
+ <rasd:ElementName>disk0</rasd:ElementName>
+ <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
+ <rasd:InstanceID>4</rasd:InstanceID>
+ <rasd:Parent>3</rasd:Parent>
+ <rasd:ResourceType>17</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="connectable.allowGuestControl" vmw:value="false"/>
+ </Item>
+ <Item>
+ <rasd:AddressOnParent>1</rasd:AddressOnParent>
+ <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+ <rasd:Connection>nat</rasd:Connection>
+ <rasd:Description>E1000 ethernet adapter on "nat"</rasd:Description>
+ <rasd:ElementName>ethernet0</rasd:ElementName>
+ <rasd:InstanceID>5</rasd:InstanceID>
+ <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
+ <rasd:ResourceType>10</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="32"/>
+ <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="connectable.allowGuestControl" vmw:value="true"/>
+ </Item>
+ <Item ovf:required="false">
+ <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+ <rasd:ElementName>video</rasd:ElementName>
+ <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:ResourceType>24</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="262144"/>
+ </Item>
+ <Item ovf:required="false">
+ <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+ <rasd:ElementName>vmci</rasd:ElementName>
+ <rasd:InstanceID>7</rasd:InstanceID>
+ <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
+ <rasd:ResourceType>1</rasd:ResourceType>
+ </Item>
+ <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="${OVA_FIRMWARE}"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="cpuid.coresPerSocket" vmw:value="1"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="ethernet0.pciSlotNumber" vmw:value="32"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="monitor.phys_bits_used" vmw:value="45"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.cookie" vmw:value="40012"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.vcpu.maxPerVirtualNode" vmw:value="${OVA_NUMBER_OF_CPU}"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.pciSlotNumber" vmw:value="17"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.pciSlotNumber" vmw:value="21"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.pciSlotNumber" vmw:value="22"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.pciSlotNumber" vmw:value="23"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.pciSlotNumber" vmw:value="24"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="softPowerOff" vmw:value="FALSE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="svga.guestBackedPrimaryAware" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="virtualHW.productCompatibility" vmw:value="hosted"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmci0.pciSlotNumber" vmw:value="33"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.checkpointSVGAPrimarySize" vmw:value="268435456"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.svga.graphicsMemoryKB" vmw:value="262144"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.svga.mobMaxSize" vmw:value="268435456"/>
+ </VirtualHardwareSection>
+ </VirtualSystem>
+</Envelope>
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/7] vm-img: shorten code by using variables we have
2021-12-14 16:17 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-12-14 16:17 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
@ 2021-12-14 16:18 ` Henning Schild
2021-12-14 16:18 ` [PATCH v2 4/7] vm-img: drop not used variables Henning Schild
2021-12-14 16:18 ` [PATCH v2 5/7] vm-img: set vmware machine type to 64bit in our template Henning Schild
3 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:18 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
this is a purely cosmetic change making use of shorthands we have
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index debdf3b2fdf8..e94b6de2d799 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -37,10 +37,10 @@ CONVERSION_OPTIONS = "${@set_convert_options(d)}"
do_convert_wic() {
rm -f '${DEPLOY_DIR_IMAGE}/${VIRTUAL_MACHINE_IMAGE_FILE}'
image_do_mounts
- bbnote "Creating ${VIRTUAL_MACHINE_IMAGE_FILE} from ${WIC_IMAGE_FILE}"
+ bbnote "Creating ${VIRTUAL_MACHINE_IMAGE_FILE} from ${SOURCE_IMAGE_FILE}"
sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
/usr/bin/qemu-img convert -f raw -O ${VIRTUAL_MACHINE_IMAGE_TYPE} ${CONVERSION_OPTIONS} \
- '${PP_DEPLOY}/${SOURCE_IMAGE_FILE}' '${PP_DEPLOY}/${VIRTUAL_MACHINE_IMAGE_FILE}'
+ '${PP_DEPLOY}/${SOURCE_IMAGE_FILE}' '${VIRTUAL_MACHINE_DISK}'
}
addtask convert_wic before do_build after do_wic_image do_copy_boot_files do_install_imager_deps do_transform_template
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 4/7] vm-img: drop not used variables
2021-12-14 16:17 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-12-14 16:17 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
2021-12-14 16:18 ` [PATCH v2 3/7] vm-img: shorten code by using variables we have Henning Schild
@ 2021-12-14 16:18 ` Henning Schild
2021-12-14 16:18 ` [PATCH v2 5/7] vm-img: set vmware machine type to 64bit in our template Henning Schild
3 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:18 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
some variables are not used in the template we had before, nor in the
new templates, drop them
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img.bbclass | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index e94b6de2d799..db390769b29f 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -53,7 +53,6 @@ OVA_VRAM ?= "64"
OVA_FIRMWARE ?= "efi"
OVA_ACPI ?= "true"
OVA_3D_ACCEL ?= "false"
-OVA_CLIPBOARD ?= "bidirectional"
OVA_SHA_ALG = "1"
# Generate random MAC addresses just as VirtualBox does, the format is
@@ -65,7 +64,7 @@ macgen() {
}
OVA_VARS = "OVA_NAME OVA_MEMORY OVA_NUMBER_OF_CPU OVA_VRAM \
- OVA_FIRMWARE OVA_ACPI OVA_3D_ACCEL OVA_CLIPBOARD \
+ OVA_FIRMWARE OVA_ACPI OVA_3D_ACCEL \
OVA_SHA_ALG VIRTUAL_MACHINE_IMAGE_FILE"
# the ovf template is updated with ensubst
@@ -91,8 +90,6 @@ do_create_ova() {
rm -f '${DEPLOY_DIR_IMAGE}/${OVA_NAME}.mf'
export PRIMARY_MAC=$(macgen)
- export SECONDARY_MAC=$(macgen)
- export DISK_NAME=$(basename -s .vmdk ${VIRTUAL_MACHINE_DISK})
export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
export OVA_FIRMWARE_UPPERCASE=$(echo ${OVA_FIRMWARE} | tr '[a-z]' '[A-Z]')
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 5/7] vm-img: set vmware machine type to 64bit in our template
2021-12-14 16:17 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
` (2 preceding siblings ...)
2021-12-14 16:18 ` [PATCH v2 4/7] vm-img: drop not used variables Henning Schild
@ 2021-12-14 16:18 ` Henning Schild
3 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:18 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Tell vmware that it is dealing with a 64bit guest. Before that change an
efi image could not be booted because the 32bit uefi firmware would not
like a 64bit bootloader.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img/vm-img-vmware.ovf.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/vm-img/vm-img-vmware.ovf.tmpl b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
index 5280f33509b4..2883ce063f90 100644
--- a/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
+++ b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
@@ -16,7 +16,7 @@
<VirtualSystem ovf:id="vm">
<Info>A virtual machine</Info>
<Name>${OVA_NAME}</Name>
- <OperatingSystemSection ovf:id="1" vmw:osType="otherGuest">
+ <OperatingSystemSection ovf:id="102" vmw:osType="otherGuest64">
<Info>The kind of installed guest operating system</Info>
</OperatingSystemSection>
<VirtualHardwareSection>
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file
@ 2021-12-14 20:35 Henning Schild
2021-12-14 20:35 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
0 siblings, 1 reply; 7+ messages in thread
From: Henning Schild @ 2021-12-14 20:35 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Instead of placing just one static template into a file coming via a
package, fetch that template file. That allows a choice in template
files, or any kind of modification in layers. Where people might not
find our template to be sufficient.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img.bbclass | 8 +++++---
.../vm-img}/vm-template.ovf.tmpl | 0
.../vm-template/vm-template_0.1.bb | 16 ----------------
3 files changed, 5 insertions(+), 19 deletions(-)
rename meta/{recipes-devtools/vm-template/files => classes/vm-img}/vm-template.ovf.tmpl (100%)
delete mode 100644 meta/recipes-devtools/vm-template/vm-template_0.1.bb
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index b230af247357..79f3b7e45e83 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -7,8 +7,10 @@
inherit buildchroot
inherit wic-img
-IMAGER_BUILD_DEPS += "vm-template"
-IMAGER_INSTALL += "qemu-utils gawk uuid-runtime vm-template"
+FILESPATH_prepend := "${LAYERDIR_core}/classes/vm-img:"
+SRC_URI += "file://vm-template.ovf.tmpl"
+
+IMAGER_INSTALL += "qemu-utils gawk uuid-runtime"
# virtual machine disk settings
SOURCE_IMAGE_FILE ?= "${IMAGE_FULLNAME}.wic.img"
@@ -100,7 +102,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat /usr/share/vm-template/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
# VirtualBox needs here a manifest file. VMware does accept that format.
diff --git a/meta/recipes-devtools/vm-template/files/vm-template.ovf.tmpl b/meta/classes/vm-img/vm-template.ovf.tmpl
similarity index 100%
rename from meta/recipes-devtools/vm-template/files/vm-template.ovf.tmpl
rename to meta/classes/vm-img/vm-template.ovf.tmpl
diff --git a/meta/recipes-devtools/vm-template/vm-template_0.1.bb b/meta/recipes-devtools/vm-template/vm-template_0.1.bb
deleted file mode 100644
index 1d474cd5d8d7..000000000000
--- a/meta/recipes-devtools/vm-template/vm-template_0.1.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-# This software is a part of ISAR.
-#
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-inherit dpkg-raw
-
-SRC_URI += "file://vm-template.ovf.tmpl"
-
-do_install() {
- TARGET=${D}/usr/share/vm-template
- install -m 0755 -d ${TARGET}
- install -m 0740 ${WORKDIR}/vm-template.ovf.tmpl \
- ${TARGET}/vm-template.ovf.tmpl
-}
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox
2021-12-14 20:35 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
@ 2021-12-14 20:35 ` Henning Schild
0 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 20:35 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Both vmware and virtualbox have their own dialects of "ovf", there is no
common way to describe things. That combined template was trying by
mixing both dialects into one file. But the result caused parsing error
on recent vmware.
Instead of trying one size fits all, this patch introduces two
templates. Both derived from ovf exports done on recent version of
vmware and virtualbox. Because of the vmdk sub-format it was anyways not
possible to build one ova image that would work for both VMMs.
We also now set the uppercase version of OVA_FIRMWARE, which is needed
for virtualbox. Before it was called OVA_FIRMWARE_VIRTUALBOX but was not
set.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta-isar/conf/machine/vmware.conf | 2 +
meta/classes/vm-img.bbclass | 6 +-
...te.ovf.tmpl => vm-img-virtualbox.ovf.tmpl} | 132 +++++++-----------
meta/classes/vm-img/vm-img-vmware.ovf.tmpl | 127 +++++++++++++++++
4 files changed, 185 insertions(+), 82 deletions(-)
rename meta/classes/vm-img/{vm-template.ovf.tmpl => vm-img-virtualbox.ovf.tmpl} (54%)
create mode 100644 meta/classes/vm-img/vm-img-vmware.ovf.tmpl
diff --git a/meta-isar/conf/machine/vmware.conf b/meta-isar/conf/machine/vmware.conf
index 5832b29955b5..9bf1fd96c5cc 100644
--- a/meta-isar/conf/machine/vmware.conf
+++ b/meta-isar/conf/machine/vmware.conf
@@ -11,5 +11,7 @@ WKS_FILE ?= "sdimage-efi"
IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
+OVF_TEMPLATE_FILE ?= "vm-img-vmware.ovf.tmpl"
+
VMDK_SUBFORMAT = "streamOptimized"
IMAGE_FSTYPES ?= "vm-img"
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index 79f3b7e45e83..debdf3b2fdf8 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -8,7 +8,8 @@ inherit buildchroot
inherit wic-img
FILESPATH_prepend := "${LAYERDIR_core}/classes/vm-img:"
-SRC_URI += "file://vm-template.ovf.tmpl"
+OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
+SRC_URI += "file://${OVF_TEMPLATE_FILE}"
IMAGER_INSTALL += "qemu-utils gawk uuid-runtime"
@@ -93,6 +94,7 @@ do_create_ova() {
export SECONDARY_MAC=$(macgen)
export DISK_NAME=$(basename -s .vmdk ${VIRTUAL_MACHINE_DISK})
export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
+ export OVA_FIRMWARE_UPPERCASE=$(echo ${OVA_FIRMWARE} | tr '[a-z]' '[A-Z]')
image_do_mounts
@@ -102,7 +104,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat ${PP_WORK}/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/${OVF_TEMPLATE_FILE} | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
# VirtualBox needs here a manifest file. VMware does accept that format.
diff --git a/meta/classes/vm-img/vm-template.ovf.tmpl b/meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
similarity index 54%
rename from meta/classes/vm-img/vm-template.ovf.tmpl
rename to meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
index e6b53058c1c7..c9561a2c3e53 100644
--- a/meta/classes/vm-img/vm-template.ovf.tmpl
+++ b/meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Envelope ovf:version="1.0" xml:lang="en-US" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" 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">
<References>
- <File ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}" ovf:id="file1"/>
+ <File ovf:id="file1" ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}"/>
</References>
<DiskSection>
<Info>List of the virtual disks used in the package</Info>
@@ -29,7 +29,6 @@
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
</System>
<Item>
- <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Caption>${OVA_NUMBER_OF_CPU} virtual CPU</rasd:Caption>
<rasd:Description>Number of virtual CPUs</rasd:Description>
<rasd:ElementName>${OVA_NUMBER_OF_CPU} virtual CPU</rasd:ElementName>
@@ -64,92 +63,65 @@
<rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
- <Item>
- <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
- <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
- <rasd:Connection>NAT</rasd:Connection>
- <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
- <rasd:InstanceID>5</rasd:InstanceID>
- <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
- <rasd:ResourceType>10</rasd:ResourceType>
- </Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Caption>disk1</rasd:Caption>
<rasd:Description>Disk Image</rasd:Description>
<rasd:ElementName>disk1</rasd:ElementName>
<rasd:HostResource>/disk/vmdisk1</rasd:HostResource>
- <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:InstanceID>5</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</Item>
- <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="${OVA_FIRMWARE}"/>
- <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
- <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
- <vmw:ExtraConfig ovf:required="false" vmw:key="virtualHW.productCompatibility" vmw:value="hosted"/>
- </VirtualHardwareSection>
- <vbox:Machine ovf:required="false" version="1.12-linux" uuid="{${VM_UUID}}" name="${OVA_NAME}" OSType="Debian_64" snapshotFolder="Snapshots" lastStateChange="${LAST_CHANGE}">
- <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
- <Hardware>
- <CPU count="${OVA_NUMBER_OF_CPU}">
- <PAE enabled="true"/>
- <HardwareVirtExLargePages enabled="false"/>
- </CPU>
- <Memory RAMSize="${OVA_MEMORY}"/>
- <Firmware type="${OVA_FIRMWARE_VIRTUALBOX}"/>
- <Boot>
- <Order position="1" device="HardDisk"/>
- <Order position="2" device="None"/>
- <Order position="3" device="None"/>
- <Order position="4" device="None"/>
- </Boot>
- <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
- <VideoRecording enabled="false" file="Test.webm" horzRes="640" vertRes="480"/>
- <RemoteDisplay enabled="false" authType="Null"/>
- <BIOS>
- <IOAPIC enabled="${OVA_ACPI}"/>
- </BIOS>
- <USBController enabled="false" enabledEhci="false"/>
- <Network>
- <Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" speed="0" type="virtio">
- <DisabledModes/>
- <NAT>
- <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
- <Alias logging="false" proxy-only="false" use-same-ports="false"/>
- </NAT>
- </Adapter>
- </Network>
- <LPT>
- <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
- </LPT>
- <AudioAdapter driver="Pulse" enabled="false"/>
- <RTC localOrUTC="local"/>
- <SharedFolders/>
- <Clipboard mode="Disabled"/>
- <DragAndDrop mode="Disabled"/>
- <IO>
- <IoCache enabled="true" size="5"/>
- <BandwidthGroups/>
- </IO>
- <HostPci>
- <Devices/>
- </HostPci>
- <EmulatedUSB>
- <CardReader enabled="false"/>
- </EmulatedUSB>
- <Guest memoryBalloonSize="0"/>
- <GuestProperties/>
- </Hardware>
- <StorageControllers>
- <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
- <AttachedDevice type="HardDisk" port="0" device="0">
- <Image uuid="{${DISK_UUID}}"/>
- </AttachedDevice>
- </StorageController>
- </StorageControllers>
- </vbox:Machine>
+ <Item>
+ <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+ <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
+ <rasd:Connection>NAT</rasd:Connection>
+ <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
+ <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:ResourceType>10</rasd:ResourceType>
+ </Item>
+ </VirtualHardwareSection>
+ <vbox:Machine ovf:required="false" version="1.12-linux" uuid="{${VM_UUID}}" name="${OVA_NAME}" OSType="Debian_64" snapshotFolder="Snapshots" lastStateChange="${LAST_CHANGE}">
+ <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
+ <Hardware>
+ <CPU count="${OVA_NUMBER_OF_CPU}">
+ <PAE enabled="true"/>
+ <HardwareVirtExLargePages enabled="false"/>
+ </CPU>
+ <Memory RAMSize="${OVA_MEMORY}"/>
+ <Firmware type="${OVA_FIRMWARE_UPPERCASE}"/>
+ <Boot>
+ <Order position="1" device="HardDisk"/>
+ <Order position="2" device="None"/>
+ <Order position="3" device="None"/>
+ <Order position="4" device="None"/>
+ </Boot>
+ <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
+ <RemoteDisplay enabled="false"/>
+ <BIOS>
+ <IOAPIC enabled="${OVA_ACPI}"/>
+ </BIOS>
+ <USBController enabled="false" enabledEhci="false"/>
+ <Network>
+ <Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" type="virtio">
+ <NAT/>
+ </Adapter>
+ </Network>
+ <LPT>
+ <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
+ </LPT>
+ <AudioAdapter driver="Pulse" enabled="false"/>
+ <Clipboard/>
+ <GuestProperties/>
+ </Hardware>
+ <StorageControllers>
+ <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
+ <AttachedDevice type="HardDisk" port="0" device="0">
+ <Image uuid="{${DISK_UUID}}"/>
+ </AttachedDevice>
+ </StorageController>
+ </StorageControllers>
+ </vbox:Machine>
</VirtualSystem>
</Envelope>
diff --git a/meta/classes/vm-img/vm-img-vmware.ovf.tmpl b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
new file mode 100644
index 000000000000..5280f33509b4
--- /dev/null
+++ b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <References>
+ <File ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}" ovf:id="file1"/>
+ </References>
+ <DiskSection>
+ <Info>Virtual disk information</Info>
+ <Disk ovf:capacity="${DISK_SIZE_BYTES}" ovf:capacityAllocationUnits="byte" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#${VMDK_SUBFORMAT}"/>
+ </DiskSection>
+ <NetworkSection>
+ <Info>The list of logical networks</Info>
+ <Network ovf:name="nat">
+ <Description>The nat network</Description>
+ </Network>
+ </NetworkSection>
+ <VirtualSystem ovf:id="vm">
+ <Info>A virtual machine</Info>
+ <Name>${OVA_NAME}</Name>
+ <OperatingSystemSection ovf:id="1" vmw:osType="otherGuest">
+ <Info>The kind of installed guest operating system</Info>
+ </OperatingSystemSection>
+ <VirtualHardwareSection>
+ <Info>Virtual hardware requirements</Info>
+ <System>
+ <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
+ <vssd:InstanceID>0</vssd:InstanceID>
+ <vssd:VirtualSystemIdentifier>${OVA_NAME}</vssd:VirtualSystemIdentifier>
+ <vssd:VirtualSystemType>vmx-18</vssd:VirtualSystemType>
+ </System>
+ <Item>
+ <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
+ <rasd:Description>Number of Virtual CPUs</rasd:Description>
+ <rasd:ElementName>${OVA_NUMBER_OF_CPU} virtual CPU(s)</rasd:ElementName>
+ <rasd:InstanceID>1</rasd:InstanceID>
+ <rasd:ResourceType>3</rasd:ResourceType>
+ <rasd:VirtualQuantity>${OVA_NUMBER_OF_CPU}</rasd:VirtualQuantity>
+ </Item>
+ <Item>
+ <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
+ <rasd:Description>Memory Size</rasd:Description>
+ <rasd:ElementName>${OVA_MEMORY}MB of memory</rasd:ElementName>
+ <rasd:InstanceID>2</rasd:InstanceID>
+ <rasd:ResourceType>4</rasd:ResourceType>
+ <rasd:VirtualQuantity>${OVA_MEMORY}</rasd:VirtualQuantity>
+ </Item>
+ <Item>
+ <rasd:Address>0</rasd:Address>
+ <rasd:Description>IDE Controller</rasd:Description>
+ <rasd:ElementName>ideController0</rasd:ElementName>
+ <rasd:InstanceID>3</rasd:InstanceID>
+ <rasd:ResourceType>5</rasd:ResourceType>
+ </Item>
+ <Item>
+ <rasd:AddressOnParent>0</rasd:AddressOnParent>
+ <rasd:ElementName>disk0</rasd:ElementName>
+ <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
+ <rasd:InstanceID>4</rasd:InstanceID>
+ <rasd:Parent>3</rasd:Parent>
+ <rasd:ResourceType>17</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="connectable.allowGuestControl" vmw:value="false"/>
+ </Item>
+ <Item>
+ <rasd:AddressOnParent>1</rasd:AddressOnParent>
+ <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+ <rasd:Connection>nat</rasd:Connection>
+ <rasd:Description>E1000 ethernet adapter on "nat"</rasd:Description>
+ <rasd:ElementName>ethernet0</rasd:ElementName>
+ <rasd:InstanceID>5</rasd:InstanceID>
+ <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
+ <rasd:ResourceType>10</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="32"/>
+ <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="connectable.allowGuestControl" vmw:value="true"/>
+ </Item>
+ <Item ovf:required="false">
+ <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+ <rasd:ElementName>video</rasd:ElementName>
+ <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:ResourceType>24</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="262144"/>
+ </Item>
+ <Item ovf:required="false">
+ <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+ <rasd:ElementName>vmci</rasd:ElementName>
+ <rasd:InstanceID>7</rasd:InstanceID>
+ <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
+ <rasd:ResourceType>1</rasd:ResourceType>
+ </Item>
+ <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="${OVA_FIRMWARE}"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="cpuid.coresPerSocket" vmw:value="1"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="ethernet0.pciSlotNumber" vmw:value="32"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="monitor.phys_bits_used" vmw:value="45"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.cookie" vmw:value="40012"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.vcpu.maxPerVirtualNode" vmw:value="${OVA_NUMBER_OF_CPU}"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.pciSlotNumber" vmw:value="17"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.pciSlotNumber" vmw:value="21"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.pciSlotNumber" vmw:value="22"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.pciSlotNumber" vmw:value="23"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.pciSlotNumber" vmw:value="24"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="softPowerOff" vmw:value="FALSE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="svga.guestBackedPrimaryAware" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="virtualHW.productCompatibility" vmw:value="hosted"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmci0.pciSlotNumber" vmw:value="33"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.checkpointSVGAPrimarySize" vmw:value="268435456"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.svga.graphicsMemoryKB" vmw:value="262144"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.svga.mobMaxSize" vmw:value="268435456"/>
+ </VirtualHardwareSection>
+ </VirtualSystem>
+</Envelope>
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file
@ 2021-12-14 16:10 Henning Schild
2021-12-14 16:10 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
0 siblings, 1 reply; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:10 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Instead of placing just one static template into a file coming via a
package, fetch that template file. That allows a choice in template
files, or any kind of modification in layers. Where people might not
find our template to be sufficient.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img.bbclass | 8 +++++---
.../vm-img}/vm-template.ovf.tmpl | 0
.../vm-template/vm-template_0.1.bb | 16 ----------------
3 files changed, 5 insertions(+), 19 deletions(-)
rename meta/{recipes-devtools/vm-template/files => classes/vm-img}/vm-template.ovf.tmpl (100%)
delete mode 100644 meta/recipes-devtools/vm-template/vm-template_0.1.bb
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index b230af247357..79f3b7e45e83 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -7,8 +7,10 @@
inherit buildchroot
inherit wic-img
-IMAGER_BUILD_DEPS += "vm-template"
-IMAGER_INSTALL += "qemu-utils gawk uuid-runtime vm-template"
+FILESPATH_prepend := "${LAYERDIR_core}/classes/vm-img:"
+SRC_URI += "file://vm-template.ovf.tmpl"
+
+IMAGER_INSTALL += "qemu-utils gawk uuid-runtime"
# virtual machine disk settings
SOURCE_IMAGE_FILE ?= "${IMAGE_FULLNAME}.wic.img"
@@ -100,7 +102,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat /usr/share/vm-template/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
# VirtualBox needs here a manifest file. VMware does accept that format.
diff --git a/meta/recipes-devtools/vm-template/files/vm-template.ovf.tmpl b/meta/classes/vm-img/vm-template.ovf.tmpl
similarity index 100%
rename from meta/recipes-devtools/vm-template/files/vm-template.ovf.tmpl
rename to meta/classes/vm-img/vm-template.ovf.tmpl
diff --git a/meta/recipes-devtools/vm-template/vm-template_0.1.bb b/meta/recipes-devtools/vm-template/vm-template_0.1.bb
deleted file mode 100644
index 1d474cd5d8d7..000000000000
--- a/meta/recipes-devtools/vm-template/vm-template_0.1.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-# This software is a part of ISAR.
-#
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-inherit dpkg-raw
-
-SRC_URI += "file://vm-template.ovf.tmpl"
-
-do_install() {
- TARGET=${D}/usr/share/vm-template
- install -m 0755 -d ${TARGET}
- install -m 0740 ${WORKDIR}/vm-template.ovf.tmpl \
- ${TARGET}/vm-template.ovf.tmpl
-}
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox
2021-12-14 16:10 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
@ 2021-12-14 16:10 ` Henning Schild
0 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2021-12-14 16:10 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Both vmware and virtualbox have their own dialects of "ovf", there is no
common way to describe things. That combined template was trying by
mixing both dialects into one file. But the result caused parsing error
on recent vmware.
Instead of trying one size fits all, this patch introduces two
templates. Both derived from ovf exports done on recent version of
vmware and virtualbox. Because of the vmdk sub-format it was anyways not
possible to build one ova image that would work for both VMMs.
We also now set the uppercase version of OVA_FIRMWARE, which is needed
for virtualbox. Before it was called OVA_FIRMWARE_VIRTUALBOX but was not
set.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta-isar/conf/machine/vmware.conf | 2 +
meta/classes/vm-img.bbclass | 6 +-
...te.ovf.tmpl => vm-img-virtualbox.ovf.tmpl} | 132 +++++++-----------
meta/classes/vm-img/vm-img-vmware.ovf.tmpl | 127 +++++++++++++++++
4 files changed, 185 insertions(+), 82 deletions(-)
rename meta/classes/vm-img/{vm-template.ovf.tmpl => vm-img-virtualbox.ovf.tmpl} (54%)
create mode 100644 meta/classes/vm-img/vm-img-vmware.ovf.tmpl
diff --git a/meta-isar/conf/machine/vmware.conf b/meta-isar/conf/machine/vmware.conf
index 5832b29955b5..9bf1fd96c5cc 100644
--- a/meta-isar/conf/machine/vmware.conf
+++ b/meta-isar/conf/machine/vmware.conf
@@ -11,5 +11,7 @@ WKS_FILE ?= "sdimage-efi"
IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
+OVF_TEMPLATE_FILE ?= "vm-img-vmware.ovf.tmpl"
+
VMDK_SUBFORMAT = "streamOptimized"
IMAGE_FSTYPES ?= "vm-img"
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index 79f3b7e45e83..debdf3b2fdf8 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -8,7 +8,8 @@ inherit buildchroot
inherit wic-img
FILESPATH_prepend := "${LAYERDIR_core}/classes/vm-img:"
-SRC_URI += "file://vm-template.ovf.tmpl"
+OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl"
+SRC_URI += "file://${OVF_TEMPLATE_FILE}"
IMAGER_INSTALL += "qemu-utils gawk uuid-runtime"
@@ -93,6 +94,7 @@ do_create_ova() {
export SECONDARY_MAC=$(macgen)
export DISK_NAME=$(basename -s .vmdk ${VIRTUAL_MACHINE_DISK})
export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
+ export OVA_FIRMWARE_UPPERCASE=$(echo ${OVA_FIRMWARE} | tr '[a-z]' '[A-Z]')
image_do_mounts
@@ -102,7 +104,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat ${PP_WORK}/vm-template.ovf.tmpl | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/${OVF_TEMPLATE_FILE} | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
# VirtualBox needs here a manifest file. VMware does accept that format.
diff --git a/meta/classes/vm-img/vm-template.ovf.tmpl b/meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
similarity index 54%
rename from meta/classes/vm-img/vm-template.ovf.tmpl
rename to meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
index e6b53058c1c7..c9561a2c3e53 100644
--- a/meta/classes/vm-img/vm-template.ovf.tmpl
+++ b/meta/classes/vm-img/vm-img-virtualbox.ovf.tmpl
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Envelope ovf:version="1.0" xml:lang="en-US" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" 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">
<References>
- <File ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}" ovf:id="file1"/>
+ <File ovf:id="file1" ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}"/>
</References>
<DiskSection>
<Info>List of the virtual disks used in the package</Info>
@@ -29,7 +29,6 @@
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
</System>
<Item>
- <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Caption>${OVA_NUMBER_OF_CPU} virtual CPU</rasd:Caption>
<rasd:Description>Number of virtual CPUs</rasd:Description>
<rasd:ElementName>${OVA_NUMBER_OF_CPU} virtual CPU</rasd:ElementName>
@@ -64,92 +63,65 @@
<rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
- <Item>
- <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
- <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
- <rasd:Connection>NAT</rasd:Connection>
- <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
- <rasd:InstanceID>5</rasd:InstanceID>
- <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
- <rasd:ResourceType>10</rasd:ResourceType>
- </Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Caption>disk1</rasd:Caption>
<rasd:Description>Disk Image</rasd:Description>
<rasd:ElementName>disk1</rasd:ElementName>
<rasd:HostResource>/disk/vmdisk1</rasd:HostResource>
- <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:InstanceID>5</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</Item>
- <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="${OVA_FIRMWARE}"/>
- <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
- <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
- <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
- <vmw:ExtraConfig ovf:required="false" vmw:key="virtualHW.productCompatibility" vmw:value="hosted"/>
- </VirtualHardwareSection>
- <vbox:Machine ovf:required="false" version="1.12-linux" uuid="{${VM_UUID}}" name="${OVA_NAME}" OSType="Debian_64" snapshotFolder="Snapshots" lastStateChange="${LAST_CHANGE}">
- <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
- <Hardware>
- <CPU count="${OVA_NUMBER_OF_CPU}">
- <PAE enabled="true"/>
- <HardwareVirtExLargePages enabled="false"/>
- </CPU>
- <Memory RAMSize="${OVA_MEMORY}"/>
- <Firmware type="${OVA_FIRMWARE_VIRTUALBOX}"/>
- <Boot>
- <Order position="1" device="HardDisk"/>
- <Order position="2" device="None"/>
- <Order position="3" device="None"/>
- <Order position="4" device="None"/>
- </Boot>
- <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
- <VideoRecording enabled="false" file="Test.webm" horzRes="640" vertRes="480"/>
- <RemoteDisplay enabled="false" authType="Null"/>
- <BIOS>
- <IOAPIC enabled="${OVA_ACPI}"/>
- </BIOS>
- <USBController enabled="false" enabledEhci="false"/>
- <Network>
- <Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" speed="0" type="virtio">
- <DisabledModes/>
- <NAT>
- <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
- <Alias logging="false" proxy-only="false" use-same-ports="false"/>
- </NAT>
- </Adapter>
- </Network>
- <LPT>
- <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
- </LPT>
- <AudioAdapter driver="Pulse" enabled="false"/>
- <RTC localOrUTC="local"/>
- <SharedFolders/>
- <Clipboard mode="Disabled"/>
- <DragAndDrop mode="Disabled"/>
- <IO>
- <IoCache enabled="true" size="5"/>
- <BandwidthGroups/>
- </IO>
- <HostPci>
- <Devices/>
- </HostPci>
- <EmulatedUSB>
- <CardReader enabled="false"/>
- </EmulatedUSB>
- <Guest memoryBalloonSize="0"/>
- <GuestProperties/>
- </Hardware>
- <StorageControllers>
- <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
- <AttachedDevice type="HardDisk" port="0" device="0">
- <Image uuid="{${DISK_UUID}}"/>
- </AttachedDevice>
- </StorageController>
- </StorageControllers>
- </vbox:Machine>
+ <Item>
+ <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+ <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
+ <rasd:Connection>NAT</rasd:Connection>
+ <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
+ <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:ResourceType>10</rasd:ResourceType>
+ </Item>
+ </VirtualHardwareSection>
+ <vbox:Machine ovf:required="false" version="1.12-linux" uuid="{${VM_UUID}}" name="${OVA_NAME}" OSType="Debian_64" snapshotFolder="Snapshots" lastStateChange="${LAST_CHANGE}">
+ <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
+ <Hardware>
+ <CPU count="${OVA_NUMBER_OF_CPU}">
+ <PAE enabled="true"/>
+ <HardwareVirtExLargePages enabled="false"/>
+ </CPU>
+ <Memory RAMSize="${OVA_MEMORY}"/>
+ <Firmware type="${OVA_FIRMWARE_UPPERCASE}"/>
+ <Boot>
+ <Order position="1" device="HardDisk"/>
+ <Order position="2" device="None"/>
+ <Order position="3" device="None"/>
+ <Order position="4" device="None"/>
+ </Boot>
+ <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
+ <RemoteDisplay enabled="false"/>
+ <BIOS>
+ <IOAPIC enabled="${OVA_ACPI}"/>
+ </BIOS>
+ <USBController enabled="false" enabledEhci="false"/>
+ <Network>
+ <Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" type="virtio">
+ <NAT/>
+ </Adapter>
+ </Network>
+ <LPT>
+ <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
+ </LPT>
+ <AudioAdapter driver="Pulse" enabled="false"/>
+ <Clipboard/>
+ <GuestProperties/>
+ </Hardware>
+ <StorageControllers>
+ <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
+ <AttachedDevice type="HardDisk" port="0" device="0">
+ <Image uuid="{${DISK_UUID}}"/>
+ </AttachedDevice>
+ </StorageController>
+ </StorageControllers>
+ </vbox:Machine>
</VirtualSystem>
</Envelope>
diff --git a/meta/classes/vm-img/vm-img-vmware.ovf.tmpl b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
new file mode 100644
index 000000000000..5280f33509b4
--- /dev/null
+++ b/meta/classes/vm-img/vm-img-vmware.ovf.tmpl
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <References>
+ <File ovf:href="${VIRTUAL_MACHINE_IMAGE_FILE}" ovf:id="file1"/>
+ </References>
+ <DiskSection>
+ <Info>Virtual disk information</Info>
+ <Disk ovf:capacity="${DISK_SIZE_BYTES}" ovf:capacityAllocationUnits="byte" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#${VMDK_SUBFORMAT}"/>
+ </DiskSection>
+ <NetworkSection>
+ <Info>The list of logical networks</Info>
+ <Network ovf:name="nat">
+ <Description>The nat network</Description>
+ </Network>
+ </NetworkSection>
+ <VirtualSystem ovf:id="vm">
+ <Info>A virtual machine</Info>
+ <Name>${OVA_NAME}</Name>
+ <OperatingSystemSection ovf:id="1" vmw:osType="otherGuest">
+ <Info>The kind of installed guest operating system</Info>
+ </OperatingSystemSection>
+ <VirtualHardwareSection>
+ <Info>Virtual hardware requirements</Info>
+ <System>
+ <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
+ <vssd:InstanceID>0</vssd:InstanceID>
+ <vssd:VirtualSystemIdentifier>${OVA_NAME}</vssd:VirtualSystemIdentifier>
+ <vssd:VirtualSystemType>vmx-18</vssd:VirtualSystemType>
+ </System>
+ <Item>
+ <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
+ <rasd:Description>Number of Virtual CPUs</rasd:Description>
+ <rasd:ElementName>${OVA_NUMBER_OF_CPU} virtual CPU(s)</rasd:ElementName>
+ <rasd:InstanceID>1</rasd:InstanceID>
+ <rasd:ResourceType>3</rasd:ResourceType>
+ <rasd:VirtualQuantity>${OVA_NUMBER_OF_CPU}</rasd:VirtualQuantity>
+ </Item>
+ <Item>
+ <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
+ <rasd:Description>Memory Size</rasd:Description>
+ <rasd:ElementName>${OVA_MEMORY}MB of memory</rasd:ElementName>
+ <rasd:InstanceID>2</rasd:InstanceID>
+ <rasd:ResourceType>4</rasd:ResourceType>
+ <rasd:VirtualQuantity>${OVA_MEMORY}</rasd:VirtualQuantity>
+ </Item>
+ <Item>
+ <rasd:Address>0</rasd:Address>
+ <rasd:Description>IDE Controller</rasd:Description>
+ <rasd:ElementName>ideController0</rasd:ElementName>
+ <rasd:InstanceID>3</rasd:InstanceID>
+ <rasd:ResourceType>5</rasd:ResourceType>
+ </Item>
+ <Item>
+ <rasd:AddressOnParent>0</rasd:AddressOnParent>
+ <rasd:ElementName>disk0</rasd:ElementName>
+ <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
+ <rasd:InstanceID>4</rasd:InstanceID>
+ <rasd:Parent>3</rasd:Parent>
+ <rasd:ResourceType>17</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="connectable.allowGuestControl" vmw:value="false"/>
+ </Item>
+ <Item>
+ <rasd:AddressOnParent>1</rasd:AddressOnParent>
+ <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+ <rasd:Connection>nat</rasd:Connection>
+ <rasd:Description>E1000 ethernet adapter on "nat"</rasd:Description>
+ <rasd:ElementName>ethernet0</rasd:ElementName>
+ <rasd:InstanceID>5</rasd:InstanceID>
+ <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
+ <rasd:ResourceType>10</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="32"/>
+ <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="connectable.allowGuestControl" vmw:value="true"/>
+ </Item>
+ <Item ovf:required="false">
+ <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+ <rasd:ElementName>video</rasd:ElementName>
+ <rasd:InstanceID>6</rasd:InstanceID>
+ <rasd:ResourceType>24</rasd:ResourceType>
+ <vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="262144"/>
+ </Item>
+ <Item ovf:required="false">
+ <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+ <rasd:ElementName>vmci</rasd:ElementName>
+ <rasd:InstanceID>7</rasd:InstanceID>
+ <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
+ <rasd:ResourceType>1</rasd:ResourceType>
+ </Item>
+ <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="${OVA_FIRMWARE}"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
+ <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="cpuid.coresPerSocket" vmw:value="1"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="ethernet0.pciSlotNumber" vmw:value="32"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="monitor.phys_bits_used" vmw:value="45"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.cookie" vmw:value="40012"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="numa.autosize.vcpu.maxPerVirtualNode" vmw:value="${OVA_NUMBER_OF_CPU}"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.pciSlotNumber" vmw:value="17"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge0.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.pciSlotNumber" vmw:value="21"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge4.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.pciSlotNumber" vmw:value="22"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge5.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.pciSlotNumber" vmw:value="23"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge6.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.functions" vmw:value="8"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.pciSlotNumber" vmw:value="24"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.present" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="pciBridge7.virtualDev" vmw:value="pcieRootPort"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="softPowerOff" vmw:value="FALSE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="svga.guestBackedPrimaryAware" vmw:value="TRUE"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="virtualHW.productCompatibility" vmw:value="hosted"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmci0.pciSlotNumber" vmw:value="33"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.checkpointSVGAPrimarySize" vmw:value="268435456"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.svga.graphicsMemoryKB" vmw:value="262144"/>
+ <vmw:ExtraConfig ovf:required="false" vmw:key="vmotion.svga.mobMaxSize" vmw:value="268435456"/>
+ </VirtualHardwareSection>
+ </VirtualSystem>
+</Envelope>
--
2.32.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-12-14 20:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 16:17 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-12-14 16:17 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
2021-12-14 16:18 ` [PATCH v2 3/7] vm-img: shorten code by using variables we have Henning Schild
2021-12-14 16:18 ` [PATCH v2 4/7] vm-img: drop not used variables Henning Schild
2021-12-14 16:18 ` [PATCH v2 5/7] vm-img: set vmware machine type to 64bit in our template Henning Schild
-- strict thread matches above, loose matches on Subject: below --
2021-12-14 20:35 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-12-14 20:35 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
2021-12-14 16:10 [PATCH v2 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-12-14 16:10 ` [PATCH v2 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox