proxmox-autosnap icon indicating copy to clipboard operation
proxmox-autosnap copied to clipboard

Add ability to send replication

Open soloam opened this issue 2 years ago • 9 comments

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

soloam avatar Feb 17 '23 17:02 soloam

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?

apprell avatar Mar 04 '23 12:03 apprell

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: @.***>

soloam avatar Mar 04 '23 12:03 soloam

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.

jocelynj avatar Mar 08 '23 20:03 jocelynj

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?

jocelynj avatar Jul 13 '24 19:07 jocelynj

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.

apprell avatar Jul 14 '24 20:07 apprell

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?

jocelynj avatar Jul 15 '24 18:07 jocelynj

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.

apprell avatar Jul 15 '24 19:07 apprell

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?

jocelynj avatar Jul 16 '24 18:07 jocelynj

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

apprell avatar Jul 18 '24 21:07 apprell

@jocelynj added send snapshot to another host with sanoid pull request

apprell avatar Jul 29 '24 17:07 apprell