Recovering a File Gateway

0

The aws best practices doc for https://docs.aws.amazon.com/storagegateway/latest/userguide/recover-data-from-gateway.html says to just activate a new gateway. There are other recovery steps for volumes or tapes but in the case of a File Gateway, the steps are to activate a new gateway and recreate the shares.

To recreate the shares, some record of the configuration would need to be available. Is there a simple way to periodicallt collect all share configurations from a gate way? Preferable a method that could be automated.

vengle
질문됨 3년 전332회 조회
2개 답변
0
수락된 답변

Hello,

You can get this information from your existing file gateways by using the AWS CLI or any of the available AWS SDKs and wrapping the commands up in a script whos output you then capture in a text file. I'll show the steps I used to do this manually using the CLI ( https://docs.aws.amazon.com/cli/latest/reference/storagegateway/index.html ):

  1. Set up credentials for CLI access and preferred region.
  2. "aws storagegateway list-gateways" - This will give you the list of all your gateways activated in a given region. Your output will be similar to this:

{
"Gateways": [
{
"GatewayId": "sgw-xxxxxxxx",
"GatewayARN": "arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:gateway/sgw-xxxxxxxx",
"GatewayType": "FILE_S3",
"GatewayOperationalState": "ACTIVE",
"GatewayName": "IADtest",
"Ec2InstanceId": "i-xxxxxxxxxxxxxxxxx",
"Ec2InstanceRegion": "us-east-1"
}
]
}

  1. "aws storagegateway list-file-shares --gateway-arn arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:gateway/sgw-xxxxxxxx" - using the gateway arn from the previous step, you'll get a list of shares:

{
"FileShareInfoList": [
{
"FileShareType": "SMB",
"FileShareARN": "arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:share/share-xxxxxxxx",
"FileShareId": "share-xxxxxxxx",
"FileShareStatus": "AVAILABLE",
"GatewayARN": "arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:gateway/sgw-xxxxxxxx"
}
],
"Marker": null
}

  1. "aws storagegateway describe-smb-file-shares --file-share-arn-list arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:share/share-xxxxxxxx" - For each file share, you'll run this command including the FileShareARN from the previous step:

{
"SMBFileShareInfoList": [
{
"FileShareARN": "arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:share/share-xxxxxxxx",
"FileShareId": "share-xxxxxxxx",
"FileShareStatus": "AVAILABLE",
"GatewayARN": "arn:aws:storagegateway:us-east-1:XXXXXXXXXXXX:gateway/sgw-xxxxxxxx",
"KMSEncrypted": false,
"Path": "/iad-test-data",
"Role": "arn:aws:iam::XXXXXXXXXXXX:role/service-role/StorageGatewayBucketAccessRole27bcd82d-37f6-4f2f-94bd-xxxxxxxxxx",
"LocationARN": "arn:aws:s3:::iad-test-data",
"DefaultStorageClass": "S3_ONEZONE_IA",
"ObjectACL": "bucket-owner-full-control",
"ReadOnly": false,
"GuessMIMETypeEnabled": true,
"RequesterPays": false,
"SMBACLEnabled": false,
"AccessBasedEnumeration": false,
"AdminUserList": [],
"ValidUserList": [],
"InvalidUserList": [],
"AuditDestinationARN": "arn:aws:logs:us-east-1:XXXXXXXXXXXX:log-group:/aws/storagegateway/share-xxxxxxxx:*", "Authentication": "GuestAccess",
"CaseSensitivity": "ClientSpecified",
"Tags": [],
"FileShareName": "iad-test-data",
"NotificationPolicy": "{}"
}
]
}

If you have a lot of gateways and/or file shares, you can see that you would want to wrap up these commands in a script. Please feel free to ask any further questions you may have.

AWS
답변함 3년 전
0

Perfect, thanks Mike!

vengle
답변함 3년 전

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

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

질문 답변하기에 대한 가이드라인

관련 콘텐츠