How to get data deduplication and data compression status for vSAN cluster using pyVmomi?

235 views Asked by At

I want to fetch data deduplication and data compression status of vSAN cluster for running precheck disk format version upgrade. enter image description here

1

There are 1 answers

0
Shrikant Chambhare On BEST ANSWER
def get_compression_deduplication_status(si, cluster_ref):
  vcMos = vsanapiutils.GetVsanVcMos(si._stub, context=context)
  vsanClusterSystem = vcMos['vsan-cluster-config-system']
  vsan_config_info = vsanClusterSystem.GetConfigInfoEx(cluster_ref)
  dedupEnabled = vsan_config_info.dataEfficiencyConfig.dedupEnabled
  compressionEnabled = vsan_config_info.dataEfficiencyConfig.compressionEnabled
  return {'dedupEnabled': bool(dedupEnabled), 'compressionEnabled': bool(compressionEnabled)}