내용으로 건너뛰기

AWS Backup: Restore composite recovery point for EKS and EBS with cli

0

We try to restore an EKS composite recovery point, which consists of the EKS and EBS resource type. When triggering an restore with

aws backup start-restore-job \
    --recovery-point-arn "<composite-recovery-arn>" \
    --iam-role-arn "<restore-role-arn>" \
    --metadata '{"clusterName":"my-cluster", "newCluster":"false" }' 

The composite restore fails, since the EBS restore got an error

Restore Job failed as no restore metadata was provided

When adding the missing availabilityZone metadata, i.e.

--metadata '{"clusterName":"my-cluster", "newCluster":"false", "availabilityZone":"eu-central-1a" }' 

the composite jobs fails with error

Invalid metadata keys found: [availabilityzone]

On the AWS console, it's possible to complete the missing availabilityZone for the volume during the "Restore backup" wizard.

질문됨 3달 전72회 조회
2개 답변
0
수락된 답변

Hello.

To restore EBS to an existing cluster, you will need the commands described in the following documentation.
The EKS "start-restore-job" command does not directly include metadata called "availabilityZone".
Please use the metadata provided for nested restores.
https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-eks.html

aws backup start-restore-job \
    --recovery-point-arn "arn:aws:backup:us-west-2:123456789012:recovery-point:composite:eks/my-cluster-20240115" \
    --iam-role-arn "arn:aws:iam::123456789012:role/AWSBackupDefaultServiceRole" \
    --metadata '{"clusterName":"existing-cluster","newCluster":"false","namespaceLevelRestore":"true","nestedrestorejobs":"{\"arn:aws:ec2:us-west-2::snapshot/snap-abc123\":\"{\\\"AvailabilityZone\\\":\\\"us-west-2a\\\"}\",\"arn:aws:backup:us-west-2:123456789012:recovery-point:fa71a304-2555-4c37-8128-f154b9578032\":\"{\\\"DestinationBucketName\\\":\\\"bucket-name\\\"}\"}"}' \
    --resource-type "EKS"
전문가
답변함 3달 전
전문가
검토됨 3달 전
-2

When restoring a composite recovery point for EKS that includes EBS volumes, you need to handle the metadata requirements for both resource types. The challenge you're experiencing occurs because EKS and EBS have different metadata requirements, and the composite restore needs to accommodate both.

For EKS restores to an existing cluster, the required metadata includes clusterName and newCluster. However, when the composite recovery point includes EBS volumes, those volumes also require their own metadata, such as availabilityZone.

The issue with your second command attempt is likely related to case sensitivity - the metadata key should be availabilityZone (with capital Z), not availabilityzone.

When using the CLI for composite restores, you need to ensure that:

  1. The metadata keys are correctly formatted with proper capitalization
  2. The IAM role specified has the necessary permissions for both EKS and EBS restore operations
  3. You're providing the appropriate metadata for each resource type within the composite recovery point

For EBS-specific metadata that can be specified during restore, valid keys include availabilityZone, encrypted, iops, kmsKeyId, volumeType, volumeSize, and throughput.

If you continue to experience issues with the CLI approach, you may need to verify that your composite recovery point structure supports the metadata configuration you're attempting to apply, as the console wizard may handle certain metadata mappings differently than the CLI command.
Sources
Restore an Amazon EKS cluster - AWS Backup
Restore an Amazon EBS volume - AWS Backup
start-restore-job — AWS CLI 2.27.41 Command Reference

답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.