datestring = Date.today.strftime('%Y%m%d')
puts datestring
data = compute.snapshots.all(description: "db01r1*data*#{datestring}*").first
log = compute.snapshots.all(description: "db01r1*log*#{datestring}*").first
journal = compute.snapshots.all(description: "db01r1*journal*#{datestring}*").first
mapping = [
{
DeviceName: '/dev/sdf',
Ebs: {
SnapshotId: data.id
},
},
{
DeviceName: '/dev/sdg',
Ebs: {
SnapshotId: journal.id
},
},
{
DeviceName: '/dev/sdh',
Ebs: {
SnapshotId: log.id
}
}
]
pp mapping
s = compute.servers.create image_id: IMAGE_ID, flavor_id: 'm3.medium', description: "dbtest-#{datestring}", block_device_mapping: mapping
On 13 February 2015 at 04:42:37, Bryan Conrad (bkco...@gmail.com) wrote:
mapping = [
{
DeviceName: '/dev/sdf',
Ebs: {
SnapshotId: data.id
},
},
{
DeviceName: '/dev/sdg',
Ebs: {
SnapshotId: journal.id
},
},
{
DeviceName: '/dev/sdh',
Ebs: {
SnapshotId: log.id
}
}
]