Repository navigation
NAS backup: support incremental backups of RBD volumes #14386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
68a403c
5fa0054
0cdbf56
a4a8c27
3321f0a
a8fddbf
935adf0
5b393a1
27012a3
88d1990
a74c7c4
9786f67
8d8cd5e
39cc104
bafa96b
38d5fb7
eb41943
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
| // | ||
|
|
||
| package org.apache.cloudstack.backup; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.apache.cloudstack.storage.to.PrimaryDataStoreTO; | ||
|
|
||
| import com.cloud.agent.api.Command; | ||
|
|
||
| /** | ||
| * Remove the backup anchors of an Instance's volumes: the RBD snapshots an incremental chain is | ||
| * exported from. An anchor is only kept to export the next incremental from it, so once the chain | ||
| * is gone the next backup is a full one and the anchor would only keep the data it references | ||
| * allocated in the pool. | ||
| */ | ||
| public class RemoveBackupAnchorsCommand extends Command { | ||
| private List<PrimaryDataStoreTO> volumePools; | ||
| private List<String> volumePaths; | ||
|
|
||
| public RemoveBackupAnchorsCommand(List<PrimaryDataStoreTO> volumePools, List<String> volumePaths) { | ||
| super(); | ||
| this.volumePools = volumePools; | ||
| this.volumePaths = volumePaths; | ||
| } | ||
|
|
||
| public List<PrimaryDataStoreTO> getVolumePools() { | ||
| return volumePools; | ||
| } | ||
|
|
||
| public void setVolumePools(List<PrimaryDataStoreTO> volumePools) { | ||
| this.volumePools = volumePools; | ||
| } | ||
|
|
||
| public List<String> getVolumePaths() { | ||
| return volumePaths; | ||
| } | ||
|
|
||
| public void setVolumePaths(List<String> volumePaths) { | ||
| this.volumePaths = volumePaths; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean executeInSequence() { | ||
| return true; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ Description: CloudStack server library | |
|
|
||
| Package: cloudstack-agent | ||
| Architecture: all | ||
| Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, ovmf, swtpm, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat, python3-libnbd, socat | ||
| Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, ovmf, swtpm, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat, python3-libnbd, python3-rados, python3-rbd, ceph-common, socat | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is ceph-common available by default on all distros? specifically ubuntu? |
||
| Recommends: init-system-helpers | ||
| Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts | ||
| Description: CloudStack agent | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,9 @@ Requires: (libgcrypt > 1.8.3 or libgcrypt20) | |
| Requires: (selinux-tools if selinux-tools) | ||
| Requires: sysstat | ||
| Requires: python3-libnbd | ||
| Requires: python3-rados | ||
| Requires: python3-rbd | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| Requires: ceph-common | ||
| Requires: socat | ||
| Provides: cloud-agent | ||
| Group: System Environment/Libraries | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,6 +120,9 @@ Requires: cifs-utils | |
| Requires: (edk2-ovmf or qemu-ovmf-x86_64) | ||
| Requires: swtpm | ||
| Requires: (python3-libvirt or python3-libvirt-python) | ||
| Requires: (python3-rados or python3-ceph-common) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And for these as well, tools aren't used in this PR |
||
| Requires: (python3-rbd or python3-ceph-common) | ||
| Requires: ceph-common | ||
| Requires: (qemu-img or qemu-tools) | ||
| Requires: qemu-kvm | ||
| Requires: cryptsetup | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we add python3-rados and rbd in this PR? Because those Python libraries aren't used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just to be consistent with the #14320 which requires the python libraries.
we can remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guessed so. Technically its not part of this PR, but I doesn't hurt that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree. ideally nasbackup.sh is rewritten with python, it is a big change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of moving most of the nasbackup.sh functionality to Java, with some unavoidable code paths still in shell (or python)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But having it in a script has its use in quickly fixing an issue directly on a deployment.