Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Allow per-ephemeral-disk options using :disks attribute #247

merged 1 commit into from

3 participants


This is the (simple) concrete version of what I mentioned on the ironfan-users mailing list.

In effect, this allows you to provide volume attributes, on a per-ephemeral-disk basis. My own motivation was to be able to override the :mount_point attribute.


mount_ephemerals is just a wrapper around a set of calls to volume, same as other calls to volume.

You should be able to say volumes(:ephemeral0).mount_point '/foo/bar' (not tested, please pardon typos). Can you find out if this works?

A hash here seems like sugar on sugar. I think we're better off getting at the volumes directly, but that's not a passionate opinion.


:+1: for using existing semantics, if possible. I think it should work.


It does work, but it's very un-DRY. Why? Because I can't (or at least I believe I can't) specify #volume calls at the cluster level.

To put numbers on the size of this problem: my cluster has 18 clusters, 16 of which I would like to have mount two of their ephemeral disks in specific locations. To achieve this with #volume calls in the different facets would be 21216= 384 lines of cluster file cut-and-pasta.

In contrast, doing it with my proposed syntactic sugar would be +5 lines in the cluster cloud(:ec2) section and +6 lines in the two facets that want different behavior.


Oh - and one other thing I forgot to mention. Mounting a single ephemeral volume manually with a #volume call disallows the possibility of a cluster- or facet-level #mount_ephemerals call, or at least makes its behaviors unpredictable. So, if you want to do something like set some global ephemerals :tags with a cluster-level mount_ephemerals call, it will actually stomp on the volume('ephemeral0') call inside a specific facet.

This syntactic sugar also happens to resolve that stomping ambiguity.


@nickmarden - thanks for explaining further.

@mrflip - the underlying problems he's got with ephemerals sounds very much like a complicated interaction between the resolve code and the way mount_ephemerals works. We definitely need fixing the resolve code to be a priority Real Soon Now: the vSphere provider approacheth, and its also causing many other issues (like this).


So...I have a project under way right now to handle this not-relocatable-software problem for our production cluster, and I'm hoping to get some guidance about which way you guys think this pull request will go.

There would and should be some push-back here at Get Satisfaction if I propose the +384 line approach described above. Since I really really strongly prefer not to run a non-mainstream version of ironfan core in Get Satisfaction's ironfan-homebase, please allow me to rephrase my pull request rationale in the hopes of swaying you:

"Since #mount_ephemerals is a syntactic sugar replacement for multiple calls to #volume, it should either support the full set of configuration parameters for each individual volume (this pull request), or it should be possible to declare volume behaviors at a cluster level in order to keep cluster definitions dry. The former is simple, whereas the latter would probably have far-reaching DSL implications."

Also, please note that I batted my eyelashes while saying that. And that I'm cute.

@temujin9 temujin9 merged commit c8c8e9f into infochimps-labs:master

Sold. It'll be in the next gem I cut.


(Which might be a little while . . . )


Okay, gem cut and pushed, finally. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
8 lib/ironfan/dsl/ec2.rb
@@ -104,7 +104,13 @@ def implied_volumes
mount_options 'defaults,noatime'
tags({:bulk => true, :local => true, :fallback => true})
- ephemeral.receive! mount_ephemerals
+ ephemeral_attrs = mount_ephemerals.clone
+ if ephemeral_attrs.has_key?(:disks)
+ disk_attrs = mount_ephemerals[:disks][idx] || { }
+ ephemeral_attrs.delete(:disks)
+ ephemeral_attrs.merge!(disk_attrs)
+ end
+ ephemeral.receive! ephemeral_attrs
result << ephemeral
8 spec/ironfan/ec2/cloud_provider_spec.rb
@@ -13,6 +13,10 @@
facet :web do
instances 3
+ cloud(:ec2) do
+ flavor 'm1.small'
+ mount_ephemerals({ :disks => { 0 => { :mount_point => '/data' } } })
+ end
@@ -30,6 +34,10 @@
it 'should have one cloud provider, EC2' do
@facet.servers[0].clouds.keys.should == [ :ec2 ]
+ it 'should have its first ephemeral disk mounted at /data' do
+ @facet.servers[0].implied_volumes[1].mount_point.should == '/data'
+ end
Something went wrong with that request. Please try again.