Looking for ways to restore EFS file system from AWS Backup? Bobcares is here to assist you!
Recently one of our customers ran into trouble when they attempted to use the AWS CLI to restore an Amazon Elastic File System from an AWS Backup recovery point. Read on to find out how our Support Techs resolved this issue. Contact our AWS Assistance services for help with any AWS queries.
How to Restore EFS File System from AWS Backup
If you are seeking a way to use the AWS Command Line Interface to restore an Amazon EFS from an AWS Backup recovery point, you have come to the right place! Let’s take a quick peek at the advice offered by the experienced experts at Bobcares.
In-place Restoration of EFS File System From an AWS Backup Recovery Point
- First, get the ARN or Amazon Resource Name of the EFS file system that has to be restored by using the list-backup-jobs command. You need to have the resource ARN in order to restore an EFS file system from an AWS Backup Recovery Point.
$ aws backup list-backup-jobs --by-resource-type EFS --region us-east-1
- Then note the ResourceArn in the command output:
{ "BackupJobs": [ { "CompletionDate": 1584448253.579, "BackupVaultArn": "arn:aws:backup:us-east-1:111222333444:backup-vault:Default", "PercentDone": "0.0", "RecoveryPointArn": "arn:aws:backup:us-east-1:111222333444:recovery-point:f28fe55c-8f34-4877-9ae6-9c6d5dce8935", "ResourceType": "EFS", "BackupSizeInBytes": 73, "State": "COMPLETED", "IamRoleArn": "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole", "ResourceArn": "arn:aws:elasticfilesystem:us-east-1:111222333444:file-system/fs-c1234567", "BackupJobId": "12ddf0b1-aed4-44ec-894f-0d74448949bd", "StartBy": 1583451934.889, "CreationDate": 1583448334.889, "BackupVaultName": "Default" }, { "CompletionDate": 1584305453.7, "BackupVaultArn": "arn:aws:backup:us-east-1:111222333444:backup-vault:Default", "PercentDone": "0.0", "RecoveryPointArn": "arn:aws:backup:us-east-1:111222333444:recovery-point:09e9dafe-44a6-471a-b4e8-64c98219a480", "ResourceType": "EFS", "BackupSizeInBytes": 73, "State": "COMPLETED", "IamRoleArn": "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole", "ResourceArn": "arn:aws:elasticfilesystem:us-east-1:111222333444:file-system/fs-gd1b761d", "BackupJobId": "721ba96d-a656-4771-a1f4-78bcd0c930f8", "StartBy": 1583309035.684, "CreationDate": 1583305435.684, "BackupVaultName": "Default" } ] }
- After that, use the start-restore-job command. Define specific metadata for restoring an EFS instance as parameters within a command or as a seperate JSON file. Create a similar JSON file as seen below to define metadata:
{"file-system-id": "fs-c1234567", "newFileSystem": "false", "Encrypted": "false", "PerformanceMode":"generalPurpose"}
Next, run the command start-restore-job
aws backup start-restore-job --region us-east-1 --recovery-point-arn "arn:aws:backup:us-east-1:111222333444:recovery-point:123e4567-6cd9-464e-bb6b-13f70e79d347" --iam-role-arn "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole" --metadata file://<path to json file>
Run the following command in the same format to define the parameters:
aws backup start-restore-job --region us-east-1 --recovery-point-arn "arn:aws:backup:us-east-1:111222333444:recovery-point:123e4567-6cd9-464e-bb6b-13f70e79d347" --iam-role-arn "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole" --metadata '{"file-system-id": "fs-c1234567", "newFileSystem": "false", "Encrypted": "false", "PerformanceMode":"generalPurpose"}'
Restoration of New EFS File System from an AWS Backup Recovery Point
- Use the list-backup-jobs command to obtain the ARN of the to-be-restored EFS file system. Our Support Techs would like to remind you that you need to have the resource ARN in order to perform the restoration of the EFS file system from an AWS Backup Recoverypoint.
$ aws backup list-backup-jobs --by-resource-type EFS --region us-east-1
- Note the ResourceArn in the command output:
{ "BackupJobs": [ { "CompletionDate": 1584448353.589, "BackupVaultArn": "arn:aws:backup:us-east-1:111222333444:backup-vault:Default", "PercentDone": "0.0", "RecoveryPointArn": "arn:aws:backup:us-east-1:111222333444:recovery-point:f29fe56c-8f44-4877-9ae6-9c6d5dce8935", "ResourceType": "EFS", "BackupSizeInBytes": 73, "State": "COMPLETED", "IamRoleArn": "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole", "ResourceArn": "arn:aws:elasticfilesystem:us-east-1:111222333444:file-system/fs-c1234567", "BackupJobId": "12ddf0b1-aed4-44ec-894f-0d74448949bd", "StartBy": 1584451934.889, "CreationDate": 1584448334.889, "BackupVaultName": "Default" }, { "CompletionDate": 1583305453.7, "BackupVaultArn": "arn:aws:backup:us-east-1:111222333444:backup-vault:Default", "PercentDone": "0.0", "RecoveryPointArn": "arn:aws:backup:us-east-1:111222333444:recovery-point:09e9dafe-44a6-471a-b4e8-64c98219a480", "ResourceType": "EFS", "BackupSizeInBytes": 73, "State": "COMPLETED", "IamRoleArn": "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole", "ResourceArn": "arn:aws:elasticfilesystem:us-east-1:111222333444:file-system/fs-gd1b761d", "BackupJobId": "721ba96d-a656-4771-a1f4-78bcd0c930f8", "StartBy": 1583309035.684, "CreationDate": 1583305435.684, "BackupVaultName": "Default" } ] }
- Generate a CreationToken to restore the new EFS file system. This will enforce the uniqueness of the request. You can choose a value as the CreationToken. Run the uuid command on a Linux operating system to generate a unique identifier.
uuid -r
You will obtain a similar output as seen:
d0c12345-678d-4071-bf30-8e7e54ab65df
- The next step is to run the start-restore-job command. Define metadata in a seprate JSON file or as parameters within the command. Create a seperate JSON file as seen below to define metadate:
{"file-system-id": "fs-c1234567", "Encrypted": "false", "PerformanceMode": "generalPurpose", "CreationToken": "d0c12345-678d-4071-bf30-8e7e54ab65df", "newFileSystem": "true"}
Remember to replace CreationToken with the unique value generated in the previous step.
After this, run the start-restore-job command:
aws backup start-restore-job --region us-east-1 --recovery-point-arn "arn:aws:backup:us-east-1:111222333444:recovery-point:123e4567-6cd9-464e-bb6b-13f70e79d347" --iam-role-arn "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole" --metadata file://<path to json file>
Remember to enter the JSON file created earlier in place of –metadata.
Run the following command to define metadata as parameters within the start-restore-job command;
aws backup start-restore-job --region us-east-1 --recovery-point-arn "arn:aws:backup:us-east-1:111222333444:recovery-point:123e4567-6cd9-464e-bb6b-13f70e79d347" --iam-role-arn "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole" --metadata file://<path to json file>
Run the following commands and define the parameters within the start-restore-job command, run the command in the following format:
aws backup start-restore-job --region us-east-1 --recovery-point-arn "arn:aws:backup:us-east-1:111222333444:recovery-point:123e4567-6cd9-464e-bb6b-13f70e79d347" --iam-role-arn "arn:aws:iam::111222333444:role/service-role/AWSBackupDefaultServiceRole" --metadata '{"file-system-id": "fs-17dda397", "newFileSystem": "true", "CreationToken": "d0c12345-678d-4071-bf30-8e7e54ab65df", "Encrypted": "false", "PerformanceMode":"generalPurpose"}'
[Need assistance? We are glad to be of service!}
Conclusion
This easy way to restore the EFS file system from AWS Backup comes from our experienced Support Techs at Bobcares.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments