aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.06k stars 322 forks source link

Can files in /var/log/amazon/ssm/download be removed safely? #309

Closed michaelsmoody closed 4 years ago

michaelsmoody commented 4 years ago

I've left my thoughts about the improperness of this download location in https://github.com/aws/amazon-ssm-agent/issues/88. However, assuming for a moment that the location doesn't change, can the files be removed safely?

If they can be removed safely, and if the download location isn't changed (or made configurable), can we add this to documentation, perhaps the README? Even better, could the solution be configured to remove old downloads, or only retain x old versions?

While it seems trivial, for systems where we have provisioned IOPS, or long term backup strategies, having these files around (a few hundred megs to a few gigs) can create a very real cost when you have thousands of instances, on the order of thousands of dollars extra each month. We can easily cost optimize for actual log files and our rotational strategies for those, but being unsure of these files and how they should be handled can add up.

Thanks, Michael

gianniLesl commented 4 years ago

Hi Michael, You can delete those files, just make sure to stop the agent first to be extra sure the agent isn't in the middle of a process using the contents. Otherwise, the agent will re-download the resources it needs. We will add the automation of cleaning up those files when they are no longer needed to our backlog and reconsider our placement of the download folder. Thanks for bringing this to our attention. -Gianni

pandafox commented 3 years ago

Our server actually ran out of disk space due to the accumulation of the download file from SSM download folders

[0] ✓ ubuntu@ip-10-0-0-186:/var/log/amazon/ssm/download/update [02:37:19]
---> du -h
906M    .
ykostsik commented 3 years ago

Confirm, that the issue is still here. 499M /var/log/amazon/ssm/download/update/

ggarcia-trimble commented 1 year ago

Does this got fixed?