stages: add more options to qemu vmdk disk type

The CoreOS team uses the compat6 and adapter_type options when creating
a VMDK for AWS.

e1943d6adb/src/cosalib/qemuvariants.py (L48)
This commit is contained in:
Dusty Mabe 2025-02-14 08:36:25 -05:00
parent 441fbf70d6
commit 4e033c305e
4 changed files with 72 additions and 2 deletions

View file

@ -21,14 +21,24 @@ def qcow2_arguments(options):
def vmdk_arguments(options):
argv = []
adapter_type = options.get("adapter_type")
compat6 = options.get("compat6", False)
compression = options.get("compression", True)
subformat = options.get("subformat")
if compression:
argv += ["-c"]
if subformat:
argv += ["-o", f"subformat={subformat}"]
if compat6 or subformat or adapter_type:
opts = []
if adapter_type:
opts += [f"adapter_type={adapter_type}"]
if compat6:
opts += ["compat6"]
if subformat:
opts += [f"subformat={subformat}"]
argv += ["-o", ",".join(opts)]
return argv

View file

@ -68,6 +68,21 @@
"vmdk"
]
},
"adapter_type": {
"description": "Virtual adapter type",
"type": "string",
"enum": [
"ide",
"lsilogic",
"buslogic",
"legacyESX"
]
},
"compat6": {
"description": "VMDK version 6 image",
"type": "boolean",
"default": false
},
"compression": {
"description": "Enable/disable compression of the vmdk image",
"type": "boolean",

View file

@ -638,6 +638,34 @@
}
]
},
{
"name": "image-compat6-adapter-type.vmdk",
"build": "name:build",
"stages": [
{
"type": "org.osbuild.qemu",
"inputs": {
"image": {
"type": "org.osbuild.files",
"origin": "org.osbuild.pipeline",
"references": {
"name:image": {
"file": "image.raw"
}
}
}
},
"options": {
"filename": "image-stream.vmdk",
"format": {
"type": "vmdk",
"compat6": true,
"adapter_type": "lsilogic"
}
}
}
]
},
{
"name": "image.vpc",
"build": "name:build",

View file

@ -91,6 +91,23 @@ pipelines:
format:
type: vmdk
subformat: streamOptimized
- name: image-compat6-adapter-type.vmdk
build: name:build
stages:
- type: org.osbuild.qemu
inputs:
image:
type: org.osbuild.files
origin: org.osbuild.pipeline
references:
name:image:
file: image.raw
options:
filename: image-stream.vmdk
format:
type: vmdk
compat6: true
adapter_type: lsilogic
- name: image.vpc
build: name:build
stages: