NAUbackup / VmBackup

XenServer simple backup script
228 stars 61 forks source link

Feature request #62

Open Daniel-Furcht opened 6 years ago

Daniel-Furcht commented 6 years ago

Hi. Its possible to add option to to export without taken a snapshoot for VMs in down state? I think that can acelerate the backup process and save some disk space.

Thanks in advance.

NAUbackup commented 6 years ago

Hi, Daniel. Interesting thought, The danger is of course that someone might suddenly start it up in the middle of the backup. In general, you'd think any regularly scheduled backups would be for running VMs that are being used actively. Also, (1) there is only ever one snapshot of a VM being created for the backup at any time which is also subsequently deleted, so the amount of free space needed on any SR will not exceed that of the biggest VM there is, and (2) a snapshot takes very little time to create, so it's not like there would be a huge amount of time difference in the process.

--Tobias

Daniel-Furcht commented 6 years ago

Hi, thanks for your prompt response! I have used NAUBackup sometimes, and observed on your 1 point, that the free space is not always restored after the deletion of the snapshoot. This occur if multiple VMs are backuped in sequence with a crontab. Is this an normal behavior? In my server after 3 weeks of weekly backup, the storage becomes full. Its a set of 4 VMs with 100Gb to 300Gb disks. Local Storage as 2 TB and remain full after that.

NAUbackup commented 6 years ago

That would be a coalesce issue, which is always a pain to deal with. Short of trying to manually scan the SR or moving all the VMs to a different SR and wiping it clean before moving VMs back, there is alas no really good recourse. It seems to happen worse for some than for others. Manually deleting snapshots should result in space recovery within at most 24 hours.

thomasmck commented 6 years ago

Would it be worth adding an "xe sr-scan" call into the backup code to try and stop this issue from occuring? Not aware of any downsides from doing it regularly.

Daniel-Furcht commented 6 years ago

https://xen-orchestra.com/blog/xenserver-coalesce-detection-in-xen-orchestra/

NAUbackup commented 6 years ago

Thanks for the link, Daniel. Here, the snapshot that gets taken just before performing a backup is automatically deleted after the backup process completes. Taking a snapshot before a backup is generally a good idea because there is the off change that a shut down VM might be started up during the backup process, which would be really bad. As to the sr-scan, I'm putting together a number of items into the queue for the next release. Have been working on this solo a long time now and so have had unfortunately very little extra time; I'm hopeful I may be able to get some help in the future to sustain this package a bit better.

--Tobias

thomasmck commented 6 years ago

@NAUbackup I can probably lend a hand if you have some specific features you want to add.

Tom

NAUbackup commented 6 years ago

"The" Thomas Mckelvey?!

thomasmck commented 6 years ago

Yes :P

Daniel-Furcht commented 6 years ago

Thanks for response! Hi, is there any way to check for pending coalesce tasks? Or stalled tasks? Perhaps introduce a wait for the task finish before starting a new snapshot.

Daniel

NAUbackup commented 6 years ago

@thomasmck -- awesome! I will contact you off-line. 💯

NAUbackup commented 6 years ago

@Daniel-Furcht, will have to look into this. Good suggestion!

NAUbackup commented 6 years ago

After consideration, I think a better place to put in an sr-scan would be in the cron job (or script) that runs the backup job. That way, it can be handed independently, and if an SR changes or such, it won't break the backup portion unexpectedly, This is really not a direct backup operation, though it can affect the outcome of a backup operation. Still looking into checking if a coalesce operation is currently in progress.