SoftLayer: Added flavor option (#56036)

* Added flavor option

Added flavor option to allow for use of SoftLayer flavor templates when creating new virtual machines.

See here for examples of ordering a vm with the flavor parameter:
https://softlayer-python.readthedocs.io/en/latest/api/managers/vs.html

To see flavor options use:
`slcli vs create-options`

* Update sl_vm.py

* Update sl_vm.py

* fixed version
This commit is contained in:
Majeed Mirza 2019-09-24 11:18:49 -04:00 committed by ansibot
parent 3299f29f7c
commit 28d30a04aa

View file

@ -63,6 +63,10 @@ options:
description:
- Amount of memory to be assigned to new virtual instance.
required: true
flavor:
description:
- Specify which SoftLayer flavor template to use instead of cpus and memory.
version_added: "2.10"
disks:
description:
- List of disk sizes to be assigned to new virtual instance.
@ -263,6 +267,7 @@ def create_virtual_instance(module):
domain=module.params.get('domain'),
cpus=module.params.get('cpus'),
memory=module.params.get('memory'),
flavor=module.params.get('flavor'),
hourly=module.params.get('hourly'),
datacenter=module.params.get('datacenter'),
os_code=module.params.get('os_code'),
@ -338,6 +343,7 @@ def main():
local_disk=dict(type='bool', default=True),
cpus=dict(type='int', choices=CPU_SIZES),
memory=dict(type='int', choices=MEMORY_SIZES),
flavor=dict(type='str'),
disks=dict(type='list', default=[25]),
os_code=dict(type='str'),
image_id=dict(type='str'),