Directory - dir
▶ Watch on YouTube (opens in a new tab)
The directory storage driver is a basic backend that stores its data in a standard file and directory structure. This driver is quick to set up and allows inspecting the files directly on the disk, which can be convenient for testing. However, LXD operations are not optimized for this driver.
dir
driver in LXD
The dir
driver in LXD is fully functional and provides the same set of features as other drivers. However, it is much slower than all the other drivers because it must unpack images and do instant copies of instances, snapshots and images.
Unless specified differently during creation (with the source
configuration option), the data is stored in the /var/snap/lxd/common/lxd/storage-pools/
(for snap installations) or /var/lib/lxd/storage-pools/
directory.
Quotas
The dir
driver supports storage quotas when running on either ext4 or XFS with project quotas enabled at the file system level.
Configuration options
The following configuration options are available for storage pools that use the dir
driver and for storage volumes in these pools.
Storage pool configuration
rsync.bwlimit
Upper limit on the socket I/O for rsync
- Key:
rsync.bwlimit
- Type: string
- Default:
0
(no limit) - Scope: global
rsync.compression
Whether to use compression while migrating storage pools
- Key:
rsync.compression
- Type: bool
- Default:
true
- Scope: global
source
Path to an existing directory
- Key:
source
- Type: string
- Scope: local
Tip: In addition to these configurations, you can also set default values for the storage volume configurations. See Configure default values for storage volumes.
Storage volume configuration
security.shared
Enable volume sharing
- Key:
security.shared
- Type: bool
- Default: same as
volume.security.shared
orfalse
- Condition: virtual-machine or custom block volume
- Scope: global
security.shifted
Enable ID shifting overlay
- Key:
security.shifted
- Type: bool
- Default: same as
volume.security.shifted
orfalse
- Condition: custom volume
- Scope: global
security.unmapped
Disable ID mapping for the volume
- Key:
security.unmapped
- Type: bool
- Default: same as
volume.security.unmappped
orfalse
- Condition: custom volume
- Scope: global
size
Size/quota of the storage volume
- Key:
size
- Type: string
- Default: same as
volume.size
- Condition: appropriate driver
- Scope: global
snapshots.expiry
When snapshots are to be deleted
- Key:
snapshots.expiry
- Type: string
- Default: same as
volume.snapshots.expiry
- Condition: custom volume
- Scope: global
snapshots.pattern
Template for the snapshot name
- Key:
snapshots.pattern
- Type: string
- Default: same as
volume.snapshots.pattern
orsnap%d
- Condition: custom volume
- Scope: global
Example:
{{ creation_date|date:'2006-01-02_15-04-05' }}
snapshots.schedule
Schedule for automatic volume snapshots
- Key:
snapshots.schedule
- Type: string
- Default: same as
snapshots.schedule
- Condition: custom volume
- Scope: global
volatile.idmap.last
JSON-serialized UID/GID map that has been applied to the volume
- Key:
volatile.idmap.last
- Type: string
- Condition: filesystem
volatile.idmap.next
JSON-serialized UID/GID map that has been applied to the volume
- Key:
volatile.idmap.next
- Type: string
- Condition: filesystem
volatile.uuid
The volume’s UUID
- Key:
volatile.uuid
- Type: string
- Default: random UUID
- Scope: global
Storage bucket configuration
To enable storage buckets for local storage pool drivers and allow applications to access the buckets via the S3 protocol, you must configure the core.storage_buckets_address
server setting.
Storage buckets do not have any configuration for dir
pools. Unlike the other storage pool drivers, the dir
driver does not support bucket quotas via the size
setting.