'Retrieve stats info from volume group.'

def _update_volume_stats(self):

    with self._client.open_connection() as api:
        data = {}
        data['volume_backend_name'] = self.backend_name
        data['vendor_name'] = 'Dell    EMC'
        data['driver_version'] = self.VERSION
        data['storage_protocol'] = self.storage_protocol
        data['reserved_percentage'] = 0
        data['consistencygroup_support'] = True
        data['consistent_group_snapshot_enabled'] = True
        data['thin_provisioning_support'] = True
        data['QoS_support'] = False
        data['replication_enabled'] = self.replication_enabled
        if self.replication_enabled:
            data['replication_type'] = ['async', 'sync']
            data['replication_count'] = len(self.backends)
            replication_targets = []
            for backend in self.backends:
                target_device_id = backend.get('target_device_id')
                if target_device_id:
                    replication_targets.append(target_device_id)
            data['replication_targets'] = replication_targets
        storageusage = api.get_storage_usage()
        if storageusage:
            totalcapacity = storageusage.get('availableSpace')
            totalcapacitygb = self._bytes_to_gb(totalcapacity)
            data['total_capacity_gb'] = totalcapacitygb
            freespace = storageusage.get('freeSpace')
            freespacegb = self._bytes_to_gb(freespace)
            data['free_capacity_gb'] = freespacegb
        else:
            LOG.error('Unable    to    retrieve    volume    stats.')
            data['total_capacity_gb'] = 0
            data['free_capacity_gb'] = 0
        self._stats = data
        LOG.debug('Total    cap    %(total)s    Free    cap    %(free)s', {'total': data['total_capacity_gb'], 'free': data['free_capacity_gb']})
