Solved FreeBSD as Azure Gen2 guest

Hi!
Does anyone successfully run FreeBSD guest as Azure Gen2 VM? I have FreeBSD 13.0 VM running as Hyper-V Gen2 VM that I need to move to Azure. After converting VHDX as described here and here and uploading disk to Azure it recognized as Disk Gen1 and no option to create Gen2 VM based on this Disk.

Latest FreeBSD Quarterly Status Report - Third Quarter 2021 has some info, but I cannot find details:
The changes for building official images on Azure Marketplace, which fulfill
the requirements of Azure and FreeBSD cloud images like disk layout and UEFI
for Gen2 VM, along with some minor improvements like configurations to speed up
booting, have been imported.
I spent a lot of time with migration process but still cannot run this VM in Azure. Convert VM to Gen1 is my last solution.
Thank you!
 
Can you provides more details about your problem? However, mains differences between Gen1 and Gen2 on HyperV are
Gen 1 : IDE Hard drive - Legacy BIOS (drive capacity should not exceed 2TB - approx)
Gen 2 : SATA/SCSI Hard Drive with UEFI + GPT (mandatory)
 
The main problem is that I cannot create Gen2 VM in Azure based on my uploaded disk(GPT, UEFI boot). On-premises it runs as Hyper-V Gen2 VM. I think my disk doesn't meet some requirements.

1637217966362.png
 
A possibility that you could do (assuming you have access to a Windows machine with Hyper V), is that you can create the Gen-2 VM there, and upload the vhd disk (Azure's faq says it will need to be uploaded in the same region the azure will be). Azure will then use that to create the Gen-2 VM.
 
As part of the hack, can't you just create a gen2 VM, then detach its root disk and connect yours ?
Unfortunately this not work:
1637319196683.png

But it gave me a new possible solution and I've finally solved this problem:

- create new Gen 2 Image based on my uploaded disk with this Azure Powershell commands:
$ImageConfig = New-AzImageConfig -Location westeurope -HyperVGeneration V2
$ImageConfig = Set-AzImageOsDisk -Image $ImageConfig -OsType Linux -ManagedDiskId "/subscriptions/ebf4c4d4-e3ac-4695-85ca-5f6c5c81a68a/resourceGroups/FLEX-IT/providers/Microsoft.Compute/disks/fbsd130"
$image = New-AzImage -ImageName fbsd130_gen2 -ResourceGroupName FLEX-IT -Image $ImageConfig
- create new Gen 2 VM based on new image
1637319892314.png


Thank you all !!!
 
Back
Top