Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added spec checking that it skips block_device_mapping for non-epheme…

…ral storage if volume id is present
  • Loading branch information...
commit db0f737757c80975dbc52fdc9ab1cc9fcd818224 1 parent 5f406a7
Philip (flip) Kromer authored
View
9 clusters/demoweb.rb
@@ -56,7 +56,7 @@
end
facet :dbnode do
- instances 1
+ instances 2
role "mysql_server"
role "redis_client"
# an m1.large is usually OK but if we have to increase the number of backend
@@ -67,7 +67,6 @@
end
volume(:data) do
- snapshot_id 'snap-d9c1edb1'
size 50
keep true
device '/dev/sdi'
@@ -75,7 +74,11 @@
mount_options 'defaults,nouuid,noatime'
fs_type 'xfs'
end
- server(0).volume(:data).volume_id 'vol-12345'
+ server(0).volume(:data).snapshot_id 'snap-d9c1edb1'
+ server(1).volume(:data) do
+ snapshot_id 'snap-d9c1edb1'
+ volume_id 'vol-12345'
+ end
end
facet :esnode do
View
15 spec/cluster_chef/server_spec.rb
@@ -24,7 +24,6 @@
vol.to_hash.should == {
:name => :data,
:tags => {},
- :volume_id => "vol-12345",
:snapshot_id => "snap-d9c1edb1",
:size => 50,
:keep => true,
@@ -45,6 +44,12 @@
"Ebs.DeleteOnTermination" => "false"
}
end
+
+ it 'skips block_device_mapping for non-ephemeral storage if volume id is present' do
+ vol = @facet.server(1).composite_volumes[:data]
+ vol.block_device_mapping.should be_nil
+ end
+
end
end
@@ -62,10 +67,10 @@
:tags => {:cluster=>:demoweb, :facet=>:dbnode, :index=>0},
:block_device_mapping => [
{"DeviceName"=>"/dev/sdi", "Ebs.SnapshotId"=>"snap-d9c1edb1", "Ebs.VolumeSize"=>50, "Ebs.DeleteOnTermination"=>"false"},
- {"DeviceName"=>"/dev/sdc", "VirtualName"=>"ephemeral0"},
- {"DeviceName"=>"/dev/sdd", "VirtualName"=>"ephemeral1"},
- {"DeviceName"=>"/dev/sde", "VirtualName"=>"ephemeral2"},
- {"DeviceName"=>"/dev/sdf", "VirtualName"=>"ephemeral3"},
+ {"DeviceName"=>"/dev/sdb", "VirtualName"=>"ephemeral0"},
+ {"DeviceName"=>"/dev/sdc", "VirtualName"=>"ephemeral1"},
+ {"DeviceName"=>"/dev/sdd", "VirtualName"=>"ephemeral2"},
+ {"DeviceName"=>"/dev/sde", "VirtualName"=>"ephemeral3"},
],
:availability_zone => "us-east-1a",
:monitoring => nil
View
4 spec/cluster_chef_spec.rb
@@ -84,7 +84,7 @@
:run_list => ["role[mysql_server]", "role[redis_client]", "role[demoweb_dbnode]" ],
:chef_attributes => {},
:facet_role => "demoweb_dbnode",
- :instances => 1,
+ :instances => 2,
}
fct.cloud.flavor.should == 'c1.xlarge'
fct.server(0).cloud.flavor.should == 'm1.large'
@@ -128,7 +128,7 @@
it 'has servers' do
@cluster.servers.map(&:fullname).should == [
- "demoweb-dbnode-0",
+ "demoweb-dbnode-0", "demoweb-dbnode-1",
"demoweb-esnode-0",
"demoweb-webnode-0", "demoweb-webnode-1", "demoweb-webnode-2", "demoweb-webnode-3", "demoweb-webnode-4", "demoweb-webnode-5"
]
Please sign in to comment.
Something went wrong with that request. Please try again.