Skip to content

Instantly share code, notes, and snippets.

Forked from anonymous/glance-test.rb
Created December 19, 2012 13:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rubiojr/4336571 to your computer and use it in GitHub Desktop.
require 'fog'
require 'pp'
require 'benchmark'
conn = nil do |x| 'connection:'.ljust(15) do
conn ={
:provider => 'OpenStack',
:openstack_api_key => ENV['OS_PASSWORD'],
:openstack_username => ENV["OS_USERNAME"],
:openstack_auth_url => ENV["OS_AUTH_URL"] + "/tokens",
:openstack_tenant => ENV["OS_TENANT_NAME"],
:connection_options => { :ssl_verify_peer => false },
end 'create 10 images:'.ljust(15) do
10.times do
img = conn.create_image :name => 'test-img',
:disk_format => 'qcow2',
:container_format => 'bare',
:location => 'fake-img.img'
end 'list images:'.ljust(15) do
end 'destroy images:'.ljust(15) do
conn.images.each { |img| img.destroy }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment