Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
Created May 4, 2011 17:19
Show Gist options
  • Save jedi4ever/955604 to your computer and use it in GitHub Desktop.
Save jedi4ever/955604 to your computer and use it in GitHub Desktop.
create AMI from instance with fog
>> aws_provider=Fog::Compute.new({ :region => "eu-west-1", :provider => "AWS"})
-> instance (running) = i-c1ac2bb7
>> ami=aws_provider.create_image("i-c1ac2bb7","name","description")
If not yet finished you might see
/Users/patrick/.rvm/gems/ruby-1.8.7-p330@mccloud/gems/excon-0.6.2/lib/excon/connection.rb:178:in `request':
InvalidAMIID.Unavailable => AMI 'ami-796d5b0d' is pending, and cannot be run (Fog::Service::Error)
but after that it's ready to use!
List all images that we are the owner of:
f.images.all({ "Owner" => "self"})
Remove it again
f.deregister_image("ami-796d5b0d")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment