mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
support r3 instances & expose virtualization type
This commit is contained in:
parent
e76623f9bc
commit
00ec36aa7e
6 changed files with 56 additions and 3 deletions
|
@ -304,6 +304,56 @@ module Fog
|
||||||
:ram => 249856,
|
:ram => 249856,
|
||||||
:ebs_optimized_available => false,
|
:ebs_optimized_available => false,
|
||||||
:instance_store_volumes => 8
|
:instance_store_volumes => 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:id => "r3.large",
|
||||||
|
:name => "R3 Large",
|
||||||
|
:bits => 64,
|
||||||
|
:cores => 2,
|
||||||
|
:ram => 15360,
|
||||||
|
:disk => 32,
|
||||||
|
:ebs_optimized_available => true,
|
||||||
|
:instance_store_volumes => 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:id => "r3.xlarge",
|
||||||
|
:name => "R3 Extra Large",
|
||||||
|
:bits => 64,
|
||||||
|
:cores => 4,
|
||||||
|
:ram => 31232,
|
||||||
|
:disk => 80,
|
||||||
|
:ebs_optimized_available => true,
|
||||||
|
:instance_store_volumes => 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:id => "r3.2xlarge",
|
||||||
|
:name => "R3 Double Extra Large",
|
||||||
|
:bits => 64,
|
||||||
|
:cores => 8,
|
||||||
|
:ram => 62464,
|
||||||
|
:disk => 160,
|
||||||
|
:ebs_optimized_available => true,
|
||||||
|
:instance_store_volumes => 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:id => "r3.4xlarge",
|
||||||
|
:name => "R3 Quadruple Extra Large",
|
||||||
|
:bits => 64,
|
||||||
|
:cores => 16,
|
||||||
|
:ram => 124928,
|
||||||
|
:disk => 320,
|
||||||
|
:ebs_optimized_available => true,
|
||||||
|
:instance_store_volumes => 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:id => "r3.8xlarge",
|
||||||
|
:name => "R3 Eight Extra Large",
|
||||||
|
:bits => 64,
|
||||||
|
:cores => 32,
|
||||||
|
:ram => 249856,
|
||||||
|
:disk => 640,
|
||||||
|
:ebs_optimized_available => true,
|
||||||
|
:instance_store_volumes => 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ module Fog
|
||||||
attribute :root_device_name, :aliases => 'rootDeviceName'
|
attribute :root_device_name, :aliases => 'rootDeviceName'
|
||||||
attribute :tags, :aliases => 'tagSet'
|
attribute :tags, :aliases => 'tagSet'
|
||||||
attribute :name
|
attribute :name
|
||||||
|
attribute :virtualization_type, :aliases => 'virtualizationType'
|
||||||
|
|
||||||
def deregister(delete_snapshot = false)
|
def deregister(delete_snapshot = false)
|
||||||
service.deregister_image(id)
|
service.deregister_image(id)
|
||||||
|
|
|
@ -32,7 +32,7 @@ module Fog
|
||||||
when 'architecture', 'clientToken', 'dnsName', 'hypervisor', 'imageId',
|
when 'architecture', 'clientToken', 'dnsName', 'hypervisor', 'imageId',
|
||||||
'instanceId', 'instanceType', 'ipAddress', 'kernelId', 'keyName',
|
'instanceId', 'instanceType', 'ipAddress', 'kernelId', 'keyName',
|
||||||
'instanceLifecycle', 'platform', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
|
'instanceLifecycle', 'platform', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
|
||||||
'reason', 'requesterId', 'rootDeviceType',
|
'reason', 'requesterId', 'rootDeviceName', 'rootDeviceType',
|
||||||
'spotInstanceRequestId', 'virtualizationType'
|
'spotInstanceRequestId', 'virtualizationType'
|
||||||
@instance[name] = value
|
@instance[name] = value
|
||||||
when 'attachTime'
|
when 'attachTime'
|
||||||
|
|
|
@ -236,7 +236,7 @@ module Fog
|
||||||
'ownerId' => instance['ownerId'],
|
'ownerId' => instance['ownerId'],
|
||||||
'reservationId' => instance['reservationId']
|
'reservationId' => instance['reservationId']
|
||||||
}
|
}
|
||||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'ebsOptimized', 'hypervisor', 'iamInstanceProfile', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'networkInterfaces', 'ownerId', 'placement', 'platform', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType', 'stateReason', 'virtualizationType'].include?(key)}.merge('tagSet' => self.data[:tag_sets][instance['instanceId']])
|
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'ebsOptimized', 'hypervisor', 'iamInstanceProfile', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'networkInterfaces', 'ownerId', 'placement', 'platform', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceName', 'rootDeviceType', 'stateReason', 'virtualizationType'].include?(key)}.merge('tagSet' => self.data[:tag_sets][instance['instanceId']])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -238,6 +238,7 @@ module Fog
|
||||||
'privateDnsName' => nil,
|
'privateDnsName' => nil,
|
||||||
'productCodes' => [],
|
'productCodes' => [],
|
||||||
'reason' => nil,
|
'reason' => nil,
|
||||||
|
'rootDeviceName' => block_device_mapping.first && block_device_mapping.first["deviceName"],
|
||||||
'rootDeviceType' => 'instance-store',
|
'rootDeviceType' => 'instance-store',
|
||||||
'virtualizationType' => 'paravirtual'
|
'virtualizationType' => 'paravirtual'
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
||||||
'privateDnsName' => NilClass,
|
'privateDnsName' => NilClass,
|
||||||
'productCodes' => Array,
|
'productCodes' => Array,
|
||||||
'reason' => Fog::Nullable::String,
|
'reason' => Fog::Nullable::String,
|
||||||
|
'rootDeviceName' => Fog::Nullable::String,
|
||||||
'rootDeviceType' => String,
|
'rootDeviceType' => String,
|
||||||
'sourceDestCheck' => Fog::Nullable::Boolean,
|
'sourceDestCheck' => Fog::Nullable::Boolean,
|
||||||
'subnetId' => Fog::Nullable::String,
|
'subnetId' => Fog::Nullable::String,
|
||||||
|
@ -175,7 +176,7 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
||||||
key = Fog::Compute[:aws].key_pairs.create(:name => key_name)
|
key = Fog::Compute[:aws].key_pairs.create(:name => key_name)
|
||||||
|
|
||||||
tests("#run_instances").formats(@run_instances_format) do
|
tests("#run_instances").formats(@run_instances_format) do
|
||||||
data = Fog::Compute[:aws].run_instances(@ami, 1, 1, 'InstanceType' => 't1.micro', 'KeyName' => key_name).body
|
data = Fog::Compute[:aws].run_instances(@ami, 1, 1, 'InstanceType' => 't1.micro', 'KeyName' => key_name, 'BlockDeviceMapping' => [{"DeviceName" => "/dev/sdp1", "VirtualName" => nil, "Ebs.VolumeSize" => 15}]).body
|
||||||
@instance_id = data['instancesSet'].first['instanceId']
|
@instance_id = data['instancesSet'].first['instanceId']
|
||||||
data
|
data
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue