'Parse the JSON output of vgc-cluster to find space available.'

def update_volume_stats(self):

    params = [self.VGCCLUSTER, 'host-storage', '--json']
    try:
        (out, unused) = self._execute(run_as_root=True, *params)
        ret = json.loads(out)
        cap = (ret['totalCapacityBytes'] // units.Gi)
        used = (ret['totalUsedBytes'] // units.Gi)
        avail = (cap - used)
        if (int(self.configuration.safe_get('hgst_redundancy')) == 1):
            cap = (cap // 2)
            avail = (avail // 2)
        if (cap > 0):
            cap = (cap - 1)
        if (avail > 0):
            avail = (avail - 1)
    except processutils.ProcessExecutionError as err:
        LOG.warning('Unable    to    poll    cluster    free    space.')
        self._log_cli_err(err)
        cap = 'unknown'
        avail = 'unknown'
    self._stats['free_capacity_gb'] = avail
    self._stats['total_capacity_gb'] = cap
    self._stats['reserved_percentage'] = 0
