【问题标题】:where azure snapshots are stored with this script使用此脚本存储 azure 快照的位置
【发布时间】:2019-07-05 23:21:27
【问题描述】:

我找到了这篇博文

https://www.techmanyu.com/automate-disk-snapshots-azure/

作者展示了这个脚本。

$clientID = "<client id>"
$key = "<client secret>"
$SecurePassword = $key | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $clientID, $SecurePassword
Add-AzureRmAccount -Credential $cred -Tenant "<Tenant ID>" -ServicePrincipal;
$disks=Get-AzureRmDisk | Select Name,Tags,Id,Location,ResourceGroupName ; 
foreach($disk in $disks) { foreach($tag in $disk.Tags) { if($tag.Snapshot -eq 'True') {$snapshotconfig = New-AzureRmSnapshotConfig -SourceUri $disk.Id -CreateOption Copy -Location $disk.Location -AccountType PremiumLRS;$SnapshotName=$disk.Name+(Get-Date -Format "yyyy-MM-dd");New-AzureRmSnapshot -Snapshot $snapshotconfig -SnapshotName $SnapshotName -ResourceGroupName $disk.ResourceGroupName }}}

试图理解脚本,我想出了一个问题,快照存储在哪里?在与 VM 磁盘相同的托管磁盘中?

【问题讨论】:

    标签: azure powershell azure-storage


    【解决方案1】:

    执行脚本后,它会创建快照,您可以在门户中查看它们,它们的资源类型为Microsoft.Compute/snapshots。 本质上,它们应该存储在 blob 存储中。导航到门户中的快照 -> 导出,然后您会发现它会生成快照的 SAS 令牌,如https://md-nxxxqz.blob.core.windows.net/wxxxxxx0m/abcd?sv=2017-04-17&amp;sr=b&amp;si=31b3d91b-51be-4c1c-930e-996f382b8ad9&amp;sig=xxxxxxmd-nxxxqz 是存储快照的存储帐户,由 Azure 管理。

    【讨论】:

    • 导出快照并将其存储在 blob 存储中会更便宜吗?
    猜你喜欢
    • 2011-11-26
    • 1970-01-01
    • 2020-12-08
    • 2021-12-26
    • 2017-09-29
    • 1970-01-01
    • 2014-05-18
    • 2021-07-18
    • 2015-05-05
    相关资源
    最近更新 更多