Cisco Catalyst slow SCP fix

Cisco released the following command in IOS-XE 17.2.6.

ip ssh bulk-mode [ window-size ]

This essentially increases the window-size for SCP which allows for more throughput – and it is very noticeable: an IOS-XE image is around 1.2 GB, and this new command makes SCP go from hours to minutes.

Here is an Ansible example showing how to utilize this new command before uploading an image.

- name: Upload software image.
  block:

    - name: Ensure bulk-mode is enabled before image upload.
      cisco.ios.ios_config:
        lines:
          - "ip ssh bulk-mode 131072"

    - name: Upload software image.
      ansible.netcommon.cli_command:
        command: >-
          copy scp://{{ software_user }}@{{ software_server }}/{{ software_path }}/{{ software_image }} flash:/
        prompt:
          - "Destination filename"
          - "Password"
        answer:
          - "{{ software_image }}"
          - "{{ software_password }}"
        check_all: true
      no_log: true
      changed_when: true
      when: not ansible_check_mode

  always:

    - name: Disable bulk-mode after image upload.
      cisco.ios.ios_config:
        lines:
          - "no ip ssh bulk-mode"

This example also ensures that the command is disabled after the upload has been done, as recommended by Cisco (see full documentation from Cisco here).


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *