Files
nomad/website/content/plugins/drivers/community/firecracker-task-driver.mdx
Aimee Ukasick 8a597a172d Docs SEO: task drivers and plugins; refactor virt section (#24783)
* Docs SEO: task drivers and plugins; refactor virt section

* add redirects for virt driver files

* Some updates. committing rather than stashing

* fix content-check errors

* Remove docs/devices/ and redirect to plugins/devices

* Update docs/drivers descriptions

* Move USB device plugin up a level. Finish descriptions.

* Apply suggestions from Jeff's code review

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>

* Apply title case suggestions from code review

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>

* apply title case suggestions; fix indentation

---------

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
2025-02-10 15:43:02 -06:00

131 lines
3.8 KiB
Plaintext

---
layout: docs
page_title: Firecracker task driver plugin
description: >-
Use the community-supported Firecracker task driver to run Firecracker micro virtual machines in your Nomad job.
---
# Firecracker task driver plugin
Name: `firecracker-task-driver`
The Firecracker task driver provides an interface for creating Linux microVMs.
For more detailed instructions on how to set up and use this driver, please
refer to the [documentation][firecracker-task-guide].
## Task Configuration
```hcl
task "test01" {
driver = "firecracker-task-driver"
config {
KernelImage = "/home/build/hello-vmlinux.bin"
Firecracker = "/home/build/firecracker"
Vcpus = 1
Mem = 128
Network = "default"
}
}
```
The firecracker task driver supports the following parameters:
- `KernelImage` - (Optional) Path to the kernel image to be used on the microvm.
Defaults to 'vmlinux' in the [allocation working directory].
- `BootDisk` - (Optional) Path to the ext4 rootfs to boot from.
Defaults to 'rootfs.ext4' in the [allocation working directory].
- `BootOptions` - (Optional) Kernel command line options to boot the microvm.
Defaults to "ro console=ttyS0 reboot=k panic=1 pci=off"
- `Network` - (Optional) Network name of your container network configuration
file.
- `Vcpus` - (Optional) Number of CPUs to assign to microvm.
- `Cputype` - (Optional) CPU template to use, templates available are C3 or T2.
- `Mem` - (Optional) Amount of memory in Megabytes to assign to microvm.
Defaults to 512
- `Firecracker` Location of the firecracker binary, the option could be omitted
if the environment variable FIRECRACKER_BIN is setup. Defaults to
'/usr/bin/firecracker'
- `DisableHt` - (Optional) Disable CPU Hyperthreading. Defaults to false
- `Log` - (Optional) path to file where to write firecracker logs.
## Networking
Network configuration is setup using CNI plugins, the steps to setup firecracker
task driver with cni are the following:
- Build [cni plugins][container network plugins] and [tc-redirect-tap][tc-redirect-tap]
and copy them to `/opt/cni`.
- Create a network configuration to be used by micro-vms on /etc/cni/conf.d/,
for example: default.conflist.
### Example network configuration
```json
{
"name": "default",
"cniVersion": "0.4.0",
"plugins": [
{
"type": "ptp",
"ipMasq": true,
"ipam": {
"type": "host-local",
"subnet": "192.168.127.0/24",
"resolvConf": "/etc/resolv.conf"
}
},
{
"type": "firewall"
},
{
"type": "tc-redirect-tap"
}
]
}
```
In this example the name of this network is default and this name is the
parameter used in Network on the task driver job spec. Also the filename must
match the name of the network, and use the .conflist extension.
## Client Requirements
`firecracker-task-driver` requires the following:
- Linux 4.14+ Firecracker currently supports physical Linux x86_64 and aarch64
hosts, running kernel version 4.14 or later. However, the aarch64 support is
not feature complete (alpha stage)
- The [Firecracker binary][firecracker binary]
- KVM enabled in your Linux kernel, and you have read/write access to /dev/kvm
- tun kernel module
- The firecracker-task-driver binary placed in the [plugin_dir][plugin_dir]
directory
- ip6tables package
- [Container network plugins][container network plugins]
- [tc-redirect-tap][tc-redirect-tap]
[plugin_dir]: /nomad/docs/configuration#plugin_dir
[tc-redirect-tap]: https://github.com/awslabs/tc-redirect-tap
[container network plugins]: https://github.com/containernetworking/plugins
[firecracker binary]: https://github.com/firecracker-microvm/firecracker/releases
[firecracker-task-guide]: https://github.com/cneira/firecracker-task-driver
[allocation working directory]: /nomad/docs/runtime/environment#task-directories 'Task Directories'