P.S. 在本文基础上,录制了操作视频,供大家参考: 【操作视频】ACI 配置回滚 "Undo these changes" 的测试
测试步骤:
1. 创建 base-line snapshot
2. 新建 tn-fushuang
3. 创建 add-tn snapshot
4. 对比两份 snapshots
5. 尝试 "Undo these changes",检查结果
==> 成功,tn-fushuang 被删除
1. 恢复 add-tn snapshot,会出现 tn-fushuang
2. 修改 tn-fushuang 配置
3. 对比 base-line & add-tn 两份 snapshot
4. 尝试 "Undo these changes",检查结果
==> 失败,tn-fushuang 依然存在
通过测试,发现 "Undo these changes" 需要针对当前配置做一份最新的 snapshot,然后选择任意之前的 snapshot,可以回退。
add-tn snapshot 之后,若手动修改了配置,并且没有做一份最新 snapshot,"Undo these changes" 会失效。
参考文档:
https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/kb/b_KB_Using_Import_Export_to_Recover_Config_States.html
MOs are present in both S1 and S2 but with different property values — If the property was modified to a different value after S2 was taken, the property is left as is. Otherwise, the rollback will revert these properties to S1.
回滚的逻辑:
The configRollbackP policy enables you to undo the changes made between two snapshots, effectively rolling back any configuration changes that were made to the snapshot that was saved earlier. When the policy is triggered, objects are processed as follows:
Deleted MOs are recreated // 删除初始 snapshot 之后创建的 MOs
Created MOs are deleted // 创建初始 snapshot 之后删除的 MOs
Modified MOs are reverted // 还原初始 snapshot 之后修改的 MOs