Getting information about system
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 763
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm facing some problems again.
I have something like this (part of bigger class):
self.template = self._find_vm(self.si, name) [instance of vim.VirtualMachine]
timeout = 60
l_timeout = 0
while l_timeout <= 0:
guest_operations = self.template.guest.guestOperationsReady
vmtools = self.template.guestHeartbeatStatus
if not guest_operations and vmtools == 'red':
return True
else:
time.sleep(2)
return False
Problem is that self.template.guest.guestOperationsReady and guestHeartbeatStatus is not updated 'realtime'. I can see that machine is turned off (or restarting) and guestHeartbeatStatus is still green (also guestOperationsReady returns True)
Sometimes it takes 1second to return valid values, sometimes that values are bad even after 10sec
Is there any 'cache' that is responsible for this? Maybe if you take vim.VirtualMachine instance all properties are queried in a single request and cached continuously?
So far I can find only one way how to reload this properties. This way is to 'reload' full vim.VirtualMachine object and than it looks ok.
Question is if it this is a right way to do it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the shown accesses to guestOperationsReady and guestHeartbeatStatus, and inspect how pyVmomi retrieves and refreshes VirtualMachine properties. Determine whether the stale values are expected caching or require an explicit refresh, then document the supported way to obtain current values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100