sandialabs / sceptre-phenix

phenix is an orchestration tool and GUI for Sandia's minimega platform
https://sandialabs.github.io/sceptre-docs/
GNU General Public License v3.0
17 stars 23 forks source link

vyos router not working #173

Open Narratot opened 7 months ago

Narratot commented 7 months ago

I an using the provided packer config for generating the vyos image. During the startup process of the vyos guest I get the information that the startup of the phenix processes failed. Furthermore it is currently not loading the router configuration.

activeshadow commented 6 months ago

@Narratot can you provide us with the specific information you're getting about the phenix processes failing? Or at least some details on how we can try to reproduce what you're seeing?

I will admit I have not used or tested the vyos capabilities in phēnix in quite a while so I'm not surprised there's some issues arising. I just need more detail on what they are or how you're generating them so I can reproduce and come up with a fix.

Narratot commented 6 months ago

I can build the vyos image successfully. During vyos startup I get the following error. Screenshot from 2024-02-29 09-33-19

The Error is logged with the following information:

Screenshot from 2024-02-29 11-29-25 Screenshot from 2024-02-29 11-29-35

This also leads to the planned configuration in the vrouter app not getting loaded by the router.

apiVersion: phenix.sandia.gov/v2
kind: Scenario
metadata:
  name: helloworld-router
  created: '2024-02-14T10:26:19+01:00'
  updated: '2024-02-29T10:57:18+01:00'
  annotations:
    topology: helloworld-router
spec:
  apps:
    - assetDir: /phenix/topologies/example-topo/assets
      hosts:
        - hostname: router
          metadata:
            dhcp:
              - defaultRoute: 192.168.1.254
                dnsServers:
                  - 192.168.1.254
                listenAddress: 192.168.1.254
                ranges:
                  - highAddress: 192.168.1.20
                    lowAddress: 192.168.1.10
      name: vrouter

Which can also be seen within the minimega view, as there are no IPs assigned to the VMs. This changes when I manually configure the vyos router.

activeshadow commented 6 months ago

Hi @Narratot can you also post your topology file please?

Narratot commented 6 months ago

@activeshadow sure.

apiVersion: phenix.sandia.gov/v1
kind: Topology
metadata:
  name: helloworld-router
  created: '2024-02-14T10:25:11+01:00'
  updated: '2024-03-01T09:34:34+01:00'
spec:
  nodes:
    - general:
        description: Test-Win
        hostname: Test
      hardware:
        drives:
          - image: Windows-10.qc2
            inject_partition: 2
        memory: 16000
        os_type: windows
        vcpus: 8
      network:
        interfaces:
          - address: 192.168.1.11
            gateway: 192.168.1.254
            mask: 24
            name: if0
            proto: ospf
            type: ethernet
            vlan: SW1
      type: VirtualMachine
    - general:
        hostname: test2
      hardware:
        drives:
          - image: kali.qc2
        os_type: linux
      network:
        interfaces:
          - address: 192.168.1.12
            gateway: 192.168.1.254
            mask: 24
            name: if0
            proto: ospf
            type: ethernet
            vlan: SW1
      type: VirtualMachine
    - general:
        hostname: router
      hardware:
        drives:
          - image: vyos.qc2
        os_type: vyos
      network:
        interfaces:
          - address: 192.168.1.1
            mask: 30
            name: SW1
            proto: ospf
            type: ethernet
            vlan: SW1
        ospf:
          areas:
            - area_id: 0
              area_networks:
                - network: 192.168.1.1/24
          dead_interval: 60
          hello_interval: 10
          retrans_interval: 5
          router_id: 192.168.1.1
      type: Router
Narratot commented 5 months ago

Update: in src/go/app/vrouter.go specifies

        if isVyos {
            vyattaConfig = "/boot/vyos/rw/config/config.boot"
        }

But from my understanding the config can be found in /config/config.boot. Furthermore the configuration is passed to the vyos router as a chain of cli commands.

I propose to use the cloudconfig implemented to vyos for the router configuration instead of passing the configuration through an individual set of CLI commands.

activeshadow commented 5 months ago

The config is injected into vyatta or vyos instances in the pre-start stage with the destination file location being different based on vyatta or vyos.

A chain of CLI commands are sent to minirouter instances and then committed to be applied in the post-start stage.

I'm open to the use of cloudconfig capabilities in vyos if you want to provide a working PR we can review and test.

Narratot commented 5 months ago

@activeshadow Thx for the explanation, i try to have a look at it. Could you reproduce the issue of the failed phenix startup services?