Added docs covering VMinstance and VMDisk backups#456
Added docs covering VMinstance and VMDisk backups#456myasnikovdaniil wants to merge 2 commits intomainfrom
Conversation
✅ Deploy Preview for cozystack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughKubernetes-level backup doc removed; new virtualization-specific backup-and-recovery guide added for VMInstance and VMDisk. Velero backup configuration updated with vminstance/vmdisk strategies, strategy parameter changes, restoreSpec updates, selectors, TTLs/timeouts, and links pointing to virtualization docs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User as User
participant K8s as Kubernetes API
participant Velero as Velero
participant CSI as CSI / Snapshot Provider
participant BackupClass as BackupClass (Config)
User->>K8s: create BackupJob / Plan (refs BackupClass)
K8s->>Velero: schedule/trigger backup (VMInstance/VMDisk)
Velero->>CSI: create VolumeSnapshot(s)
CSI-->>Velero: snapshot ready
Velero->>K8s: store backup metadata / objects
Velero-->>User: backup status (Pending→Running→Succeeded/Failed)
alt Restore in-place
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
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
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
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
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.
| # HelmRelease (the Cozystack app object) | ||
| - matchLabels: | ||
| apps.cozystack.io/application.kind: '{{ .Application.kind }}' | ||
| apps.cozystack.io/application.name: '{{ .Application.metadata.name }}' |
There was a problem hiding this comment.
lets add:
# keeps ControllerRevisions used KubeVirt instancetype/preference of VMI
- matchLabels:
instancetype.kubevirt.io/object-kind: VirtualMachineClusterInstancetype
- matchLabels:
instancetype.kubevirt.io/object-kind: VirtualMachineClusterPreference
| includedResources: | ||
| - helmreleases.helm.toolkit.fluxcd.io | ||
| - virtualmachines.kubevirt.io | ||
| - virtualmachineinstances.kubevirt.io |
There was a problem hiding this comment.
and please add this
- controllerrevisions.apps # KubeVirt instancetype/preference refs; VM fails without them
Summary by CodeRabbit