This guide explains the snapshot functionality in the RabbitMQ Queue Migration Plugin, including the three supported modes and their configuration.
The plugin creates snapshots before migration to enable rollback in case of failure. Snapshots capture the RabbitMQ data directory state, allowing recovery if migration encounters issues.
Three snapshot modes are supported:
- EBS Mode (default) - AWS EBS snapshots for production
- Tar Mode - Tar archives for development/testing
- None Mode - Disabled (snapshots handled externally or not needed)
Creates tar.gz archives of the RabbitMQ data directory. Use this mode for development and testing environments where EBS snapshots are not available.
Using rabbitmq.conf:
queue_migration.snapshot_mode = tarUsing advanced.config:
{rabbitmq_queue_migration, [
{snapshot_mode, tar}
]}Snapshots are stored in:
/tmp/rabbitmq_migration_snapshots/{ISO8601_timestamp}/{node_name}.tar.gz
Example:
/tmp/rabbitmq_migration_snapshots/2025-12-21T17:30:00Z/rabbit@node1.tar.gz
Controlled by cleanup_snapshots_on_success setting (default: true).
When enabled, tar archives are automatically deleted after successful migration. When disabled, archives remain for manual cleanup or audit purposes.
Creates AWS EBS snapshots using the EC2 API. This is the default mode for production deployments running on AWS EC2.
Using rabbitmq.conf (optional, these are defaults):
queue_migration.snapshot_mode = ebs
queue_migration.ebs_volume_device = /dev/sdhUsing advanced.config:
{rabbitmq_queue_migration, [
{snapshot_mode, ebs},
{ebs_volume_device, "/dev/sdh"}
]}-
EBS Volume
- RabbitMQ data directory must be on an EBS volume
- Volume must be attached at the configured device path (default:
/dev/sdh)
-
IAM Permissions
ec2:CreateSnapshot- Create EBS snapshotsec2:DescribeVolumes- Query attached volumesec2:DescribeSnapshots- Check snapshot statusec2:DeleteSnapshot- Delete snapshots after successful migration
-
AWS Credentials
- EC2 instance role (recommended)
- Credentials automatically retrieved from instance metadata service
EBS snapshots are created with descriptive names:
Description: "RabbitMQ migration snapshot {ISO8601_timestamp} on {node_name}"
Example:
Description: "RabbitMQ migration snapshot 2025-12-21T17:30:00Z on rabbit@node1"
Controlled by cleanup_snapshots_on_success setting (default: true).
When enabled, EBS snapshots are automatically deleted after successful migration. When disabled, snapshots remain in your AWS account for manual management.
Cost Consideration: EBS snapshots incur storage costs. If cleanup is disabled, implement a lifecycle policy or cleanup script to manage retention and costs.
See EC2_SETUP for detailed IAM role configuration and setup instructions.
Disables snapshot creation entirely. Use this mode when:
- Snapshots are handled externally
- Rollback capability is not needed
- Testing in environments without snapshot support
Using rabbitmq.conf:
queue_migration.snapshot_mode = noneUsing advanced.config:
{rabbitmq_queue_migration, [
{snapshot_mode, none}
]}Warning: Without snapshots, rollback after migration failure requires manual intervention and may result in data loss.
Type: Boolean
Default: true
Description: Whether to delete snapshots after successful migration
Using rabbitmq.conf:
queue_migration.cleanup_snapshots_on_success = falseUsing advanced.config:
{rabbitmq_queue_migration, [
{cleanup_snapshots_on_success, false}
]}When to Disable:
- Audit requirements mandate snapshot retention
- Want to keep snapshots for additional safety
- Testing rollback procedures
When Disabled:
- Tar mode: Archives remain in
/tmp/rabbitmq_migration_snapshots/ - EBS mode: Snapshots remain in AWS account (incurs storage costs)
- Manual cleanup required
- EC2 IAM Setup: EC2_SETUP
- Configuration Reference: CONFIGURATION
- Troubleshooting: TROUBLESHOOTING