OpenNebula / one

The open source Cloud & Edge Computing Platform bringing real freedom to your Enterprise Cloud 🚀
http://opennebula.io
Apache License 2.0
1.23k stars 479 forks source link

Cant change backupjob execution mode from `SEQUENTIAL` to `PARALLEL` on rsync backups #6464

Closed Franco-Sparrow closed 6 months ago

Franco-Sparrow commented 8 months ago

Description

Hi team and @rsmontero.

I testing the new backupjob feature (using rsync driver) and I like this new way to schedule backups, as longs as it allow multiple backups at the same time, following the global configuration in the /etc/one/sched.conf. The problem is that Sunstone does not give you the option to create a new job with execution mode PARALLEL (Backups are executed in parallel subject to the available slots). Tried to modify the execution mode attribute, but it always return to SEQUENTIAL mode. I did this from Sunstone and from CLI, once created the backupjob from Sunstone, it creates the job with execution mode SEQUENTIAL by default and cant be changed.

To Reproduce

Using CLI

Create a file with the backupjob configuration:

cat << EOF > /tmp/job.txt
NAME = "job_increment_cbt_agent_parallel"

BACKUP_VMS   = "33,34,35"
DATASTORE_ID = 100

FS_FREEZE = "AGENT"
KEEP_LAST = "3"
MODE      = "INCREMENT"

PRIORITY  = 51
EXECUTION = "PARALLEL"
EOF

Create the backupjob using the previous file:

onebackupjob create /tmp/job.txt

In this case, the output was as follow:

ID: 3

Check the backupjob details:

onebackupjob show 3

The output was as follow, and you can see that execution mode is still SEQUENTIAL:

BACKUP JOB 3 INFORMATION
ID             : 3
NAME           : job_increment_cbt_agent_parallel
USER           : oneadmin
GROUP          : oneadmin
LOCK           : None
PERMISSIONS
OWNER          : um-
GROUP          : ---
OTHER          : ---

LAST BACKUP JOB EXECUTION INFORMATION
TIME           : -
DURATION       :   0d 00h00m00s

VIRTUAL MACHINE BACKUP STATUS
UPDATED        :
OUTDATED       :
ONGOING        :
ERROR          :

TEMPLATE CONTENTS
BACKUP_VMS="33,34,35"
BACKUP_VOLATILE="NO"
DATASTORE_ID="100"
EXECUTION="SEQUENTIAL"
FS_FREEZE="AGENT"
INCREMENT_MODE="CBT"
KEEP_LAST="3"
MODE="INCREMENT"

Using Sunstone

imagen

imagen

imagen

imagen

These pictures follow the creation of the new backupjob and the edition of the attribute EXECUTION. Same result as CLI way.

Expected behavior

A new backupjob created with the chance to change the execution mode from SEQUENTIAL to PARALLEL for rsync backups.

Details

Additional context Add any other context about the problem here.

Progress Status

atodorov-storpool commented 8 months ago

It is an obvious typo. Usually it is not recommended but as it is a string I'd try fixing it in the binary until it is fixed upstream ;-).

cp /usr/bin/oned /usr/bin/oned-$(date +%s)
sed -i.bak 's|PARALELL|PARALLEL|' /usr/bin/oned

Checking what was changed in the bynary:

diff <(xxd /usr/bin/oned.bak) <(xxd /usr/bin/oned)
265232c265232
< 0040c0f0: 4c45 4c4c 0042 4143 4b49 4e47 5f55 505f  LELL.BACKING_UP_
---
> 0040c0f0: 4c4c 454c 0042 4143 4b49 4e47 5f55 505f  LLEL.BACKING_UP_

Let's try the new binary

systemctl restart opennebula

Hope this helps.

Best Regards, Anton

Franco-Sparrow commented 8 months ago

@atodorov-storpool Thanks Sir, this solved the issue :)

nachowork90 commented 8 months ago

The typo is in the line that is referenced:

https://github.com/OpenNebula/one/blob/41461d4c03c9d3eae13ef6b0ce60a5dd9b64c8e4/include/BackupJob.h#L95

I have compiled the packages with this fix and work perfectly.