ipspace / netlab

Making virtual networking labs suck less
https://netlab.tools
Other
438 stars 66 forks source link

[BUG] Newer Vagrant Images fail to deploy with Private SSH key error and weak password #1415

Open SudarshanVK opened 5 hours ago

SudarshanVK commented 5 hours ago

Describe the bug

When using libvirt provider to deploy cumulus nodes version 5.10.0, vagrant up command fails with Private key error. Also, Cumulus seems to have introduced password policy so the default password of cumulus also produces error messages.

An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An error occurred while executing the action on the 'router1'
machine. Please handle this error then try again:

The private key you are attempting to generate is not supported by
the guest SSH server. Please use one of the available key types defined
below that is supported by the guest SSH server.

and

router2: BAD PASSWORD: The password contains less than 1 digits
    router2: BAD PASSWORD: The password contains less than 1 digits
    router2: BAD PASSWORD: The password contains less than 1 digits
    router2: chpasswd: (user cumulus) pam_chauthtok() failed, error:
    router2: Have exhausted maximum number of retries for service
    router2: chpasswd: (line 1, user cumulus) password not changed

To Reproduce

Most of the bugs are caused by an error in the data transformation code or templates -- the data structures or device configurations generated by netlab are not what you would expect (which should have been described in the above section).

If you're experiencing any other unexpected behavior, please add the steps needed to reproduce it.

deploy a lab with the below topology file

provider: libvirt
defaults.device: cumulus_nvue

nodes:
  - {"name": "router1", "image": "CumulusCommunity/cumulus-vx:5.10.0"}
  - {"name": "router2", "image": "CumulusCommunity/cumulus-vx:5.10.0"}

links:
  - {"router1": {"ifindex": 6}, "router2": {"ifindex": 7}}

addressing:
  mgmt:
    ipv4: 192.168.100.0/24
    mac: 08-4F-A9-00-00-00
    prefix: 24
    start: 20

Expected behavior

Expect the lab to be deployed without errors and should be able to ssh to the nodes

Lab topology

provider: libvirt
defaults.device: cumulus_nvue

nodes:
  - {"name": "router1", "image": "CumulusCommunity/cumulus-vx:5.10.0"}
  - {"name": "router2", "image": "CumulusCommunity/cumulus-vx:5.10.0"}

links:
  - {"router1": {"ifindex": 6}, "router2": {"ifindex": 7}}

addressing:
  mgmt:
    ipv4: 192.168.100.0/24
    mac: 08-4F-A9-00-00-00
    prefix: 24
    start: 20

Output

netlab create does not produce any errors

Version

netlab version 1.9.1

Additional context

Add any other context about the problem here.

SudarshanVK commented 4 hours ago

I was able to get around the issues with the following edits.

Modified file netsim/templates/provider/libvirt/Vagrantfile.j2 to add the following two lines above the config.vm.provider :libvirt do |libvirt|.

  config.ssh.forward_agent = true
  config.ssh.insert_key = false

Modified file netsim/templates/provider/libvirt/cumulus_nvue-domain.j2 and changed the default password in the set_cumulus_password function