Articles → MICROSOFT AZURE → Create a snapshot of the data disk from one virtual machine to another in Azure

Create a snapshot of the data disk from one virtual machine to another in Azure






What is the snapshot?





Implementation






Picture showing 2 virtual machines in Azure

Click to Enlarge



Picture showing the data disk in the virtual machine

Click to Enlarge



Picture showing the notepad file created inside the virtual machine

Click to Enlarge



Picture showing the Create snapshot button for creating the snapshot

Click to Enlarge



Picture showing the screen for creating the snapshot

Click to Enlarge





Picture showing the Create Disk button for creating the disk for the snapshot

Click to Enlarge



Picture showing the detail screen for creating the disk

Click to Enlarge





$rgName = 'RG'
$vmName = 'MYVM1'
$location = "East US" 
$dataDiskName = "backupdisk"
$disk = Get-AzDisk -ResourceGroupName $rgName -DiskName $dataDiskName 

$vm = Get-AzVM -Name $vmName -ResourceGroupName $rgName 

$vm = Add-AzVMDataDisk -CreateOption Attach -Lun 0 -VM $vm -ManagedDiskId $disk.Id

Update-AzVM -VM $vm -ResourceGroupName $rgName




Picture showing the data disk attached to the another virtual machine

Click to Enlarge



Picture showing the text file created in the another virtual machine

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, April 20, 2021

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250