dom0: implement QubesVm.get_start_time() (#231)
Needed to check if VM was just started again
This commit is contained in:
parent
dccc528144
commit
ee87fff0d7
@ -499,6 +499,20 @@ class QubesVm(object):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_start_time(self):
|
||||||
|
if not self.is_running():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
try:
|
||||||
|
start_time = xend_session.session.xenapi.VM_metrics.get_record (self.session_metrics)['start_time']
|
||||||
|
except XenAPI.Failure:
|
||||||
|
self.refresh_xend_session()
|
||||||
|
if self.session_uuid is None:
|
||||||
|
return "NA"
|
||||||
|
start_time = xend_session.session.xenapi.VM_metrics.get_record (self.session_metrics)['start_time']
|
||||||
|
|
||||||
|
return start_time
|
||||||
|
|
||||||
def is_outdated(self):
|
def is_outdated(self):
|
||||||
# Makes sense only on VM based on template
|
# Makes sense only on VM based on template
|
||||||
if self.template_vm is None:
|
if self.template_vm is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user