2

I have taken a snapshot of a VM running as a managed disk. Now i want to create multiple vm's using that snapshot.

Can someone tell me how to create an image from that snapshot ?

GavinS1986
  • 21
  • 1
  • 3

2 Answers2

5

You can create the image from a snapshot using Powershell.

  1. Create the variables
    $rgName = "myResourceGroup"`
    $location = "EastUS"
    $snapshotName = "mySnapshot"
    $imageName = "myImage"
  1. Get the snapshot
    $snapshot = Get-AzureRmSnapshot -ResourceGroupName $rgName -SnapshotName $snapshotName
  1. Create the image configuration
    $imageConfig = New-AzureRmImageConfig -Location $location
    $imageConfig = Set-AzureRmImageOsDisk -Image $imageConfig -OsState Generalized -OsType Windows -SnapshotId $snapshot.Id
  1. Create the Image
    New-AzureRmImage -ImageName $imageName -ResourceGroupName $rgName -Image $imageConfig

The link for the same can be found here: Capture Image Resource

Akash Masand
  • 1,441
  • 14
  • 30
1

We can use PowerShell to create Image from managed disk.
More information please refer to this link.

By the way, if you want to create image from this snapshot, we should generalize it first.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25