Azure Virtual Machine Stuck on Bootup – Getting Device Ready

Microsoft Azure Virtual Machine got stuck at boot up with message “Getting device ready

Follow the steps below to fix it.

  1. Capture the Virtual Machine configuration information from Azure Portal

$rgname = “ResourceGroupName”
$loc = “DatacenterName”
$vmsize = “Standard_E4_v3”
$vmname = “ServerName”
$nic=”NicName”
$osDisk=”OSDiskName”

  1. Note the Operating System Disk location
  2. Delete Virtual Machine form Azure
  3. Attached the Operating System Disk to another VM at Azure as secondary disk
  4. Login to Azure VM where you attached the OS disk
  5. Open registry editor and go to file Load Hive
  6. Browse “C:\Windows\system32\config” select System file and load
    • Open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AppFabricCachingService
    • Add a Multi-String value called “DependOnService”
    • Edit the value and type in “CryptSvc”
    • Reboot with SAFER policy applied
  1. Detached the Operating System Disk from temporary server
  2. Create the Virtual Machine back with following script

Add-AzureRMAccount
Select-AzureRmSubscription -SubscriptionId “SubscriptionID”
$rgname = “ResourceGroupName”
$loc = “DatacenterName”
$vmsize = “Standard_E4_v3”
$vmname = “ServerName”
$vm = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize;

$nic = Get-AzureRmNetworkInterface -Name (“niname”) -ResourceGroupName $rgname;
$nicId = $nic.Id;
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nicId;

$osDisk = get-azurermdisk -ResourceGroupName $rgName -DiskName “DiskName”
$vm = Set-AzureRmVMOSDisk -VM $vm -ManagedDiskId $osDisk.Id -StorageAccountType StandardLRS -CreateOption Attach -Windows

$vm=Set-AzureRmVMBootDiagnostics -VM $vm -Disable
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vm -Verbose