David Kerr
2013-07-09 23:32:51 UTC
Howdy.
I'm trying to take a snapshot of the volumes on one instance and move them
to a new instance that I'm creating.
(think cloning a database server to a new environment for testing)
I get the snapshots created ok. but when I try to attach them to the new
instance I get the above error.
I've attempted to go the reverse route and attach the volumes after the
instance is created, and that sort of worked
(I got 1 volume out of the 3 i tried to attach) but I'd much rather have it
get created with the volumes.
@mysnapshot = Array.new
loop through snapshots{
if y['deviceName'] !~ /sda1/ # because i don't want the root device.
snap = $ec2.snapshots.new
snap.description = "hello"
snap.volume_id = y['volumeId']
snap.save
snap.reload
@mysnapshot.push({ 'DeviceName' => y['deviceName'], 'Ebs.SnapshotId'
=> snap.id , 'Ebs.DeleteOnTermination' => true })
end
}
server = $ec2.servers.create(
:image_id => 'ami-xxxxxxx',
:flavor_id => 'm1.large',
:ebs_optimized => 'true',
:block_device_mapping => @mysnapshot
[other stuff])
I suspect that my block_device_mapping is clobbering my root partition.
does that sound correct? assuming that i solve that does this look right?
Thanks
I'm trying to take a snapshot of the volumes on one instance and move them
to a new instance that I'm creating.
(think cloning a database server to a new environment for testing)
I get the snapshots created ok. but when I try to attach them to the new
instance I get the above error.
I've attempted to go the reverse route and attach the volumes after the
instance is created, and that sort of worked
(I got 1 volume out of the 3 i tried to attach) but I'd much rather have it
get created with the volumes.
@mysnapshot = Array.new
loop through snapshots{
if y['deviceName'] !~ /sda1/ # because i don't want the root device.
snap = $ec2.snapshots.new
snap.description = "hello"
snap.volume_id = y['volumeId']
snap.save
snap.reload
@mysnapshot.push({ 'DeviceName' => y['deviceName'], 'Ebs.SnapshotId'
=> snap.id , 'Ebs.DeleteOnTermination' => true })
end
}
server = $ec2.servers.create(
:image_id => 'ami-xxxxxxx',
:flavor_id => 'm1.large',
:ebs_optimized => 'true',
:block_device_mapping => @mysnapshot
[other stuff])
I suspect that my block_device_mapping is clobbering my root partition.
does that sound correct? assuming that i solve that does this look right?
Thanks
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.