Skip to content

Instantly share code, notes, and snippets.

@dagi3d
Created April 10, 2013 17:49
Show Gist options
  • Save dagi3d/5356854 to your computer and use it in GitHub Desktop.
Save dagi3d/5356854 to your computer and use it in GitHub Desktop.
ebs attaching
require 'right_aws'
ec2 = RightAws::Ec2.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
volume = ec2.create_volume(nil, 1, 'us-east-1c')
sleep 5
ec2.attach_volume(volume[:aws_id], 'i-3b7dc953', '/dev/sdh1')
[root@ip-10-137-4-86 ~]# ls /dev/sd*
/dev/sda
[root@ip-10-137-4-86 ~]# ruby ebs_test.rb
I, [2013-04-10T17:46:13.632555 #3059] INFO -- : New RightAws::Ec2 using shared connections mode
I, [2013-04-10T17:46:13.633544 #3059] INFO -- : Opening new HTTPS connection to ec2.amazonaws.com:443
[root@ip-10-137-4-86 ~]# ls /dev/sd*
/dev/sda /dev/sdl1
@dagi3d
Copy link
Author

dagi3d commented Apr 10, 2013

according to the aws console the volume was attached to /dev/sdh1 exactly as I wanted but the system(a CentOS 6.3 machine) uses another device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment