Skip to content

Instantly share code, notes, and snippets.

@dkavanagh
Created November 13, 2015 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkavanagh/b43801a1121c8e8a5d2a to your computer and use it in GitHub Desktop.
Save dkavanagh/b43801a1121c8e8a5d2a to your computer and use it in GitHub Desktop.
Setup request generator for eucaconsole for scale testing. Each instance in scaling group generates 100 users sessions.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Deploy request generator for console with Autoscaling.",
"Parameters" : {
"ImageId" : {
"Description" : "The ID of the image to use for the console",
"Type" : "String",
"ConstraintDescription" : "Must be the ID of a CentOS 7 image on the cloud."
},
"InstanceType" : {
"Description" : "WebServer EC2 instance type",
"Type" : "String",
"Default" : "m1.medium",
"ConstraintDescription" : "must be a valid EC2 instance type."
},
"KeyName" : {
"Description" : "The EC2 Key Pair to allow SSH access to the instances",
"Type" : "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription" : "must be the name of an existing EC2 KeyPair."
},
"SSHLocation" : {
"Description" : "The IP address range that can be used to SSH to the EC2 instances",
"Type": "String",
"MinLength": "9",
"MaxLength": "18",
"Default": "0.0.0.0/0",
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
},
"ConsoleFQDN" : {
"Description" : "The FQDN name of the console ELB",
"Type" : "String",
"ConstraintDescription" : "Must be either an IP address or DNS name resolvable and reachable from this cloud."
}
},
"Resources" : {
"ReqgenScalingGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : ""},
"LaunchConfigurationName" : { "Ref" : "ReqgenLaunchConfig" },
"MinSize" : "1",
"DesiredSize" : "1",
"MaxSize" : "3"
}
},
"ReqgenLaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"KeyName" : { "Ref" : "KeyName" },
"ImageId" : { "Ref" : "ImageId" },
"SecurityGroups" : [ { "Ref" : "ReqgenSecurityGroup" } ],
"InstanceType" : { "Ref" : "InstanceType" },
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"#cloud-config\n",
"# vim: syntax=yaml\n",
"#\n",
"# This config installs the eucalyptus and epel repos, then installs and\n",
"# configures the request generator\n",
"runcmd:\n",
" - [ yum, -y, install, wget, python-pip ]\n",
" - [ pip, install, requests, cachecontrol, beautifulsoup4 ]\n",
" - [ pip, install, --upgrade, urllib3, requests ]\n",
" - [ wget, 'https://raw.githubusercontent.com/eucalyptus/eucaconsole/master/tests/reqgenerator/reqgenerator.py' ]\n",
" - [ chmod, 555, reqgenerator.py ]\n",
" - [ python, reqgenerator.py, 'https://",
{ "Ref" : "ConsoleFQDN" },
"/', 100, 9999, '>/var/log/reqgen.log' ]\n"
]]}}
}
},
"ReqgenSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Enable SSH access",
"SecurityGroupIngress" : [ {
"IpProtocol" : "tcp",
"FromPort" : "22",
"ToPort" : "22",
"CidrIp" : { "Ref" : "SSHLocation"}
} ]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment