Skip to content

Instantly share code, notes, and snippets.

/gistify469.txt Secret

Created August 22, 2016 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/de0bf9e1211267f1afd547aad6072c69 to your computer and use it in GitHub Desktop.
Save anonymous/de0bf9e1211267f1afd547aad6072c69 to your computer and use it in GitHub Desktop.
showOvsOvnValues () {
echo === ; echo "OVS show (cropped)"
ovs-vsctl show | grep -v "options: " | grep -v "type: " | grep -v "fail_mode" | grep -v "Interface "
echo === ; echo "OF flows"
ovs-ofctl -O OpenFlow13 dump-flows br-int | cut -d',' -f3- | grep --color -E 'output|drop|'
echo === ; echo "ovn port binds"
ovn-sbctl --format=csv --data=bare list port_binding
echo === ; echo "ovn datapaths and dp binding"
ovn-sbctl list datapath ; echo ---
ovn-sbctl list datapath_binding
echo === ; echo "ovn logical flows"
ovn-sbctl lflow-list | grep --color -E 'Datapath|$'
echo ===
}
ovn_start
# Create a bridge do simulate connection between hypervisors
net_add n1
sim_add hv1
as hv1
ovs-vsctl add-br br-phys
ovn_attach n1 br-phys 192.168.0.1
showOvsOvnValues
# Add port inside hv1's context
ovs-vsctl -- add-port br-int hv1-vif1 -- \
set interface hv1-vif1 mac="00\:11\:22\:33\:44\:55" \
external-ids:iface-id=foo ofport-request=1
showOvsOvnValues
ovn-nbctl ls-add sw0
ovn-nbctl lsp-add sw0 foo
showOvsOvnValues
#-- remove
as hv1
ovs-vsctl -- del-port br-int hv1-vif1
ovn-nbctl lsp-del foo
ovn-nbctl ls-del sw0
showOvsOvnValues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment