从 EC2 管理控制台自动获取每日/每小时 EBS 快照?

从 EC2 管理控制台自动获取每日/每小时 EBS 快照?

是否有人知道是否可以从在线 EC2 管理控制台自动创建 EBS 快照(比如每天或每小时),然后告诉它保留它们多长时间(修剪它们)?

我不使用命令行工具,所以希望有一个选项(我目前看不到!)可以自动快照?我知道你可以通过第三方应用程序和网站(如 Ylastic)来实现这一点 - 但希望现在就可以内置这个功能吗?

答案1

不幸的是,管理控制台中没有可用于创建每日/每小时 EBS 快照的功能。唯一的选项是您突出显示的选项,尽管有些人创建了命令行脚本,这些脚本可以执行您需要的操作,并且相对简单,可以根据您自己的要求进行配置。

https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup

答案2

现在可以使用 CloudWatch 规则从 AWS 控制台自动拍摄快照。

正如解释的那样AWS CloudWatch 文档

Create a rule that takes snapshots on a schedule. You can use a rate expression or a cron expression to specify the schedule. For more information, see Schedule Expressions for Rules.

To create a rule

1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

2. In the navigation pane, choose Events, Create rule.

3. For Event Source, do the following:

a. Choose Schedule.

b. Choose Fixed rate of and specify the schedule interval (for example, 5 minutes). Alternatively, choose Cron expression and specify a cron expression (for example, every 15 minutes Monday through Friday, starting at the current time).

4. For Targets, choose Add target and then select EC2 Create Snapshot API call.

5. For Volume ID, choose an EBS volume.

6. Choose Configure details.

7. For Rule definition, type a name and description for the rule.

8. For AWS permissions, choose the option to create a new role. This opens the IAM console in a new tab. The new role grants the built-in target permissions to access resources on your behalf. Choose Allow. The tab with the IAM window closes.

9. Choose Create rule.

答案3

从 AWS 控制台实施通用备份计划的问题在于,Amazon 不知道您的卷上有什么。这就是为什么有以下解决方案ec2 一致快照它可以处理诸如在拍摄快照之前冻结文件系统以及刷新和锁定数据库等事情。采取这些额外步骤有助于确保您能够真正使用快照,而无需执行数据清理/恢复步骤。

答案4

现在可以使用 Amazon Data Lifecycle Manager 来实现:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html

相关内容