Deploy a VM application by using raw YAML
You can deploy a VM application by writing a VmApplication specification with an inline KubeVirt VirtualMachine YAML manifest.
Use this method to configure advanced VM parameters beyond what the guided form exposes, or to automate VM deployments through the flightctl CLI or API.
Before you begin
- A container disk image is pushed to an OCI-compatible registry accessible from the edge device.
- The target edge device meets the KVM readiness requirements.
- Pull credentials for
registry.redhat.ioare configured on the device at/root/.config/containers/auth.json. See Configure pull credentials on an edge device for VM applications. - You have the Admin or Operator role in Red Hat Edge Manager.
- The
flightctlCLI is installed and authenticated (for CLI deployments).
Procedure
Results
- Check the application status by inspecting the device.
The application appears in the status after the device has updated to the new spec.
For VMs that require downloading large images, this might take a while.
Review the device update status for troubleshooting if needed.
$ flightctl get device/<device_name> -o yamlThe application status transitions from
PreparingtoStartingtoRunning:status: applications: - name: my-vm status: Running ready: 2/4 restarts: 0Note VM applications render as multiple Podman workloads, including the compute container and init containers generated by the
vm-to-quadletconversion. Thereadyfield shows the ratio of healthy containers to total containers. Ratios such as2/4or2/5are normal for a running VM application and do not indicate a partial failure.Note On its first boot, a Windows VM guest might start without network connectivity. To recover, restart the VM application by using lifecycle control: run
flightctl app restart device/<device_name> --name <app_name>, or stop and then start the application.
If the API returns HTTP 422, check the following validation rules:
- The
inlineset must contain exactly one file namedvm.yaml. - The
vm.yamlcontent must havekind: VirtualMachineandapiVersion: kubevirt.io/v1. - The
metadata.nameinvm.yamlmust match thenameof theVmApplication. - Each
publishPortsentry must use the<host_port>:<vm_port>or<host_port>:<vm_port>/<protocol>format. - Only the
inlineprovider is supported. TheimageandgitRefproviders are not supported for VM applications.
If the VM application does not reach Running status or you cannot open a console session, inspect the device-side service logs:
$ sudo journalctl -u '*<vm_app_name>*' --no-pager
Every container for a VM application, including the compute container and any init containers, is managed as a quadlet-generated systemd service.
If an init container fails to start because of a bad image reference or a configuration error, Podman does not create a container to collect logs from.
The journalctl -u command accepts glob patterns and captures logs from all systemd units associated with the application.