forked from equelin/vsanmetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvsanmetrics.py
787 lines (553 loc) · 23.5 KB
/
vsanmetrics.py
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
#!/usr/bin/env python
# Erwan Quelin - erwan.quelin@gmail.com
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import VmomiSupport, SoapStubAdapter, vim, vmodl
import threading
import argparse
import atexit
import getpass
from datetime import datetime, timedelta
import time
import ssl
import pickle
import os
import vsanapiutils
import vsanmgmtObjects
def get_args():
parser = argparse.ArgumentParser(
description='Export vSAN cluster performance and storage usage statistics to InfluxDB line protocol')
parser.add_argument('-s', '--vcenter',
required=True,
action='store',
help='Remote vcenter to connect to')
parser.add_argument('-o', '--port',
type=int,
default=443,
action='store',
help='Port to connect on')
parser.add_argument('-u', '--user',
required=True,
action='store',
help='User name to use when connecting to vcenter')
parser.add_argument('-p', '--password',
required=False,
action='store',
help='Password to use when connecting to vcenter')
parser.add_argument('-c', '--cluster_name',
dest='clusterName',
required=True,
help='Cluster Name')
parser.add_argument("--performance",
help="Output performance metrics",
action="store_true")
parser.add_argument("--capacity",
help="Output storage usage metrics",
action="store_true")
parser.add_argument("--health",
help="Output cluster health status",
action="store_true")
parser.add_argument('--skipentitytypes',
required=False,
action='store',
help='List of entity types to skip. Separated by a comma')
parser.add_argument('--cachefolder',
default='.',
required=False,
action='store',
help='Folder where the cache files are stored')
parser.add_argument('--cacheTTL',
type=int,
default=60,
required=False,
action='store',
help='TTL of the object inventory cache')
args = parser.parse_args()
if not args.password:
args.password = getpass.getpass(
prompt='Enter password for host %s and user %s: ' %
(args.vcenter, args.user))
if not args.performance and args.skipentitytypes:
print("You can't skip a performance entity type if you don't provide the --performance tag")
exit()
if not args.performance and not args.capacity and not args.health:
print('Please provide tag(s) --performance and/or --capacity and/or --health to specify what type of data you want to collect')
exit()
return args
def connectvCenter(args):
# Don't check for valid certificate
context = ssl._create_unverified_context()
# Connect to vCenter
try:
si = SmartConnect(host=args.vcenter,
user=args.user,
pwd=args.password,
port=int(args.port),
sslContext=context)
if not si:
raise Exception("Could not connect to the specified host using specified username and password")
except vmodl.MethodFault as e:
raise Exception("Caught vmodl fault : " + e.msg)
except Exception as e:
raise Exception("Caught exception : " + str(e))
# Get content informations
content = si.RetrieveContent()
# Get Info about cluster
cluster_obj = getClusterInstance(args.clusterName, content)
# Exit if the cluster provided in the arguments is not available
if not cluster_obj:
raise Exception('Inventory exception: Did not find the required cluster')
# Disconnect to vcenter at the end
atexit.register(Disconnect, si)
apiVersion = vsanapiutils.GetLatestVmodlVersion(args.vcenter)
vcMos = vsanapiutils.GetVsanVcMos(si._stub, context=context, version=apiVersion)
vsanClusterConfigSystem = vcMos['vsan-cluster-config-system']
try:
clusterConfig = vsanClusterConfigSystem.VsanClusterGetConfig(
cluster=cluster_obj
)
except vmodl.fault.InvalidState as e:
raise Exception("InvalidState exception: " + e.msg())
except vmodl.fault.RuntimeFault as e:
raise Exception("RuntimeFault exception: " + e.msg())
if not clusterConfig.enabled:
raise Exception("Configuration exeption: vSAN is not enabled on cluster " + args.clusterName)
return si, content, cluster_obj, vcMos
# Get cluster informations
def getClusterInstance(clusterName, content):
container = content.rootFolder
viewType = [vim.ClusterComputeResource]
recursive = True
containerView = content.viewManager.CreateContainerView(container, viewType, recursive)
clusters = containerView.view
nbClusterWithSameName = 0
for cluster in clusters:
if cluster.name == clusterName:
nbClusterWithSameName += 1
cluster_obj = cluster
if nbClusterWithSameName == 1:
return cluster_obj
if nbClusterWithSameName > 1:
raise Exception("There is more than one cluster with the name " + clusterName)
return None
def getInformations(witnessHosts, cluster, si):
uuid = {}
hostnames = {}
disks = {}
# Get Host and disks informations
for host in cluster.host:
# Get relationship between host id and hostname
hostnames[host.summary.host] = host.summary.config.name
# Get all disk (cache and capcity) attached to hosts in the cluster
diskAll = host.configManager.vsanSystem.QueryDisksForVsan()
for disk in diskAll:
if disk.state == 'inUse':
uuid[disk.vsanUuid] = disk.disk.canonicalName
disks[disk.vsanUuid] = host.summary.config.name
for vsanHostConfig in cluster.configurationEx.vsanHostConfig:
uuid[vsanHostConfig.clusterInfo.nodeUuid] = hostnames[vsanHostConfig.hostSystem]
# Get witness disks informations
for witnessHost in witnessHosts:
host = (vim.HostSystem(witnessHost.host._moId, si._stub))
uuid[witnessHost.nodeUuid] = host.name
diskWitness = host.configManager.vsanSystem.QueryDisksForVsan()
for disk in diskWitness:
if disk.state == 'inUse':
uuid[disk.vsanUuid] = disk.disk.canonicalName
disks[disk.vsanUuid] = host.name
return uuid, disks
# Get all VM managed by the hosts in the cluster, return array with name and uuid of the VMs
# Source: https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/getvmsbycluster.py
def getVMs(cluster):
vms = {}
for host in cluster.host: # Iterate through Hosts in the Cluster
for vm in host.vm: # Iterate through each VM on the host
vmname = vm.summary.config.name
# Check for white space in VM's name, and replace with escape characters
vmname = "\ ".join(vmname.split())
vms[vm.summary.config.instanceUuid] = vmname
return vms
# Output data in the Influx Line protocol format
def printInfluxLineProtocol(measurement, tags, fields, timestamp):
result = "%s,%s %s %i" % (measurement, arrayToString(tags), arrayToString(fields), timestamp)
print(result)
# Output data in the Influx Line protocol format
def formatInfluxLineProtocol(measurement, tags, fields, timestamp):
result = "%s,%s %s %i \n" % (measurement, arrayToString(tags), arrayToString(fields), timestamp)
return result
# Convert time in string format to epoch timestamp (nanosecond)
def convertStrToTimestamp(str):
sec = time.mktime(datetime.strptime(str, "%Y-%m-%d %H:%M:%S").timetuple())
ns = int(sec * 1000000000)
return ns
# parse EntytyRefID, convert to tags
def parseEntityRefId(measurement, entityRefId, uuid, vms, disks):
tags = {}
if measurement == 'vscsi':
entityRefId = entityRefId.split("|")
split = entityRefId[0].split(":")
tags['uuid'] = split[1]
tags['vscsi'] = entityRefId[1]
tags['vmname'] = vms[split[1]]
else:
entityRefId = entityRefId.split(":")
if measurement == 'cluster-domclient':
tags['uuid'] = entityRefId[1]
if measurement == 'cluster-domcompmgr':
tags['uuid'] = entityRefId[1]
if measurement == 'host-domclient':
tags['uuid'] = entityRefId[1]
tags['hostname'] = uuid[entityRefId[1]]
if measurement == 'host-domcompmgr':
tags['uuid'] = entityRefId[1]
tags['hostname'] = uuid[entityRefId[1]]
if measurement == 'cache-disk':
tags['uuid'] = entityRefId[1]
tags['naa'] = uuid[entityRefId[1]]
tags['hostname'] = disks[entityRefId[1]]
if measurement == 'capacity-disk':
tags['uuid'] = entityRefId[1]
tags['naa'] = uuid[entityRefId[1]]
tags['hostname'] = disks[entityRefId[1]]
if measurement == 'disk-group':
tags['uuid'] = entityRefId[1]
tags['hostname'] = disks[entityRefId[1]]
if measurement == 'virtual-machine':
tags['uuid'] = entityRefId[1]
tags['vmname'] = vms[entityRefId[1]]
if measurement == 'virtual-disk':
split = entityRefId[1].split("/")
tags['uuid'] = split[0]
tags['disk'] = split[1]
if measurement == 'vsan-vnic-net':
split = entityRefId[1].split("|")
tags['uuid'] = split[0]
tags['hostname'] = uuid[split[0]]
tags['stack'] = split[1]
tags['vmk'] = split[2]
if measurement == 'vsan-host-net':
tags['uuid'] = entityRefId[1]
tags['hostname'] = uuid[entityRefId[1]]
if measurement == 'vsan-pnic-net':
split = entityRefId[1].split("|")
tags['uuid'] = split[0]
tags['hostname'] = uuid[split[0]]
tags['vmnic'] = split[1]
if measurement == 'vsan-iscsi-host':
tags['uuid'] = entityRefId[1]
tags['hostname'] = uuid[entityRefId[1]]
if measurement == 'vsan-iscsi-target':
tags['target'] = entityRefId[1]
if measurement == 'vsan-iscsi-lun':
split = entityRefId[1].split("|")
tags['target'] = split[0]
tags['lunid'] = split[1]
return tags
# Convert array to a string compatible with influxdb line protocol tags or fields
def arrayToString(data):
i = 0
result = ""
for key, val in data.items():
if i == 0:
result = "%s=%s" % (key, val)
else:
result = result + ",%s=%s" % (key, val)
i = i + 1
return result
def parseVsanObjectSpaceSummary(data):
fields = {}
fields['overheadB'] = data.overheadB
fields['overReservedB'] = data.overReservedB
fields['physicalUsedB'] = data.physicalUsedB
fields['primaryCapacityB'] = data.primaryCapacityB
fields['reservedCapacityB'] = data.reservedCapacityB
fields['temporaryOverheadB'] = data.temporaryOverheadB
fields['usedB'] = data.usedB
if data.provisionCapacityB:
fields['provisionCapacityB'] = data.provisionCapacityB
return fields
def parseVimVsanDataEfficiencyCapacityState(data):
fields = {}
fields['dedupMetadataSize'] = data.dedupMetadataSize
fields['logicalCapacity'] = data.logicalCapacity
fields['logicalCapacityUsed'] = data.logicalCapacityUsed
fields['physicalCapacity'] = data.physicalCapacity
fields['physicalCapacityUsed'] = data.physicalCapacityUsed
fields['ratio'] = float(data.logicalCapacityUsed) / float(data.physicalCapacityUsed)
return fields
def parseCapacity(scope, data, tagsbase, timestamp):
tags = {}
fields = {}
tags['scope'] = scope
tags.update(tagsbase)
measurement = 'capacity_' + scope
if scope == 'global':
fields['freeCapacityB'] = data.freeCapacityB
fields['totalCapacityB'] = data.totalCapacityB
elif scope == 'summary':
fields = parseVsanObjectSpaceSummary(data.spaceOverview)
elif scope == 'efficientcapacity':
fields = parseVimVsanDataEfficiencyCapacityState(data.efficientCapacity)
else:
fields = parseVsanObjectSpaceSummary(data)
printInfluxLineProtocol(measurement, tags, fields, timestamp)
def parseHealth(test, value, tagsbase, timestamp):
measurement = 'health_' + test
tags = tagsbase
fields = {}
if value == 'green':
fields['health'] = 0
if value == 'yellow':
fields['health'] = 1
if value == 'red':
fields['health'] = 2
fields['value'] = '\"' + value + '\"'
printInfluxLineProtocol(measurement, tags, fields, timestamp)
def getCapacity(args, tagsbase, cluster_obj, vcMos, uuid, disks, vms):
vsanSpaceReportSystem = vcMos['vsan-cluster-space-report-system']
try:
spaceReport = vsanSpaceReportSystem.VsanQuerySpaceUsage(
cluster=cluster_obj
)
except vmodl.fault.InvalidArgument as e:
print("Caught InvalidArgument exception : " + str(e))
return
except vmodl.fault.NotSupported as e:
print("Caught NotSupported exception : " + str(e))
return
except vmodl.fault.RuntimeFault as e:
print("Caught RuntimeFault exception : " + str(e))
return
timestamp = int(time.time() * 1000000000)
parseCapacity('global', spaceReport, tagsbase, timestamp)
parseCapacity('summary', spaceReport, tagsbase, timestamp)
if spaceReport.efficientCapacity:
parseCapacity('efficientcapacity', spaceReport, tagsbase, timestamp)
for object in spaceReport.spaceDetail.spaceUsageByObjectType:
parseCapacity(object.objType, object, tagsbase, timestamp)
# Get informations about VsanClusterBalancePerDiskInfo
vsanClusterHealthSystem = vcMos['vsan-cluster-health-system']
try:
clusterHealth = vsanClusterHealthSystem.VsanQueryVcClusterHealthSummary(
cluster=cluster_obj
)
except vmodl.fault.NotFound as e:
print("Caught NotFound exception : " + str(e))
return
except vmodl.fault.RuntimeFault as e:
print("Caught RuntimeFault exception : " + str(e))
return
for disk in clusterHealth.diskBalance.disks:
measurement = 'capacity_diskBalance'
tags = tagsbase
tags['uuid'] = disk.uuid
tags['hostname'] = disks[disk.uuid]
fields = {}
fields['varianceThreshold'] = clusterHealth.diskBalance.varianceThreshold
fields['fullness'] = disk.fullness
fields['variance'] = disk.variance
fields['fullnessAboveThreshold'] = disk.fullnessAboveThreshold
fields['dataToMoveB'] = disk.dataToMoveB
printInfluxLineProtocol(measurement, tags, fields, timestamp)
def getHealth(args, tagsbase, cluster_obj, vcMos,):
vsanClusterHealthSystem = vcMos['vsan-cluster-health-system']
try:
clusterHealth = vsanClusterHealthSystem.VsanQueryVcClusterHealthSummary(
cluster=cluster_obj
)
except vmodl.fault.NotFound as e:
print("Caught NotFound exception : " + str(e))
return
except vmodl.fault.RuntimeFault as e:
print("Caught RuntimeFault exception : " + str(e))
return
timestamp = int(time.time() * 1000000000)
for group in clusterHealth.groups:
splitGroupId = group.groupId.split('.')
testName = splitGroupId[-1]
parseHealth(testName, group.groupHealth, tagsbase, timestamp)
def isFilesExist(listFile):
result = True
for file in listFile:
if not os.path.isfile(file):
result = False
return result
def isTTLOver(listFile, TTL):
result = True
for file in listFile:
if os.path.isfile(file):
filemodificationtime = datetime.fromtimestamp(os.stat(file).st_mtime) # This is a datetime.datetime object!
now = datetime.today()
max_delay = timedelta(minutes=TTL)
if now - filemodificationtime < max_delay:
result = False
return result
def isHostsConnected(cluster, witnessHosts, si):
result = True
for host in cluster.host:
if not host.summary.runtime.connectionState == 'connected':
result = False
for witnesshost in witnessHosts:
host = (vim.HostSystem(witnesshost.host._moId, si._stub))
if not host.summary.runtime.connectionState == 'connected':
result = False
return result
def pickelDumpObject(object, filename):
fileObject = open(filename, 'wb')
pickle.dump(object, fileObject)
fileObject.close()
def pickelLoadObject(filename):
if os.path.isfile(filename):
fileObject = open(filename, 'rb')
object = pickle.load(fileObject)
return object
else:
print("Can't open cache file : " + filename)
return -1
# Gather informations about uuid, disks and hostnames
# Store them in cache files if needed
def manageData(args, si, cluster_obj, vcMos):
vsanVcStretchedClusterSystem = vcMos['vsan-stretched-cluster-system']
# Witness
# Retrieve Witness Host for given VSAN Cluster
witnessHosts = vsanVcStretchedClusterSystem.VSANVcGetWitnessHosts(
cluster=cluster_obj
)
# Build cache's file names
uuidfilename = os.path.join(args.cachefolder, 'vsanmetrics_uuid-' + args.clusterName + '.cache')
disksfilename = os.path.join(args.cachefolder, 'vsanmetrics_disks-' + args.clusterName + '.cache')
vmsfilename = os.path.join(args.cachefolder, 'vsanmetrics_vms-' + args.clusterName + '.cache')
listFile = (uuidfilename, disksfilename, vmsfilename)
# By default, don't rebuild cache
rebuildcache = False
# Test if all needed cache files exists, if all hosts are connected and if TTL of the cache is not over
resultFilesExist = isFilesExist(listFile)
resultHostConnected = isHostsConnected(cluster_obj, witnessHosts, si)
resultTTLOver = isTTLOver(listFile, args.cacheTTL)
# Make decision if rebuilding cache is needed
if not resultFilesExist and not resultHostConnected:
print("One or more host disconnected. Can't continue")
return
else:
if not resultFilesExist and resultHostConnected:
rebuildcache = True
elif resultFilesExist and resultHostConnected and not resultTTLOver:
rebuildcache = False
elif resultFilesExist and resultHostConnected and resultTTLOver:
rebuildcache = True
if rebuildcache:
# Rebuild cache
# Get uuid/names relationship informations for hosts and disks
uuid, disks = getInformations(witnessHosts, cluster_obj, si)
# Get VM uuid/names
vms = getVMs(cluster_obj)
pickelDumpObject(uuid, uuidfilename)
pickelDumpObject(disks, disksfilename)
pickelDumpObject(vms, vmsfilename)
else:
# Load data from cache
uuid = pickelLoadObject(uuidfilename)
disks = pickelLoadObject(disksfilename)
vms = pickelLoadObject(vmsfilename)
return uuid, disks, vms
def getPerformance(args, tagsbase, si, cluster_obj, vcMos, uuid, disks, vms):
vsanPerfSystem = vcMos['vsan-performance-manager']
# Gather a list of the available entity types (ex: vsan-host-net)
entityTypes = vsanPerfSystem.VsanPerfGetSupportedEntityTypes()
# query interval, last 10 minutes -- UTC !!!
endTime = datetime.utcnow()
startTime = endTime + timedelta(minutes=-10)
splitSkipentitytypes = []
if args.skipentitytypes:
splitSkipentitytypes = args.skipentitytypes.split(',')
result = ""
for entities in entityTypes:
if entities.name not in splitSkipentitytypes:
entitieName = entities.name
labels = []
# Gather all labels related to the entity (ex: iopsread, iopswrite...)
for entity in entities.graphs:
for metric in entity.metrics:
labels.append(metric.label)
# Build entity
entity = '%s:*' % (entities.name)
# Build spec object
spec = vim.cluster.VsanPerfQuerySpec(
endTime=endTime,
entityRefId=entity,
labels=labels,
startTime=startTime
)
# Get statistics
try:
metrics = vsanPerfSystem.VsanPerfQueryPerf(
querySpecs=[spec],
cluster=cluster_obj
)
except vmodl.fault.InvalidArgument as e:
print("Caught InvalidArgument exception : " + str(e))
return
except vmodl.fault.NotFound as e:
print("Caught NotFound exception : " + str(e))
return
except vmodl.fault.NotSupported as e:
print("Caught NotSupported exception : " + str(e))
return
except vmodl.fault.RuntimeFault as e:
print("Caught RuntimeFault exception : " + str(e))
return
except vmodl.fault.Timedout as e:
print("Caught Timedout exception : " + str(e))
return
except vmodl.fault.VsanNodeNotMaster as e:
print("Caught VsanNodeNotMaster exception : " + str(e))
return
for metric in metrics:
if not metric.sampleInfo == "":
measurement = entitieName
sampleInfos = metric.sampleInfo.split(",")
lenValues = len(sampleInfos)
timestamp = convertStrToTimestamp(sampleInfos[lenValues - 1])
tags = parseEntityRefId(measurement, metric.entityRefId, uuid, vms, disks)
tags.update(tagsbase)
fields = {}
for value in metric.value:
listValue = value.values.split(",")
fields[value.metricId.label] = float(listValue[lenValues - 1])
result = result + formatInfluxLineProtocol(measurement, tags, fields, timestamp)
print(result)
# Main...
def main():
# Parse CLI arguments
args = get_args()
# Initiate tags with vcenter and cluster name
tagsbase = {}
tagsbase['vcenter'] = args.vcenter
tagsbase['cluster'] = args.clusterName
try:
si, _, cluster_obj, vcMos = connectvCenter(args)
except Exception as e:
print("MAIN - Caught exception: " + str(e))
return
uuid, disks, vms = manageData(args, si, cluster_obj, vcMos)
threads = list()
# CAPACITY
if args.capacity:
x = threading.Thread(target=getCapacity, args=(args, tagsbase, cluster_obj, vcMos, uuid, disks, vms))
threads.append(x)
x.start()
# HEALTH
if args.health:
x = threading.Thread(target=getHealth, args=(args, tagsbase, cluster_obj, vcMos,))
threads.append(x)
x.start()
# PERFORMANCE
if args.performance:
x = threading.Thread(target=getPerformance, args=(args, tagsbase, si, cluster_obj, vcMos, uuid, disks, vms,))
threads.append(x)
x.start()
for _, thread in enumerate(threads):
thread.join()
return 0
# Start program
if __name__ == "__main__":
main()