none
How to get the VM-Generation ID from VM or hypervisor. RRS feed

  • Question

  • Hi I just red the articles about DC cloneing

    https://technet.microsoft.com/en-us/library/hh831734.aspx

    I found the msDS-GenerationID attribute in Active Directory.

    Is there a way to see the VM GenerationID in virtual machine driver of the VM or to see the assigned VM GenerationID on the Hypervisor? 


    Sunday, February 22, 2015 3:50 PM

Answers

  • Hello,

    Here is the instructions to compile the code.

    Open Visual Studio 2010
    Create a New Project / Visual C++ / Win32 Console Application with name GetVMGenerationIdentifier
    From Solution Explorer, open the file Header Files / stdafx.h then add the following text after line // TODO:

    #include "windows.h"

    Copy / Paste the code C++ vmgenerationcounter.h from https://msdn.microsoft.com/en-us/library/jj643357(v=vs.85).aspx

    Save the stdafx.h file

    Open GetVMGenerationIdentifier.cp and place your cursor under the line #include "stdafx.h"

    Copy / Paste the other code C++ from https://msdn.microsoft.com/en-us/library/jj643357(v=vs.85).aspx

    Insert the following line before the text return 0;

    GetVmCounter(FALSE);

    Save your project and build it.

    Test your GetVMGenerationIdentifier.exe with elevation privileges in a command prompt

    Compare the Generation ID with the generation_id from the file .xml of your Hyper-V Host under <global_settings>

    Regards
    Charlie


    Charlie Dancoisne - Independent Consultant & Trainer (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable. This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Tuesday, February 24, 2015 12:43 PM

All replies

  • Hello,

    On your VM, use Device Manager to verify that the Microsoft Hyper-V Generation Counter system device is present. This is how virtual machine presents Generation ID to the operating system.

    The Generation ID value is projected into a virtual machine through an emulated BIOS device, and Integration Services presents it as a Hyper-V Generation Counter. Because of this, operating systems on a virtual machine can access the Generation ID value only if it has Integration Services installed from Windows 8, Windows Server 2012, or newer.


    https://technet.microsoft.com/en-us/library/jj574223.aspx

    Actions that will cause the Generation ID to change include:

    • The virtual machine starts from a checkpoint.
    • The same checkpoint is applied multiple times.
    • The virtual machine is restored from a backup.
    • The virtual machine is migrated by using System Center 2012 - VMM (Export and Import).
    • The virtual machine is imported.

    Actions that will not cause the Generation ID to change include:

    • The virtual machine is live-migrated.
    • The virtual machine is paused or resumed.
    • The virtual machine is restarted.
    • The Hyper-V host is restarted

    Regards


    Charlie Dancoisne - Independent Consultant & Trainer (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable. This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Sunday, February 22, 2015 5:41 PM
  • thx for your replay. I found the Hyper-V Generation Counter in my VM. But how can I see the value of the generation ID?. When you look at the right hand side there is the value of the generation ID from my DC in active directory. There has to be a correlating value in the bios of the maschine. The question is how to get it!
    • Edited by Arno N Sunday, February 22, 2015 6:16 PM
    Sunday, February 22, 2015 6:15 PM
  • Hello,

    Below is a link to a white paper. I think this is the only solution (Visual C ++)

    https://msdn.microsoft.com/en-us/library/jj643357(v=vs.85).aspx

    Regards


    Charlie Dancoisne - Independent Consultant & Trainer (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable. This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Sunday, February 22, 2015 11:05 PM
  • Hello,

    Here is the instructions to compile the code.

    Open Visual Studio 2010
    Create a New Project / Visual C++ / Win32 Console Application with name GetVMGenerationIdentifier
    From Solution Explorer, open the file Header Files / stdafx.h then add the following text after line // TODO:

    #include "windows.h"

    Copy / Paste the code C++ vmgenerationcounter.h from https://msdn.microsoft.com/en-us/library/jj643357(v=vs.85).aspx

    Save the stdafx.h file

    Open GetVMGenerationIdentifier.cp and place your cursor under the line #include "stdafx.h"

    Copy / Paste the other code C++ from https://msdn.microsoft.com/en-us/library/jj643357(v=vs.85).aspx

    Insert the following line before the text return 0;

    GetVmCounter(FALSE);

    Save your project and build it.

    Test your GetVMGenerationIdentifier.exe with elevation privileges in a command prompt

    Compare the Generation ID with the generation_id from the file .xml of your Hyper-V Host under <global_settings>

    Regards
    Charlie


    Charlie Dancoisne - Independent Consultant & Trainer (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable. This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Tuesday, February 24, 2015 12:43 PM
  • 1. Is there any example in c#?

    2. More important is: Is there a way to get the Generation ID of a VM from outside through the Microsoft.SystemCenter.VirtualMachineManager?

    Tuesday, January 26, 2016 9:39 AM