What are Azure Gen1 and Gen2 virtual machines and how does this affect migration to Azure from on premise?
You can read the full differences on the Microsoft site below which covers memory architecthure and other features.
https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2
However, a key difference is in how the boot works specifically with regards to BIOS and UEFI.
Generation | Boot mode |
Gen1 | BIOS |
Gen2 | UEFI |
Depending upon the machine you are looking to migrate from you must choose the correct generation to match the boot mode. This generation cannot be changed once created.
The disk usually determines the generation and we’ve seen issues with encrypted Linux machines being restored to Azure via Veeam creating them as Gen1. This is fine if it uses a BIOS boot mode but not if UEFI.
Why does Veeam only restore this as Gen1? We found this to be due to the encrypted disk and the helper appliance not able to read the data partition (as intended) and therefore cannot work out the disk type. So it defaults to Gen1.
What’s the solution?
Thankfully Azure powershell allows conversions of disk from Gen1 to Gen2 creating a new disk.
Open powershell from the Azure GUI
az disk create -g TEST-RG -mydisk-gen2 --source mydisk-gen1 --hyper-v-generation V2
This will create a new Gen2 type disk called mydisk-gen2 from the original disk called mydisk-gen1.
This will take a few minutes to create and in the Azure GUI you’ll see the new disk with an overview showing “provisioningState”: “Succeeded”.

Once created you can create a new VM from the new mydisk-gen2 disk and the vm type will be Gen2.
You can now proceed with building the VM.
You may also need to enable serial access and also add Hyper-V drivers to the VM to allow it to boot. If you are migrating from Hyper-V you should be fine but this is certainly needed for vmWare and ProxMox. That’s another article!