Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forced reserved capacity guests to be monthly #1454

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion SoftLayer/CLI/virt/capacity/create_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
help="Test order, will return the order container, but not actually order a server.")
@environment.pass_env
def cli(env, **args):
"""Allows for creating a virtual guest in a reserved capacity."""
"""Allows for creating a virtual guest in a reserved capacity. Only MONTHLY guests are supported at this time.

If you would like support for hourly reserved capacity guests, please open an issue on the softlayer-python github.
"""
create_args = _parse_create_args(env.client, args)

create_args['primary_disk'] = args.get('primary_disk')
Expand Down
3 changes: 3 additions & 0 deletions SoftLayer/managers/vs_capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def create_guest(self, capacity_id, test, guest_object):

# Reserved capacity only supports SAN as of 20181008
guest_object['local_disk'] = False
# Reserved capacity only supports monthly ordering via Virtual_Guest::generateOrderTemplate
# Hourly ordering would require building out the order manually.
guest_object['hourly'] = False
template = vs_manager.verify_create_instance(**guest_object)
template['reservedCapacityId'] = capacity_id
if guest_object.get('ipv6'):
Expand Down
3 changes: 1 addition & 2 deletions tests/managers/vs/vs_capacity_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def test_create_guest(self):
'disks': (),
'domain': 'test.com',
'hostname': 'A1538172419',
'hourly': True,
'ipv6': True,
'local_disk': None,
'os_code': 'UBUNTU_LATEST_64',
Expand All @@ -132,7 +131,7 @@ def test_create_guest(self):
'maxMemory': None,
'hostname': 'A1538172419',
'domain': 'test.com',
'hourlyBillingFlag': True,
'hourlyBillingFlag': False,
'supplementalCreateObjectOptions': {
'bootMode': None,
'flavorKeyName': 'B1_1X2X25'
Expand Down