aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2014-01-28 19:20:40 +1300
committerRobert Collins <rbtcollins@hp.com>2014-01-29 01:39:27 +1300
commitc071255ad6bf1fb2c9db6799e96b509295f53fc9 (patch)
treecaf081f072674cbb9861308f2e5a617157370f3d /examples
parent23c8aac2bacfee96e0faedb84d0b72893f13c6ec (diff)
Make scaling out a feature for merge.py.
This is a simple implementation designed to work with our current non-HOT approach. We need to adjust our templates a little to support this - though future work could make that better, it's orthogonal to this effort. Change-Id: I555617e5f24a5882de915f057dc02e008c81e753
Diffstat (limited to 'examples')
-rw-r--r--examples/scale1.yaml30
-rw-r--r--examples/scale2.yaml66
-rw-r--r--examples/scale_result.yaml190
3 files changed, 286 insertions, 0 deletions
diff --git a/examples/scale1.yaml b/examples/scale1.yaml
new file mode 100644
index 00000000..c0a0763d
--- /dev/null
+++ b/examples/scale1.yaml
@@ -0,0 +1,30 @@
+Resources:
+ ComputeUser:
+ Type: AWS::IAM::User
+ Properties:
+ Policies: [ { Ref: ComputeAccessPolicy } ]
+ GlobalAccessPolicy:
+ Type: OS::Heat::AccessPolicy
+ NovaCompute0Key:
+ Type: FileInclude
+ Path: examples/scale2.yaml
+ SubKey: Resources.NovaCompute0Key
+ NovaCompute0CompletionCondition:
+ Type: FileInclude
+ Path: examples/scale2.yaml
+ SubKey: Resources.NovaCompute0CompletionCondition
+ NovaCompute0CompletionHandle:
+ Type: FileInclude
+ Path: examples/scale2.yaml
+ SubKey: Resources.NovaCompute0CompletionHandle
+ NovaCompute0Config:
+ Type: FileInclude
+ Path: examples/scale2.yaml
+ SubKey: Resources.NovaCompute0Config
+ Parameters:
+ ComputeImage: "123"
+ RabbitPassword: "guest"
+ NovaCompute0:
+ Type: FileInclude
+ Path: examples/scale2.yaml
+ SubKey: Resources.NovaCompute0
diff --git a/examples/scale2.yaml b/examples/scale2.yaml
new file mode 100644
index 00000000..d1a81fe5
--- /dev/null
+++ b/examples/scale2.yaml
@@ -0,0 +1,66 @@
+HeatTemplateFormatVersion: '2012-12-12'
+Parameters:
+ ComputeImage:
+ Type: String
+ RabbitPassword:
+ Type: String
+ NoEcho: true
+Resources:
+ ComputeAccessPolicy:
+ Type: OS::Heat::AccessPolicy
+ Properties:
+ AllowedResources: [ NovaCompute0 ]
+ NovaCompute0Key:
+ Type: AWS::IAM::AccessKey
+ Properties:
+ UserName:
+ Ref: ComputeUser
+ NovaCompute0CompletionCondition:
+ Type: AWS::CloudFormation::WaitCondition
+ DependsOn: notcompute
+ Properties:
+ Handle: {Ref: NovaCompute0CompletionHandle}
+ Count: '1'
+ Timeout: '1800'
+ NovaCompute0CompletionHandle:
+ Type: AWS::CloudFormation::WaitConditionHandle
+ NovaCompute0:
+ Type: OS::Nova::Server
+ Properties:
+ image:
+ Ref: ComputeImage
+ Metadata:
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute0Key
+ secret_access_key:
+ Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
+ stack_name: {Ref: 'AWS::StackName'}
+ path: NovaCompute0Config.Metadata
+ NovaCompute0Config:
+ Type: AWS::AutoScaling::LaunchConfiguration
+ Metadata:
+ completion-handle:
+ Ref: NovaCompute0CompletionHandle
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute0Key
+ secret_access_key:
+ Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
+ stack_name: {Ref: 'AWS::StackName'}
+ path: NovaCompute0Config.Metadata
+ neutron:
+ ovs:
+ local_ip:
+ Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute0
+ - networks
+ rabbit:
+ password: {Ref: RabbitPassword}
+
diff --git a/examples/scale_result.yaml b/examples/scale_result.yaml
new file mode 100644
index 00000000..f22d864e
--- /dev/null
+++ b/examples/scale_result.yaml
@@ -0,0 +1,190 @@
+Description: examples/scale1.yaml
+HeatTemplateFormatVersion: '2012-12-12'
+Resources:
+ ComputeUser:
+ Properties:
+ Policies:
+ - Ref: ComputeAccessPolicy
+ Type: AWS::IAM::User
+ GlobalAccessPolicy:
+ Type: OS::Heat::AccessPolicy
+ NovaCompute0:
+ Metadata:
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute0Key
+ path: NovaCompute0Config.Metadata
+ secret_access_key:
+ Fn::GetAtt:
+ - NovaCompute0Key
+ - SecretAccessKey
+ stack_name:
+ Ref: AWS::StackName
+ Properties:
+ image:
+ Ref: ComputeImage
+ Type: OS::Nova::Server
+ NovaCompute0CompletionCondition:
+ DependsOn: notcompute
+ Properties:
+ Count: '1'
+ Handle:
+ Ref: NovaCompute0CompletionHandle
+ Timeout: '1800'
+ Type: AWS::CloudFormation::WaitCondition
+ NovaCompute0CompletionHandle:
+ Type: AWS::CloudFormation::WaitConditionHandle
+ NovaCompute0Config:
+ Metadata:
+ completion-handle:
+ Ref: NovaCompute0CompletionHandle
+ neutron:
+ ovs:
+ local_ip:
+ Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute0
+ - networks
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute0Key
+ path: NovaCompute0Config.Metadata
+ secret_access_key:
+ Fn::GetAtt:
+ - NovaCompute0Key
+ - SecretAccessKey
+ stack_name:
+ Ref: AWS::StackName
+ rabbit:
+ password: guest
+ Type: AWS::AutoScaling::LaunchConfiguration
+ NovaCompute0Key:
+ Properties:
+ UserName:
+ Ref: ComputeUser
+ Type: AWS::IAM::AccessKey
+ NovaCompute1:
+ Metadata:
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute1Key
+ path: NovaCompute1Config.Metadata
+ secret_access_key:
+ Fn::GetAtt:
+ - NovaCompute1Key
+ - SecretAccessKey
+ stack_name:
+ Ref: AWS::StackName
+ Properties:
+ image:
+ Ref: ComputeImage
+ Type: OS::Nova::Server
+ NovaCompute1CompletionCondition:
+ DependsOn: notcompute
+ Properties:
+ Count: '1'
+ Handle:
+ Ref: NovaCompute1CompletionHandle
+ Timeout: '1800'
+ Type: AWS::CloudFormation::WaitCondition
+ NovaCompute1CompletionHandle:
+ Type: AWS::CloudFormation::WaitConditionHandle
+ NovaCompute1Config:
+ Metadata:
+ completion-handle:
+ Ref: NovaCompute1CompletionHandle
+ neutron:
+ ovs:
+ local_ip:
+ Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute1
+ - networks
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute1Key
+ path: NovaCompute1Config.Metadata
+ secret_access_key:
+ Fn::GetAtt:
+ - NovaCompute1Key
+ - SecretAccessKey
+ stack_name:
+ Ref: AWS::StackName
+ rabbit:
+ password: guest
+ Type: AWS::AutoScaling::LaunchConfiguration
+ NovaCompute1Key:
+ Properties:
+ UserName:
+ Ref: ComputeUser
+ Type: AWS::IAM::AccessKey
+ NovaCompute2:
+ Metadata:
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute2Key
+ path: NovaCompute2Config.Metadata
+ secret_access_key:
+ Fn::GetAtt:
+ - NovaCompute2Key
+ - SecretAccessKey
+ stack_name:
+ Ref: AWS::StackName
+ Properties:
+ image:
+ Ref: ComputeImage
+ Type: OS::Nova::Server
+ NovaCompute2CompletionCondition:
+ DependsOn: notcompute
+ Properties:
+ Count: '1'
+ Handle:
+ Ref: NovaCompute2CompletionHandle
+ Timeout: '1800'
+ Type: AWS::CloudFormation::WaitCondition
+ NovaCompute2CompletionHandle:
+ Type: AWS::CloudFormation::WaitConditionHandle
+ NovaCompute2Config:
+ Metadata:
+ completion-handle:
+ Ref: NovaCompute2CompletionHandle
+ neutron:
+ ovs:
+ local_ip:
+ Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute2
+ - networks
+ os-collect-config:
+ cfn:
+ access_key_id:
+ Ref: NovaCompute2Key
+ path: NovaCompute2Config.Metadata
+ secret_access_key:
+ Fn::GetAtt:
+ - NovaCompute2Key
+ - SecretAccessKey
+ stack_name:
+ Ref: AWS::StackName
+ rabbit:
+ password: guest
+ Type: AWS::AutoScaling::LaunchConfiguration
+ NovaCompute2Key:
+ Properties:
+ UserName:
+ Ref: ComputeUser
+ Type: AWS::IAM::AccessKey