what is OpenStack?
• Open source cloud infrastructure
• Broadly available
• Runs on non proprietary hardware
• Governed by the OpenStack Foundation
• AT&T, Canonical, HP, IBM, Rackspace
(others)
OpenStack birth
“ Launched Nova. Apache-Licensed Cloud
Computing, in Python. It’s live. it’s buggy, it’s
beta. Check it out “
- Joshua McKenty blog post, summer 2010
@jmckenty
(Joshua McKenty)
OpenStack birth
• NASA Aimes CTO
• Worked with Microsoft/Google
on some NASA visualizations
• Preferred Google’s approach
• NASA needs a cloud!
@kemp
(Chris Kemp)
ok, why should I care?
• Less than 2% of global
compute workloads run on
AWS
• Large companies have public
data concerns
• Countries have security
concerns
fog collections
module Fog
module Compute
class HPV2
class VolumeAttachments < Fog::Collection
!
model Fog::Compute::HPV2::VolumeAttachment
!
attr_accessor :server
!
def all
requires :server
data = service.list_server_volumes(server.id).body['volumeAttachments']
load(data)
end
!
def get(volume_id)
requires :server
if data = service.get_server_volume_details(server.id, volume_id).body['volumeAttachment']
new(data)
end
rescue Fog::Compute::HPV2::NotFound
nil
end
end
end
end
end
fog models
module Fog
module Compute
class HPV2
!
class AvailabilityZone < Fog::Model
!
identity :name, :aliases => 'zoneName'
!
attribute :zoneState
attribute :hosts
!
def available?
zoneState['available']
end
!
end
!
end
end
end
fog requests
• actual business logic for request
def list_flavors(options = {})
request(
:expects => [200, 203],
:method => 'GET',
:path => 'flavors',
:query => options
)
end
fog mocks
• test data to return example API responses
• requires no network connection