Nomad
Client
Beta Feature: The Virt task driver is in beta and under active development. Refer to the repo README for the latest updates. Do not use this driver in production environments.
The virt
task driver is not built into Nomad. You must downloaded onto the client
host in the configured plugin directory. The client host must also be capable of running hardware
accelerated KVM virtual machines, which you can check by using kvm-ok command.
Additional requirements:
- Linux
- Commands
bridge-utils
,cloudinit
,dnsmasq
, andiptables
- libvirt daemon installed and running
- QEMU system packages installed
- Nomad client running as root
Use the following command to install the package requirements:
$ sudo apt-get update && \
sudo apt-get install -y \
bridge-utils \
cloud-init \
dnsmasq \
iptables \
libvirt-daemon-system \
qemu-system \
qemu-system-x86 \
qemu-utils
Client capabilities
The virt
task driver implements the following driver capabilities.
Feature | Implementation |
---|---|
nomad alloc signal | false |
nomad alloc exec | false |
filesystem isolation | image |
network isolation | host |
volume mounting | false |
Plugin configuration
This example shows the default plugin configuration.
plugin "nomad-driver-driver" {
config {
data_dir = "/var/lib/virt"
image_paths = ["/var/lib/virt", "${ALLOC_DIR}"]
emulator {
uri = "qemu:///system"
user = ""
password = ""
}
}
}
data_dir
- (default:"/var/lib/virt"
) - the directory for storing VM configuration files and intermediate files.image_paths
- (default:["/var/lib/virt", "${ALLOC_DIR}"]
) - an allow-list of paths the driver is allowed to load an image from.emulator
- (block)
Client attributes
When installed, the virt
plugin provides the following node attributes that you can use as
constraints when authoring jobs.
driver.virt = true
driver.virt.active = 0
driver.virt.emulator.version = 8002002
driver.virt.inactive = 0bytes
driver.virt.libvirt.version = 10000000
driver.virt.network.default.bridge_name = virbr0
driver.virt.network.default.state = active