Skip to content

Added docs covering VMinstance and VMDisk backups#456

Open
myasnikovdaniil wants to merge 2 commits intomainfrom
backups
Open

Added docs covering VMinstance and VMDisk backups#456
myasnikovdaniil wants to merge 2 commits intomainfrom
backups

Conversation

@myasnikovdaniil
Copy link
Contributor

@myasnikovdaniil myasnikovdaniil commented Mar 18, 2026

Summary by CodeRabbit

  • Documentation
    • Removed the generic Kubernetes "Backup and Recovery" guide and added a virtualization-focused Backup and Recovery doc that explains VMInstance and VMDisk one‑off and scheduled backups, restores, status checks, examples, and troubleshooting (including Velero guidance).
    • Updated backup configuration guidance to introduce VMInstance and VMDisk strategies, adjust example settings (selectors, TTLs, timeouts, storage parameters), and redirect workflow links to the new virtualization backup/restore docs.

@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for cozystack ready!

Name Link
🔨 Latest commit 8871430
🔍 Latest deploy log https://app.netlify.com/projects/cozystack/deploys/69bb9bace1d0df0008b6d1af
😎 Deploy Preview https://deploy-preview-456--cozystack.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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

Kubernetes-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

Cohort / File(s) Summary
Kubernetes → Virtualization docs
content/en/docs/v1/kubernetes/backup-and-recovery.md, content/en/docs/v1/virtualization/backup-and-recovery.md
Removed the Kubernetes backup-and-recovery page and added a virtualization-focused page covering BackupClass discovery, one-off BackupJob and scheduled Plan workflows for VMInstance and VMDisk, how BackupJobBackup mappings work, RestoreJob-based in-place/target restores, status checks, and troubleshooting.
Velero backup configuration
content/en/docs/v1/operations/services/velero-backup-configuration.md
Updated tenant workflow links to virtualization docs; replaced single example with vminstance-strategy and new vmdisk-strategy; added template.restoreSpec.existingResourcePolicy: update, orLabelSelectors, included pods, removed services, set includeClusterResources: false, added ttl/itemOperationTimeout, and added application.apiGroup: apps.cozystack.io plus backupStorageLocationName: default parameters; updated BackupClass YAML and restore references to RestoreJob.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through YAML, tidy and bright,
Swapping kube notes for VM-backed light.
Velero snaps, RestoreJob sings along,
Disks and instances hum the backup song,
A rabbit cheers—safe data, quick and right! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: introducing new documentation for VMInstance and VMDisk backups in the virtualization section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backups
📝 Coding Plan
  • Generate coding plan for human review comments

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, 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 Backup and Recovery Guide: A new, dedicated documentation page has been added for backing up and restoring VMInstance and VMDisk resources, providing comprehensive instructions for tenant users.
  • Updated Velero Backup Configuration: The Velero backup configuration guide has been updated with new example strategies for both VMInstance and VMDisk, enhancing clarity and functionality for administrators.
  • Refined VMInstance Backup Strategy: The example strategy for VMInstance backups now includes pods in includedResources and sets includeClusterResources to false, while removing services.

🧠 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.

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 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.

Comment on lines 145 to 153
includedResources:
- helmreleases.helm.toolkit.fluxcd.io
- virtualmachines.kubevirt.io
- virtualmachineinstances.kubevirt.io
- pods
- datavolumes.cdi.kubevirt.io
- persistentvolumeclaims
- services
- configmaps
- secrets
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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

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: 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 | 🔴 Critical

Update 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0bf8aa4 and 88691d5.

📒 Files selected for processing (3)
  • content/en/docs/v1/kubernetes/backup-and-recovery.md
  • content/en/docs/v1/operations/services/velero-backup-configuration.md
  • content/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>
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.

🧹 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.md around 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.md around 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

📥 Commits

Reviewing files that changed from the base of the PR and between 51bf9bb and d08887f.

📒 Files selected for processing (3)
  • content/en/docs/v1/kubernetes/backup-and-recovery.md
  • content/en/docs/v1/operations/services/velero-backup-configuration.md
  • content/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>
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between d08887f and 8871430.

📒 Files selected for processing (1)
  • content/en/docs/v1/virtualization/backup-and-recovery.md


Example output:

```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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 }}'
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

and please add this

- controllerrevisions.apps  # KubeVirt instancetype/preference refs; VM fails without them

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