* [PATCH v6 0/7] vm-img improvements and fixes
@ 2021-12-17 14:48 Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file Anton Mikanovich
` (7 more replies)
0 siblings, 8 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
changes since v5:
- base on v4, not v3 as previous version
changes since v4:
- format commit messages
changes since v3:
- change the way we play with the SRC_URI path in p1
- adding cover letter again
changes since v2:
- change avocado code and move renamed bullseye test into another test
changes since v1:
- rebase on next/avocado
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 ---
testsuite/build_test/build_test.py | 6 +-
8 files changed, 199 insertions(+), 123 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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2021-12-17 16:35 ` Henning Schild
2021-12-17 14:48 ` [PATCH v6 2/7] vm-img: use two different ovf templates for vmware/virtualbox Anton Mikanovich
` (6 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
From: 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 c75a544..84ca328 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"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/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"
@@ -101,7 +103,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 1d474cd..0000000
--- 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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 2/7] vm-img: use two different ovf templates for vmware/virtualbox
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 3/7] vm-img: shorten code by using variables we have Anton Mikanovich
` (5 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
From: Henning Schild <henning.schild@siemens.com>
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 5832b29..9bf1fd9 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 84ca328..0733208 100644
--- a/meta/classes/vm-img.bbclass
+++ b/meta/classes/vm-img.bbclass
@@ -8,7 +8,8 @@ inherit buildchroot
inherit wic-img
FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/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
@@ -103,7 +105,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 e6b5305..c9561a2 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 0000000..5280f33
--- /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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 3/7] vm-img: shorten code by using variables we have
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 2/7] vm-img: use two different ovf templates for vmware/virtualbox Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 4/7] vm-img: drop not used variables Anton Mikanovich
` (4 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild, Anton Mikanovich
From: Henning Schild <henning.schild@siemens.com>
This is a purely cosmetic change making use of shorthands we have.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
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 0733208..bae78c9 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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 4/7] vm-img: drop not used variables
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
` (2 preceding siblings ...)
2021-12-17 14:48 ` [PATCH v6 3/7] vm-img: shorten code by using variables we have Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template Anton Mikanovich
` (3 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild, Anton Mikanovich
From: Henning Schild <henning.schild@siemens.com>
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>
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
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 bae78c9..5dfb48e 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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
` (3 preceding siblings ...)
2021-12-17 14:48 ` [PATCH v6 4/7] vm-img: drop not used variables Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2022-05-19 21:20 ` Henning Schild
2021-12-17 14:48 ` [PATCH v6 6/7] vm-img: make use of isars template class for most of the tmpl variables Anton Mikanovich
` (2 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
From: Henning Schild <henning.schild@siemens.com>
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 5280f33..2883ce0 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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 6/7] vm-img: make use of isars template class for most of the tmpl variables
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
` (4 preceding siblings ...)
2021-12-17 14:48 ` [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 7/7] meta-isar: switch virtualbox test from buster to bullseye Anton Mikanovich
2021-12-27 13:00 ` [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
7 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
From: Henning Schild <henning.schild@siemens.com>
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 5dfb48e..4258780 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'
@@ -102,7 +92,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.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v6 7/7] meta-isar: switch virtualbox test from buster to bullseye
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
` (5 preceding siblings ...)
2021-12-17 14:48 ` [PATCH v6 6/7] vm-img: make use of isars template class for most of the tmpl variables Anton Mikanovich
@ 2021-12-17 14:48 ` Anton Mikanovich
2021-12-27 13:00 ` [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
7 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-17 14:48 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild, Anton Mikanovich
From: Henning Schild <henning.schild@siemens.com>
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>
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta-isar/conf/local.conf.sample | 2 +-
...{virtualbox-ova-buster.conf => virtualbox-bullseye.conf} | 2 +-
testsuite/build_test/build_test.py | 6 +++---
3 files changed, 5 insertions(+), 5 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 9d61c4e..e260906 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 3042556..90bb17e 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/testsuite/build_test/build_test.py b/testsuite/build_test/build_test.py
index 5a771d1..8f1ec18 100644
--- a/testsuite/build_test/build_test.py
+++ b/testsuite/build_test/build_test.py
@@ -126,8 +126,7 @@ class NoCrossTest(CIBaseTest):
'mc:qemumipsel-buster:isar-image-base',
'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:qemuamd64-focal:isar-image-base'
]
# Cleanup after cross build
@@ -142,7 +141,8 @@ class NoCrossTest(CIBaseTest):
'mc:qemuarm-bullseye:isar-image-base',
'mc:qemui386-bullseye:isar-image-base',
'mc:qemumipsel-bullseye:isar-image-base',
- 'mc:hikey-bullseye:isar-image-base'
+ 'mc:hikey-bullseye:isar-image-base',
+ 'mc:virtualbox-bullseye:isar-image-base'
]
try:
--
2.25.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file
2021-12-17 14:48 ` [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file Anton Mikanovich
@ 2021-12-17 16:35 ` Henning Schild
2021-12-28 6:37 ` Anton Mikanovich
0 siblings, 1 reply; 14+ messages in thread
From: Henning Schild @ 2021-12-17 16:35 UTC (permalink / raw)
To: Anton Mikanovich; +Cc: isar-users
Am Fri, 17 Dec 2021 17:48:29 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:
> From: 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 c75a544..84ca328 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"
> +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/vm-img:"
Ok let us see if that will work. If the recipes have issues finding the
template then we should use
FILESEXTRAPATHS_prepend := "${LAYERDIR_core}/classes/vm-img:"
Henning
> +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"
> @@ -101,7 +103,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 1d474cd..0000000 ---
> 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] 14+ messages in thread
* Re: [PATCH v6 0/7] vm-img improvements and fixes
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
` (6 preceding siblings ...)
2021-12-17 14:48 ` [PATCH v6 7/7] meta-isar: switch virtualbox test from buster to bullseye Anton Mikanovich
@ 2021-12-27 13:00 ` Anton Mikanovich
7 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-27 13:00 UTC (permalink / raw)
To: Henning Schild, isar-users; +Cc: Anton Mikanovich
17.12.2021 17:48, Anton Mikanovich wrote:
> changes since v5:
> - base on v4, not v3 as previous version
>
> changes since v4:
> - format commit messages
>
> changes since v3:
> - change the way we play with the SRC_URI path in p1
> - adding cover letter again
>
> changes since v2:
> - change avocado code and move renamed bullseye test into another test
>
> changes since v1:
> - rebase on next/avocado
>
>
> 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 ---
> testsuite/build_test/build_test.py | 6 +-
> 8 files changed, 199 insertions(+), 123 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
>
Applied to next, thanks.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file
2021-12-17 16:35 ` Henning Schild
@ 2021-12-28 6:37 ` Anton Mikanovich
0 siblings, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2021-12-28 6:37 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
17.12.2021 19:35, Henning Schild wrote:
> Ok let us see if that will work. If the recipes have issues finding the
> template then we should use
>
> FILESEXTRAPATHS_prepend := "${LAYERDIR_core}/classes/vm-img:"
>
> Henning
Thanks, you was right, using 'FILE_DIRNAME' was not correct, because
'FILE' actually stands for isar-image-base (or any other) recipe here.
Fixed in '[PATCH] vm-img: set layer-based template search path'.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template
2021-12-17 14:48 ` [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template Anton Mikanovich
@ 2022-05-19 21:20 ` Henning Schild
2022-05-24 19:05 ` Jan Kiszka
0 siblings, 1 reply; 14+ messages in thread
From: Henning Schild @ 2022-05-19 21:20 UTC (permalink / raw)
To: Anton Mikanovich; +Cc: isar-users
Am Fri, 17 Dec 2021 17:48:33 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:
> From: Henning Schild <henning.schild@siemens.com>
>
> 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.
In fact the machine config has DISTRO_ARCH ?= so people could
potentially go 32 bit after all.
> 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 5280f33..2883ce0
> 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">
We could try and derive the value from DISTRO_ARCH.
But on the other hand we allow people to provide their own template in
case the default does not match.
This is a pitfall but not a big deal, just hoping that not too many
people end up building 32bit vmware images.
Not sure i will send a patch, probably not ... just saying for now.
Henning
> <Info>The kind of installed guest operating system</Info>
> </OperatingSystemSection>
> <VirtualHardwareSection>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template
2022-05-19 21:20 ` Henning Schild
@ 2022-05-24 19:05 ` Jan Kiszka
2022-05-24 22:28 ` Henning Schild
0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2022-05-24 19:05 UTC (permalink / raw)
To: Henning Schild, Anton Mikanovich; +Cc: isar-users
On 19.05.22 23:20, Henning Schild wrote:
> Am Fri, 17 Dec 2021 17:48:33 +0300
> schrieb Anton Mikanovich <amikan@ilbers.de>:
>
>> From: Henning Schild <henning.schild@siemens.com>
>>
>> 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.
>
> In fact the machine config has DISTRO_ARCH ?= so people could
> potentially go 32 bit after all.
>
>> 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 5280f33..2883ce0
>> 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">
>
> We could try and derive the value from DISTRO_ARCH.
>
> But on the other hand we allow people to provide their own template in
> case the default does not match.
>
> This is a pitfall but not a big deal, just hoping that not too many
> people end up building 32bit vmware images.
>
> Not sure i will send a patch, probably not ... just saying for now.
>
We should ship the better default, and that is clearly 64-bit today.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template
2022-05-24 19:05 ` Jan Kiszka
@ 2022-05-24 22:28 ` Henning Schild
0 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2022-05-24 22:28 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Anton Mikanovich, isar-users
Am Tue, 24 May 2022 21:05:31 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> On 19.05.22 23:20, Henning Schild wrote:
> > Am Fri, 17 Dec 2021 17:48:33 +0300
> > schrieb Anton Mikanovich <amikan@ilbers.de>:
> >
> >> From: Henning Schild <henning.schild@siemens.com>
> >>
> >> 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.
> >
> > In fact the machine config has DISTRO_ARCH ?= so people could
> > potentially go 32 bit after all.
> >
> >> 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 5280f33..2883ce0
> >> 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">
> >
> > We could try and derive the value from DISTRO_ARCH.
> >
> > But on the other hand we allow people to provide their own template
> > in case the default does not match.
> >
> > This is a pitfall but not a big deal, just hoping that not too many
> > people end up building 32bit vmware images.
> >
> > Not sure i will send a patch, probably not ... just saying for now.
> >
>
> We should ship the better default, and that is clearly 64-bit today.
The default is 64 and the templates can now be overridden in layers. So
let us just not do anything and get back here in case anyone brings a
real case that Isar might want to cater for with the templates in place.
Testing those images in CI is anyhow hard and not covered to a
boot-test. So isar catering for 32bit really sounds like a waste of
effort.
In fact i just posted all that to ask for an opinion and document
things for people reading the list or its archives.
Henning
> Jan
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-05-24 22:28 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 14:48 [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 1/7] vm-img: move template out of package into SRC_URI file Anton Mikanovich
2021-12-17 16:35 ` Henning Schild
2021-12-28 6:37 ` Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 2/7] vm-img: use two different ovf templates for vmware/virtualbox Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 3/7] vm-img: shorten code by using variables we have Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 4/7] vm-img: drop not used variables Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 5/7] vm-img: set vmware machine type to 64bit in our template Anton Mikanovich
2022-05-19 21:20 ` Henning Schild
2022-05-24 19:05 ` Jan Kiszka
2022-05-24 22:28 ` Henning Schild
2021-12-17 14:48 ` [PATCH v6 6/7] vm-img: make use of isars template class for most of the tmpl variables Anton Mikanovich
2021-12-17 14:48 ` [PATCH v6 7/7] meta-isar: switch virtualbox test from buster to bullseye Anton Mikanovich
2021-12-27 13:00 ` [PATCH v6 0/7] vm-img improvements and fixes Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox