proxmox-autosnap
proxmox-autosnap copied to clipboard
Add ability to send replication
Hello, I love this script, tks for sharing! But it would be nice to add the ability to send the replication. Is that possible?
Thank you
Hello, I don't really understand why this is necessary, because Proxmox has a built-in replications that works very well.
Can you describe for which situations you would use it from script?
In proxmox if I try to replicate it says that I need to have more that one node to do that! I ony have one! I would replicate to TrueNas for example!
Thank you
On Sat, Mar 4, 2023, 12:19 Denis @.***> wrote:
Hello, I don't really understand why this is necessary, because Proxmox has a built-in replications that works very well.
Can you describe for which situations you would use it from script?
— Reply to this email directly, view it on GitHub https://github.com/apprell/proxmox-autosnap/issues/6#issuecomment-1454721418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3FPI4MUJPLU6PIDRCDMYDW2MXMRANCNFSM6AAAAAAU7VNUMQ . You are receiving this because you authored the thread.Message ID: @.***>
I agree that it would be nice to be able to replicate to another machine, for example on a different Proxmox cluster, on a different site.
pve-zsync is already able to replicate to another machine, so I don't know if it is worth adding this support to autosnap.
I’ve added an option to use syncoid
to send proxmox subvolume to another host, renaming the subvolume with the hostname of the corresponding VM (the name of the destination subvolume can be discussed and changed): https://github.com/osm-fr/proxmox-autosnap/commit/cc92994914f95aff365fb3f21b859a5512da1e40
This uses the option --no-privilege-elevation
of syncoid
, which needs some configuration with zfs allow
on both source and dest hosts, that I would need to document.
@apprell : would you be interested in a cleaner version of this commit?
I reviewed the code you wrote and noticed that it will not work for all types of virtualization. Specifically, it will only work for LXC and not for KVM, as your code searches for rootfs, which does not exist for KVM. Additionally, for LXC, the code will not work for mounted devices.
You’re right, I had forgotten about KVM - I will add it.
About mounted devices - are you talking about config like mp0: local-zfs:subvol-202-disk-2,mp=/var/log,replicate=0,size=4G
in lxc configuration?
Yes, about mp0, mp1, and so on, if snapshots are taken, they include these as well. Important information can be stored on such partitions, for example, data from a database with a modified record size.
For the example of mp0: /var/log/
, do you think that they should be copied on $TARGET_HOST:$TARGET_ZFS/$hostname/var/log
, or on $TARGET_HOST:$TARGET_ZFS/$hostname-mp0
?
I would stick to the name as in the configuration, as an example:
rootfs: ssd:subvol-100-disk-0,size=8G
mp0: ssd:subvol-100-disk-1,mp=/var/lib/mysql/data,size=10G
mp1: ssd:subvol-100-disk-2,mp=/var/lib/mysql/log,size=10G
$TARGET_HOST:/ssd/subvol-100-disk-0
$TARGET_HOST:/ssd/subvol-100-disk-1
$TARGET_HOST:/ssd/subvol-100-disk-2
@jocelynj added send snapshot to another host with sanoid pull request