Skip to content

Conversation

@kvaps
Copy link
Member

@kvaps kvaps commented Jan 7, 2026

What this PR does

Enable DRBD auto-diskful options to automatically convert diskless nodes to diskful when they remain in Primary state for an extended period.

How it works

When LINSTOR is integrated with Kubernetes, the platform may schedule workloads on nodes that don't have local storage replicas. In such cases, DRBD operates in "diskless" mode, accessing data over the network from nodes that have actual disk replicas.

The auto-diskful feature addresses this by:

  1. Monitoring Primary state duration: When a diskless node holds a DRBD resource in Primary state (actively using the volume) for more than the configured time (30 minutes), LINSTOR automatically creates a local disk replica on that node.

  2. Automatic cleanup: With auto-diskful-allow-cleanup enabled, when the resource is no longer in Primary state on that node, LINSTOR can automatically remove the disk replica that was created, freeing up storage space.

Configuration

  • DrbdOptions/auto-diskful: 30 — Convert diskless to diskful after 30 minutes in Primary state
  • DrbdOptions/auto-diskful-allow-cleanup: true — Allow automatic removal of auto-created replicas when no longer needed

Benefits

  • Improves I/O performance for long-running workloads by creating local replicas
  • Reduces network traffic for frequently accessed data
  • Automatic cleanup prevents storage waste from temporary replicas

Release note

[linstor] Enable auto-diskful to automatically create local replicas on diskless nodes that hold volumes in Primary state for more than 30 minutes, improving I/O performance for long-running workloads.

Summary by CodeRabbit

  • New Features
    • Introduced an "auto diskful" option to automatically manage diskful resources with configurable interval and optional cleanup.
  • Chores
    • Added default configuration values to enable and time the auto-diskful behavior and to control automatic cleanup.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

Adds a conditional block to the linstor cluster template that injects two DRBD properties when enabled, and introduces corresponding default values under linstor.autoDiskful in the chart values file.

Changes

Cohort / File(s) Change Summary
Template: cluster spec
packages/system/linstor/templates/cluster.yaml
Added conditional block guarded by {{- if .Values.linstor.autoDiskful.enabled }} that inserts spec.properties entries: DrbdOptions/auto-diskful (value from .Values.linstor.autoDiskful.minutes) and DrbdOptions/auto-diskful-allow-cleanup (value from .Values.linstor.autoDiskful.allowCleanup).
Chart values
packages/system/linstor/values.yaml
Added linstor.autoDiskful block with fields: enabled: true, minutes: 30, allowCleanup: true to provide defaults for the new template conditional.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibble on YAML, soft and fleet,
Tucked two options in a neat little sheet,
Minutes and cleanup set to play,
Enabled by toggle, tucked away,
Config warmed—hop, deploy away! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: enabling auto-diskful functionality for diskless nodes in LINSTOR, which is the core feature introduced by the configuration changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to LINSTOR by activating and configuring the auto-diskful feature. This change aims to improve I/O performance and reduce network traffic for long-running workloads on diskless nodes within orchestration platforms. By automatically creating local DRBD replicas when a diskless node consistently acts as a primary, and then cleaning them up when no longer required, the system optimizes resource utilization and data access efficiency.

Highlights

  • Enable LINSTOR auto-diskful: This pull request enables the auto-diskful feature for LINSTOR, which automatically converts diskless nodes to diskful nodes under specific conditions.
  • Configure auto-diskful duration: The DrbdOptions/auto-diskful setting is configured to '30', meaning a diskless node will become diskful if it remains in the Primary state for 30 minutes.
  • Enable automatic cleanup: The DrbdOptions/auto-diskful-allow-cleanup option is set to 'true', allowing LINSTOR to automatically remove auto-created disk replicas when they are no longer needed.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enables the auto-diskful feature in LINSTOR by adding the necessary properties to the LinstorCluster configuration. The changes are straightforward and well-described. My feedback focuses on improving the maintainability and flexibility of the Helm chart by parameterizing the new configuration options instead of hardcoding them, which is a common best practice.

@kvaps kvaps marked this pull request as ready for review January 7, 2026 14:13
@kvaps kvaps requested review from lllamnyp and nbykov0 as code owners January 7, 2026 14:13
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Jan 7, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/system/linstor/templates/cluster.yaml (1)

17-20: DRBD options are valid; consider parameterizing via values.yaml for maintainability.

