Comment 7 for bug 1567773

Revision history for this message
Li Ma (nick-ma-z) wrote :

The logs according to the described problem during the VM creation:

2016-04-10 16:27:45.233 INFO dragonflow.db.api_nb [-] Pushing Update to Queue: Action:create, Table:ovsinterface, Key:c594bfc3-2cfe-4ce6-a60d-834df7e2da38 Value:uuid:c594bfc3-2cfe-4ce6-a60d-834df7e2da38, ofport:-1, name:tap87e9d127-a3, admin_state:, type:vm, iface_id:87e9d127-a395-410d-87a8-cad4e3a413cd, peer:, attached_mac:fa:16:3e:1c:88:92, remote_ip:, tunnel_type: Topic:None
2016-04-10 16:27:45.237 INFO dragonflow.db.api_nb [-] Pushing Update to Queue: Action:update, Table:ovsinterface, Key:c594bfc3-2cfe-4ce6-a60d-834df7e2da38 Value:uuid:c594bfc3-2cfe-4ce6-a60d-834df7e2da38, ofport:7, name:tap87e9d127-a3, admin_state:down, type:vm, iface_id:87e9d127-a395-410d-87a8-cad4e3a413cd, peer:, attached_mac:fa:16:3e:1c:88:92, remote_ip:, tunnel_type: Topic:None
2016-04-10 16:27:45.243 INFO dragonflow.db.api_nb [-] Pushing Update to Queue: Action:update, Table:ovsinterface, Key:c594bfc3-2cfe-4ce6-a60d-834df7e2da38 Value:uuid:c594bfc3-2cfe-4ce6-a60d-834df7e2da38, ofport:7, name:tap87e9d127-a3, admin_state:up, type:vm, iface_id:87e9d127-a395-410d-87a8-cad4e3a413cd, peer:, attached_mac:fa:16:3e:1c:88:92, remote_ip:, tunnel_type: Topic:None
2016-04-10 16:27:45.244 INFO dragonflow.controller.ryu_base_app [-] port added 7
2016-04-10 16:27:45.244 INFO dragonflow.controller.ryu_base_app [-] port modified 7
2016-04-10 16:27:45.245 INFO dragonflow.controller.topology [-] Ovs port updated: uuid:c594bfc3-2cfe-4ce6-a60d-834df7e2da38, ofport:-1, name:tap87e9d127-a3, admin_state:, type:vm, iface_id:87e9d127-a395-410d-87a8-cad4e3a413cd, peer:, attached_mac:fa:16:3e:1c:88:92, remote_ip:, tunnel_type:

You can see that there is only one ovs port updated message during VM creation:

2016-04-10 16:27:45.245 INFO dragonflow.controller.topology [-] Ovs port updated: uuid:c594bfc3-2cfe-4ce6-a60d-834df7e2da38, ofport:-1, name:tap87e9d127-a3, admin_state:, type:vm, iface_id:87e9d127-a395-410d-87a8-cad4e3a413cd, peer:, attached_mac:fa:16:3e:1c:88:92, remote_ip:, tunnel_type:

This message happened when a VM port is being created, and its ofport = -1. At this time, the port is ignored. See the code below:
https://github.com/openstack/dragonflow/blob/master/dragonflow/controller/topology.py#L63

However, in the log, you can see that there's one important message that wasn't processed:

2016-04-10 16:27:45.243 INFO dragonflow.db.api_nb [-] Pushing Update to Queue: Action:update, Table:ovsinterface, Key:c594bfc3-2cfe-4ce6-a60d-834df7e2da38 Value:uuid:c594bfc3-2cfe-4ce6-a60d-834df7e2da38, ofport:7, name:tap87e9d127-a3, admin_state:up, type:vm, iface_id:87e9d127-a395-410d-87a8-cad4e3a413cd, peer:, attached_mac:fa:16:3e:1c:88:92, remote_ip:, tunnel_type: Topic:None

This message is an update message that indicates that the VM port is ready. The admin_state is up while the ofport number is assigned. The problem is here. It is not respected.

We can assume that if it is respected:

There should be a funcitonal call from distributed topology: ovs_port_updated with the right ofport number. As a result, it will call _vm_port_updated.
https://github.com/openstack/dragonflow/blob/master/dragonflow/controller/topology.py#L139

Then logical_port_updated in local controller will be called next.
https://github.com/openstack/dragonflow/blob/master/dragonflow/controller/df_local_controller.py#L183

In the function above, it will set the right ofport number and 'is_local' = True.

Finally it will notify openflow applications to add local port. At this point, the VM port will be set up and the corresponding dhcp flows will be installed.

All in all, the problem is why the port update message is not processed. During the debugging, I noticed the update message path:

(1) Put the message to the queue: https://github.com/openstack/dragonflow/blob/master/dragonflow/db/api_nb.py#L150
(2) Read from the queue: https://github.com/openstack/dragonflow/blob/master/dragonflow/db/api_nb.py#L165
(3) Apply db change: https://github.com/openstack/dragonflow/blob/master/dragonflow/db/api_nb.py#L228-L231

In the step 3, the update messages related with 'ovsinterface' table are all ignored.