|
1 | 1 | # Example: Run a KVM guest |
2 | 2 |
|
3 | | -It is possible to launch a Virtual Machine (VM) within a GitHub Action. Support for virtualization is not enabled by default for Actuated. The Agent has to be configured to use a custom kernel. |
| 3 | +It is possible to launch a Virtual Machine (VM) within a GitHub Action using nested virtualisation. |
4 | 4 |
|
5 | | -There are some prerequisites to enable KVM support: |
| 5 | +With the following caveats: |
6 | 6 |
|
7 | | -- `aarch64` runners are not supported at the moment. |
8 | | -- A bare-metal host for the Agent is required. |
| 7 | +- Nested Virtualisation is generally slower than bare-metal. |
| 8 | +- Arm is not supported by the Linux Kernel or the current generation of Arm SoCs. |
9 | 9 |
|
| 10 | +The `kvm` and `kvm_intel` / `kvm_amd` modules are shipped with the actuated Kernel, so you can load them in your workflow via `sudo modprobe`. |
10 | 11 |
|
11 | | -!!! info "Nested virtualisation is a premium feature" |
12 | | - This feature requires a plan size of 15 concurrent builds or greater, however you can get a 14-day free trial by contacting our team directly through the actuated Slack. |
13 | | - |
14 | | -## Configure the Agent |
15 | | - |
16 | | -1. Make sure [nested virtualization is enabled](https://ostechnix.com/how-to-enable-nested-virtualization-in-kvm-in-linux/) on the Agent host. |
17 | | - |
18 | | -2. Edit `/etc/default/actuated` on the Actuated Agent and add the `kvm` suffix to the `AGENT_KERNEL_REF` variable: |
19 | | - |
20 | | - ```diff |
21 | | - - AGENT_KERNEL_REF="ghcr.io/openfaasltd/actuated-kernel:x86_64-latest" |
22 | | - + AGENT_KERNEL_REF="ghcr.io/openfaasltd/actuated-kernel:x86_64-kvm-latest" |
23 | | - ``` |
24 | | - |
25 | | -3. Also add it to the `AGENT_IMAGE_REF` line: |
26 | | - |
27 | | - ```diff |
28 | | - - AGENT_IMAGE_REF="ghcr.io/openfaasltd/actuated-ubuntu22.04:x86_64-latest" |
29 | | - + AGENT_IMAGE_REF="ghcr.io/openfaasltd/actuated-ubuntu22.04:x86_64-kvm-latest" |
30 | | - ``` |
31 | | - |
32 | | -3. Restart the Agent to use the new kernel. |
33 | | - |
34 | | - ```bash |
35 | | - sudo systemctl daemon-reload && \ |
36 | | - sudo systemctl restart actuated |
37 | | - ``` |
38 | | - |
39 | | -4. Run a [test build](/test-build/) to verify KVM support is enabled in the runner. The specs script from the test build will report whether `/dev/kvm` is available. |
40 | | - |
41 | | -## Run a Firecracker microVM |
| 12 | +## Example: Run a Firecracker microVM |
42 | 13 |
|
43 | 14 | This example is an adaptation of the [Firecracker quickstart guide](https://github.com/firecracker-microvm/firecracker/blob/main/docs/getting-started.md) that we run from within a GitHub Actions workflow. |
44 | 15 |
|
|
0 commit comments