* [PATCH 0/7] vm-img improvements and fixes
@ 2021-09-22 14:11 Henning Schild
2021-09-22 14:11 ` [PATCH 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, Henning Schild
The vm-img support we currently have is a bit broken in various aspects.
Most prominently the resulting ova files are accepted by vmware only
with warnings. And UEFI booting did not really work in virtualbox or
vmware.
This series makes the template for the appliance a file one can override
with a custom template. Which should allow close to any special
configuration that the VMMs can express in their respective ovf
dialects. It further makes changes to the templates we ship with isar to
hopefully give people a decent baseline so they will not even need
custom templates. And there is some code cleanup to the vm-img class.
Henning Schild (7):
vm-img: move template out of package into SRC_URI file
vm-img: use two different ovf templates for vmware/virtualbox
vm-img: shorten code by using variables we have
vm-img: drop not used variables
vm-img: set vmware machine type to 64bit in our template
vm-img: make use of isars template class for most of the tmpl
variables
meta-isar: switch virtualbox test from buster to bullseye
meta-isar/conf/local.conf.sample | 2 +-
meta-isar/conf/machine/vmware.conf | 2 +
...a-buster.conf => virtualbox-bullseye.conf} | 2 +-
meta/classes/vm-img.bbclass | 35 ++---
.../vm-img/vm-img-virtualbox.ovf.tmpl} | 132 +++++++-----------
meta/classes/vm-img/vm-img-vmware.ovf.tmpl | 127 +++++++++++++++++
.../vm-template/vm-template_0.1.bb | 16 ---
scripts/ci_build.sh | 2 +-
8 files changed, 197 insertions(+), 121 deletions(-)
rename meta-isar/conf/multiconfig/{virtualbox-ova-buster.conf => virtualbox-bullseye.conf} (77%)
rename meta/{recipes-devtools/vm-template/files/vm-template.ovf.tmpl => classes/vm-img/vm-img-virtualbox.ovf.tmpl} (54%)
create mode 100644 meta/classes/vm-img/vm-img-vmware.ovf.tmpl
delete mode 100644 meta/recipes-devtools/vm-template/vm-template_0.1.bb
--
2.32.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/7] vm-img: move template out of package into SRC_URI file
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-10-06 14:08 ` Henning Schild
2021-09-22 14:11 ` [PATCH 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
` (7 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, 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] 12+ messages in thread
* [PATCH 2/7] vm-img: use two different ovf templates for vmware/virtualbox
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
2021-09-22 14:11 ` [PATCH 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-09-22 14:11 ` [PATCH 3/7] vm-img: shorten code by using variables we have Henning Schild
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, 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 731559e78d3b..56035530e007 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_TYPE ?= "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] 12+ messages in thread
* [PATCH 3/7] vm-img: shorten code by using variables we have
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
2021-09-22 14:11 ` [PATCH 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-09-22 14:11 ` [PATCH 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-09-22 14:11 ` [PATCH 4/7] vm-img: drop not used variables Henning Schild
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, 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] 12+ messages in thread
* [PATCH 4/7] vm-img: drop not used variables
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
` (2 preceding siblings ...)
2021-09-22 14:11 ` [PATCH 3/7] vm-img: shorten code by using variables we have Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-09-22 14:11 ` [PATCH 5/7] vm-img: set vmware machine type to 64bit in our template Henning Schild
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, 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] 12+ messages in thread
* [PATCH 5/7] vm-img: set vmware machine type to 64bit in our template
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
` (3 preceding siblings ...)
2021-09-22 14:11 ` [PATCH 4/7] vm-img: drop not used variables Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-09-22 14:11 ` [PATCH 6/7] vm-img: make use of isars template class for most of the tmpl variables Henning Schild
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, 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] 12+ messages in thread
* [PATCH 6/7] vm-img: make use of isars template class for most of the tmpl variables
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
` (4 preceding siblings ...)
2021-09-22 14:11 ` [PATCH 5/7] vm-img: set vmware machine type to 64bit in our template Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-09-22 14:11 ` [PATCH 7/7] meta-isar: switch virtualbox test from buster to bullseye Henning Schild
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, Henning Schild
The vm-img class used to envsubst everything itself, but doing so with
the templating mechanism of isar is probably better, also to cover
variable depends.
But we stick with a second run of envsubst for variables where the
content needs to be discovered/calculated.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/vm-img.bbclass | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass
index db390769b29f..c03628c21a37 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -67,20 +67,9 @@ OVA_VARS = "OVA_NAME OVA_MEMORY OVA_NUMBER_OF_CPU OVA_VRAM \
OVA_FIRMWARE OVA_ACPI OVA_3D_ACCEL \
OVA_SHA_ALG VIRTUAL_MACHINE_IMAGE_FILE"
-# the ovf template is updated with ensubst
-# this function adds the variable from OVA_VARS to the environment
-python update_environment() {
- template_vars = (d.getVar('OVA_VARS', True) or "").split()
- if len(template_vars) == 0:
- return
-
- for varname in template_vars:
- value = d.getVar(varname, True)
- if value:
- os.environ.update({varname: value})
-}
+TEMPLATE_FILES += "${OVF_TEMPLATE_FILE}"
+TEMPLATE_VARS += "${OVA_VARS}"
-do_create_ova[prefuncs] += "update_environment"
do_create_ova() {
if [ ! ${VIRTUAL_MACHINE_IMAGE_TYPE} = "vmdk" ]; then
exit 0
@@ -93,6 +82,7 @@ do_create_ova() {
export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
export OVA_FIRMWARE_UPPERCASE=$(echo ${OVA_FIRMWARE} | tr '[a-z]' '[A-Z]')
+ export OVF_TEMPLATE_STAGE2=$(echo ${OVF_TEMPLATE_FILE} | sed 's/.tmpl$//' )
image_do_mounts
sudo -Es chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} <<'EOSUDO'
@@ -101,7 +91,7 @@ do_create_ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat ${PP_WORK}/${OVF_TEMPLATE_FILE} | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
+ cat ${PP_WORK}/${OVF_TEMPLATE_STAGE2} | 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.
--
2.32.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 7/7] meta-isar: switch virtualbox test from buster to bullseye
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
` (5 preceding siblings ...)
2021-09-22 14:11 ` [PATCH 6/7] vm-img: make use of isars template class for most of the tmpl variables Henning Schild
@ 2021-09-22 14:11 ` Henning Schild
2021-09-22 14:14 ` [PATCH 0/7] vm-img improvements and fixes Henning Schild
2021-09-22 17:05 ` Henning Schild
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:11 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff, Henning Schild
in fact the multiconfig had an "-ova" in its name which did not really
follow our pattern MACHINE-DISTRO. While renaming that switch the distro
as well, to what is stable today.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta-isar/conf/local.conf.sample | 2 +-
.../{virtualbox-ova-buster.conf => virtualbox-bullseye.conf} | 2 +-
scripts/ci_build.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
rename meta-isar/conf/multiconfig/{virtualbox-ova-buster.conf => virtualbox-bullseye.conf} (77%)
diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 88a8175b1dee..47d12aefe1af 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -65,7 +65,7 @@ BBMULTICONFIG = " \
nand-ubi-demo-buster \
nanopi-neo-buster \
stm32mp15x-buster \
- virtualbox-ova-buster \
+ virtualbox-bullseye \
rpi-stretch \
sifive-fu540-sid-ports \
qemuarm64-focal \
diff --git a/meta-isar/conf/multiconfig/virtualbox-ova-buster.conf b/meta-isar/conf/multiconfig/virtualbox-bullseye.conf
similarity index 77%
rename from meta-isar/conf/multiconfig/virtualbox-ova-buster.conf
rename to meta-isar/conf/multiconfig/virtualbox-bullseye.conf
index 30425567b96b..90bb17e52270 100644
--- a/meta-isar/conf/multiconfig/virtualbox-ova-buster.conf
+++ b/meta-isar/conf/multiconfig/virtualbox-bullseye.conf
@@ -5,4 +5,4 @@
MACHINE = "virtualbox"
-DISTRO = "debian-buster"
+DISTRO = "debian-bullseye"
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 48a51f259c00..5ca8b6222c26 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -44,7 +44,7 @@ TARGETS_SET="\
mc:nand-ubi-demo-buster:isar-image-ubi \
mc:rpi-stretch:isar-image-base \
mc:qemuamd64-focal:isar-image-base \
- mc:virtualbox-ova-buster:isar-image-base \
+ mc:virtualbox-bullseye:isar-image-base \
"
# qemu-user-static of <= buster too old to build that
# mc:qemuarm64-buster:isar-image-base
--
2.32.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/7] vm-img improvements and fixes
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
` (6 preceding siblings ...)
2021-09-22 14:11 ` [PATCH 7/7] meta-isar: switch virtualbox test from buster to bullseye Henning Schild
@ 2021-09-22 14:14 ` Henning Schild
2021-09-22 17:05 ` Henning Schild
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 14:14 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff
I tested all of this on vmware 16.1.2 build-17966106 and virtualbox
6.1.26 on a Linux host.
patches can also be found here
https://github.com/henning-schild-work/isar/tree/henning/staging11
Henning
Am Wed, 22 Sep 2021 16:11:40 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> The vm-img support we currently have is a bit broken in various
> aspects. Most prominently the resulting ova files are accepted by
> vmware only with warnings. And UEFI booting did not really work in
> virtualbox or vmware.
>
> This series makes the template for the appliance a file one can
> override with a custom template. Which should allow close to any
> special configuration that the VMMs can express in their respective
> ovf dialects. It further makes changes to the templates we ship with
> isar to hopefully give people a decent baseline so they will not even
> need custom templates. And there is some code cleanup to the vm-img
> class.
>
>
> Henning Schild (7):
> vm-img: move template out of package into SRC_URI file
> vm-img: use two different ovf templates for vmware/virtualbox
> vm-img: shorten code by using variables we have
> vm-img: drop not used variables
> vm-img: set vmware machine type to 64bit in our template
> vm-img: make use of isars template class for most of the tmpl
> variables
> meta-isar: switch virtualbox test from buster to bullseye
>
> meta-isar/conf/local.conf.sample | 2 +-
> meta-isar/conf/machine/vmware.conf | 2 +
> ...a-buster.conf => virtualbox-bullseye.conf} | 2 +-
> meta/classes/vm-img.bbclass | 35 ++---
> .../vm-img/vm-img-virtualbox.ovf.tmpl} | 132
> +++++++----------- meta/classes/vm-img/vm-img-vmware.ovf.tmpl |
> 127 +++++++++++++++++ .../vm-template/vm-template_0.1.bb |
> 16 --- scripts/ci_build.sh | 2 +-
> 8 files changed, 197 insertions(+), 121 deletions(-)
> rename meta-isar/conf/multiconfig/{virtualbox-ova-buster.conf =>
> virtualbox-bullseye.conf} (77%) rename
> meta/{recipes-devtools/vm-template/files/vm-template.ovf.tmpl =>
> classes/vm-img/vm-img-virtualbox.ovf.tmpl} (54%) create mode 100644
> meta/classes/vm-img/vm-img-vmware.ovf.tmpl delete mode 100644
> meta/recipes-devtools/vm-template/vm-template_0.1.bb
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/7] vm-img improvements and fixes
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
` (7 preceding siblings ...)
2021-09-22 14:14 ` [PATCH 0/7] vm-img improvements and fixes Henning Schild
@ 2021-09-22 17:05 ` Henning Schild
8 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-09-22 17:05 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff
Using this in a layer i in fact had the need to bring my own template
for vmware to enable a nested virtualization. That worked as expected.
Henning
Am Wed, 22 Sep 2021 16:11:40 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> The vm-img support we currently have is a bit broken in various
> aspects. Most prominently the resulting ova files are accepted by
> vmware only with warnings. And UEFI booting did not really work in
> virtualbox or vmware.
>
> This series makes the template for the appliance a file one can
> override with a custom template. Which should allow close to any
> special configuration that the VMMs can express in their respective
> ovf dialects. It further makes changes to the templates we ship with
> isar to hopefully give people a decent baseline so they will not even
> need custom templates. And there is some code cleanup to the vm-img
> class.
>
>
> Henning Schild (7):
> vm-img: move template out of package into SRC_URI file
> vm-img: use two different ovf templates for vmware/virtualbox
> vm-img: shorten code by using variables we have
> vm-img: drop not used variables
> vm-img: set vmware machine type to 64bit in our template
> vm-img: make use of isars template class for most of the tmpl
> variables
> meta-isar: switch virtualbox test from buster to bullseye
>
> meta-isar/conf/local.conf.sample | 2 +-
> meta-isar/conf/machine/vmware.conf | 2 +
> ...a-buster.conf => virtualbox-bullseye.conf} | 2 +-
> meta/classes/vm-img.bbclass | 35 ++---
> .../vm-img/vm-img-virtualbox.ovf.tmpl} | 132
> +++++++----------- meta/classes/vm-img/vm-img-vmware.ovf.tmpl |
> 127 +++++++++++++++++ .../vm-template/vm-template_0.1.bb |
> 16 --- scripts/ci_build.sh | 2 +-
> 8 files changed, 197 insertions(+), 121 deletions(-)
> rename meta-isar/conf/multiconfig/{virtualbox-ova-buster.conf =>
> virtualbox-bullseye.conf} (77%) rename
> meta/{recipes-devtools/vm-template/files/vm-template.ovf.tmpl =>
> classes/vm-img/vm-img-virtualbox.ovf.tmpl} (54%) create mode 100644
> meta/classes/vm-img/vm-img-vmware.ovf.tmpl delete mode 100644
> meta/recipes-devtools/vm-template/vm-template_0.1.bb
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/7] vm-img: move template out of package into SRC_URI file
2021-09-22 14:11 ` [PATCH 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
@ 2021-10-06 14:08 ` Henning Schild
2021-12-15 15:44 ` Henning Schild
0 siblings, 1 reply; 12+ messages in thread
From: Henning Schild @ 2021-10-06 14:08 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff
Am Wed, 22 Sep 2021 16:11:41 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> 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:"
better might be
FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/files:"
as found in other places playing that trick
> +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
> -}
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/7] vm-img: move template out of package into SRC_URI file
2021-10-06 14:08 ` Henning Schild
@ 2021-12-15 15:44 ` Henning Schild
0 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-12-15 15:44 UTC (permalink / raw)
To: isar-users; +Cc: Q . Gylstorff
Am Wed, 6 Oct 2021 16:08:28 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> Am Wed, 22 Sep 2021 16:11:41 +0200
> schrieb Henning Schild <henning.schild@siemens.com>:
>
> > 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:"
>
> better might be
> FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/files:"
> as found in other places playing that trick
done in v4
> > +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
> > -}
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-12-15 15:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 14:11 [PATCH 0/7] vm-img improvements and fixes Henning Schild
2021-09-22 14:11 ` [PATCH 1/7] vm-img: move template out of package into SRC_URI file Henning Schild
2021-10-06 14:08 ` Henning Schild
2021-12-15 15:44 ` Henning Schild
2021-09-22 14:11 ` [PATCH 2/7] vm-img: use two different ovf templates for vmware/virtualbox Henning Schild
2021-09-22 14:11 ` [PATCH 3/7] vm-img: shorten code by using variables we have Henning Schild
2021-09-22 14:11 ` [PATCH 4/7] vm-img: drop not used variables Henning Schild
2021-09-22 14:11 ` [PATCH 5/7] vm-img: set vmware machine type to 64bit in our template Henning Schild
2021-09-22 14:11 ` [PATCH 6/7] vm-img: make use of isars template class for most of the tmpl variables Henning Schild
2021-09-22 14:11 ` [PATCH 7/7] meta-isar: switch virtualbox test from buster to bullseye Henning Schild
2021-09-22 14:14 ` [PATCH 0/7] vm-img improvements and fixes Henning Schild
2021-09-22 17:05 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox