ポータルまたは Azure CLI を使用してスナップショットを作成するCreate a snapshot using the portal or Azure CLI
バックアップ、または VM の問題を解決するために、OS ディスクまたはデータ ディスクのスナップショットを作成します。Take a snapshot of an OS or data disk for backup or to troubleshoot VM issues. スナップショットは、VHD の完全な読み取り専用コピーです。A snapshot is a full, read-only copy of a VHD.
Azure CLI の使用Use Azure CLI
次の例では、Cloud Shell を使用するか、または Azure CLI をインストールする必要があります。The following example requires that you use Cloud Shell or have the Azure CLI installed.
次の手順は、az snapshot create コマンドと --source-disk パラメターを使用してスナップショットを取得する方法を示しています。The following steps show how to take a snapshot using the az snapshot create command with the --source-disk parameter. 次の例では、myResourceGroup リソース グループに myVM という名前の VM があるものとします。The following example assumes that there is a VM called myVM in the myResourceGroup resource group.
az vm show を使用して、ディスク ID を取得します。Get the disk ID using az vm show.
osDiskId=$(az vm show \
-g myResourceGroup \
-n myVM \
--query "storageProfile.osDisk.managedDisk.id" \
-o tsv)
az snapshot create を使用して、osDisk-backup という名前のスナップショットを取得します。Take a snapshot named osDisk-backup using az snapshot create.
az snapshot create \
-g myResourceGroup \
--source "$osDiskId" \
--name osDisk-backup
注意
スナップショットをゾーン回復性のあるストレージに格納する場合は、可用性ゾーンをサポートするリージョンにストレージを作成し、 --sku Standard_ZRS パラメーターを含める必要があります。If you would like to store your snapshot in zone-resilient storage, you need to create it in a region that supports availability zones and include the --sku Standard_ZRS parameter.
az snapshot list を使用して、スナップショットの一覧を表示できます。You can see a list of the snapshots using az snapshot list.
az snapshot list \
-g myResourceGroup \
- table
Azure Portal の使用Use Azure portal
- Azure portal にサインインします。Sign in to the Azure portal.
- 左上の [リソースの作成] をクリックし、 [スナップショット] を探します。Starting in the upper-left, click Create a resource and search for snapshot. 検索結果から [スナップショット] を選択します。Select Snapshot from the search results.
- [スナップショット] ブレードで [作成] をクリックします。In the Snapshot blade, click Create.
- スナップショットの [名前] を入力します。Enter a Name for the snapshot.
- 既存のリソース グループを選択するか、新しいリソース グループの名前を入力します。Select an existing resource group or type the name for a new one.
- [ソース ディスク] で、スナップショットを作成するマネージド ディスクを選びます。For Source disk, select the managed disk to snapshot.
- スナップショットの保存に使う [アカウントの種類] を選びます。Select the Account type to use to store the snapshot. 高パフォーマンスの SSD に保存する必要がある場合を除き、 [Standard HDD] を使用します。Use Standard HDD unless you need it stored on a high performing SSD.
- Create をクリックしてください。Click Create.
次のステップNext steps
スナップショットからマネージド ディスクを作成し、その新しいマネージド ディスクを OS ディスクとして接続することで、スナップショットから仮想マシンを作成します。Create a virtual machine from a snapshot by creating a managed disk from the snapshot and then attaching the new managed disk as the OS disk. 詳細については、スナップショットからの仮想マシンの作成に関する記事のスクリプトを参照してください。For more information, see the Create a VM from a snapshot script.