Skip to content

ovs-vswitchd .ctl file not created if variable "OVS_RUNDIR" is not set. #121

@nstamatelopoulos

Description

@nstamatelopoulos

Hello

Im trying to use this tool and i fell on an issue on Fedora CSB 43. The problem was that the script was not able to expose the .ctl file for the OVS service running in the container as it was only being created under a container filesystem and not inside the mounted volume that the actual script expects to pick it up and later print it post running the "ovs-offline start"

* openvswitch control found at /tmp/ovs-offline/var-run/ovs/ovs-vswitchd.1535056.ctl
  You can run ovs-appctl commands as:
      ovs-appctl --target=/tmp/ovs-offline/var-run/ovs/ovs-vswitchd.1535056.ctl [...]

So after some troubleshooting i found out that the code does not set the mounted volume path for the .ctl file creation but depends solely on the variable "OVS_RUNDIR" that might be exposed or might be not. (like in my environment.)

Therefore i had to change the script line like below to make it work.

      419 -    ${CONTAINER_CMD} run -d -e OVSDB_SOCKET=${socket_file} ${caps} -e UID=$(id -u) -e RESTORE_DIR="/root/restore_flows" -e CONTAINER_TYPE=${CONTAINER_CMD} -v ${WORKDIR}/restore_flows:"/root/restore_flows" -v ${local_var_run}:${remote_var_run} --pid=host --name ovs
          --vswitchd ovs-offline vswitchd-dummy                                                                                                                                                                                                                                    
      419 +    ${CONTAINER_CMD} run -d -e OVSDB_SOCKET=${socket_file} -e OVS_RUNDIR=${remote_var_run} ${caps} -e UID=$(id -u) -e RESTORE_DIR="/root/restore_flows" -e CONTAINER_TYPE=${CONTAINER_CMD} -v ${WORKDIR}/restore_flows:"/root/restore_flows" -v ${local_var_run}:${remot
          +e_var_run} --pid=host --name ovs-vswitchd ovs-offline vswitchd-dummy        

As you can see i had to set the variable manually in the CONTAINER_CMD to force it using the volume related path and not the default that is only visilble from inside the container.

If im missing something let me know cause while this might work might be not the intented way to do this.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions