Sunday, 15 September 2013

ruby - How to run AWS instances with attached ephemeral disks with the fog library -


I would like to know what is the option of "block-device-maping" in the ec2 fog library To include short-term discs on examples of AWS, command line -stone-instance command line.

There is a reference on BlockDeviceMappings in the Cog source code. But since the documentation is a bit short and I am not a Ruby expert, any help will be welcomed! "post-text" itemprop = "text">

It looks like the command line is & lt; Devicename & gt; = & Lt; Block Devices & gt; . That is why we should be able to do this in fog in one of the ways. Using your values, the model version will look something like this:

 compute = Fog :: Compute.new (...) compute.servers.create (: block_device_mapping => [{'deviceName' = ' & Gt; '' / dev / sdb ',' virtualname '= & gt;' ephemeral0 '}, {' deviceName '=>' / dev / sdc ',' virtualname '= & gt;' ephemeral1 '}, {'DeviceName' = & gt; '/ dev / sdd', 'virtualname' = & gt; ephemeral2 '}, {' deviceName '= & gt;' / dev / sde ',' virtualname '= & gt; Ephemeral3 '},],: image_id =>' Ami-xxxxxxxx ')  

or lower level, more direct path may look like this:

 compute.run_instances (' Block_device_mapping = & gt; ['DeviceName' = & gt; '/ dev / sdb', 'virtualname' = & gt; ephemeral0 '}, {' deviceName '= & gt ;,' ami-xxxxxxxx ', 1, 1, '/ Dev / sdc', 'virtualname' = & gt; ephemeral 1 '},' suffix C Name '= & gt;' ephemeral2 '}, {' deviceName '= & gt;' / dev / sde ',' virtualname '= & gt; ephemeral 3'},])  

I Recommend a high-level one because it is a little easier to use / understand (and sets something and a good omission for you). Hope that comes close to a good solution for you, but is happy to continue the discussion.

No comments:

Post a Comment