Comments (4)
Added pull request suggestions and pushed changes. Also, logs are now exported to CloudWatch Logs to the cost-optimization-ec2-right-sizing log group to make troubleshooting easier.
from cost-optimization-ec2-right-sizing.
Please try and run the version located here: https://s3.amazonaws.com/solutions-reference/cost-optimization/latest/cost-optimization-ec2-right-sizing.template
If you look in the template, the script that runs the commands is /tmp/perform-rightsizing.sh, So log into the EC2 instance, sudo su - and run the script yourself to see where it fails.
from cost-optimization-ec2-right-sizing.
I suspect that issue #5 may be related, though I don't know for certain. Since there has been no traffic on this issue, I am adding what I am seeing, as it seems that I get stuck on EC2 instance generation, and when it does make it through to CREATE_COMPLETE, nothing ends up in the S3 bucket (this appears to be intermittent behavior; sometimes it completes, sometimes it does not, and when it does complete, nothing is created in the S3 bucket).
Below is the last 10 entries of output from the script (and logged to /tmp/run-rightsizing-redshift.log as well):
INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com Traceback (most recent call last): File "./run-rightsizing-redshift.py", line 423, in <module> ls_cwfile = callgcw.call_gcw(CW_REGION, CW_ACCOUNT, CW_MODE, CW_STATISTICS, CW_PERIOD, CW_STARTTIME, CW_ENDTIME, CW_OUTPUT) File "/tmp/callgcw.py", line 64, in call_gcw getcloudwatchmetrics.download_metrics(ls_region_array, account, mode, statistics, period, startTime, endTime, ls_outputfile_name) File "/tmp/getcloudwatchmetrics.py", line 196, in download_metrics response = p2.map(func, response) File "/usr/lib64/python2.7/multiprocessing/pool.py", line 251, in map return self.map_async(func, iterable, chunksize).get() File "/usr/lib64/python2.7/multiprocessing/pool.py", line 567, in get raise self._value KeyError: 'DiskReadOps' INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): monitoring.us-west-2.amazonaws.com
Hopefully there is enough information available to assist in debugging the issue whatever it is.
from cost-optimization-ec2-right-sizing.
After debugging, I have submitted pull request #6 which seems to address the issue for me. It appears that some of my metrics do not have a key 'DiskReadOps' in them (maybe others, this was the one that errored out for me). When Python attempts to access a key in a dict and that key does not exist, it throws a KeyError, which is what appears to be going on.
I suspect that this issue and issue #5 are likely the same issue, as my CloudFormation stack is stuck on AWS::EC2::Instance CREATE_IN_PROGRESS, as is the entire stack formation, and no files ever make it to the S3 bucket. In my case, I suspect that the metrics in question relate to an EC2 instance that recently had it's instance type changed to allocate more memory to it, and that the metrics refer to the old instance type, which is no longer accumulating any metrics against it, though the instance type being reported in the metric is the new instance type. The metric in question is missing the DiskReadOps and DiskWriteOps keys, which is causing the script to bomb out when getcloudwatchmetrics.py blindly attempts to access them, assuming they are there.
from cost-optimization-ec2-right-sizing.
Related Issues (19)
- Error while launching this stack HOT 1
- Multiple recommendations for each instance HOT 1
- Unnecessary calls to CW metrics HOT 1
- CW metric lookup fails when there are lots of instances in a region HOT 1
- Empty result file HOT 8
- RDS right sizing? HOT 1
- No output when using region ap-southeast-1
- Can I specify CPU model for recommendation? HOT 1
- Accurate in an A/S environment? HOT 3
- cross-account support HOT 1
- How does this compare to Trusted Advisor reports? HOT 2
- Define thresholds and create a cloud watch alert HOT 2
- Wrong code for EUC1 (Frankfurt)
- SSD storage parsing logic
- got a ValueError when running the script HOT 4
- stuck at EC2Instance creation
- Right sizing only gives results of the right-sizing EC2
- Getting empty S3 bucket after running the solution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cost-optimization-ec2-right-sizing.