Skip to content

Commit 9277add

Browse files
Merge pull request #1454 from allmightyspiff/issues1395
Forced reserved capacity guests to be monthly
2 parents 3db1007 + 0f4b627 commit 9277add

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

SoftLayer/CLI/virt/capacity/create_guest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
help="Test order, will return the order container, but not actually order a server.")
3535
@environment.pass_env
3636
def cli(env, **args):
37-
"""Allows for creating a virtual guest in a reserved capacity."""
37+
"""Allows for creating a virtual guest in a reserved capacity. Only MONTHLY guests are supported at this time.
38+
39+
If you would like support for hourly reserved capacity guests, please open an issue on the softlayer-python github.
40+
"""
3841
create_args = _parse_create_args(env.client, args)
3942

4043
create_args['primary_disk'] = args.get('primary_disk')

SoftLayer/managers/vs_capacity.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def create_guest(self, capacity_id, test, guest_object):
151151

152152
# Reserved capacity only supports SAN as of 20181008
153153
guest_object['local_disk'] = False
154+
# Reserved capacity only supports monthly ordering via Virtual_Guest::generateOrderTemplate
155+
# Hourly ordering would require building out the order manually.
156+
guest_object['hourly'] = False
154157
template = vs_manager.verify_create_instance(**guest_object)
155158
template['reservedCapacityId'] = capacity_id
156159
if guest_object.get('ipv6'):

tests/managers/vs/vs_capacity_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def test_create_guest(self):
116116
'disks': (),
117117
'domain': 'test.com',
118118
'hostname': 'A1538172419',
119-
'hourly': True,
120119
'ipv6': True,
121120
'local_disk': None,
122121
'os_code': 'UBUNTU_LATEST_64',
@@ -132,7 +131,7 @@ def test_create_guest(self):
132131
'maxMemory': None,
133132
'hostname': 'A1538172419',
134133
'domain': 'test.com',
135-
'hourlyBillingFlag': True,
134+
'hourlyBillingFlag': False,
136135
'supplementalCreateObjectOptions': {
137136
'bootMode': None,
138137
'flavorKeyName': 'B1_1X2X25'

0 commit comments

Comments
 (0)