-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Report correct guest UUID, when VM Generation 2 is used
* When VM is created as Generation 2 in the setup wizard of Hyper-V hypervisor, then hypervisor reports UUID of given VM using little-endian. Thus it is not necessary to convert this UUID as we do for Generation 1. * We solve this issue by extending SQL query. We also ask for VirtualSystemSubType, which contains version of VM generation ("Microsoft:Hyper-V:SubType:1" or "Microsoft:Hyper-V:SubType:2"). When VM is generation 1, then we convert UUID from big-endian to little-endian as we have did it in the past. When generation is 2, then we do nothing with guest UUID. * Changed code around little bit, because there was variable uuid used for different purpose and it was confusing. * TODO: hyperv.py deserves more refactoring * More information about generation 1 or 2 on Hyper-V could be found e.g. here: * https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/create-a-virtual-machine-in-hyper-v * https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/plan/should-i-create-a-generation-1-or-2-virtual-machine-in-hyper-v
- Loading branch information
1 parent
37c4269
commit 934fa7b
Showing
1 changed file
with
65 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters