Created
April 10, 2013 17:49
-
-
Save dagi3d/5356854 to your computer and use it in GitHub Desktop.
ebs attaching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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