VMware {code} Community
akoeplinger
Enthusiast
Enthusiast

Bug: power-state of a suspended VM is reported as powered-off in VMware Server 2

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

Tags (2)
0 Kudos
9 Replies
fixitchris
Hot Shot
Hot Shot

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...

0 Kudos
akoeplinger
Enthusiast
Enthusiast

Hi!

In my case it reports the false value in step 2 and the correct in step 4 Smiley Wink

What do you mean with "retrieving a new VM HANDLE"? A second call to OpenVM() ?

Regards, Alex

0 Kudos
fixitchris
Hot Shot
Hot Shot

Yes, a second call to OpenVM between retrieving power states.

0 Kudos
akoeplinger
Enthusiast
Enthusiast

I tried that, it didn't help.

Are you getting the correct power state of a suspended VM on VMware Server 2?

Regards, Alex

0 Kudos
fixitchris
Hot Shot
Hot Shot

Yes I am. Check out my implementation of the Vix in the 'Multithreading Vix' thread below...

0 Kudos
akoeplinger
Enthusiast
Enthusiast

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

0 Kudos
fixitchris
Hot Shot
Hot Shot

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?

0 Kudos
akoeplinger
Enthusiast
Enthusiast

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 Smiley Wink

Regards, Alex

0 Kudos
fixitchris
Hot Shot
Hot Shot

I agree that this is a bug.

0 Kudos