Workflows¶
Common inputs¶
incus-apply accepts local files, directories, standard input, and remote URLs.
# Apply all configs in the current directory
incus-apply .
# Apply specific files
incus-apply instance.yaml network.yaml
# Apply recursively from a directory
incus-apply ./configs/ -r
# Apply from stdin
cat instance.yaml | incus-apply -
# Apply from URL
incus-apply https://example.com/instance.yaml
Preview and confirm changes¶
By default, incus-apply previews the changes and asks for confirmation.
# Show diff only without applying
incus-apply . --diff
# Show machine-readable diff output
incus-apply . --diff=json
For instance resources, config.environment.* values are redacted in preview output by default. Use --show-env when you need to inspect the actual values in the preview.
If planning detects errors, the preview is still shown, but apply or delete stops before making changes.
Preview output identifies resources by effective scope:
Most resources use
type/name, for exampleinstance/web.Pool-scoped storage resources use
project:type/pool/name, for exampledefault:storage-volume/pool1/data.Global resources omit the project prefix and use
type/name.
Non-interactive runs¶
Use these options in automation or CI:
# Auto-accept changes
incus-apply . -y
# Non-interactive with quiet output
incus-apply . -yq
Remote and project targeting¶
Apply everything to a specific project:
incus-apply . --project myproject
Apply everything to a remote server by appending the remote name with a trailing colon:
incus-apply instance.yaml server-a:
For per-resource remote overrides, prefix the resource name:
kind: instance
name: server-a:ubuntu
image: images:ubuntu/24.04
Delete, replace, and reset¶
# Delete resources described in the configuration
incus-apply . -d -y
# Recreate resources when create-only fields change
incus-apply . --replace
# Delete then recreate everything from scratch
incus-apply . --reset
--reset is mutually exclusive with --delete and --diff.
Some fields are create-only, such as an instance image, storage pool driver, or network type. When one of those fields changes on a managed resource, the preview is marked recreate required and apply stops before making changes. Use --replace to delete and recreate the resource in one run.
Interactive resource selection¶
Use --select to choose a subset of resources before the diff is computed. Navigate with ↑ and ↓ or j and k, toggle items with space, toggle all with a, confirm with enter, and cancel with q.
Dependency ordering¶
Resources are created in dependency order. The default order is:
Projects
Storage pools
Networks
Network forwards
Network ACLs
Network zones
Storage volumes
Storage buckets
Storage bucket keys
Cluster groups
Profiles
Instances
For deletion, the order is reversed.