Looks like the command line equates to <devicename>=<blockdevice>
. So we should be able to do that in fog in one of a couple ways. The model version using your values would be something like:
compute = Fog::Compute.new(...) compute.servers.create( :block_device_mapping => [ { 'deviceName' => '/dev/sdb', 'virtualName' => 'ephemeral0' }, { 'deviceName' => '/dev/sdc', 'virtualName' => 'ephemeral1' }, { 'deviceName' => '/dev/sdd', 'virtualName' => 'ephemeral2' }, { 'deviceName' => '/dev/sde', 'virtualName' => 'ephemeral3' }, ], :image_id => 'ami-xxxxxxxx' )
Or the lower level, more direct path might look like:
compute.run_instances( 'ami-xxxxxxxx', 1, 1, :block_device_mapping => [ { 'deviceName' => '/dev/sdb', 'virtualName' => 'ephemeral0' }, { 'deviceName' => '/dev/sdc', 'virtualName' => 'ephemeral1' }, { 'deviceName' => '/dev/sdd', 'virtualName' => 'ephemeral2' }, { 'deviceName' => '/dev/sde', 'virtualName' => 'ephemeral3' }, ] )
I would recommend the higher-level one as it is a bit easier to use/understand (and sets some nice defaults for you). Hopefully that gets closer to a good solution for you, but happy to continue discussing.