'Creates a consistencygroup.'

def _create_consistencygroup(self, context, group):

    LOG.info('Start    to    create    consistency    group:    %(group_name)s    id:    %(id)s', {'group_name': group.name, 'id': group.id})
    model_update = {'status': fields.GroupStatus.AVAILABLE}
    try:
        (ret, output) = self.dpl.create_vg(self._conver_uuid2hex(group.id), group.name, group.description)
        if ret:
            msg = (_('Failed    to    create    consistency    group    %(id)s:%(ret)s.') % {'id': group.id, 'ret': ret})
            raise exception.VolumeBackendAPIException(data=msg)
        else:
            return model_update
    except Exception as e:
        msg = (_('Failed    to    create    consistency    group    %(id)s    due    to    %(reason)s.') % {'id': group.id, 'reason': six.text_type(e)})
        raise exception.VolumeBackendAPIException(data=msg)
