Skip to content

docs(concepts): add Instance Manager section - #1381

Open
Felipalds wants to merge 3 commits into
longhorn:masterfrom
Felipalds:docs/concepts-instance-manager
Open

docs(concepts): add Instance Manager section#1381
Felipalds wants to merge 3 commits into
longhorn:masterfrom
Felipalds:docs/concepts-instance-manager

Conversation

@Felipalds

@Felipalds Felipalds commented Jun 17, 2026

Copy link
Copy Markdown

The Instance Manager is currently only mentioned briefly in terminology.md and contributing.md, so readers of concepts.md are not introduced to the per-node pod that actually hosts engine and replica processes. This adds a new 1.2. The Instance Manager section to concepts.md covering:

  • What the Instance Manager is and how it relates to the Longhorn Manager and Engine
  • How engine and replica instances are placed (one engine per attached volume, one replica per node selected for that volume's replicas)
  • The hosting model for V1 (Linux processes, iSCSI frontend) vs V2 (SPDK target, NVMe-TCP/UBLK frontend) -> this may be removed if wanted.
  • Failure domain implications and where to look when debugging engine/replica behavior

Applied to the supported 1.11.x, 1.12.x, and 1.13.0 docs. Renumbered the existing 1.2 to 1.5 subsections to 1.3 to 1.6 (headings + TOC).

Any feedback on this PR is welcome, please suggest additions, removals, or rewordings if anything is inaccurate or missing.

image

Issue related: longhorn/longhorn#13197

@Felipalds
Felipalds requested a review from a team as a code owner June 17, 2026 20:36
@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for longhornio ready!

Name Link
🔨 Latest commit 79b1efa
🔍 Latest deploy log https://app.netlify.com/projects/longhornio/deploys/6a4c1f1b235d7800078dac32
😎 Deploy Preview https://deploy-preview-1381--longhornio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Felipalds
Felipalds force-pushed the docs/concepts-instance-manager branch from 7ece590 to b6263b3 Compare June 17, 2026 20:39
Signed-off-by: Luiz Felipe Rosa <luizrosa8@proton.me>
@Felipalds
Felipalds force-pushed the docs/concepts-instance-manager branch from b6263b3 to 5e16d3c Compare June 17, 2026 20:40
sushant-suse
sushant-suse previously approved these changes Jun 18, 2026
Comment thread content/docs/1.11.0/concepts.md Outdated
Comment thread content/docs/1.11.0/concepts.md Outdated
Comment thread content/docs/1.11.1/concepts.md Outdated
Comment thread content/docs/1.11.1/concepts.md Outdated
Comment thread content/docs/1.11.2/concepts.md Outdated
Comment thread content/docs/1.12.0/concepts.md Outdated
Comment thread content/docs/1.12.1/concepts.md Outdated
Comment thread content/docs/1.12.1/concepts.md Outdated
Comment thread content/docs/1.13.0/concepts.md Outdated
Comment thread content/docs/1.13.0/concepts.md Outdated
Co-authored-by: Sushant Gaurav <sushant.gaurav@suse.com>
Signed-off-by: Luiz Rosa <luiz.rosa@suse.com>
@Felipalds
Felipalds force-pushed the docs/concepts-instance-manager branch from bf26589 to cef710b Compare June 19, 2026 00:34
@Felipalds

Copy link
Copy Markdown
Author

Thanks for the review @sushant-suse !

sushant-suse
sushant-suse previously approved these changes Jun 19, 2026

@shuo-wu shuo-wu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some supplementary comments for the instance manager section. Feel free to reorganize the words.

Comment thread content/docs/1.11.1/concepts.md Outdated
Comment thread content/docs/1.11.1/concepts.md Outdated
Comment thread content/docs/1.11.1/concepts.md Outdated
- **V1 Data Engine.** The Instance Manager runs each engine and each replica as a Linux process inside the pod. The engine process is also what exposes the volume's block device to the host, using iSCSI as the frontend. A single V1 Instance Manager pod can host engine and replica processes for many volumes.
- **V2 Data Engine.** The Instance Manager runs an SPDK target process (`spdk_tgt`) inside the pod. Engines are exposed as SPDK RAID block devices and replicas as SPDK logical volume bdevs within that target. The frontend presenting the block device to the host (NVMe-TCP or UBLK) is also driven from this Instance Manager. Because `spdk_tgt` uses busy-polling, the V2 Instance Manager consumes at least one dedicated CPU core per node.

If both data engines are enabled on a cluster, each node runs two Instance Manager pods — one for V1 and one for V2 — each with its own CPU reservation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for one version. I think you can talk a little bit more about the upgrade case in this paragraph.

Comment thread content/docs/1.11.1/concepts.md Outdated

If both data engines are enabled on a cluster, each node runs two Instance Manager pods — one for V1 and one for V2 — each with its own CPU reservation.

Because the engine and replica instances live inside the Instance Manager pod, the Instance Manager defines the failure domain for everything it hosts. If an Instance Manager pod is restarted or evicted, every engine and replica instance it was hosting goes with it, and the Longhorn Manager must reattach the affected volumes and rebuild replicas as needed. For this reason, Longhorn reserves CPU for the Instance Manager pod (see [Guaranteed Instance Manager CPU](../best-practices/#guaranteed-instance-manager-cpu)) and avoids restarting it while it is still hosting active instances.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since an instance manager pod missing means all replicas on this node are unavailable, Longhorn will avoid the volume data loss by relying on PDB to protect the instance manager pods from accidental eviction or drain, see https://longhorn.io/docs/1.12.0/references/settings/#node-drain-policy

@derekbit

derekbit commented Jul 4, 2026

Copy link
Copy Markdown
Member

@Felipalds Could you address the comments from @shuo-wu? Thanks.

Signed-off-by: Luiz Rosa <luiz.rosa@suse.com>
@Felipalds
Felipalds force-pushed the docs/concepts-instance-manager branch from 961cc0b to 79b1efa Compare July 6, 2026 21:33
@Felipalds
Felipalds requested review from shuo-wu and sushant-suse July 6, 2026 21:33
@Felipalds

Copy link
Copy Markdown
Author

Thanks @shuo-wu. I addressed all comments. Would like to see if they are ok, specially on the upgrade part. Thanks.

@Felipalds

Copy link
Copy Markdown
Author

@shuo-wu @derekbit wdyt about the proposed changes? thanks a lot.

@shuo-wu shuo-wu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM


If both data engines are enabled on a cluster, each node runs two Instance Manager pods (one per data engine version), each with its own CPU reservation. During a Longhorn upgrade, a new Instance Manager pod is created alongside the existing one on each affected node. The old pod keeps hosting the engine and replica instances that are already running so that live volumes stay online, while newly created and newly attached volumes land on the upgraded pod. Existing volumes only move to the new Instance Manager when they are detached and reattached (typically as part of the engine upgrade workflow), and the old pod is only removed once no instances remain inside it. Because both the old and new pods keep their CPU and memory reservations during this window, each node needs enough spare capacity to run the extra pods until the upgrade completes.

Because the engine and replica instances live inside the Instance Manager pod, the Instance Manager defines the failure domain for everything it hosts. If an Instance Manager pod is restarted or evicted, every engine and replica instance it was hosting goes with it, and the Longhorn Manager must reattach the affected volumes and rebuild replicas as needed. For this reason, Longhorn reserves CPU for the Instance Manager pod (see [Guaranteed Instance Manager CPU](../best-practices/#guaranteed-instance-manager-cpu)) and avoids restarting it while it is still hosting active instances. For the same reason, Longhorn protects the Instance Manager pod from accidental eviction or drain with a PodDisruptionBudget, whose behavior is controlled by the [Node Drain Policy](../references/settings/#node-drain-policy) setting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Besides, Longhorn deploys a dedicated Priority Class (see setting Priority Class) by default to help prevent Longhorn components from being evicted under Node Pressure.

- **V1 Data Engine.** The Instance Manager runs each engine and each replica as a Linux process inside the pod. The engine process is also what exposes the volume's block device to the host, using iSCSI as the frontend. A single V1 Instance Manager pod can host engine and replica processes for many volumes. Because engine and replica processes share the pod, the Instance Manager's resource consumption scales with the aggregate I/O load of the volumes hosted on the node. Review the [Guaranteed Instance Manager CPU](../references/settings/#guaranteed-instance-manager-cpu) setting before scaling replicas or attaching high-throughput volumes on a node.
- **V2 Data Engine.** The Instance Manager runs an SPDK target process (`spdk_tgt`) inside the pod, and SPDK takes over the full storage path, including the disks themselves. Each V2 block-type disk is imported into the target as a Logical Volume Store (LVS), and replicas live on top as SPDK logical volume bdevs. Engines are exposed as SPDK RAID block devices built from those replicas. The frontend presenting the block device to the host (NVMe-TCP or UBLK) is also driven from this Instance Manager. Because `spdk_tgt` runs in polling mode by default, the V2 Instance Manager reserves dedicated CPU cores and memory (hugepages when enabled) on each node. Use the [Data Engine CPU Mask](../references/settings/#data-engine-cpu-mask) and [Data Engine Memory Size](../references/settings/#data-engine-memory-size) settings to tune these reservations. Longhorn also supports [Interrupt Mode](../advanced-resources/v2-data-engine/interrupt-mode/) as an alternative when reducing CPU consumption is more important than raw I/O performance.

If both data engines are enabled on a cluster, each node runs two Instance Manager pods (one per data engine version), each with its own CPU reservation. During a Longhorn upgrade, a new Instance Manager pod is created alongside the existing one on each affected node. The old pod keeps hosting the engine and replica instances that are already running so that live volumes stay online, while newly created and newly attached volumes land on the upgraded pod. Existing volumes only move to the new Instance Manager when they are detached and reattached (typically as part of the engine upgrade workflow), and the old pod is only removed once no instances remain inside it. Because both the old and new pods keep their CPU and memory reservations during this window, each node needs enough spare capacity to run the extra pods until the upgrade completes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no enough resources reserved, Longhorn will not start the new version IM pod after the system upgrade, especially for v2 IM (which requires hugepages and dedicated CPU masks).

@derekbit

Copy link
Copy Markdown
Member

@Felipalds Could you address the comments? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants