Creating Image (from uploaded VHD) is failing on Azure - azure

I am trying to create a VM on Azure, from VHD of an On Premise Server. As per the steps, I have created the VHD file of the C Drive of my server (including the system reserved partition), and have uploaded the same VHD to Blob Storage (as Page Blob). I have uploaded it through Portal.
Now as per next step, I am trying to create an Image from it, so that it can be used to create VM.
But I am getting the following error:
Failed to create image 'NewImage'. Error: At least one resource
deployment operation failed. Please list deployment operations for
details. Please see https://aka.ms/arm-debug for usage details.
Not able to identify the actual error or problem in this.

From description i believe the issue is with the way you converted the VHD. People always miss the section where is says the VHD must be Fixed Size VHD.
Not sure if disk2vhd has the option but you can use the Convert-VHD command in Hyper-V module or Microsoft VM Converter.
Convert-VHD –Path c:\test\MY-VM.vhdx –DestinationPath c:\test\MY-NEW-VM.vhd -VHDType Fixed
Also, VHD images on Azure must have a virtual size aligned to 1 MB. Typically, VHDs created using Hyper-V are aligned correctly.

To create the Azure VM from a VHD file which created on-premise. You need to do a lot of steps to prepare the VHD file. Not just convert the disk to the VHD file, you need to make sure it can run well on-premise.
The error you get does not show the reason that causes the accident. What I can provide are the steps that you can follow to create an available VHD file. And all the steps and recommends in Prepare a Windows VHD or VHDX to upload to Azure.

Related

How to backup Azure Custom managed image

I have created a custom managed image in Azure and it is there in the images menu. Is it possible to back it up or put delete protection etc or to store the image somewhere else.
Because If the subscription is cancelled or deleted, all these images also will be deleted as far as my understanding.
Or is there any best practices to save the image.
Thanks in advance.
As #Tiny-wa's comment points out, you can lock the image resource via the Azure portal from image--->Locks--->Add--->set the delete lock to prevent the image to be deleted unexpectedly.
There is not a direct feature to backup a managed image in Azure. If you want to save the image content, you need to download the VHD file from the source VM OsDisk and dataDisk or the snapshots of the source VM to your local VM. You also could upload the VHD file to a file share or your managed Azure storage account. Read Download a Windows VHD from Azure for more details.

Unable to create an azure image in ARM

I have uploaded a back up of onprem OS disk to azure RM storage account. I want to create an image out of that os disk to provision vms in azure.
Please let me know if that is possible ?
Assuming your base system is running Windows, and you don't want to sysprep the machine, you're trying to create what's called a Specialized image in Azure. The best steps to follow to complete this are:
Create the Specialized image
Create a VM from an image
The first thing that you need to make sure that the disk is in correct format i.e VHD for azure. There are many third party tools available to convert the disk to VHD (very easy if it's hyper v machine).
Secondly do create the necessary infrastructure in azure like storage account to upload the disk and virtual network that would connect to your machine, resource group etc. Also this is currently only possible through powershell and not through portal.
Azure migarte has now made it very to migrate large number of vms if you are considering a production( much better than its was last year).
The question says unable to migrate is disk so I assume you must have gone through Microsoft document and than must have faced problem. Can you provide me the error you got while uploading?

Azure: Attaching page blob created using storage API as a data disk to Virtual Machine.

I am tying to create a page blob using the storage API and add it as a disk to the Virtual Machine. Is there a way this can be done ?
Currently when I create a blob and add it as the disk , the VM fails with provisioning state failed.
It sounds like you want to create a data disk using Azure Storage SDK for Java to attach page blob as data disk for Linux VM. However, some concepts you understanded are note accurate.
Firstly, you need to create a VHD file on local environment. As references, you can try to follow the below documents to do it.
On Windows, please refer to the document Create and Use a Virtual Hard Disk on Windows 7 to create a VHD file.
On Linux or MacOS, you can install & configure QEMU/VirtualBox/KVM to create a disk image and convert it. For example, to convert a qemu image via command qemu-image convert.
For more information, please see About disks and VHDs for Azure virtual machines
Secondly, you upload the VHD file created to Azure Blob Storage as a page blob via AzCopy or follow the related section of the tutorial Creating and Uploading a Virtual Hard Disk that Contains the Linux Operating System.
Then, you can refer to the document Add a disk to a Linux VM to attach the data disk on Azure Storage.
Meanwhile, based on my understanding, I think you just want to extend the filesystem of your Linux VM. So the other solution may be suitable for your needs, which mount Azure File Storage on Linux VMs using SMB protocol. More details, please refer to How to use Azure File Storage with Linux.
Hope it helps. Any concern, please feel free to let me know.

How to replace os disk with attached data disk on azure virtual machine

I attached a new vhd file to my virtual machine but I could not find a way to boot that machine with this disk. How can I boot my virtual machine with newly attached data disk?
Edit: I found the way of creating of vm from captured vm image. It is preformed on VM Images section. Now my problem is that when I transfer the captured page blobs from one azure account to another account they appear on storage account section but not on VM Images section. Hence I am not able to create VM from transferred images. How can I make this blobs appear on VM Image or is there a way to transfer VM Image disk directly to the section of VM Images of another azure account by using azure-cli?
I would like to create OS Disk from a vhd file. In microsoft documents here as it mentioned there is a command azure vm image create in my azure-cli there is no such command. I could not find a way to make an OS Disk from my stored vhd files.
Solved: Using classic portal of Azure it is easy to create vm images or os disks and creating vms from these images.
Here is a link to get disk up and running, check the section 'Initialize the disk'.
Source : https://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-windows-classic-attach-disk/

Using AzCopy in azure virtual machine

I have an azure virtual machine which has some application specific CSV files(retrieved via ftp from on-premise) that needs to be stored into a blob (and eventually will be read and pushed into a Azure SQL DB via a worker role). Question is around pushing the files from VM to blob. Is it possible to get AzCopy without installing the SDK to have the files copied to the blob? Is there a better solution than this? Please read the points below for further information
Points to note:
1) Though files could be directly uploaded to a blob rather than getting them into the VM first and copying from there, for security reasons the files will have to be pulled into the VM and this cannot be changed.
2) I also thought about a worker role talking to a VM folder share (via common virtual network) to pull the files and upload to the blob, but this does not appear to be a right solution after reading some blogs - as it requires changes to both VMs (worker role VM and the Iaas VM).
3) Azure File Service is still in preview (?) and hence cannot be used.
Is it possible to get AzCopy without installing the SDK to have the
files copied to the blob?
Absolutely yes. You can directly download AzCopy binaries without installing SDK using the following links:
Version 3.1.0: http://aka.ms/downloadazcopy
Version 4.1.0: http://aka.ms/downloadazcopypr
Source: http://blogs.msdn.com/b/windowsazurestorage/archive/2015/01/13/azcopy-introducing-synchronous-copy-and-customized-content-type.aspx

Resources