Erik-Lamers1 / vnet-manager

Virtual network manager - Manages containers and VMs to create a virtual network setup
MIT License
11 stars 7 forks source link

Base image can be created, while FRRouting install failed #2

Closed Erik-Lamers1 closed 3 years ago

Erik-Lamers1 commented 4 years ago

Which results in a corrupted base image, which gets accepted. On building an environment this can lead to the following weird errors:

2020-09-27 15:56:24,371 [vnet_manager.operations.files] [INFO] Putting requested files on machine router100
2020-09-27 15:56:24,371 [vnet_manager.operations.files] [DEBUG] Getting files from file dir /root/vnet-manager/config/ripng/router100
2020-09-27 15:56:24,381 [vnet_manager.operations.files] [DEBUG] Copying /root/vnet-manager/config/ripng/router100/ripd.conf to container router100 at path /etc/frr/ripd.conf
Traceback (most recent call last):
  File "/usr/local/bin/vnet-manager", line 11, in <module>
    load_entry_point('vnet-manager==0.3', 'console_scripts', 'vnet-manager')()
  File "/usr/local/lib/python3.8/dist-packages/vnet_manager-0.3-py3.8.egg/vnet_manager/vnet_manager.py", line 68, in main
    return manager.execute(args.action)
  File "/usr/local/lib/python3.8/dist-packages/vnet_manager-0.3-py3.8.egg/vnet_manager/actions/manager.py", line 90, in execute
    getattr(self, "preform_{}_action".format(action.replace("-", "_")))()
  File "/usr/local/lib/python3.8/dist-packages/vnet_manager-0.3-py3.8.egg/vnet_manager/actions/manager.py", line 146, in preform_create_action
    put_files_on_machine(self.config)
  File "/usr/local/lib/python3.8/dist-packages/vnet_manager-0.3-py3.8.egg/vnet_manager/operations/files.py", line 20, in put_files_on_machine
    select_files_and_put_on_machine(name, data["files"], provider)
  File "/usr/local/lib/python3.8/dist-packages/vnet_manager-0.3-py3.8.egg/vnet_manager/operations/files.py", line 37, in select_files_and_put_on_machine
    getattr(modules[__name__], "place_file_on_{}_machine".format(provider))(
  File "/usr/local/lib/python3.8/dist-packages/vnet_manager-0.3-py3.8.egg/vnet_manager/operations/files.py", line 68, in place_file_on_lxc_machine
    machine.files.put(guest_file_path, file_data)
  File "/usr/local/lib/python3.8/dist-packages/pylxd-2.2.10-py3.8.egg/pylxd/models/container.py", line 114, in put
    response = (self._client.api.containers[self._container.name]
  File "/usr/local/lib/python3.8/dist-packages/pylxd-2.2.10-py3.8.egg/pylxd/client.py", line 177, in post
    self._assert_response(response, allowed_status_codes=(200, 201, 202))
  File "/usr/local/lib/python3.8/dist-packages/pylxd-2.2.10-py3.8.egg/pylxd/client.py", line 117, in _assert_response
    raise exceptions.LXDAPIException(response)
pylxd.exceptions.LXDAPIException: file does not exist

Workaround, delete the base image and rebuild it:

vnet-manager destroy <config>
vnet-manager destroy <config> -b
vnet-manager create <config>
Erik-Lamers1 commented 4 years ago

Fix for this would be to verify the integrity of the base image at the end of creation. Maybe even make a retry wrapper.

Erik-Lamers1 commented 3 years ago

This might be fixed by https://github.com/Erik-Lamers1/vnet-manager/pull/14. I haven't been able to reproduce it anymore. Closing for now.