Make bandwidth/port speed options for softlayer-hw

This commit is contained in:
Joseph Hall 2013-09-24 20:06:52 +00:00
parent 4b37cd7949
commit b9b2d0d063
2 changed files with 46 additions and 9 deletions

View File

@ -159,12 +159,13 @@ vlan
If it is necessary for an instance to be created within a specific VLAN, the ID If it is necessary for an instance to be created within a specific VLAN, the ID
for that VLAN can be specified in either the provider or profile configuration. for that VLAN can be specified in either the provider or profile configuration.
This ID can be queried using the `list_vlans` function, as described below. This ID can be queried using the `list_vlans` function, as described below. This
setting is optional.
max_net_speed max_net_speed
------------- -------------
Specifies the connection speed for the instance's network components. By Specifies the connection speed for the instance's network components. This
default, this is set to 10. setting is optional. By default, this is set to 10.
The profile can be realized now with a salt command: The profile can be realized now with a salt command:
@ -202,6 +203,8 @@ Set up an initial profile at ``/etc/salt/cloud.profiles``:
domain: example.com domain: example.com
# Optional # Optional
vlan: 396 vlan: 396
port_speed: 273
banwidth: 248
Most of the above items are required; optional items are specified below. Most of the above items are required; optional items are specified below.
@ -268,6 +271,34 @@ for that VLAN can be specified in either the provider or profile configuration.
This ID can be queried using the `list_vlans` function, as described below. This ID can be queried using the `list_vlans` function, as described below.
port_speed
----------
Specifies the speed for the instance's network port. This setting refers to an
ID within the SoftLayer API, which sets the port speed. This setting is
optional. The default is 273, or, 100 Mbps Public & Private Networks. The
following settings are available:
* 273: 100 Mbps Public & Private Networks
* 274: 1 Gbps Public & Private Networks
* 21509: 10 Mbps Dual Public & Private Networks (up to 20 Mbps)
* 21513: 100 Mbps Dual Public & Private Networks (up to 200 Mbps)
* 2314: 1 Gbps Dual Public & Private Networks (up to 2 Gbps)
* 272: 10 Mbps Public & Private Networks
bandwidth
---------
Specifies the network bandwidth available for the instance. This setting refers
to an ID within the SoftLayer API, which sets the bandwidth. This setting is
optional. The default is 248, or, 5000 GB Bandwidth. The following settings are
available:
* 248: 5000 GB Bandwidth
* 129: 6000 GB Bandwidth
* 130: 8000 GB Bandwidth
* 131: 10000 GB Bandwidth
* 36: Unlimited Bandwidth (10 Mbps Uplink)
* 125: Unlimited Bandwidth (100 Mbps Uplink)
Actions Actions
======= =======

View File

@ -397,12 +397,6 @@ def create(vm_):
# Image Ex: 13963: CentOS 6.0 - Minimal Install (64 bit) # Image Ex: 13963: CentOS 6.0 - Minimal Install (64 bit)
{'id': vm_['image']}, {'id': vm_['image']},
# The following items should be made into an option
# 100 Mbps Public & Private Networks
{'id': '273'},
# 5000 GB Bandwidth
{'id': '248'},
# The following items are currently required # The following items are currently required
# Reboot / Remote Console # Reboot / Remote Console
{'id': '905'}, {'id': '905'},
@ -427,6 +421,18 @@ def create(vm_):
for product in optional_products: for product in optional_products:
kwargs['prices'].append({'id': product}) kwargs['prices'].append({'id': product})
# Default is 273 (100 Mbps Public & Private Networks)
port_speed = config.get_config_value(
'port_speed', vm_, __opts__, default=273
)
kwargs['prices'].append({'id': port_speed})
# Default is 248 (5000 GB Bandwidth)
bandwidth = config.get_config_value(
'bandwidth', vm_, __opts__, default=248
)
kwargs['prices'].append({'id': bandwidth})
vlan_id = config.get_config_value( vlan_id = config.get_config_value(
'vlan', vm_, __opts__, default=False 'vlan', vm_, __opts__, default=False
) )