Skip to content

Commit fe31263

Browse files
author
Kristy Wienken
committed
Add boot mode option
1 parent 02812ce commit fe31263

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

SoftLayer/CLI/virt/create.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def _parse_create_args(client, args):
8080
"disks": args['disk'],
8181
"cpus": args.get('cpu', None),
8282
"memory": args.get('memory', None),
83-
"flavor": args.get('flavor', None)
83+
"flavor": args.get('flavor', None),
84+
"boot_mode": args.get('boot_mode', None)
8485
}
8586

8687
# The primary disk is included in the flavor and the local_disk flag is not needed
@@ -175,6 +176,9 @@ def _parse_create_args(client, args):
175176
help="OS install code. Tip: you can specify <OS>_LATEST")
176177
@click.option('--image',
177178
help="Image ID. See: 'slcli image list' for reference")
179+
@click.option('--boot-mode',
180+
help="Specify the mode to boot the OS in",
181+
type=click.STRING)
178182
@click.option('--billing',
179183
type=click.Choice(['hourly', 'monthly']),
180184
default='hourly',

SoftLayer/managers/vs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def _generate_create_dict(
307307
dedicated=False, public_vlan=None, private_vlan=None,
308308
userdata=None, nic_speed=None, disks=None, post_uri=None,
309309
private=False, ssh_keys=None, public_security_groups=None,
310-
private_security_groups=None, **kwargs):
310+
private_security_groups=None, boot_mode=None, **kwargs):
311311
"""Returns a dict appropriate to pass into Virtual_Guest::createObject
312312
313313
See :func:`create_instance` for a list of available options.
@@ -410,6 +410,11 @@ def _generate_create_dict(
410410
if ssh_keys:
411411
data['sshKeys'] = [{'id': key_id} for key_id in ssh_keys]
412412

413+
if boot_mode:
414+
supplemental_options = data.get('supplementalObjectOptions', {})
415+
supplemental_options['bootMode'] = supplemental_options
416+
data['supplementalObjectOptions'] = supplemental_options
417+
413418
return data
414419

415420
@retry(logger=LOGGER)

0 commit comments

Comments
 (0)