open-nomad/website/content/docs/job-specification/ephemeral_disk.mdx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
2.2 KiB
Plaintext
Raw Normal View History

2016-11-01 00:03:31 +00:00
---
2020-02-06 23:45:31 +00:00
layout: docs
page_title: ephemeral_disk Block - Job Specification
2016-11-01 00:03:31 +00:00
description: |-
The "ephemeral_disk" block describes the ephemeral disk requirements of the
group. Ephemeral disks can be marked as sticky and support live data
2016-11-01 01:52:45 +00:00
migrations.
2016-11-01 00:03:31 +00:00
---
# `ephemeral_disk` Block
2016-11-01 00:03:31 +00:00
2020-02-06 23:45:31 +00:00
<Placement groups={['job', 'group', 'ephemeral_disk']} />
2016-11-01 01:52:45 +00:00
The `ephemeral_disk` block describes the ephemeral disk requirements of the
group. Ephemeral disks can be marked as sticky and support live data migrations.
All tasks in this group will share the same ephemeral disk.
2016-11-01 00:03:31 +00:00
```hcl
job "docs" {
group "example" {
ephemeral_disk {
migrate = true
size = 500
2016-11-01 00:03:31 +00:00
sticky = true
}
}
}
```
The ephemeral disk can be referenced under `alloc/data/`. More information can be found in the [filesystem internals].
2016-11-01 00:03:31 +00:00
## `ephemeral_disk` Parameters
- `migrate` `(bool: false)` - When `sticky` is true, this specifies that the
Nomad client should make a best-effort attempt to migrate the data from a
remote machine if placement cannot be made on the original node. During data
migration, the task will block starting until the data migration has
completed. Migration is atomic and any partially migrated data will be
removed if an error is encountered.
2016-11-01 00:03:31 +00:00
2020-02-06 23:45:31 +00:00
- `size` `(int: 300)` - Specifies the size of the ephemeral disk in MB. The
current Nomad ephemeral storage implementation does not enforce this limit;
however, it is used during job placement.
2016-11-01 00:03:31 +00:00
- `sticky` `(bool: false)` - Specifies that Nomad should make a best-effort
attempt to place the updated allocation on the same machine. This will move
the `local/` and `alloc/data` directories to the new allocation.
## `ephemeral_disk` Examples
The following examples only show the `ephemeral_disk` blocks. Remember that the
`ephemeral_disk` block is only valid in the placements listed above.
2016-11-01 00:03:31 +00:00
### Sticky Volumes
This example shows enabling sticky volumes with Nomad using ephemeral disks:
```hcl
ephemeral_disk {
sticky = true
}
```
[resources]: /nomad/docs/job-specification/resources 'Nomad resources Job Specification'
[filesystem internals]: /nomad/docs/concepts/filesystem#templates-artifacts-and-dispatch-payloads 'Filesystem internals documentation'