VmApplication API schema reference
Use the following reference to compose valid VmApplication specifications for deploying VM applications through the Red Hat Edge Manager API, CLI, or web console.
VmApplication fields Copy linkLink copied!
The VmApplication schema extends ApplicationProviderBase with VM-specific fields.
| Field | Type | Required | Description |
|---|---|---|---|
|
|
String |
Yes |
The application name.
Must be 1-253 lowercase characters, consisting of lowercase letters ( |
|
|
String |
Yes |
Must be |
|
|
List |
Yes |
Must contain exactly one file entry with |
|
|
List of Strings |
No |
Host-to-guest port mappings in |
|
|
String |
Read-only |
The target power state of the application.
Values: |
|
|
Integer |
Read-only |
Restart counter managed by the control plane.
This field is read-only and cannot be set through |
|
|
Map |
Read-only |
Internal key-value pairs used by the control plane during render. This field is read-only and is not intended for user-supplied metadata. |
Validation rules Copy linkLink copied!
The Red Hat Edge Manager API validates VmApplication specifications against the following rules.
Violations return HTTP 422.
- The
inlineset must contain exactly one file namedvm.yaml. - The
vm.yamlcontent must includekind: VirtualMachine. - The
vm.yamlcontent must includeapiVersion: kubevirt.io/v1. - The
metadata.nameinvm.yamlmust match thenameof theVmApplication. - Each
publishPortsentry must follow thehostPort:guestPortorhostPort:guestPort/protocolformat, where protocol istcp,udp, orsctp. - Only the
inlineprovider is supported. Theimageprovider is accepted by the schema but returns "not yet supported" at render time. ThegitRefprovider is not valid for VM applications.
Examples Copy linkLink copied!
Minimal VM application
spec:
applications:
- name: fedora-vm
appType: vm
inline:
- path: vm.yaml
content: |
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: fedora-vm
spec:
running: true
template:
spec:
domain:
devices:
disks:
- name: rootdisk
disk:
bus: virtio
resources:
requests:
memory: 2048Mi
volumes:
- name: rootdisk
containerDisk:
image: quay.io/containerdisks/fedora:40
VM application with SSH port publishing
spec:
applications:
- name: fedora-vm
appType: vm
publishPorts:
- "2222:22"
inline:
- path: vm.yaml
content: |
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: fedora-vm
spec:
running: true
template:
spec:
domain:
devices:
disks:
- name: rootdisk
disk:
bus: virtio
resources:
requests:
memory: 2048Mi
volumes:
- name: rootdisk
containerDisk:
image: quay.io/containerdisks/fedora:40
VM application with cloud-init credentials
spec:
applications:
- name: fedora-vm
appType: vm
publishPorts:
- "2222:22"
inline:
- path: vm.yaml
content: |
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: fedora-vm
spec:
running: true
template:
spec:
domain:
devices:
disks:
- name: rootdisk
disk:
bus: virtio
- name: cloudinitdisk
disk:
bus: virtio
resources:
requests:
memory: 2048Mi
volumes:
- name: rootdisk
containerDisk:
image: quay.io/containerdisks/fedora:40
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
#cloud-config
user: fedora
ssh_pwauth: true
chpasswd:
expire: false
users:
- name: fedora
password: <password>
type: text
ssh_authorized_keys:
- <ssh_public_key>
Application type lifecycle support Copy linkLink copied!
The desiredState and restartGeneration fields are available for all application types through the ApplicationProviderBase schema.
These fields are read-only and appear on the rendered application specification that the agent reconciles.
They are driven by the flightctl app start, flightctl app stop, and flightctl app restart APIs (or the equivalent UI actions), not by editing and applying the device specification.
| Application type |
desiredState
|
restartGeneration
|
|---|---|---|
|
|
Supported |
Supported |
|
|
Supported |
Supported |
|
|
Supported |
Supported |
|
|
Supported |
Supported |
|
|
Supported |
Supported |