Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from ccnode.utils import and_
# hypervisor related tags
def htype():
"""Hypervisor type."""
# FIXME for other support
return u'kvm'
def hv():
"""Hypervisor name."""
# What is the point of this tag ? if the information not already in a and id
# ?
def hvm():
"""Hardware virtualization enable."""
# see
# http://www.linux-kvm.org/page/FAQ#How_can_I_tell_if_I_have_Intel_VT_or_AMD-V.3F
# or
# http://www.cyberciti.biz/faq/linux-xen-vmware-kvm-intel-vt-amd-v-support/
# if we are in a xen hypervisor we won't see vt in /proc/cpuinfo
result = {True: u'yes', False: u'no'}
if htype() == u'kvm':
# findout in /proc/cpuinfo if all CPUs have virtualisation enabled
return result[and_(
set(
'vmx', # Intel VT
'svm', # AMD
) & set(
l.split(': ')[-1].split()
) for l in open('/proc/cpuinfo').readline() if l.startswith('Tags')
)]
return None
def hvver():
"""Hypervisor version."""
def libvirtver():
"""Version of running libvirt."""
# jobs
def rjobs():
"""Number of currently running jobs."""
# storage pools
def sto():
"""Storage pool names."""
# dynamic sto
# Vm related tags
def nvm():
"""Number of VMS in the current hypervisor."""
def vmpaused():
"""Count of VMs paused."""
def vmstarted():
"""Count of VMs started."""
def vmstopped():
"""Count of VMs Stopped."""