Skip to content

split lvmd config from topolvm - #227

Open
leelavg wants to merge 1 commit into
microshift-io:mainfrom
leelavg:lvmd-config
Open

split lvmd config from topolvm#227
leelavg wants to merge 1 commit into
microshift-io:mainfrom
leelavg:lvmd-config

Conversation

@leelavg

@leelavg leelavg commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

we can bind mount the lvmd config during runtime for any configuration changes like sparegb or use thinpool config, the default behaviour is unchaged.

Summary by CodeRabbit

  • New Features
    • TopoLVM’s configuration is now organized into separate generated manifests for easier management, including a dedicated LVMD configuration.
  • Refactor
    • The generated asset set was reorganized by removing the LVMD ConfigMap from the main TopoLVM manifest and adding it as a standalone manifest.
    • The kustomization output was updated to include the new LVMD manifest resource.

@leelavg
leelavg requested a review from a team as a code owner July 6, 2026 06:13
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3be0e9f9-fd6a-4e72-b940-cb2757fbc08a

📥 Commits

Reviewing files that changed from the base of the PR and between 61c288a and 3e754bf.

📒 Files selected for processing (4)
  • src/topolvm/assets/02-topolvm.yaml
  • src/topolvm/assets/03-lvmd.yaml
  • src/topolvm/assets/kustomization.yaml
  • src/topolvm/generate_manifests.sh
💤 Files with no reviewable changes (1)
  • src/topolvm/assets/02-topolvm.yaml
✅ Files skipped from review due to trivial changes (1)
  • src/topolvm/assets/kustomization.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/topolvm/generate_manifests.sh
  • src/topolvm/assets/03-lvmd.yaml

📝 Walkthrough

Walkthrough

The topolvm-lvmd-0 ConfigMap is moved from 02-topolvm.yaml into a new 03-lvmd.yaml manifest. The kustomization resource list and manifest generation script are updated to include the new file.

Changes

lvmd ConfigMap Extraction

Layer / File(s) Summary
New lvmd manifest and removal from main manifest
src/topolvm/assets/03-lvmd.yaml, src/topolvm/assets/02-topolvm.yaml
The topolvm-lvmd-0 ConfigMap is removed from 02-topolvm.yaml and added as a standalone 03-lvmd.yaml file with the lvmd.yaml payload.
Kustomization and generation script wiring
src/topolvm/assets/kustomization.yaml, src/topolvm/generate_manifests.sh
kustomization.yaml now includes 03-lvmd.yaml, and generate_manifests.sh writes the ConfigMap to that file, removes it from 02-topolvm.yaml, and updates generated kustomization resources.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ggiguash

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: moving lvmd configuration out of the main TopoLVM manifest.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@leelavg

leelavg commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

still debugging, the failure timing matches topolvm didn't come up. will update.

@leelavg

leelavg commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

maybe some outage?

time="2026-07-06T10:06:12Z" level=fatal msg="copying image 2/2 from manifest list:
 reading blob sha256:f0e298721aa8206a84c7cf45c6b2e12dcb7c6c3f0bbf4daeb6b2c640aba70ffd: 
Get \"https://cdn01.quay.io/...": EOF"

rebased now.

we can bind mount the lvmd config during runtime for any configuration
changes like sparegb or use thinpool config, the default behaviour is
unchaged.

Signed-off-by: Leela Venkaiah G <leelavg@thoughtexpo.com>
@copejon copejon self-assigned this Jul 23, 2026
@copejon

copejon commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

To echo our slack conversation here:

/etc/microshift/lvmd.yaml is the user facing configuration file. MicroShift watches this file and will edit the live configMap then restart topolvm. Managing the configMap directly is strongly discouraged because it will be overwritten whenever microshift restarts or the lvmd.yaml file on the microshift host is changed.

@leelavg

leelavg commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Managing the configMap directly is strongly discouraged because it will be overwritten whenever microshift restarts or the lvmd.yaml file on the microshift host is changed.

  • if it's bind mounted the config will persist throughout the cluster lifecycle.

