Rename custom disk for simulated ssd backed instances
diff --git a/ec2stack/configure.py b/ec2stack/configure.py index a80b70d..5c4ffee 100644 --- a/ec2stack/configure.py +++ b/ec2stack/configure.py
@@ -169,13 +169,13 @@ @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(
diff --git a/ec2stack/providers/cloudstack/instances.py b/ec2stack/providers/cloudstack/instances.py index 84aa429..3e8115b 100644 --- a/ec2stack/providers/cloudstack/instances.py +++ b/ec2stack/providers/cloudstack/instances.py
@@ -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 @@ 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: