V2V Converter doesn't set Azure VM as Generation 2

VM image converter (VMDK, VHD, VHDX, IMG, RAW, QCOW and QCOW2), P2V migrator

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
labmaster
Posts: 3
Joined: Thu Oct 07, 2021 9:05 pm

Thu Oct 07, 2021 10:43 pm

I am using V2V converter to convert a local VMDK image to Azure, and the Generation is not set, which defaults to Gen 1. The source VMDK is UEFI, so the resulting Azure VM doesn't boot.

I have read in other posts that the Generation of the VM is supposed to be detected automatically, but that doesn't seem to be working in this case. Maybe it is because I am using a local VDMK image as the source (I'm not using an ESXi Server as the source)? Maybe it is because V2V Converter doesn't know how to set the Generation on the Azure side?

There needs to be a configuration option in V2V Converter to set the Generation of the Azure destination Disk

While I'm at it, the name of the managed disk in Azure is terrible. I have the opportunity to set the name of the VDH file that goes in the Blob, but no control of the managed disk that is attached to the VM, that uses the underlying VHD file.


--- A little more information on my process ---
My VMware Datastores are replicated to Azure via software from the Storage Provider.
I'm trying to do a Proof of Concept for DR, where I access the replicated VM in Azure and convert it to run in native Azure format.
I won't have access to an ESXi server in DR in Azure. Technically I could run VMware in Azure, but that is expensive.
I have created a native Azure VM to use for conversion/jumpbox.
I am able to retrieve a VMDK image from the Azure copy of the Datastore, and save it locally on the jumpbox.
I am able to use V2V Converter to convert the local VMDK to Azure, but it won't boot (because it is Gen 1 in Azure).

--- Additional testing information ---
I have also done some testing on a PC in the office.
In the office, I am able to convert a local VMDK to a local VHD.
With a little magic, I am able to upload the VHD to Azure (as Gen 2), create an Azure VM, and get it to boot in Azure.
Unfortunately, my magic doesn't work on the Azure jumpbox because the converted VHD needs to be resized and I can't install HyperV tools in an Azure VM.


--- A little more information about the magic of uploading to Azure ---
https://docs.microsoft.com/en-us/azure/ ... powershell

# Install Azure Powershell
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

# Install only the PowerShell module
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell

Connect-AzAccount

$pathToConvertedVM = "C:\scripts\HyperV\Azure.v2\convertedVM1_2.vhd"
$rgName = 'resourceGroupName'
$managedDiskName = 'convertedVM1v2'

#$vhdSizeBytes = (Get-Item $pathToConvertedVM).length - 512
$vhdSizeBytes = (Get-Item $pathToConvertedVM).length
$vhdSizeBytes / 1MB
# The answer to vhdsize / 1 MB needs to be a whole number.
# if is it not a whole number, it needs to be resized to a whole number (Hyper-V tools need to be installed to resize).
# Example, vhd size is 102400.000488281 MB - it needs to be resized to 102410 MB (went a little bigger just to make sure)
Resize-VHD -Path C:\scripts\HyperV\adfscli.Azure.v2\adfscli1_2.vhd -SizeBytes 102410MB


$diskconfig = New-AzDiskConfig -SkuName 'Standard_LRS' -OsType 'Windows' -UploadSizeInBytes $vhdSizeBytes -Location 'canadacentral' -CreateOption 'Upload' -HyperVGeneration V2
New-AzDisk -ResourceGroupName $rgName -DiskName $managedDiskName -Disk $diskconfig

$diskSas = Grant-AzDiskAccess -ResourceGroupName $rgName -DiskName $managedDiskName -DurationInSecond 86400 -Access 'Write'
$disk = Get-AzDisk -ResourceGroupName $rgName -DiskName $managedDiskName

C:\scripts\HyperV\AzCopy.exe copy $pathToConvertedVM $diskSas.AccessSAS --blob-type PageBlob

Revoke-AzDiskAccess -ResourceGroupName $rgName -DiskName $managedDiskName


--- Properties of the AzDisk on Azure, created by V2V Converter ---
--- Note that the HyperVGeneration property is not set (null), which defaults to Gen 1 ---
PS C:\WINDOWS\system32> Get-AzDisk -ResourceGroupName resourceGroupName -DiskName OS_Disk_5908594670418047227


ResourceGroupName : resourceGroupName
ManagedBy :
ManagedByExtended : {}
Sku : Microsoft.Azure.Management.Compute.Models.DiskSku
Zones :
TimeCreated : 2021-10-02 2:15:07 PM
OsType : Windows
HyperVGeneration :
CreationData : Microsoft.Azure.Management.Compute.Models.CreationData
DiskSizeGB : 100
DiskSizeBytes : 107374182400
UniqueId : d03b6d33-unique-id-5555-2cd1b5dce7f7
EncryptionSettingsCollection :
ProvisioningState : Succeeded
DiskIOPSReadWrite : 500
DiskMBpsReadWrite : 60
DiskIOPSReadOnly :
DiskMBpsReadOnly :
DiskState : Unattached
Encryption : Microsoft.Azure.Management.Compute.Models.Encryption
MaxShares :
ShareInfo : {}
Id : /subscriptions/210fa214-subscription-id-5555-d7ffb6e0af13/resourceGroups/resourceGroupName/providers/Micr
osoft.Compute/disks/OS_Disk_5908594670418047227
Name : OS_Disk_5908594670418047227
Type : Microsoft.Compute/disks
Location : canadacentral
ExtendedLocation :
Tags : {}
NetworkAccessPolicy : AllowAll
DiskAccessId :
Tier :
BurstingEnabled :
PurchasePlan :
SupportsHibernation :
SecurityProfile :
yaroslav (staff)
Staff
Posts: 2362
Joined: Mon Nov 18, 2019 11:11 am

Sat Oct 09, 2021 1:44 pm

Hi,

Welcome to StarWind Forum. Are you attempting to use StarWind V2V Converter as a DR replication solution? If so, that is not what the tool is intended for as it requires the VM to be shut down to replicate. I'd recommend using Veeam Backup and Replication to build the DR solution but I am not sure how it integrates with the public cloud.
labmaster
Posts: 3
Joined: Thu Oct 07, 2021 9:05 pm

Sat Oct 09, 2021 9:12 pm

No, I am not trying to use it as a DR Replication solution. My storage software is taking care of the data transfer to Azure. In reality, it is a backup solution and Azure is the offsite copy. My primary DR solution is a second managed Data Center (not Azure). What I am working on is really a Proof of Concept that I could run my VMs in Azure.

I already have the data in Azure, I just want to prove that I could convert the VMs and run them in Native Azure format rather than VMware format. When I use V2V Converter, it says the conversion is successful, but the resulting Azure VM doesn't boot. The Azure VM is configured as Gen 1, when it should be Gen 2. I need V2V Converter to be able to register the converted VM as Gen 2 in Azure.

Also forgot to add the fact that the VM is shutdown. It is not a live copy f the VM. It is an offsite backup copy of the VM. It is just the files of the VM, no ESXi involved (or available) at this point.
yaroslav (staff)
Staff
Posts: 2362
Joined: Mon Nov 18, 2019 11:11 am

Mon Oct 11, 2021 3:25 am

StarWind V2V Converter is a converter but not a backup solution. I will check on the possibility of Gen2 VM creation with my colleagues. Will keep you posted.
yaroslav (staff)
Staff
Posts: 2362
Joined: Mon Nov 18, 2019 11:11 am

Mon Oct 11, 2021 6:56 am

Hi,

This is happening due to the GPT drive your VM has. Either convert the disk to MBR, or please wait for the new build to arrive.
The new build should be able to convert the VM to GEN2.
labmaster
Posts: 3
Joined: Thu Oct 07, 2021 9:05 pm

Mon Oct 11, 2021 8:58 pm

Thanks for letting me know that GPT is a problem. Seems pretty unreasonable to me to convert to MBR, which is going backwards to 80's technology.

I'll wait for the new build, any estimate of when it should be released? Before the end of the year?
yaroslav (staff)
Staff
Posts: 2362
Joined: Mon Nov 18, 2019 11:11 am

Mon Oct 11, 2021 9:19 pm

Unfortunately, I have no ETA now. Stay tuned!
yaroslav (staff)
Staff
Posts: 2362
Joined: Mon Nov 18, 2019 11:11 am

Tue Oct 12, 2021 7:43 am

Have an update for you: the build should be available really soon.
As a workaround, you can convert the VM to ESXi and select BIOS instead of UEFI there and convert it to another host.
daisymaria
Posts: 1
Joined: Wed Dec 28, 2022 4:39 am

Wed Dec 28, 2022 4:41 am

Separate the Windows partition from the Boot partition. The Boot partition and Windows partition are located on the OS disk if there is only one partition.
leochad
Posts: 1
Joined: Fri Jan 13, 2023 7:56 am

Fri Jan 13, 2023 7:57 am

Secure Boot for your VM is the cornerstone of trustworthy launch. This mode, which is integrated into the platform firmware, guards against the addition of boot kits and malware-based rootkits.
yaroslav (staff)
Staff
Posts: 2362
Joined: Mon Nov 18, 2019 11:11 am

Fri Jan 13, 2023 8:45 am

You are right.
Post Reply