/etc/microshift/lvmd.yaml is the user facing configuration file. MicroShift watches this file and will edit the live configMap then restart topolvm.

  • ack, i'll give a try directly on current PR itself if /etc/microshift/lvmd.yaml takes priority the PR intent will be implicitly met without any changes.
  • btw, restarting topolvm operator or any of the node/lvmd ds should be discouraged as the both configs will race to be realized on the cluster leaving defunct lv's
  • if microshift is overwriting the configmap always with /etc/microshift/lvmd.yaml contents it'll work great.

all my statements are using microshift in bootc containers but not directly on host via rpms.

thanks for the comments!

@leelavg

leelavg commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

doesn't work, let me know if I'm missing something, I didn't restart any, just created microshift cluster with bindmount of lvmd.yaml

Expectation: Microshift takes the config at /etc/microshift/lvmd.yaml and update the configmap.
Actual: Configmap isn't updated.

Even if the configmap is updated, there'll be a race b/n kustomize and microshift updating the same configmap upon microshift unit restart afaik.

> sudo podman inspect micro-1 | jq -r '.[0].HostConfig.Binds'
[
  "232b874d8e51137251cc2d9b4e11677ad3ba0080cd68eb1d81fb6d1ff8b64e74:/var:rprivate,rw,nodev,exec,nosuid,rbind",
  "/dev:/dev:rprivate,nosuid,rbind",
  "/var/lib/containers:/var/lib/containers:rprivate,rbind",
  "~/.config/dfmicro/micro/custom_config.yaml:/etc/microshift/config.d/99-api-server.yaml:ro,rprivate,rbind",
  "~/.config/dfmicro/micro/power-tuning.yaml:/etc/microshift/config.d/10-power-tuning.yaml:ro,rprivate,rbind",
  "~/oss/dfmicro/bin/lvmd.yaml:/etc/microshift/lvmd.yaml:ro,rprivate,rbind"
]


> oc get cm topolvm-lvmd-0 -ojsonpath='{.data.lvmd\.yaml}'
socket-name: /run/topolvm/lvmd.sock
device-classes: 
  - default: true
    name: ssd
    spare-gb: 10
    volume-group: myvg1


> sudo podman exec micro-1 cat /etc/microshift/lvmd.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: topolvm-lvmd-0
  namespace: topolvm-system
data:
  lvmd.yaml: |
        device-classes:
          - name: ssd
            volume-group: micro
            type: thin
            spare-gb: 0
            thin-pool:
              name: thin
              overprovision-ratio: 10.0
              
> oc logs topolvm-lvmd-0-9txmf 
{"level":"info","ts":"2026-07-24T06:33:59Z","msg":"configuration file loaded","device_classes":[{"name":"ssd","volume-group":"myvg1","default":true,"spare-gb":10,"stripe":null,"stripe-size":"","lvcreate-options":null,"type":"","thin-pool":null}],"socket_name":"/run/topolvm/lvmd.sock","file_name":"/etc/topolvm/lvmd.yaml"}
not found
{"level":"error","ts":"2026-07-24T06:33:59Z","msg":"volume group not found","volume_group":"myvg1","error":"not found","stacktrace":"github.com/topolvm/topolvm/cmd/lvmd/app.subMain\n\t/workdir/cmd/lvmd/app/root.go:85\ngithub.com/topolvm/topolvm/cmd/lvmd/app.init.func2\n\t/workdir/cmd/lvmd/app/root.go:58\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041\ngithub.com/topolvm/topolvm/cmd/lvmd/app.Execute\n\t/workdir/cmd/lvmd/app/root.go:188\nmain.main\n\t/workdir/cmd/hypertopolvm/main.go:38\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271"}
Error: not found

@copejon

copejon commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@leelavg Thanks for the feedback! I'll check this out and see what's going on.

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.

2 participants