Added docs covering VMinstance and VMDisk backups#456
Conversation
✅ Deploy Preview for cozystack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughKubernetes-level backup doc removed and replaced with a virtualization-focused backup-and-recovery guide for VMInstance and VMDisk; Velero backup configuration updated with separate vminstance/vmdisk strategies, strategy parameter changes, restoreSpec updates, selectors, TTLs/timeouts, and links adjusted to virtualization docs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User as User
participant K8s as Kubernetes API
participant BackupClass as BackupClass (Config)
participant Velero as Velero
participant CSI as CSI / Snapshot Provider
User->>K8s: create BackupJob / Plan (refs BackupClass)
K8s->>Velero: schedule/trigger backup (VMInstance / VMDisk)
Velero->>CSI: create VolumeSnapshot(s)
CSI-->>Velero: snapshot(s) ready
Velero->>K8s: create Backup object / store metadata
Velero-->>User: update backup status (Pending→Running→Succeeded/Failed)
alt Restore in-place or target
User->>K8s: create RestoreJob (refs Backup)
K8s->>Velero: trigger restore
Velero->>CSI: restore volumes
CSI-->>Velero: volumes restored
Velero->>K8s: reconcile resources (existingResourcePolicy: update)
Velero-->>User: restore status
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Summary of ChangesHello, 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 significantly improves the documentation around backup and recovery processes for virtualized resources within the platform. It introduces a new, detailed guide specifically for VMInstance and VMDisk backups and restores, making these operations clearer for tenant users. Concurrently, it updates the underlying Velero backup configuration examples for administrators, ensuring that the provided strategies are robust and cover both VM instances and individual disks effectively. Highlights
🧠 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 AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the documentation for backup and recovery by adding dedicated guides for VMInstance and VMDisk resources. The changes include refactoring existing content into a new, more focused page for tenant users and updating the administrator's configuration guide with specific, improved strategy examples. The new documentation is comprehensive and well-structured. I have one suggestion to enhance the VMInstance backup strategy example for better completeness.
| includedResources: | ||
| - helmreleases.helm.toolkit.fluxcd.io | ||
| - virtualmachines.kubevirt.io | ||
| - virtualmachineinstances.kubevirt.io | ||
| - pods | ||
| - datavolumes.cdi.kubevirt.io | ||
| - persistentvolumeclaims | ||
| - services | ||
| - configmaps | ||
| - secrets |
There was a problem hiding this comment.
The list of includedResources for the vminstance-strategy example no longer includes services. If a VMInstance is exposed via a Kubernetes Service, it would be beneficial to include the service in the backup to ensure a complete application restore. Consider adding services back to this list for completeness, as it was present in the previous version of the example strategy.
| includedResources: | |
| - helmreleases.helm.toolkit.fluxcd.io | |
| - virtualmachines.kubevirt.io | |
| - virtualmachineinstances.kubevirt.io | |
| - pods | |
| - datavolumes.cdi.kubevirt.io | |
| - persistentvolumeclaims | |
| - services | |
| - configmaps | |
| - secrets | |
| includedResources: | |
| - helmreleases.helm.toolkit.fluxcd.io | |
| - virtualmachines.kubevirt.io | |
| - virtualmachineinstances.kubevirt.io | |
| - pods | |
| - datavolumes.cdi.kubevirt.io | |
| - persistentvolumeclaims | |
| - services | |
| - configmaps | |
| - secrets |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
content/en/docs/v1/operations/services/velero-backup-configuration.md (1)
8-8:⚠️ Potential issue | 🔴 CriticalUpdate reference to the new virtualization backup guide.
This line references
/docs/v1/kubernetes/backup-and-recovery, but that page is being deleted in this PR. The guide has moved to the virtualization section.🔗 Proposed fix
-This guide is for **cluster administrators** who configure the backup infrastructure in Cozystack: S3 storage, Velero locations, backup **strategies**, and **BackupClasses**. Tenant users then use existing BackupClasses to create [BackupJobs and Plans]({{% ref "/docs/v1/kubernetes/backup-and-recovery" %}}). +This guide is for **cluster administrators** who configure the backup infrastructure in Cozystack: S3 storage, Velero locations, backup **strategies**, and **BackupClasses**. Tenant users then use existing BackupClasses to create [BackupJobs and Plans]({{% ref "/docs/v1/virtualization/backup-and-recovery" %}}).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/en/docs/v1/operations/services/velero-backup-configuration.md` at line 8, Update the broken reference to the removed page by replacing the link target "/docs/v1/kubernetes/backup-and-recovery" in the text that mentions "BackupJobs and Plans" with the new virtualization backup guide URL/path (the new virtualization section's backup guide). Locate the string "/docs/v1/kubernetes/backup-and-recovery" in content/en/docs/v1/operations/services/velero-backup-configuration.md and change it to the correct ref for the virtualization backup guide so the "BackupJobs and Plans" link points to the new location.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@content/en/docs/v1/operations/services/velero-backup-configuration.md`:
- Line 283: The existing reference to the deleted page uses the ref string
"/docs/v1/kubernetes/backup-and-recovery"; update that ref in the content
paragraph that mentions RestoreJob so it points to the new virtualization backup
guide (replace the ref target inside the Markdown ref expression: [{% ref
"..."}] with the new virtualization path), ensuring the link text and
surrounding sentence remain unchanged and the reference uses the same {% ref %}
templating style.
- Around line 256-257: Two inline markdown links ("[BackupJob]({{% ref
"/docs/v1/kubernetes/backup-and-recovery#one-off-backup" %}})" and "[Plan]({{%
ref "/docs/v1/kubernetes/backup-and-recovery#scheduled-backup" %}})") still
reference the deleted /docs/v1/kubernetes/backup-and-recovery page; update both
references to point to the new virtualization backup guide path used in this PR
(replace the ref target in the BackupJob and Plan link lines with the new
virtualization guide slug/anchor so both links resolve correctly).
---
Outside diff comments:
In `@content/en/docs/v1/operations/services/velero-backup-configuration.md`:
- Line 8: Update the broken reference to the removed page by replacing the link
target "/docs/v1/kubernetes/backup-and-recovery" in the text that mentions
"BackupJobs and Plans" with the new virtualization backup guide URL/path (the
new virtualization section's backup guide). Locate the string
"/docs/v1/kubernetes/backup-and-recovery" in
content/en/docs/v1/operations/services/velero-backup-configuration.md and change
it to the correct ref for the virtualization backup guide so the "BackupJobs and
Plans" link points to the new location.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bfa537e7-3d49-498e-b905-fee50767990c
📒 Files selected for processing (3)
content/en/docs/v1/kubernetes/backup-and-recovery.mdcontent/en/docs/v1/operations/services/velero-backup-configuration.mdcontent/en/docs/v1/virtualization/backup-and-recovery.md
💤 Files with no reviewable changes (1)
- content/en/docs/v1/kubernetes/backup-and-recovery.md
content/en/docs/v1/operations/services/velero-backup-configuration.md
Outdated
Show resolved
Hide resolved
content/en/docs/v1/operations/services/velero-backup-configuration.md
Outdated
Show resolved
Hide resolved
0d3e651 to
d08887f
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
content/en/docs/v1/virtualization/backup-and-recovery.md (2)
33-36: Add language specifier to code block.The fenced code block showing example output should include a language specifier for proper rendering and accessibility.
📝 Suggested fix
-``` +```text NAME AGE velero 14m</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@content/en/docs/v1/virtualization/backup-and-recovery.mdaround lines 33 -
36, The fenced code block displaying the Velero output (the lines starting with
"NAME AGE" and "velero 14m") lacks a language specifier; update that code
fence to include a language tag (e.g., add ```text) so the block is
rendered/accessed correctly and retains plain text formatting.</details> --- `174-177`: **Add language specifier to code block.** The fenced code block showing example output should include a language specifier for proper rendering and accessibility. <details> <summary>📝 Suggested fix</summary> ```diff -``` +```text NAME AGE my-vm-backup 2h ``` ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@content/en/docs/v1/virtualization/backup-and-recovery.mdaround lines 174 -
177, The fenced code block showing the example output lacks a language
specifier; update the markdown fence that contains the lines "NAME
AGE" and "my-vm-backup 2h" to use a language tag (e.g., change ``` to
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@content/en/docs/v1/virtualization/backup-and-recovery.md`:
- Around line 33-36: The fenced code block displaying the Velero output (the
lines starting with "NAME AGE" and "velero 14m") lacks a language
specifier; update that code fence to include a language tag (e.g., add ```text)
so the block is rendered/accessed correctly and retains plain text formatting.
- Around line 174-177: The fenced code block showing the example output lacks a
language specifier; update the markdown fence that contains the lines "NAME
AGE" and "my-vm-backup 2h" to use a language tag (e.g., change ``` to
```text) so the snippet renders/accessibility metadata correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 28c466dc-2c23-4146-9b67-c4b9cdf643be
📒 Files selected for processing (3)
content/en/docs/v1/kubernetes/backup-and-recovery.mdcontent/en/docs/v1/operations/services/velero-backup-configuration.mdcontent/en/docs/v1/virtualization/backup-and-recovery.md
💤 Files with no reviewable changes (1)
- content/en/docs/v1/kubernetes/backup-and-recovery.md
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
content/en/docs/v1/virtualization/backup-and-recovery.md (1)
216-216: Use a complete sentence for the section opener.Line 216 is a sentence fragment. Consider making it imperative for consistency with the rest of the guide.
✍️ Suggested wording
-To restore only a VMDisk without touching the VM configuration. +Use this flow to restore only a VMDisk without touching the VM configuration.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/en/docs/v1/virtualization/backup-and-recovery.md` at line 216, Replace the sentence fragment "To restore only a VMDisk without touching the VM configuration." with a complete, imperative opener such as "Restore only a VMDisk without modifying the VM configuration." to match the guide's consistent tone; update the section header/first line where that exact sentence appears.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@content/en/docs/v1/virtualization/backup-and-recovery.md`:
- Line 33: Two fenced code blocks in the document (the examples that show "NAME
AGE / velero 14m" and "NAME AGE / my-vm-backup 2h") are missing
language identifiers and trigger MD040; update each triple-backtick fence to
include a language identifier (use "text") so they become ```text ... ```,
ensuring both example-output blocks are annotated.
---
Nitpick comments:
In `@content/en/docs/v1/virtualization/backup-and-recovery.md`:
- Line 216: Replace the sentence fragment "To restore only a VMDisk without
touching the VM configuration." with a complete, imperative opener such as
"Restore only a VMDisk without modifying the VM configuration." to match the
guide's consistent tone; update the section header/first line where that exact
sentence appears.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 48b854fa-1bf6-4301-a766-289cf1f9cb8c
📒 Files selected for processing (1)
content/en/docs/v1/virtualization/backup-and-recovery.md
|
|
||
| Example output: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Add language identifiers to fenced code blocks to satisfy Markdown linting.
These two example-output blocks use plain triple backticks without a language, which triggers MD040 and may fail docs lint checks.
🛠️ Proposed fix
-```
+```text
NAME AGE
velero 14m- +text
NAME AGE
my-vm-backup 2h
Also applies to: 184-184
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 33-33: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@content/en/docs/v1/virtualization/backup-and-recovery.md` at line 33, Two
fenced code blocks in the document (the examples that show "NAME AGE /
velero 14m" and "NAME AGE / my-vm-backup 2h") are missing
language identifiers and trigger MD040; update each triple-backtick fence to
include a language identifier (use "text") so they become ```text ... ```,
ensuring both example-output blocks are annotated.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
content/en/docs/v1/operations/services/velero-backup-configuration.md (1)
139-144:⚠️ Potential issue | 🟠 MajorAdd matchLabels for KubeVirt instancetype and preference ControllerRevisions.
The
orLabelSelectorsshould include entries for KubeVirt instancetype and preference ControllerRevisions to ensure they are captured in the backup. Without these, VMs using cluster instancetypes or preferences may fail to start after restore.🔧 Proposed fix
orLabelSelectors: # VM resources (VirtualMachine, DataVolume, PVC, etc.) - matchLabels: app.kubernetes.io/instance: 'vm-instance-{{ .Application.metadata.name }}' # HelmRelease (the Cozystack app object) - matchLabels: apps.cozystack.io/application.kind: '{{ .Application.kind }}' apps.cozystack.io/application.name: '{{ .Application.metadata.name }}' + # keeps ControllerRevisions used KubeVirt instancetype/preference of VMI + - matchLabels: + instancetype.kubevirt.io/object-kind: VirtualMachineClusterInstancetype + - matchLabels: + instancetype.kubevirt.io/object-kind: VirtualMachineClusterPreference🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/en/docs/v1/operations/services/velero-backup-configuration.md` around lines 139 - 144, The orLabelSelectors section is missing label selectors for KubeVirt instancetype and preference ControllerRevisions, which prevents those ControllerRevision objects from being backed up; update the orLabelSelectors block to add matchLabels entries for the KubeVirt instancetype and preference ControllerRevision labels (e.g., the kubevirt.io/instancetype and kubevirt.io/preference label keys or their name variants) so ControllerRevision resources for instancetype and preference are included in backups; locate the orLabelSelectors/matchLabels blocks in this document and add two new entries referencing the KubeVirt instancetype and preference label keys so they are captured during backup/restore.
🧹 Nitpick comments (1)
content/en/docs/v1/operations/services/velero-backup-configuration.md (1)
154-154: Add clarifying comment for controllerrevisions.apps resource.The
controllerrevisions.appsentry should include a comment explaining why it's included, to help administrators understand its purpose in the backup.📝 Proposed fix
- configmaps - secrets - - controllerrevisions.apps + - controllerrevisions.apps # KubeVirt instancetype/preference refs; VM fails without them🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/en/docs/v1/operations/services/velero-backup-configuration.md` at line 154, Add a short clarifying comment next to the controllerrevisions.apps list entry explaining why controller revisions are backed up (e.g., to preserve historical revision state for Deployments/StatefulSets/DaemonSets and enable restores/rollbacks), by updating the documentation near the controllerrevisions.apps item so readers immediately understand its purpose in the Velero backup configuration; locate the list that contains "controllerrevisions.apps" and insert a brief explanatory sentence or HTML comment adjacent to that entry referencing controllerrevisions.apps and its relation to revision history and restores.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@content/en/docs/v1/virtualization/backup-and-recovery.md`:
- Line 267: Replace the sentence fragment "To restore only a VMDisk without
touching the VM configuration." with a complete sentence by adding a subject and
verb (e.g., "Use this procedure to restore only a VMDisk without touching the VM
configuration." or "This section explains how to restore only a VMDisk without
touching the VM configuration.") so the line becomes a grammatically complete
sentence in the backup-and-recovery document.
---
Duplicate comments:
In `@content/en/docs/v1/operations/services/velero-backup-configuration.md`:
- Around line 139-144: The orLabelSelectors section is missing label selectors
for KubeVirt instancetype and preference ControllerRevisions, which prevents
those ControllerRevision objects from being backed up; update the
orLabelSelectors block to add matchLabels entries for the KubeVirt instancetype
and preference ControllerRevision labels (e.g., the kubevirt.io/instancetype and
kubevirt.io/preference label keys or their name variants) so ControllerRevision
resources for instancetype and preference are included in backups; locate the
orLabelSelectors/matchLabels blocks in this document and add two new entries
referencing the KubeVirt instancetype and preference label keys so they are
captured during backup/restore.
---
Nitpick comments:
In `@content/en/docs/v1/operations/services/velero-backup-configuration.md`:
- Line 154: Add a short clarifying comment next to the controllerrevisions.apps
list entry explaining why controller revisions are backed up (e.g., to preserve
historical revision state for Deployments/StatefulSets/DaemonSets and enable
restores/rollbacks), by updating the documentation near the
controllerrevisions.apps item so readers immediately understand its purpose in
the Velero backup configuration; locate the list that contains
"controllerrevisions.apps" and insert a brief explanatory sentence or HTML
comment adjacent to that entry referencing controllerrevisions.apps and its
relation to revision history and restores.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 28bbb338-861f-4bcc-a2fb-f782136b7c42
📒 Files selected for processing (2)
content/en/docs/v1/operations/services/velero-backup-configuration.mdcontent/en/docs/v1/virtualization/backup-and-recovery.md
|
|
||
| ## Restore a VMDisk in place | ||
|
|
||
| To restore only a VMDisk without touching the VM configuration. |
There was a problem hiding this comment.
Fix sentence fragment.
This line is missing a subject. The sentence "To restore only a VMDisk without touching the VM configuration." is a fragment.
✏️ Proposed fix
-To restore only a VMDisk without touching the VM configuration.
+Use this procedure to restore only a VMDisk without touching the VM configuration.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| To restore only a VMDisk without touching the VM configuration. | |
| Use this procedure to restore only a VMDisk without touching the VM configuration. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@content/en/docs/v1/virtualization/backup-and-recovery.md` at line 267,
Replace the sentence fragment "To restore only a VMDisk without touching the VM
configuration." with a complete sentence by adding a subject and verb (e.g.,
"Use this procedure to restore only a VMDisk without touching the VM
configuration." or "This section explains how to restore only a VMDisk without
touching the VM configuration.") so the line becomes a grammatically complete
sentence in the backup-and-recovery document.
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2d6a44e to
f34f4ac
Compare
Summary by CodeRabbit