Hi!
One of the users of my C# wrapper library for VixCOM () noticed a problem in the current implementation: when querying the power-state of a VM using the GetProperties() function, the function returns POWERED_OFF (decimal 2) even for suspended VMs. The expected result would be SUSPENDED (decimal 32).
I verified that it's not related to my library or VixCOM by writing a simple C++ application using vix.dll, even here the returned value is 2 instead of 32 !
However, the interesting thing is, this only applies when I suspend the virtual machine via the VI Client or VI Web Access. If I'm suspending the VM via VIX, the GetProperties() function returns the correct value for the power state. When I disconnect and re-connect, it returns POWERED_OFF again.
Anybody else seeing this behavior?
Regards, Alex
I have run into this issue with the following sequence:
1.get vm handle
2.check Power status
3.send suspend event
4.check power status <--- this check would return an incorrect value
I fixed this by retrieving a new VM HANDLE between step 3 and 4...
Hi!
In my case it reports the false value in step 2 and the correct in step 4
What do you mean with "retrieving a new VM HANDLE"? A second call to OpenVM() ?
Regards, Alex
Yes, a second call to OpenVM between retrieving power states.
I tried that, it didn't help.
Are you getting the correct power state of a suspended VM on VMware Server 2?
Regards, Alex
Yes I am. Check out my implementation of the Vix in the 'Multithreading Vix' thread below...
Hi!
I tested it with your implementation and it also reports the VM as powered-off instead of suspended.
Maybe this is related to the version of VIX I'm using (1.6.2), since Server 2 shipped with 1.6.0 ?
Regards, Alex
What about getting a new handle for the host as well (disconnect host / garbage collect / connect host / openvm), since you are interacting through the vmware UI to modify the powerstate.
What does this to apply to: "When I disconnect and re-connect, it returns POWERED_OFF again."
1. when you suspend via VIX and do iHost.Disconnect/.Connect?
2. when you suspend via vmware UI and do ihost.disc/.conn?
Hi!
It applies to both, since in the second scenario I always get POWERED_OFF, only in the first I'm getting SUSPENDED until I call disconnect/connect.
Thanks for your help
Regards, Alex
I agree that this is a bug.