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.
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.
- 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
}
- 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