0

I have some questions about the Azure Files Share snapshot, if you know something about that, please let me know. Thanks.

1, Where are the snapshots stored? Will it cost the storage capacity and how about the cost of creates and delete snapshots? 2, If my snapshot exceeds 200, what will it be? Deleted by itself or the new one can't be created? 3, May I delete the snapshot which I want by Azure Automation (use the runbook to schedules it)? 4, If I use Azure automation and Back up (Preview) to deploy the Azure FileShare snapshot together, which snapshot will I get?

If you know something about that, please share with us (even you can answer one of them, I will mark it as an answer). Thanks so much for your help.

Arthur
  • 103
  • 11

1 Answers1

0

Just a quick answer to some of your question(for others, I will update later).

Some questions can be found here.

1.1 Where are the snapshots stored?

Share snapshots are stored in the same storage account as the file share.

1.2 Will it cost the storage capacity

As per this doc (The Space usage section) metioned: Snapshots don't count toward your 5-TB share limit. There is no limit to how much space share snapshots occupy in total. Storage account limits still apply.

This means that when you create a file share, there is a Quota option which let you specify the file max capacity(like 5 GB), if you total snapshots(like 10 GB) is larger than that max capacity, and don't worry, you can still save these snapshots, but the total snapshots capacity should less than your storage account's max capacity.

  1. If my snapshot exceeds 200, what will it be? Deleted by itself or the new one can't be created?

if more than 200, an error will occur:

"Exception calling "Snapshot" with "0" argument(s): "The remote server returned an error: (409) Conflict.".

You can test it just using the following powershell code:

$context = New-AzureStorageContext -StorageAccountName your_accouont_name -StorageAccountKey your_account_key
$share = Get-AzureStorageShare -Context $context -Name s22
for($i=0;$i -le 201;$i++){
$share.snapshot();
start-sleep -Seconds 1
}
  1. May I delete the snapshot which I want by Azure Automation (use the runbook to schedules it)?

This should be possible, I can test it at my side later then update to you.

And most of the snapshot operation commands can be found here, including delete.

update:

$s =  Get-AzureStorageShare -Context $context -SnapshotTime 2018-12-17T06:05:38.0000000Z -Name s33    
$s.Delete() #delete the snapshot

Note:

For -SnapshotTime, you can pass the snapshot name to it. As of now, the snapshot name is always auto assigned a UTC time value, like 2018-12-17T06:05:38.0000000Z

For -Name, pass the azure file share name

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • Thanks so much, Yang. About Question 1, I found some information at https://learn.microsoft.com/en-us/azure/storage/files/storage-snapshots-files, in the Space usage, they say "Snapshots don't count toward your 5-TB share limit. There is no limit to how much space share snapshots occupy in total. Storage account limits still apply." How to explain this one? Again, Thanks for your professional answers, after you finished, I will make it as an answer. – Arthur Dec 17 '18 at 04:54
  • Thanks for your suggestion about where to find the command, last time I tried to use them but I failed. I want to use the existing storage account, but there usually has an error even I set the storage account. "Get-AzureStorageShare : Could not get the storage context. Please pass in a storage context or set the current storage context." – Arthur Dec 17 '18 at 05:01
  • @Arthur, can you let me know how do you set the storage account name? you should go to your azure portal -> your storage account -> Access keys, you can find your storage account and the key(key1 or key2), then use this code in your powershell: `$context = New-AzureStorageContext -StorageAccountName your_accouont_name -StorageAccountKey your_account_key`, and please let me know if you have any issue about this. – Ivan Glasenberg Dec 17 '18 at 05:23
  • @Arthur, for the Space usage section, I have updated my answer: section 1.2. – Ivan Glasenberg Dec 17 '18 at 05:40
  • Where did you run the powershell? you need to import the azure.storage module. If in runbook, you can refer to this [answer](https://stackoverflow.com/questions/53772305/how-to-deploy-files-share-snapshot-scheduler-by-azure-automation) – Ivan Glasenberg Dec 17 '18 at 06:42
  • I run the powershell at Azure cloud shell. – Arthur Dec 17 '18 at 07:00
  • Try it from local. or go to this site https://www.powershellgallery.com/packages/Azure.Storage/4.6.0 , and under Installation Options -> select Azure automation, then click deploy to azure automation – Ivan Glasenberg Dec 17 '18 at 07:17
  • Okay, thanks so much. By the way, will I create 200 snapshots if I run this command? – Arthur Dec 17 '18 at 07:31
  • yes, take care of that it's just for a testing use. – Ivan Glasenberg Dec 17 '18 at 07:34
  • and I see you post another question about delete snapshot, you can provide more details about it. such as if 200 is reached, which snapshots you want to delete(like delete the previous 10 snapshots or something else) – Ivan Glasenberg Dec 17 '18 at 07:37
  • Okay, thanks for your advice, I will go to add something. I want to mark your answer, do you have something to add? How about the last question? Do you know something about that? – Arthur Dec 17 '18 at 08:26
  • For the last question, I tested it at my self, if I enable the backup feature(the backup can work well), then in azure portal -> file share, the "create snapshot" button is missing. So I doubt maybe we can only choose one of them. I also submit a ticket and try to get help from the related team, and any feedback, I will let you know :) – Ivan Glasenberg Dec 17 '18 at 08:29
  • Thanks so much, how about the command runs by the runbook, I mean can the Backup and the Azure Automation work together to create one Fileshare snapshot, I am sorry to say that but can you test? – Arthur Dec 17 '18 at 09:02
  • can you tell me why you use this way? just use runbook and the snapshot() method can do it well. – Ivan Glasenberg Dec 17 '18 at 09:09
  • That is the second scheme way because I want to set the retention period of the Files share snapshots. I hope I can just use runbook and the snapshot() method to do it, can you give me some suggestion about my another question. Thanks so much, I will mark your answer now. – Arthur Dec 17 '18 at 09:39
  • Thank you:). I will take a try and may update you tomorrow. – Ivan Glasenberg Dec 17 '18 at 09:42
  • I am so sorry to trouble you, but can you see my another post, I tried to make your cmdlet together with the delete one, and I think if we can change the path to get the snapshot created upside, maybe it can work very well. Can you give some advice if you have time, Thanks. – Arthur Dec 18 '18 at 04:23