Hi all.
I currently have a two-node cluster using a Dell MD3200 as LVM shared storage (two LUNs, one for OS and one for data LVs).
For disaster recovery, I'd need to automatically send a backup of some VMs to another Proxmox cluster, that uses iSCSI-backed LVM.
But till now I couldn't find a "good enough" way to automate the copy.
What I have now is a bash script that:
0) checks that source VM is running and dst VM isn't
1) suspends source VM
2) takes a snapshot
3) resumes source VM
4) copies (using dd) from snapshot to dst LV
5) destroys snapshot
But I think it's quite fragile:
- if source VM is moved to another node, backup can't run
- if dest VM is moved to another node, I risk overwriting its data with old (that should never happen: the disaster-recovery VM should never be turned on if the main is active, but...)
- dest LV is accessed from outside its CLVM cluster (I just added iSCSI target and its LVM in the GUI), and I fear that that could lead to data corruption (since metadata is not synced)
- the backup overwrites the only copy of the data: if someting goes wrong, I lose it (maybe I could fix this by taking a snapshot of the dest LV on the dest before starting writes and discarding it after copy, but if backup fails do I have to copy back all the data before being able to restart the machine?)
Suggestions?
Tks.
I currently have a two-node cluster using a Dell MD3200 as LVM shared storage (two LUNs, one for OS and one for data LVs).
For disaster recovery, I'd need to automatically send a backup of some VMs to another Proxmox cluster, that uses iSCSI-backed LVM.
But till now I couldn't find a "good enough" way to automate the copy.
What I have now is a bash script that:
0) checks that source VM is running and dst VM isn't
1) suspends source VM
2) takes a snapshot
3) resumes source VM
4) copies (using dd) from snapshot to dst LV
5) destroys snapshot
But I think it's quite fragile:
- if source VM is moved to another node, backup can't run
- if dest VM is moved to another node, I risk overwriting its data with old (that should never happen: the disaster-recovery VM should never be turned on if the main is active, but...)
- dest LV is accessed from outside its CLVM cluster (I just added iSCSI target and its LVM in the GUI), and I fear that that could lead to data corruption (since metadata is not synced)
- the backup overwrites the only copy of the data: if someting goes wrong, I lose it (maybe I could fix this by taking a snapshot of the dest LV on the dest before starting writes and discarding it after copy, but if backup fails do I have to copy back all the data before being able to restart the machine?)
Suggestions?
Tks.