Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement device attach/deploy values diff check and update during restore --update #6

Open
storg2001 opened this issue Oct 17, 2022 · 5 comments

Comments

@storg2001
Copy link

Hi Guys,
we faced an issue while restoring an backup with sastre (v 1.19).
Between taking backup and restoring we changed some vedge configurations (changing template input values). We wanted to reset this change by restoring the backup but device values (template input values) have not been updated.
Sastre backup stores this information under device_templates/values/$template_name but seams not using it.
Would be very useful if you could add some functionality for restoring device values.
Thanks in advance

@reismarcelo
Copy link
Collaborator

Hi,

The device values are pushed when the restore task is executed with --attach option. Also with the attach task. Have you tried those options?

Thanks

@storg2001
Copy link
Author

storg2001 commented Oct 18, 2022

Hi,
i tried both the attach task and the restore task with --attach option. it doesn't work.
Verbose output and logs suggest restore of device values is skipped because template is already attached and there is no diff between device values in backup and vmanage.

python3.9 sdwan.py -a [vmanage-asp-qs.infra.dvint.de](https://xxxxxx) -u xxx --port 443 --verbose restore all --attach --workdir /data/projects/sastre/data/backup_vmanage_20221018 
INFO: Restore task: Local workdir: "/data/projects/sastre/data/backup_vmanage_20221018" -> vManage URL: "https://xxxxxx" INFO: Loading existing items from target vManage 
INFO: Identifying items to be pushed 
INFO: Inspecting config_group items 
INFO: Inspecting feature_profile items 
INFO: Inspecting template_device items 
INFO: Inspecting template_feature items 
INFO: Inspecting policy_vsmart items 
INFO: Inspecting policy_vedge items
INFO: Inspecting policy_security items 
INFO: Inspecting policy_voice items 
INFO: Inspecting policy_customapp items 
INFO: Inspecting policy_definition items 
INFO: Inspecting policy_list items 
INFO: No items to push 
INFO: No WAN Edge template attachments needed 
INFO: No vSmart template attachments needed 
INFO: vSmart policy activate: Centralized-Policy_v1 
INFO: Activating vSmart policy 
INFO: Waiting... 
INFO: Waiting... 
INFO: Waiting... 
INFO: Completed Centralized-Policy_v1 
INFO: Completed activating vSmart policy
INFO: Task completed successfully

Log:

2022-10-18 08:54:21,800: TaskRestore: DEBUG: Skip template Spoke_C1121X-8P, no devices to attach
2022-10-18 08:54:21,800: TaskRestore: INFO: No WAN Edge template attachments needed

I tested my guess. i set device to cli mode (detached template). then i tried to restore the backup. in this case it worked.

python3.9 sdwan.py -a https://xxxxxx -u xxx --port 443 --verbose restore all --attach --workdir /data/projects/sastre/data/backup_vmanage_20221018
vManage password:
INFO: Restore task: Local workdir: "/data/projects/sastre/data/backup_vmanage_20221018" -> vManage URL: "https://xxxxxx"
INFO: Loading existing items from target vManage
INFO: Identifying items to be pushed
INFO: Inspecting config_group items
INFO: Inspecting feature_profile items
INFO: Inspecting template_device items
INFO: Inspecting template_feature items
INFO: Inspecting policy_vsmart items
INFO: Inspecting policy_vedge items
INFO: Inspecting policy_security items
INFO: Inspecting policy_voice items
INFO: Inspecting policy_customapp items
INFO: Inspecting policy_definition items
INFO: Inspecting policy_list items
INFO: No items to push
INFO: Template attach: Spoke_C1111-4PLTEEA (Spoke10)
INFO: Template attaching WAN Edges
INFO: Waiting...
INFO: Waiting...
INFO: Waiting...
INFO: Completed Spoke_C1111-4PLTEEA
INFO: Completed template attaching WAN Edges
INFO: No vSmart template attachments needed
INFO: vSmart policy activate: Centralized-Policy_v1
INFO: Activating vSmart policy INFO: Waiting...
INFO: Waiting... INFO: Waiting...
INFO: Completed Centralized-Policy_v1
INFO: Completed activating vSmart policy

Would be very useful if you could add some option for diff and restore device values.
Thanks in advance
markus

@reismarcelo
Copy link
Collaborator

Hi Markus,

You're right, we don't currently diff for template values. There is diff on the templates themselves when one restores with --update. What you're looking for is basically expand that to look/diff into attachments as well.

Planning to look into 2 options:

  • Expand "restore --update" to also diff on attachment values.
  • Add --update as an option to attach task, in which case it would perform a diff.

Please let me know your thoughts on those options. Which seems more natural to your workflow?

@storg2001
Copy link
Author

I would say "restore --update" describes my intention best.
Thanks in advance
markus

@reismarcelo
Copy link
Collaborator

Thank you Markus. Adding this to our backlog, also renaming the issue to better reflect the ask.

@reismarcelo reismarcelo changed the title Restore backup - Device Values not updated Implement device attach/deploy values diff check and update during restore --update Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants