# Tenant required\_experimental not permitted

**URL:** <https://forums.foundationdb.org/t/tenant-required-experimental-not-permitted/4446>\
**Category:** Running FoundationDB\
**Created:** [April 20, 2024, 12:46am UTC](https://forums.foundationdb.org/t/tenant-required-experimental-not-permitted/4446 "2024-04-20T00:46:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [April 20, 2024, 12:46am UTC](https://forums.foundationdb.org/t/tenant-required-experimental-not-permitted/4446/1 "2024-04-20T00:46:34Z")

</div>

A transition from disabled or optional to required does not seem to be permitted.

That also seems to supported from a reading of the code and the tests cases.

How are you supposed to initialize required tenant mode?

```auto
TEST_CASE("/ManagementAPI/ChangeConfig/TenantMode") {
	DatabaseConfiguration oldConfig;
	DatabaseConfiguration newConfig;
	std::vector<TenantMode> tenantModes = { TenantMode::DISABLED, TenantMode::OPTIONAL_TENANT, TenantMode::REQUIRED };
	// required tenant mode can change to any other tenant mode
	oldConfig.tenantMode = TenantMode::REQUIRED;
	newConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes);
	ASSERT(isTenantModeModeConfigValid(oldConfig, newConfig));
	// optional/disabled tenant mode can switch to optional/disabled tenant mode
	oldConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT;
	newConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT;
	ASSERT(isTenantModeModeConfigValid(oldConfig, newConfig));
	// optional/disabled tenant mode CANNOT switch to required tenant mode
	oldConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT;
	newConfig.tenantMode = TenantMode::REQUIRED;
	ASSERT(!isTenantModeModeConfigValid(oldConfig, newConfig));

	return Void();
}

```
