1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

default to Ubuntu 10.04 LTS 64bit for image id

This commit is contained in:
geemus 2011-04-14 16:31:58 -07:00
parent 331d58dabf
commit 945df29845
10 changed files with 39 additions and 10 deletions

View file

@ -205,6 +205,8 @@ module Fog
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
@region = options[:region] ||= 'us-east-1'
if @endpoint = options[:endpoint]
endpoint = URI.parse(@endpoint)
@host = endpoint.host
@ -212,7 +214,6 @@ module Fog
@port = endpoint.port
@scheme = endpoint.scheme
else
options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region]
when 'ap-northeast-1'
'ec2.ap-northeast-1.amazonaws.com'

View file

@ -42,8 +42,22 @@ module Fog
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
def initialize(attributes={})
self.groups ||= ["default"] unless attributes[:subnet_id]
self.flavor_id ||= 'm1.small'
self.groups ||= ["default"] unless attributes[:subnet_id]
self.flavor_id ||= 'c1.medium'
self.image_id ||= begin
case attributes[:connection].instance_variable_get(:@region) # Ubuntu 10.04 LTS 64bit (EBS)
when 'ap-northeast-1'
'ami-5e0fa45f'
when 'ap-southeast-1'
'ami-f092eca2'
when 'eu-west-1'
'ami-3d1f2b49'
when 'us-east-1'
'ami-3202f25b'
when 'us-west-1'
'ami-f5bfefb0'
end
end
super
end

View file

@ -25,7 +25,8 @@ module Fog
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
def initialize(attributes={})
self.flavor_id ||= '94fd37a7-2606-47f7-84d5-9000deda52ae'
self.flavor_id ||= '94fd37a7-2606-47f7-84d5-9000deda52ae' # Block 1GB Virtual Server
self.image_id ||= '03807e08-a13d-44e4-b011-ebec7ef2c928' # Ubuntu LTS 10.04 64bit
super
end

View file

@ -28,6 +28,12 @@ module Fog
attribute :cloud_ips
attribute :interfaces
def initialize(attributes={})
self.flavor_id ||= 'typ-4nssg' # Nano
self.image_id ||= 'img-tjjt6' # Lucid 10.04 LTS 64bit
super
end
def snapshot
requires :identity
connection.snapshot_server(identity)

View file

@ -21,6 +21,7 @@ module Fog
attribute :sandbox # Optional. Default: False
def initialize(attributes={})
image_id ||= 'ubuntu_10_04_LTS_64_base' # Ubuntu 10.04 LTS 64bit
super
end

View file

@ -22,7 +22,8 @@ module Fog
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
def initialize(attributes={})
self.flavor_id ||= 1
self.flavor_id ||= 1 # 256 server
self.image_id ||= 49 # Ubuntu 10.04 LTS 64bit
super
end

View file

@ -23,7 +23,8 @@ module Fog
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
def initialize(attributes={})
self.flavor_id ||= 1
self.flavor_id ||= 1 # 256 server
self.image_id ||= 49 # Ubuntu 10.04 LTS 64bit
super
end

View file

@ -4,8 +4,11 @@ module Fog
module Voxel
class Compute
class Image < Fog::Model
identity :id
attribute :name
attribute :summary
end
end
end

View file

@ -16,6 +16,7 @@ module Fog
attribute :ip_assignments, :aliases => 'ipassignments'
def initialize(attributes={})
self.image_id ||= '55' # Ubuntu 10.04 LTS 64bit
super
end

View file

@ -16,10 +16,10 @@ module Fog
options[:image_id] = image_id
end
data = request("voxel.images.list", options).body
data = request("voxel.images.list", options)
if data['stat'] == "ok"
data['images']
if data.body['stat'] == "ok"
data
else
raise Fog::Voxel::Compute::NotFound
end