def create_consistencygroup(self, context, group):
    'Creates the consistency group.'
    context = context.elevated()
    status = fields.ConsistencyGroupStatus.AVAILABLE
    model_update = None
    self._notify_about_consistencygroup_usage(context, group, 'create.start')
    try:
        utils.require_driver_initialized(self.driver)
        LOG.info(_LI('Consistency group %s: creating'), group.name)
        model_update = self.driver.create_consistencygroup(context, group)
        if model_update:
            if (model_update['status'] == fields.ConsistencyGroupStatus.ERROR):
                msg = _('Create consistency group failed.')
                LOG.error(msg, resource={'type': 'consistency_group', 'id': group.id})
                raise exception.VolumeDriverException(message=msg)
            else:
                group.update(model_update)
                group.save()
    except Exception:
        with excutils.save_and_reraise_exception():
            group.status = fields.ConsistencyGroupStatus.ERROR
            group.save()
            LOG.error(_LE('Consistency group %s: create failed'), group.name)
    group.status = status
    group.created_at = timeutils.utcnow()
    group.save()
    LOG.info(_LI('Consistency group %s: created successfully'), group.name)
    self._notify_about_consistencygroup_usage(context, group, 'create.end')
    LOG.info(_LI('Create consistency group completed successfully.'), resource={'type': 'consistency_group', 'id': group.id})
    return group
Creates the consistency group.
def create_consistencygroup(self, context, group):
    
    context = context.elevated()
    status = fields.ConsistencyGroupStatus.AVAILABLE
    model_update = None
    self._notify_about_consistencygroup_usage(context, group, 'create.start')
    try:
        utils.require_driver_initialized(self.driver)
        LOG.info(_LI('Consistency group %s: creating'), group.name)
        model_update = self.driver.create_consistencygroup(context, group)
        if model_update:
            if (model_update['status'] == fields.ConsistencyGroupStatus.ERROR):
                msg = _('Create consistency group failed.')
                LOG.error(msg, resource={'type': 'consistency_group', 'id': group.id})
                raise exception.VolumeDriverException(message=msg)
            else:
                group.update(model_update)
                group.save()
    except Exception:
        with excutils.save_and_reraise_exception():
            group.status = fields.ConsistencyGroupStatus.ERROR
            group.save()
            LOG.error(_LE('Consistency group %s: create failed'), group.name)
    group.status = status
    group.created_at = timeutils.utcnow()
    group.save()
    LOG.info(_LI('Consistency group %s: created successfully'), group.name)
    self._notify_about_consistencygroup_usage(context, group, 'create.end')
    LOG.info(_LI('Create consistency group completed successfully.'), resource={'type': 'consistency_group', 'id': group.id})
    return group