Manually upgrading 50 edge switches is tedious. Modern Huawei switches support NETCONF over SSH. Sample Python script using ncclient:
from ncclient import manager
with manager.connect(host="10.0.0.1", port=830, username="admin", password="Huawei@123", hostkey_verify=False) as m:
# Copy file via SCP
m.copy_file(source="http://server/firmware.cc", target="flash:/new_firmware.cc")
# Set startup
m.edit_config(target="running", config="""<config><sysman><startup><software>flash:/new_firmware.cc</software></startup></sysman></config>""")
# Reboot
m.reboot()
This allows you to use Ansible’s huawei_switch collection for zero-touch upgrades.
A disciplined process – backup, check compatibility, validate, and prepare rollback – ensures successful Huawei switch firmware upgrades. Automation (e.g., Python scripts with SSH) can reduce human error in large networks.
<SW1> save <SW1> reboot