none
After Startup, how to wait until HyperV virtual machine gets ready for operations (Using WMI)? RRS feed

  • Question

  • I am able to start the HyperV using WMI interface(C++ code). I used 'RequestStateChange' of Msvm_ComputerSystem for that. I am waiting for completion of this job using 'JobState'.

    I actually want to wait till the winlogon.exe is finished on the Virtual machine. This is required since I am getting the IPAddress of VM using Msvm_KvpExchangeComponent's 'GuestIntrinsicExchangeItems'. In this, IPAddress wont be available unless Virtual Machine is booted up completely.

    Is there a way to wait till the HyperV is completely booted up?


    I am currently waiting on Virtual Machine's Msvm_HeartbeatComponent classes 'OperationalStatus' property to be 2 for this. Is this right?
    Monday, April 12, 2010 1:14 PM

All replies

  • Not sure but did you try Msvm_CIM_ConcreteJob::RequestStateChange after Msvm_ComputerSystem::RequestStateChange on the job returned by latter?
    Monday, April 12, 2010 7:22 PM
  • There is no class named Msvm_CIM_ConcreteJob. I think you are referring to CIM_ConcreteJob which is the return value of Msvm_ComputerSystem::RequestStateChange. I am monitoring the same class with its 'JobState' property to get the job status.

    Problem is, 'JobState' changes from Running(4) to Completed(7) as soon as the image starts booting up. I wanted to wait till winlogon process is over...

     

    Tuesday, April 13, 2010 6:04 AM
  • Hey Rajeesh,

    Were you able to find a good mechanism to detect VM boot? If yes, could u share it?

    Regards,

    -Ajay

    Sunday, July 4, 2010 9:33 PM