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
preguntada hace 3 años332 visualizaciones
2 Respuestas
0
Respuesta aceptada

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
respondido hace 3 años
0

Perfect, thanks Mike!

vengle
respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas