Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverted poll task for collecting instance info into the cache and reverted to the initial idea of property collector intercepting events in VC and storing properties of the instance into the cache. Due to issues with possible collision between the periodic task _sync_power_states and the arbitary time in which the property collector is bringing the queued changes we have inconsistencies in the power states of the instances. So one approach presented here is to remove the cached "powerState" in power_on/off methods which should cause the following scenarios:
-We poll the power-state before we get a change from the property-collector, then it should trigger a load from the vsphere-api
-We receive the update on time from power-off/on task in the property-collector, then the value is updated in the cache