2016-11-01 00:03:31 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "ephemeral_disk Stanza - Job Specification"
|
|
|
|
sidebar_current: "docs-job-specification-ephemeral_disk"
|
|
|
|
description: |-
|
2016-11-01 01:52:45 +00:00
|
|
|
The "ephemeral_disk" stanza describes the ephemeral disk requirements of the
|
2016-11-02 13:26:08 +00:00
|
|
|
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` Stanza
|
|
|
|
|
|
|
|
<table class="table table-bordered table-striped">
|
|
|
|
<tr>
|
|
|
|
<th width="120">Placement</th>
|
|
|
|
<td>
|
|
|
|
<code>job -> group -> **ephemeral_disk**</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2016-11-01 01:52:45 +00:00
|
|
|
|
|
|
|
The `ephemeral_disk` stanza describes the ephemeral disk requirements of the
|
2016-11-02 13:26:08 +00:00
|
|
|
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"
|
|
|
|
sticky = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## `ephemeral_disk` Parameters
|
|
|
|
|
2017-06-28 16:21:01 +00:00
|
|
|
- `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.
|
2016-11-01 00:03:31 +00:00
|
|
|
|
2017-06-28 16:51:27 +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` stanzas. Remember that the
|
|
|
|
`ephemeral_disk` stanza is only valid in the placements listed above.
|
|
|
|
|
|
|
|
### Sticky Volumes
|
|
|
|
|
|
|
|
This example shows enabling sticky volumes with Nomad using ephemeral disks:
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
ephemeral_disk {
|
|
|
|
sticky = true
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
[resources]: /docs/job-specification/resources.html "Nomad resources Job Specification"
|