diff --git a/content/nomad/v1.11.x/content/docs/deploy/task-driver/qemu.mdx b/content/nomad/v1.11.x/content/docs/deploy/task-driver/qemu.mdx index 42d1f91eec..d9c1fa8abd 100644 --- a/content/nomad/v1.11.x/content/docs/deploy/task-driver/qemu.mdx +++ b/content/nomad/v1.11.x/content/docs/deploy/task-driver/qemu.mdx @@ -43,8 +43,12 @@ way to retrieve the image being run. The `qemu` driver will set the following client attributes: - `driver.qemu` - Set to `1` if QEMU is found on the host node. Nomad determines - this by executing `qemu-system-x86_64 -version` on the host and parsing the output -- `driver.qemu.version` - Version of `qemu-system-x86_64`, ex: `2.4.0` + this by executing the first found QEMU binary with `--version` on the client + and parsing the output. Nomad does not get the version of each individual QEMU + emulator. +- `driver.qemu.version` - Version found running the command for `driver.qemu`; + for example: `2.4.0` +- `driver.qemu.emulators` - A comma separated list of emulators detected on the client. Here is an example of using these properties in a job file: @@ -52,13 +56,24 @@ Here is an example of using these properties in a job file: job "docs" { # Only run this job where the qemu version is higher than 1.2.3. constraint { - attribute = "${driver.qemu.version}" + attribute = "${attr.driver.qemu.version}" operator = ">" value = "1.2.3" } } ``` +```hcl +job "docs" { + # Only run this job where the the qemu-system-aarch64 emulator was detected. + constraint { + attribute = "${attr.driver.qemu.emulators}" + operator = "set_contains" + value = "aarch64" + } +} +``` + ## Plugin Options ```hcl @@ -78,6 +93,10 @@ plugin "qemu" { including flags that provide the VM with access to host devices such as USB drives. Refer to the [QEMU documentation] for the available flags. +- `emulators_allowlist` (`[]string`: `[]`) - Specifies the allowed emulators + tasks may use. When specified, Nomad only fingerprints this list and does not + allow tasks to run using other emulators. Defaults to fingerprinting and + allowing all emulators. ## Resource Isolation diff --git a/content/nomad/v1.11.x/content/docs/job-declare/task-driver/qemu.mdx b/content/nomad/v1.11.x/content/docs/job-declare/task-driver/qemu.mdx index 2eee6c2019..f415fdcd1a 100644 --- a/content/nomad/v1.11.x/content/docs/job-declare/task-driver/qemu.mdx +++ b/content/nomad/v1.11.x/content/docs/job-declare/task-driver/qemu.mdx @@ -14,8 +14,9 @@ great performance. Currently the `qemu` driver can map a set of ports from the host machine to the guest virtual machine, and provides configuration for resource allocation. -The `qemu` driver can execute any regular `qemu` image (e.g. `qcow`, `img`, -`iso`), and is currently invoked with `qemu-system-x86_64`. +The `qemu` driver can execute any regular `qemu` image, such as `qcow`, `img`, +and `iso`. Nomad uses the QEMU binary specified by the `emulator` parameter. For +example, if you specify `x86_64d, Nomad uses `qemu-system-x86_64`. The driver requires the image to be accessible from the Nomad client via the [`artifact` downloader](/nomad/docs/job-specification/artifact). @@ -31,6 +32,8 @@ task "webservice" { config { image_path = "/path/to/my/linux.img" + emulator = "x86_64" + machine_type = "q35" accelerator = "kvm" graceful_shutdown = true args = ["-nodefaults", "-nodefconfig"] @@ -40,10 +43,15 @@ task "webservice" { The `qemu` driver supports the following configuration in the job spec: -- `image_path` - The path to the downloaded image. In most cases this will just - be the name of the image. However, if the supplied artifact is an archive that - contains the image in a subfolder, the path will need to be the relative path - (`subdir/from_archive/my.img`). +- `image_path` - The path to the downloaded image. In most cases this is the + name of the image. However, if the supplied artifact is an archive that + contains the image in a subfolder, the path needs to be the relative path + (`subdir/from_archive/my.img`). Nomad gives this image an ID of "image0". + +- `emulator` `(string: "x86_64")` - The architecture of the QEMU emulator used to + run the virtual machine. + +- `machine_type` `(string: "pc")` - Used to select the emulated machine by name. - `drive_interface` - (Optional) This option defines on which type of interface the drive is connected. Available types are: `ide`, `scsi`, `sd`, `mtd`, diff --git a/content/nomad/v1.11.x/content/docs/upgrade/upgrade-specific.mdx b/content/nomad/v1.11.x/content/docs/upgrade/upgrade-specific.mdx index f226921902..41fff16057 100644 --- a/content/nomad/v1.11.x/content/docs/upgrade/upgrade-specific.mdx +++ b/content/nomad/v1.11.x/content/docs/upgrade/upgrade-specific.mdx @@ -14,6 +14,21 @@ used to document those details separately from the standard upgrade flow. ## Nomad 1.11.1 +#### Task config emulators + +We added `emulator` and `machine_type` to the task config. +These default to the previously used values of `qemu-system-x86_64`, and `pc`. +We also added the `emulators_allowlist` driver config, which defaults to +allowing any emulator to run. + +#### `kvm` accelerator + +Previously, using the `kvm` accelerator required a machine type of `host`. This +is no longer enforced. Nomad now uses the value for `machine_type`. Also, if +using `resources.cores` with the `kvm` accelerator, Nomad set the `-smp` value +to the `resources.cores` value. Nomad now only does this when you do not specify +a custom `-smp` flag. + #### Storage fingerprinting calculation changed Nomad now calculates the storage available for scheduling using only `totalBytes @@ -28,7 +43,6 @@ The QEMU driver now uses host file paths for filesystem environment variables instead of relative container paths such as `/alloc` and `/local`. You may need to update job specs utilizing these variables to reflect the new values. - ## Nomad 1.11.0 #### Sysbatch jobs will no longer accept `reschedule` blocks