export DRAGONFLOW_NET_NAME=dragonflow_net
docker network create --subnet=172.18.0.0/16 $DRAGONFLOW_NET_NAME
mkdir -p /tmp/etcd
chcon -Rt svirt_sandbox_file_t /tmp/etcd
export NODE1=172.18.0.2 # Any free IP in the subnet
export DATA_DIR=/tmp/etcd
docker run --detach --net $DRAGONFLOW_NET_NAME --ip ${NODE1} --volume=${DATA_DIR}:/etcd-data --name etcd quay.io/coreos/etcd:latest /usr/local/bin/etcd --data-dir=/etcd-data --name node1 --initial-advertise-peer-urls http://${NODE1}:2380 --listen-peer-urls http://${NODE1}:2380 --advertise-client-urls http://${NODE1}:2379 --listen-client-urls http://${NODE1}:2379 --initial-cluster node1=http://${NODE1}:2380
docker inspect --format "{{ .NetworkSettings.Networks.${DRAGONFLOW_NET_NAME}.IPAddress }}" etcd
This section assumes you have OVS set up. Make sure ovsdb-server listens on TCP port 6640. This can be done with the following command. Note you may need to allow this via selinux.
sudo ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6640
export DRAGONFLOW_IP=172.18.0.3 # Any free IP in the subnet
export MANAGEMENT_IP=$(docker inspect --format "{{ .NetworkSettings.Networks.${DRAGONFLOW_NET_NAME}.Gateway }}" etcd) # Assuming you put OVS on the host
docker run --name dragonflow --net $DRAGONFLOW_NET_NAME --ip ${DRAGONFLOW_IP} dragonflow:latest --dragonflow_ip ${DRAGONFLOW_IP} --db_ip ${NODE1}:2379 --management_ip ${MANAGEMENT_IP}
docker inspect --format "{{ .NetworkSettings.Networks.${DRAGONFLOW_NET_NAME}.IPAddress }}" dragonflow
There are two configuration files that Dragonflow needs, and creates automatically if they do not exist:
If these files exist, they are used as-is, and are not overwritten. You can add these files using e.g. -v local-dragonflow-conf.ini:/etc/dragonflow/dragonflow.ini.
This enables you to run the container without running the container service. This is useful in order to create a standalone node for Dragonflow API, separated from the controller node.
docker run --name dragonflow --net $DRAGONFLOW_NET_NAME --ip ${DRAGONFLOW_ADDRESS} -e DF_NO_CONTROLLER=1 -i -t dragonflow:latest --dragonflow_address ${DRAGONFLOW_ADDRESS} --db_address ${NODE1}:2379
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.