プロジェクトの設定¶
プロジェクトは、キー/値の設定オプションのセットを通じて設定することができます。 これらのオプションを設定する方法については、プロジェクトの設定 を参照してください。
キー/値の設定は名前空間化されています。 次のオプションが利用可能です:
プロジェクトの機能¶
プロジェクトの機能は、プロジェクト内でどのエンティティが隔離され、どのエンティティがdefault
プロジェクトから継承されるかを定義します。
feature.*
オプションが true
に設定されている場合、対応するエンティティはプロジェクト内で隔離されます。
注釈
特定のオプションを明示的に設定せずにプロジェクトを作成すると、このオプションは以下の表で与えられた初期値に設定されます。
ただし、feature.*
オプションのいずれかを解除すると、初期値に戻るのではなく、デフォルト値に戻ります。
すべての feature.*
オプションのデフォルト値は false
です。
Key: | features.images |
Type: | bool |
Default: |
|
Initial value: |
|
This setting applies to both images and image aliases.
Key: | features.networks |
Type: | bool |
Default: |
|
Initial value: |
|
Key: | features.networks.zones |
Type: | bool |
Default: |
|
Initial value: |
|
Key: | features.profiles |
Type: | bool |
Default: |
|
Initial value: |
|
Key: | features.storage.buckets |
Type: | bool |
Default: |
|
Initial value: |
|
プロジェクトの制限¶
プロジェクトの制限は、プロジェクトに属するコンテナや VM が使用できるリソースの上限を定義します。
limits.*
オプションによっては、プロジェクト内で許可されるエンティティの数に制限が適用されることがあります(たとえば limits.containers
や limits.networks
)。また、プロジェクト内のすべてのインスタンスのリソース使用量の合計値に制限が適用されることもあります(たとえば、 limits.cpu
や limits.processes
)。
後者の場合、制限は通常、各インスタンスに設定されている リソース制限 に適用されます(直接またはプロファイル経由で設定されている場合)、実際に使用されているリソースではありません。
たとえば、プロジェクトの limits.memory
設定を 50GB
に設定した場合、プロジェクトのインスタンスで定義されたすべての limits.memory
設定キーの個別の値の合計が 50GB 未満に保たれます。
limits.memory
設定の合計が 50GB を超えるインスタンスを作成しようとすると、エラーが発生します。
同様に、プロジェクトの limits.cpu
設定キーを 100
に設定すると、個々の limits.cpu
値の合計が 100 未満に保たれます。
プロジェクトの制限を使用する場合、以下の条件を満たす必要があります:
limits.*
設定のいずれかを設定し、インスタンスに対応する設定がある場合、プロジェクト内のすべてのインスタンスに対応する設定が定義されている必要があります(直接またはプロファイル経由で設定)。 インスタンスの設定オプションについては リソース制限 を参照してください。CPUピンニング が有効になっている場合、CPUピンニング 設定は使用できません。 これは、プロジェクトで CPUピンニング を使用するためには、プロジェクト内の各インスタンスの CPUピンニング 設定を CPU の数、または CPU のセットや範囲ではなく、数値に設定する必要があることを意味します。
limits.memory
設定は、パーセンテージではなく絶対値で設定する必要があります。
Key: | limits.containers |
Type: | integer |
Key: | limits.cpu |
Type: | integer |
This value is the maximum value for the sum of the individual limits.cpu
configurations set on the instances of the project.
Key: | limits.disk |
Type: | string |
This value is the maximum value of the aggregate disk space used by all instance volumes, custom volumes, and images of the project.
Key: | limits.instances |
Type: | integer |
Key: | limits.memory |
Type: | string |
The value is the maximum value for the sum of the individual limits.memory
configurations set on the instances of the project.
Key: | limits.networks |
Type: | integer |
Key: | limits.processes |
Type: | integer |
This value is the maximum value for the sum of the individual limits.processes
configurations set on the instances of the project.
プロジェクトの制約¶
プロジェクトのインスタンスがセキュリティーに関連する機能(コンテナのネストや raw LXC 設定など)にアクセスできないようにするには、restricted
設定オプションを true
に設定します。
その後、さまざまな restricted.*
オプションを使用して、通常は restricted
によってブロックされる個々の機能を選択し、プロジェクトのインスタンスで使用できるように許可できます。
たとえば、プロジェクトを制限し、すべてのセキュリティー関連機能をブロックしつつ、コンテナのネストを許可するには、次のコマンドを入力します:
incus project set <project_name> restricted=true
incus project set <project_name> restricted.containers.nesting=allow
セキュリティーに関連する各機能には、関連する restricted.*
プロジェクト設定オプションがあります。
機能の使用を許可する場合は、その restricted.*
オプションの値を変更してください。
ほとんどの restricted.*
設定は、block
(デフォルト)または allow
に設定できる二値スイッチです。
ただし、一部のオプションは、より細かい制御のために他の値をサポートしています。
注釈
restricted.*
オプションを有効にするには、restricted
設定を true
に設定する必要があります。
restricted
が false
に設定されている場合、restricted.*
オプションを変更しても効果はありません。
すべての restricted.*
キーを allow
に設定することは、restricted
自体を false
に設定することと同等です。
Key: | restricted |
Type: | bool |
Default: |
|
This option must be enabled to allow the restricted.*
keys to take effect.
To temporarily remove the restrictions, you can disable this option instead of clearing the related keys.
Key: | restricted.backups |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.cluster.groups |
Type: | string |
If specified, this option prevents targeting cluster groups other than the provided ones.
Key: | restricted.cluster.target |
Type: | string |
Default: |
|
Possible values are allow
or block
.
When set to allow
, this option allows targeting of cluster members (either directly or via a group) when creating or moving instances.
Key: | restricted.containers.interception |
Type: | string |
Default: |
|
Possible values are allow
, block
, or full
.
When set to allow
, interception options that are usually safe are allowed.
File system mounting remains blocked.
Key: | restricted.containers.nesting |
Type: | string |
Default: |
|
Possible values are allow
or block
.
When set to allow
, security.nesting
can be set to true
for an instance.
Key: | restricted.containers.privilege |
Type: | string |
Default: |
|
Possible values are unprivileged
, isolated
, and allow
.
When set to
unpriviliged
, this option prevents settingsecurity.privileged
totrue
.When set to
isolated
, this option prevents settingsecurity.privileged
andsecurity.idmap.isolated
totrue
.When set to
allow
, there is no restriction.
Key: | restricted.devices.disk |
Type: | string |
Default: |
|
Possible values are allow
, block
, or managed
.
When set to
block
, this option prevents using all disk devices except the root one.When set to
managed
, this option allows using disk devices only ifpool=
is set.When set to
allow
, there is no restriction on which disk devices can be used.
Key: | restricted.devices.disk.paths |
Type: | string |
If restricted.devices.disk
is set to allow
, this option controls which source
can be used for disk
devices.
Specify a comma-separated list of path prefixes that restrict the source
setting.
If this option is left empty, all paths are allowed.
Key: | restricted.devices.gpu |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.infiniband |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.nic |
Type: | string |
Default: |
|
Possible values are allow
, block
, or managed
.
When set to
block
, this option prevents using all network devices.When set to
managed
, this option allows using network devices only ifnetwork=
is set.When set to
allow
, there is no restriction on which network devices can be used.
Key: | restricted.devices.pci |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.proxy |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.unix-block |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.unix-char |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.unix-hotplug |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.devices.usb |
Type: | string |
Default: |
|
Possible values are allow
or block
.
Key: | restricted.idmap.gid |
Type: | string |
This option specifies the host GID ranges that are allowed in the instance's raw.idmap
setting.
Key: | restricted.idmap.uid |
Type: | string |
This option specifies the host UID ranges that are allowed in the instance's raw.idmap
setting.
Key: | restricted.networks.access |
Type: | string |
Specify a comma-delimited list of network names that are allowed for use in this project. If this option is not set, all networks are accessible.
Note that this setting depends on the restricted.devices.nic
setting.
Key: | restricted.networks.integrations |
Type: | string |
Specify a comma-delimited list of network integrations that can be used by networks in this project.
Key: | restricted.networks.subnets |
Type: | string |
Default: |
|
Specify a comma-delimited list of network subnets from the uplink networks that are allocated for use in this project.
Use the form <uplink>:<subnet>
.
Key: | restricted.networks.uplinks |
Type: | string |
Specify a comma-delimited list of network names that can be used as uplink for networks in this project.
Key: | restricted.networks.zones |
Type: | string |
Default: |
|
Specify a comma-delimited list of network zones that can be used (or something under them) in this project.
Key: | restricted.snapshots |
Type: | string |
Default: |
|
Key: | restricted.virtual-machines.lowlevel |
Type: | string |
Default: |
|
Possible values are allow
or block
.
When set to allow
, low-level VM options like raw.qemu
, volatile.*
, etc. can be used.
プロジェクト固有の設定¶
プロジェクトに対していくつかの サーバー設定 オプションを上書きできます。 また、プロジェクトにユーザーメタデータを追加することができます。
Key: | backups.compression_algorithm |
Type: | string |
Specify which compression algorithm to use for backups in this project.
Possible values are bzip2
, gzip
, lzma
, xz
, or none
.
Key: | images.auto_update_cached |
Type: | bool |
Key: | images.auto_update_interval |
Type: | integer |
Specify the interval in hours.
To disable looking for updates to cached images, set this option to 0
.
Key: | images.compression_algorithm |
Type: | string |
Possible values are bzip2
, gzip
, lzma
, xz
, or none
.
Key: | images.default_architecture |
Type: | string |
Key: | images.remote_cache_expiry |
Type: | integer |
Specify the number of days after which the unused cached image expires.