Change in vdsm[master]: status: adding elapsed time in millis

nsoffer at redhat.com nsoffer at redhat.com
Fri May 22 13:32:59 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: status: adding elapsed time in millis
......................................................................


Patch Set 5:

(1 comment)

https://gerrit.ovirt.org/#/c/40904/5/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 407: 
Line 408:     def _get_elapsed_time_in_millis(self):
Line 409:         return str(
Line 410:             int(round(time.time() * 1000)) -
Line 411:             int(round(self._startTime * 1000))
> It is not about making the life easier it is about solving the problem in c
_startTime does not solve this issue, as different host may have different idea about the current time, so messages from a host after migration may look older than messages from the previous host.

What we would like to use is vm uptime, but libvirt does not provide this in a way
that works across migration.

Here are some ways to solve this:

- vm generation, persisted using virDomainSetMetadata() - for each state change, increase the generation number and store it using virDomainSetMetadata(). We read the value when starting/recovering a vm, and update it when sending a vm state change notification. This can also replace the hash used today to detect changes.

- vm migration counter, persisted using virDomainSetMetadata() - each time migration is started or completed, we increase the counter and store it using virDomainSetMetadata(). A message id
will use this format: "migration-generation.monotonic-time". This will ensure that messages from
current host are always sorted after messages from the previous hosts, and monotonic time ensures
that messages from same host are always ordered.

This will require more work than the solution you suggest here, but if you are looking for the correct way, we will have to do more work.
Line 412:         )
Line 413: 
Line 414:     lastStatus = property(_get_lastStatus, _set_lastStatus)
Line 415: 


-- 
To view, visit https://gerrit.ovirt.org/40904
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I38727e0eac7cb29c1dc7c9696568540b6545461c
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list