mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 01:15:43 +03:00
98 lines
2.9 KiB
Plaintext
98 lines
2.9 KiB
Plaintext
---
|
|
layout: docs
|
|
page_title: Client
|
|
description: Nomad client requirements, capabilities, and configuration options for the Virt task driver.
|
|
---
|
|
|
|
# Client
|
|
|
|
@include 'virt-beta-callout.mdx'
|
|
|
|
The `virt` task driver is not built into Nomad. You must [downloaded][releases] 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`, and `iptables`
|
|
- [libvirt daemon][] installed and running
|
|
- QEMU system packages installed
|
|
- Nomad client running as root
|
|
|
|
Use the following command to install the package requirements:
|
|
|
|
```console
|
|
$ 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][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.
|
|
|
|
```hcl
|
|
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)
|
|
- `uri` - (default: `"qemu:///system"`) - The `uri` specifies which hypervisor to connect to.
|
|
- `user` - (default: `""`) - the username to use for authentication.
|
|
- `password` - (default: `""`) - the password to use for authentication.
|
|
|
|
## 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
|
|
```
|
|
|
|
[releases]: https://releases.hashicorp.com/nomad-driver-virt
|
|
[kvm-ok]: https://manpages.ubuntu.com/manpages/bionic/man1/kvm-ok.1.html
|
|
[libvirt daemon]: https://libvirt.org/daemons.html
|
|
[capabilities]: https://developer.hashicorp.com/nomad/docs/concepts/plugins/task-drivers#task-driver-plugin-api
|