The option names and value formats are correct per LINSTOR documentation:

  • DrbdOptions/auto-diskful: "30" — valid 30-minute threshold (LINSTOR accepts integer minutes)
  • DrbdOptions/auto-diskful-allow-cleanup: "true" — valid boolean value; effect only applies when auto-diskful is set

To align with Helm best practices for the packages/system/ chart pattern, parameterize these values in values.yaml rather than hardcoding them in the template.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8b330e and 32fb48b.

📒 Files selected for processing (1)
  • packages/system/linstor/templates/cluster.yaml
🧰 Additional context used
📓 Path-based instructions (2)
packages/system/**

📄 CodeRabbit inference engine (AGENTS.md)

Use Helm Chart umbrella pattern with vendored upstream charts in charts/ directory

Files:

  • packages/system/linstor/templates/cluster.yaml
**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do NOT directly edit upstream Helm charts in vendored charts directory; use proper chart vendoring mechanisms

Files:

  • packages/system/linstor/templates/cluster.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install Cozystack

Add DRBD options to automatically convert diskless nodes to diskful
when they remain in Primary state for more than 30 minutes.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps force-pushed the feat/linstor-auto-diskful branch from 32fb48b to 115df4a Compare January 7, 2026 14:44
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 7, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/system/linstor/values.yaml (1)

6-10: Consider documenting the configuration and evaluating the default enabled state.

While the parameterization addresses the previous review feedback, consider the following improvements:

  1. Add inline comments explaining what each field does, including the units for minutes and the implications of allowCleanup.
  2. Evaluate the default enabled: true: Since this feature automatically creates disk replicas (consuming storage resources), users may prefer opt-in behavior. If the feature is intentionally enabled by default, document this decision clearly.
📝 Suggested documentation improvement
 
 linstor:
   autoDiskful:
+    # Enable automatic conversion of diskless nodes to diskful after a configured duration
     enabled: true
+    # Time in minutes a diskless node must remain in Primary state before auto-diskful triggers
     minutes: 30
+    # Automatically remove auto-created replicas when resource is no longer Primary
     allowCleanup: true
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32fb48b and 115df4a.

📒 Files selected for processing (2)
  • packages/system/linstor/templates/cluster.yaml
  • packages/system/linstor/values.yaml
🧰 Additional context used
📓 Path-based instructions (2)
packages/system/**

📄 CodeRabbit inference engine (AGENTS.md)

Use Helm Chart umbrella pattern with vendored upstream charts in charts/ directory

Files:

  • packages/system/linstor/values.yaml
  • packages/system/linstor/templates/cluster.yaml
**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do NOT directly edit upstream Helm charts in vendored charts directory; use proper chart vendoring mechanisms

Files:

  • packages/system/linstor/values.yaml
  • packages/system/linstor/templates/cluster.yaml
🪛 YAMLlint (1.37.1)
packages/system/linstor/templates/cluster.yaml

[error] 18-18: syntax error: could not find expected ':'

(syntax)

🔇 Additional comments (1)
packages/system/linstor/templates/cluster.yaml (1)

17-22: Code is correct—no changes needed.

The | quote filter is appropriate. LINSTOR properties are key-value pairs where all values (including integers and booleans) are passed as strings, consistent with the hardcoded "15", "20", and "100" values for other DrbdOptions in lines 23-30. The property names DrbdOptions/auto-diskful (integer) and DrbdOptions/auto-diskful-allow-cleanup (boolean) are correct per LINSTOR documentation.

The YAMLlint error on line 18 is a false positive. YAMLlint doesn't parse Helm template syntax, so the conditional block wrapped around YAML list items triggers a spurious error.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 7, 2026
@kvaps
Copy link
Member Author

kvaps commented Jan 7, 2026

/retest

@kvaps kvaps merged commit 95a15e7 into main Jan 8, 2026
33 of 34 checks passed
@kvaps kvaps deleted the feat/linstor-auto-diskful branch January 8, 2026 13:17
kvaps added a commit that referenced this pull request Jan 8, 2026
## What this PR does

Enable DRBD auto-diskful options to automatically convert diskless nodes
to diskful when they remain in Primary state for an extended period.

### How it works

When LINSTOR is integrated with Kubernetes, the platform may schedule
workloads on nodes that don't have local storage replicas. In such
cases, DRBD operates in "diskless" mode, accessing data over the network
from nodes that have actual disk replicas.

The `auto-diskful` feature addresses this by:

1. **Monitoring Primary state duration**: When a diskless node holds a
DRBD resource in Primary state (actively using the volume) for more than
the configured time (30 minutes), LINSTOR automatically creates a local
disk replica on that node.

2. **Automatic cleanup**: With `auto-diskful-allow-cleanup` enabled,
when the resource is no longer in Primary state on that node, LINSTOR
can automatically remove the disk replica that was created, freeing up
storage space.

### Configuration

- `DrbdOptions/auto-diskful: 30` — Convert diskless to diskful after 30
minutes in Primary state
- `DrbdOptions/auto-diskful-allow-cleanup: true` — Allow automatic
removal of auto-created replicas when no longer needed

### Benefits

- Improves I/O performance for long-running workloads by creating local
replicas
- Reduces network traffic for frequently accessed data
- Automatic cleanup prevents storage waste from temporary replicas

### Release note

```release-note
[linstor] Enable auto-diskful to automatically create local replicas on diskless nodes that hold volumes in Primary state for more than 30 minutes, improving I/O performance for long-running workloads.
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Introduced an "auto diskful" option to automatically manage diskful
resources with configurable interval and optional cleanup.
* **Chores**
* Added default configuration values to enable and time the auto-diskful
behavior and to control automatic cleanup.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kvaps added a commit that referenced this pull request Jan 8, 2026
## What this PR does

Enable DRBD auto-diskful options to automatically convert diskless nodes
to diskful when they remain in Primary state for an extended period.

### How it works

When LINSTOR is integrated with Kubernetes, the platform may schedule
workloads on nodes that don't have local storage replicas. In such
cases, DRBD operates in "diskless" mode, accessing data over the network
from nodes that have actual disk replicas.

The `auto-diskful` feature addresses this by:

1. **Monitoring Primary state duration**: When a diskless node holds a
DRBD resource in Primary state (actively using the volume) for more than
the configured time (30 minutes), LINSTOR automatically creates a local
disk replica on that node.

2. **Automatic cleanup**: With `auto-diskful-allow-cleanup` enabled,
when the resource is no longer in Primary state on that node, LINSTOR
can automatically remove the disk replica that was created, freeing up
storage space.

### Configuration

- `DrbdOptions/auto-diskful: 30` — Convert diskless to diskful after 30
minutes in Primary state
- `DrbdOptions/auto-diskful-allow-cleanup: true` — Allow automatic
removal of auto-created replicas when no longer needed

### Benefits

- Improves I/O performance for long-running workloads by creating local
replicas
- Reduces network traffic for frequently accessed data
- Automatic cleanup prevents storage waste from temporary replicas

### Release note

```release-note
[linstor] Enable auto-diskful to automatically create local replicas on diskless nodes that hold volumes in Primary state for more than 30 minutes, improving I/O performance for long-running workloads.
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Introduced an "auto diskful" option to automatically manage diskful
resources with configurable interval and optional cleanup.
* **Chores**
* Added default configuration values to enable and time the auto-diskful
behavior and to control automatic cleanup.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kvaps added a commit that referenced this pull request Jan 9, 2026
## What this PR does

Enable DRBD auto-diskful options to automatically convert diskless nodes
to diskful when they remain in Primary state for an extended period.

### How it works

When LINSTOR is integrated with Kubernetes, the platform may schedule
workloads on nodes that don't have local storage replicas. In such
cases, DRBD operates in "diskless" mode, accessing data over the network
from nodes that have actual disk replicas.

The `auto-diskful` feature addresses this by:

1. **Monitoring Primary state duration**: When a diskless node holds a
DRBD resource in Primary state (actively using the volume) for more than
the configured time (30 minutes), LINSTOR automatically creates a local
disk replica on that node.

2. **Automatic cleanup**: With `auto-diskful-allow-cleanup` enabled,
when the resource is no longer in Primary state on that node, LINSTOR
can automatically remove the disk replica that was created, freeing up
storage space.

### Configuration

- `DrbdOptions/auto-diskful: 30` — Convert diskless to diskful after 30
minutes in Primary state
- `DrbdOptions/auto-diskful-allow-cleanup: true` — Allow automatic
removal of auto-created replicas when no longer needed

### Benefits

- Improves I/O performance for long-running workloads by creating local
replicas
- Reduces network traffic for frequently accessed data
- Automatic cleanup prevents storage waste from temporary replicas

### Release note

```release-note
[linstor] Enable auto-diskful to automatically create local replicas on diskless nodes that hold volumes in Primary state for more than 30 minutes, improving I/O performance for long-running workloads.
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Introduced an "auto diskful" option to automatically manage diskful
resources with configurable interval and optional cleanup.
* **Chores**
* Added default configuration values to enable and time the auto-diskful
behavior and to control automatic cleanup.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants