You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by se...@apache.org on 2015/05/05 15:26:25 UTC
[32/50] cloudstack-ec2stack git commit: Rename custom disk for
simulated ssd backed instances
Rename custom disk for simulated ssd backed instances
Project: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/commit/93358520
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/tree/93358520
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/diff/93358520
Branch: refs/heads/master
Commit: 9335852056251cea35d83f15a79f774f9e47fa67
Parents: 249834f
Author: brogand1993 <da...@hotmail.com>
Authored: Sun Aug 17 17:18:48 2014 +0100
Committer: brogand1993 <da...@hotmail.com>
Committed: Sun Aug 17 17:18:48 2014 +0100
----------------------------------------------------------------------
ec2stack/configure.py | 8 ++++----
ec2stack/providers/cloudstack/instances.py | 14 ++++++++++----
2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/93358520/ec2stack/configure.py
----------------------------------------------------------------------
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 @@ 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(
http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/93358520/ec2stack/providers/cloudstack/instances.py
----------------------------------------------------------------------
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 flask import current_app
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: