Support softlayer dedicated host in salt-cloud.

Update docs as well.
This commit is contained in:
Federico Pires 2017-10-25 10:58:12 -03:00
parent 405b882438
commit e7aebf46ce
2 changed files with 22 additions and 2 deletions

View File

@ -94,6 +94,8 @@ Set up an initial profile at ``/etc/salt/cloud.profiles``:
private_vlan: 396 private_vlan: 396
private_network: True private_network: True
private_ssh: True private_ssh: True
# Use a dedicated host instead of cloud
dedicated_host_id: 1234
# May be used _instead_of_ image # May be used _instead_of_ image
global_identifier: 320d8be5-46c0-dead-cafe-13e3c51 global_identifier: 320d8be5-46c0-dead-cafe-13e3c51
@ -334,9 +336,21 @@ it can be verified with Salt:
# salt 'myserver.example.com' test.ping # salt 'myserver.example.com' test.ping
Dedicated Host
Cloud Profiles
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Soflayer allows the creation of new VMs in a dedicated host. This means that
you can order and pay a fixed amount for a bare metal dedicated host and use
it to provision as many VMs as you can fit in there. If you want your VMs to
be launched in a dedicated host, instead of Sofltayer's cloud, set the
``dedicated_host_id`` parameter in your profile.
dedicated_host_id
-----------------
The id of the dedicated host where the VMs should be created. If not set, VMs
will be created in Softlayer's cloud instead.
Bare metal Profiles
~~~~~~~~~~~~~~~~~~~
Set up an initial profile at ``/etc/salt/cloud.profiles``: Set up an initial profile at ``/etc/salt/cloud.profiles``:
.. code-block:: yaml .. code-block:: yaml

View File

@ -371,6 +371,12 @@ def create(vm_):
if post_uri: if post_uri:
kwargs['postInstallScriptUri'] = post_uri kwargs['postInstallScriptUri'] = post_uri
dedicated_host_id = config.get_cloud_config_value(
'dedicated_host_id', vm_, __opts__, default=None
)
if dedicated_host_id:
kwargs['dedicatedHost'] = {'id': dedicated_host_id}
__utils__['cloud.fire_event']( __utils__['cloud.fire_event'](
'event', 'event',
'requesting instance', 'requesting instance',