Things to consider before you use image sharing to convert VM image to VHD in Azure
Image sharing with Azure provider support converting VMware virtual machine to Azure VHD, which is uploaded to Azure storage blob. You can use Azure web portal to create a VM based on VHD. Image sharing does not add additional limitations about VM conversion, but Azure has the following prerequisites on source VMs:
Source virtual machine OS Type
The following guest operating systems in source virtual machine are supported:
Windows 10 Series
Windows 2012 R2 Series
Windows 2016 Series
Windows 2019 Series
Windows 2022 Series
RHEL 7.6, 7.7, 7.9, 8.6
Ubuntu 18.04
SUSE 12SP4, 15SP4
For other operation systems, see Supported platforms.
For non-endorsed distributions, verify that the source VM meets the requirements for non-endorsed distributions before you convert a VM. This verification is important because Linux VMs that are based on an endorsed distribution of Microsoft Azure have the prerequisites that enable them to run on Azure, but the VMs that originate from other hypervisors might not. For more information, see Information for Non-Endorsed Distributions.
Hyper-V Drivers in source virtual machine
For Linux, the following Hyper-V drivers are required on the source VM:
hv_netvsc.ko
hv_storvsc.ko
hv_vmbus.ko
You may need to rebuild the initrd so that required kernel modules are available on the initial ramdisk. The mechanism for rebuilding the initrd or initramfs image may vary depending on the distribution. Many distributions have these built-in drivers available already. For Red Hat or CentOS, the latest Hyper-V drivers (LIS) may be required if the built-in drivers do not work well. For more information, see Linux Kernel requirements.
For example, before you perform a backup for a Linux source VM that runs CentOS or Red Hat, verify that required Hyper-V drivers are installed on the source VM. Those drivers must be present on the source VM backup to start the VM after conversion.
Take a snapshot of the source VM..
Run the following command to modify the boot image:
sudo dracut -f -v -N
Run the following command to verify that Hyper-V drivers are present in the boot image:
lsinitrd | grep hv
Verify that no dracut conf files (for example,
/usr/lib/dracut/dracut.conf.d/01-dist.conf) contain the following line:hostonly="yes"
Run a new backup to use for the conversion.
Disk
The OS in source VMs is installed on the first disk of the source VMs. Do not configure a swap partition on the operating system disk. See Information for Non-endorsed Distributions
Multiple Data disks attached to new VM created by converted VHD will be in offline status for Windows and unmounted for Linux. Need to make them online and mount manually after conversion.
After creating a VM by converted VHD, one extra temporary storage disk whose size is determined by the VM size may be added by Azure in both Linux and Windows systems. For more information, see Azure VM Temporary Disk.
Networking
If the source VM has multiple network interfaces, only one interface will be kept available in the new VM created by converted VHD.
Linux: The name of the primary network interface on source VMs must be eth0 for endorsed Linux distributions. If not, it is unable to connect new VM created by converted VHD, and some manual steps need to be done on the converted VHDs. For more information, see Can't connect to Azure Linux VM through network.
Windows: Enable Remote Desktop Protocol (RDP) on the source VM. Some windows systems need to disable the firewall in source VMs, otherwise unable to connect remotely.
Azure account
When you convert VMDK to VHD, Azure account in image sharing using MSDP cloud should be Azure general-purpose storage accounts. See Storage account overview.
Note:
For VM conversion, if the image sharing volume is FortKnox, only access credentials are supported, Azure Service Principal or AWS IAM anywhere credentials are not supported.