Skip to content
Permalink
Browse files
Rename custom disk for simulated ssd backed instances
  • Loading branch information
brogand93 committed Aug 17, 2014
1 parent 249834f commit 9335852056251cea35d83f15a79f774f9e47fa67
Showing 2 changed files with 14 additions and 8 deletions.
@@ -169,13 +169,13 @@ def _set_optional_attributes_of_profile(config, profile):
@return: configparser configuration.
"""

configure_instance_type_mapings = raw_input(
'Do you wish to input a local custom storage disk for instances? (Yes/No): '
configure_instance_disk = raw_input(
'Do you wish to input a second custom storage disk for instances? (Yes/No): '
)

if configure_instance_type_mapings.lower() in ['yes', 'y']:
if configure_instance_disk.lower() in ['yes', 'y']:
config = _set_attribute_of_profile(
config, profile, 'cloudstack_local_custom_disk_offering', 'Cloudstack custom local disk offering name', 'CustomLocal'
config, profile, 'cloudstack_instance_custom_disk_offering', 'Cloudstack custom instance disk offering name', 'CustomInstance'
)

configure_instance_type_mapings = raw_input(
@@ -9,7 +9,7 @@

from ec2stack.providers import cloudstack
from ec2stack.providers.cloudstack import requester, service_offerings, zones, \
disk_offerings, volumes
disk_offerings
from ec2stack import helpers, errors


@@ -178,9 +178,15 @@ def _run_instance_request():
if helpers.get('BlockDeviceMapping.1.Ebs.VolumeType') is not None:
disk_type = helpers.get('BlockDeviceMapping.1.Ebs.VolumeType')
if disk_type == 'gp2':
args['diskofferingid'] = disk_offerings.get_disk_offering(
current_app.config['CLOUDSTACK_LOCAL_CUSTOM_DISK_OFFERING']
)['id']
if 'CLOUDSTACK_INSTANCE_CUSTOM_DISK_OFFERING' in current_app.config:
args['diskofferingid'] = disk_offerings.get_disk_offering(
current_app.config['CLOUDSTACK_INSTANCE_CUSTOM_DISK_OFFERING']
)['id']
else:
errors.invalid_request(
"Unable to configure secondary disk, please run ec2stack-configure and choose to "
"configure an instance disk")

if helpers.get('BlockDeviceMapping.1.Ebs.VolumeSize') is None:
errors.invalid_request("VolumeSize not found in BlockDeviceMapping")
else:

0 comments on commit 9335852

Please sign in to comment.