Create and Use Patch Files

A patch file is a compact way to represent differences between plan files. These differences or patches can be applied to other plan files or deployed to the network.

You can create, apply, view, and edit patches by choosing Actions > Tools > Patches from the toolbar.

A common Cisco Crosswork Planning use case is to create a plan file for deployment. One potential workflow for doing this is the following:

  1. Open a plan file from the Cisco Crosswork Planning UI (see Open Plan Files).

  2. Duplicate the plan file by using the > Make a copy option.

  3. Make LSP modifications as needed in the duplicated plan file.

  4. Open both plan files, and create a patch file (Actions > Tools > Patches > Create patch).

  5. Deploy the patch file to the network (Actions > Tools > Patches > Apply patch).

This section contains the following topics:

Create Patch Files

The patch created identifies how to get from the plan file identified in the From file field to the plan file identified in the To file field. These patch files only include differences in new, modified, and deleted objects that are supported by the Cisco Crosswork Planning YANG model.

Examples:

  • If From file iosnet.txt contains 33 LSPs and To file atlantic.txt contains 23 LSPs, the patch file identifies which 10 LSPs to delete from plan iosnet.txt to create plan atlantic.txt.

  • If From file iosnet.txt contains 10 LSPs and To file atlantic.txt contains 15 LSPs, the patch file identifies which 5 LSPs to add to plan iosnet.txt to create plan atlantic.txt.

  • If both plan files contain the same LSP, but in From file iosnet.txt the LSP has a SetupBW property equal to 100, whereas in the To file atlantic.txt it does not, the patch file identifies the need to modify the SetupBW property of this LSP in plan iosnet.txt so that it matches plan atlantic.txt.

Procedure


Step 1

Open the two plan files that you are using for the patch file creation. For details, see Open Plan Files.

Step 2

From the plan file used as the To file, which is the plan file you want to achieve using the patch file, choose Actions > Tools > Patches > Create patch from the toolbar.

Step 3

From the From file drop-down list, choose the plan file from which you are determining required changes to achieve the plan file identified in the To File field.

Step 4

The default patch filename combines the From and To plan filenames. If needed, change the filename. It must have a .plp extension. Unless you want the patch file to be overwritten, the patch filename must be unique to its location.

Step 5

Click Create.

The patch file is created successfully. Use the Edit patch button to edit the patch file. Use the Download button to download the file to your local machine.

The generated patch file is saved under Network Models > User space > Other files. Use the button under the Actions column to open, download, delete, or view details of the patch file.


Apply Patch Files

To apply patch files to the plan files, do the following:

Procedure


Step 1

Open the plan file in the Network Design page. For details, see Open Plan Files.

Step 2

From the toolbar, choose Actions > Tools > Patches > Apply patch.

Step 3

Click Browse to browse to the location where the patch file resides. Choose from the following options:

  • From user space—Choose this option to select the patch file saved in your user space.

  • From local—Choose this option to select the patch files saved in your local system. Click Browse, choose the patch file located in your local system, and click Import.

    Note that the patch file is imported into the user space as well.

Step 4

Specify whether you want to stop or continue in case of error.

Step 5

(Optional) To verify the patch file’s contents before applying it, click the View details link. After viewing the patch, click Close. Use the Edit patch button to edit the patch file.

Step 6

Click Run in the Apply Patch page.


View or Edit Patch Files

Viewing the patch files lets you ensure they meet your needs before applying or deploying them.

If the patch files are available under Network Models > User space > Other files, then use the > Open option to view the patch file details.

You can also use the following steps to view the patch files:

Procedure


Step 1

Open the plan file in the Network Design page. For details, see Open Plan Files.

Step 2

From the toolbar, choose Actions > Tools > Patches > View patch.

Step 3

Browse to the location where the patch file resides. Choose from the following options:

  • From user space—Lists the patch files saved in the User Space. Select the required patch file.

  • From local—Click Browse and choose the patch file located in your local system. Then, click Import.

Step 4

Click the View details link.

Step 5

View the patch and then click one of the following:

  • Edit patch—Use this option to edit the patch file. The file becomes editable, displaying the contents of the patch as XML text. You can save or discard the patch text edits. The tool warns you if you try to save invalid XML syntax. Other standard text editing (cut, copy, paste, and so on) is also supported.

  • Download—Use this option to download the patch file to your local system.

  • Close—Use this option to close the window without deploying the patch.