ephemeral disk - practical example?

1,984 views
Skip to first unread message

enya...@peernova.com

unread,
May 14, 2018, 11:06:21 AM5/14/18
to Nomad

Hello

I'm trying to understand the ephemeral disk volume. 

I first ran a job that spins a busybox container, got inside it (with docker exec -it xxx sh) and then created a file inside /alloc with "touch /alloc/data/MYFILE".

Then i stopped the job and ran it again.  A new allocation was created. I was expecting to see /alloc/data/MYFILE inside the new container, but it's not.

Could someone please what's wrong with my reasoning? The documentation unfortunately doesn't provide any practical example. 

Thank you.
 

Justin DynamicD

unread,
May 14, 2018, 1:26:42 PM5/14/18
to Nomad
Ephemeral means "lasting a really short time", and by nature it's meant to refer to volumes where the long term state doesn't matter ... thus data is not retained.  So basically this is working as intended.  Nothing placed on an ephemeral disk ever survives a restart.


These kind of disks are ideal for scenarios where you essentially want a restart to "start clean".  Non-data volumes in an immutable architecture are ideal for this, as an example as it forces people to create new containers instead of being tempted to edit them after deployment.  They also get used a lot as /tmp volumes for similar reasons.

Edson Yamada

unread,
May 14, 2018, 1:49:36 PM5/14/18
to Nomad
I really didn't get it.

The doc (https://www.nomadproject.io/docs/job-specification/ephemeral_disk.html) says 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.

So, despite the "ephemeral" name, shouldn't the data be copied/moved from the old allocation to the new one when i stop/start a job?

If not, what's the purpose of ephemeral disk? 

tks 



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/849b3867-68b4-405c-9123-c1f32f557873%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Justin DynamicD

unread,
May 14, 2018, 4:59:50 PM5/14/18
to Nomad
I see where you're coming from now.

I think it has to do with the fact that you're stopping the job instead of just updating it and that action having something to do with when it decides to flush the contents of the disk.  Most examples I'm reading are about re-running batches and other "temporary" tasks that eventually exit on their own.  It would take some code spelunking or a more offical authority to answer that one, I'm afraid.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages