Exclude specified VMs from image backups #509

Merged
raucao merged 2 commits from feature/kvm_backup_exceptions into master 2023-07-26 08:58:45 +00:00
3 changed files with 13 additions and 0 deletions
Showing only changes of commit 9568b7072d - Show all commits

View File

@@ -34,6 +34,15 @@
}
}
},
"kosmos_kvm": {
"backup": {
"nodes_excluded": [
"garage-2", "garage-3", "garage-4",
"postgres-5",
"rsk-mainnet-2", "rsk-testnet-3"
]
}
},
"kosmos-mastodon": {
"domain": "kosmos.social",
"s3_endpoint": "http://localhost:3900",

View File

@@ -8,3 +8,5 @@ node.default["kosmos_kvm"]["host"]["qemu_base_image"] = {
# A systemd.timer OnCalendar config value
node.default["kosmos_kvm"]["backup"]["schedule"] = "daily"
# Node/VM names excluded from backups
node.default["kosmos_kvm"]["backup"]["nodes_excluded"] = []

View File

@@ -54,6 +54,8 @@ end
vm_domains = search(:node, "role:kvm_guest").map{|n| n["hostname"] } \
& `virsh list --name`.strip.chomp.split("\n")
vm_domains.reject! { |d| node["kosmos_kvm"]["backup"]["nodes_excluded"].include?(d) }
template "/root/backups/backup_all_vms.sh" do
source "backup_all_vms.sh.erb"
mode '0750'