I'm trying to (1) create a new EBS snapshot using the EBS direct APIs and (2) put data into the newly-created snapshot. I keep getting the following error at step #2:
"Error parsing parameter '--block-data': Blob values must be a path to a file."
I'm sure it has to do with the file path ( /tmp/data) in step #2, but I'm not sure what that path file should be or what exactly should be in there.
All help is appreciated. TY!
Here are my CLI commands (from the EC2 instance I'm trying to snapshot):
- Start a Snapshot:
aws ebs start-snapshot --volume-size 8 --timeout 60 --client-token 550e8400-e29b-41d4-a716-446655440000
OUTPUT:
{
"Status": "pending",
"KmsKeyArn": "arn:aws:kms:us-east-1:721340000000:key/a0919dc2-5e54-4a66-b52bEXAMPLE",
"BlockSize": 524288,
"VolumeSize": 8,
"StartTime": 1663609346.678,
"SnapshotId": "snap-0d0b369bf6EXAMPLE",
"OwnerId": "7213410000000"
}
- Put data into the newly-created snapshot:
aws ebs put-snapshot-block --snapshot-id snap-0d0b369bf6EXAMPLE --block-index 1000 --data-length 524288 --block-data /tmp/data --checksum UK3qYfpOd6sRG4FHFgl6v9Bfg6IHtH60Upu9TXXXXXX= --checksum-algorithm SHA256
This has been my guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/writesnapshots.html