cisco-open / sdwan-lab-deployment-tool

This tool automates Cisco Catalyst SD-WAN lab deployment inside Cisco Modeling Labs (CML).
BSD 3-Clause "New" or "Revised" License
17 stars 5 forks source link

Cant launch setup #25

Closed Ondjultomte closed 2 months ago

Ondjultomte commented 3 months ago
❯ sdwan-lab setup
CML IP address: cml1.local
CML user: admin
CML password:
Verifying software images...Traceback (most recent call last):
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/bin/sdwan-lab", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/catalyst_sdwan_lab/__main__.py", line 534, in main
    setup.main(cml, cli_args.loglevel, cli_args.list)
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/catalyst_sdwan_lab/tasks/setup.py", line 135, in main
    cml.definitions.remove_image_definition(image_definition["id"])
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/virl2_client/models/node_image_definitions.py", line 313, in remove_image_definition
    self._session.delete(url)
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_client.py", line 1253, in delete
    return self.request(
           ^^^^^^^^^^^^^
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_client.py", line 828, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_client.py", line 915, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_client.py", line 961, in _send_handling_auth
    raise exc
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_client.py", line 950, in _send_handling_auth
    next_request = auth_flow.send(response)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_auth.py", line 78, in sync_auth_flow
    request = flow.send(response)
              ^^^^^^^^^^^^^^^^^^^
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/virl2_client/models/authentication.py", line 112, in auth_flow
    response_raise(response)
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/virl2_client/models/authentication.py", line 154, in response_raise
    raise error
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/virl2_client/models/authentication.py", line 144, in response_raise
    response.raise_for_status()
  File "/Users/cmluser/Projects/sdwanlabbcml/sdwan-lab-deployment-tool/venv/lib/python3.12/site-packages/httpx/_models.py", line 759, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://cml1.local/api/v0/image_definitions/cat-sdwan-controller-20-13-1'
Image Definition in use: cat-sdwan-controller-20-13-1.

showing help works

 sdwan-lab setup -h
usage: sdwan-lab setup [-h] [--list]

options:
  -h, --help  show this help message and exit
  --list      After running setup task, list the available SD-WAN software per node type.

❯ python3 --version Python 3.12.3

tzarski0 commented 3 months ago

Hi @Ondjultomte, this error points that you are using some SD-WAN labs that were not deployed by the script. For setup task to work, please remove any SD-WAN labs that were not deployed by script. In next version of the tool, I will add a check to proceed with setup, but print a warning that those images are not properly migrated as they are in use.

tzarski0 commented 3 months ago

@Ondjultomte please test the fix by installing the dev version:

pip install --upgrade git+https://github.com/cisco-open/sdwan-lab-deployment-tool.git@dev-2.0.13