Bug 1549030

Summary: Update neutron binding after VM migration with info from caps
Product: [oVirt] ovirt-engine Reporter: Marcin Mirecki <mmirecki>
Component: BLL.NetworkAssignee: Marcin Mirecki <mmirecki>
Status: CLOSED CURRENTRELEASE QA Contact: Meni Yakove <myakove>
Severity: medium Docs Contact:
Priority: high    
Version: 4.3.0CC: alkaplan, bugs, danken, lveyde, mburman, myakove, ylavi
Target Milestone: ovirt-4.2.4Flags: rule-engine: ovirt-4.2+
ylavi: exception+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.4 Doc Type: Enhancement
Doc Text:
When a port is created/updated, it's "binding:host_id" attribute should be updated with the id of the provider driver id (for example OVN chassis id) reported during get_caps. The port for which the binding has been reported, requires the binding to be set on every consecutive host it moves to. This could be a problem when migrating from a 4.2.2 level host to an earlier one. Hosts before that do not report the host_id. When no provider driver id is reported, the "binding:host_id" is not set, and the value from the previous host will be kept. To fix this, the older hosts need to be updated with a newer version of the provider driver.
Story Points: ---
Clone Of: 1532674
: 1554268 (view as bug list) Environment:
Last Closed: 2018-06-26 08:40:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1532674, 1554268    
Bug Blocks: 1549033    

Description Marcin Mirecki 2018-02-26 09:38:51 UTC
This is a follow up change to: 
    https://bugzilla.redhat.com/1532674

Engine should use the information received in caps:
  https://gerrit.ovirt.org/#/c/87329/
  https://gerrit.ovirt.org/#/c/87369/

as the value to update binding_host_id



+++ This bug was initially created as a clone of Bug #1532674 +++

Description of problem:
Engine should update neutron that binding host has been changed after VM migration with neutron network.

During the testing done to certify the ospd12 with RHV, i have found that when migratin a VM that has a neutron network, engine doesn't update neutron that the binding host has been changed and the port's state reported as DOWN in neutron.
Engine should do what nova doing and update neutron after VM migration with the new binding host.
Note, that although this bug, the VM remain operational and i can ping it and from it. 

Version-Release number of selected component (if applicable):
openstack-neutron-11.0.1-7.el7ost.noarch
Red Hat OpenStack Platform release 12.0 Beta (Pike)
rhv-4.2.1-0.2.el7
vdsm-4.20.11-1.el7ev

How reproducible:
100%

Steps to Reproduce:
1. Add ospd12 to RHV 4.2 - See BZ 1518370 for the flow
2. Add 2 rhv nodes with neutron roles and neutron agents configured and Create 2 VMs
3. After the setup is up and you have neutron networks in RHV, start VM1 on node1 with neutron network and check the port's state. Ping the VM2(on same node)
4. Migrate VM to node2 and ping VM2  

Actual results:

3. Port is ACTIVE and ping is ok - 

Port state before migration:
(overcloud) [root@overcloud-controller-0 ~]# openstack port show f4f2a451-45c2-4204-b6f6-682b19cc1894
+-----------------------+--------------------------------------------------------------------------+
| Field                 | Value                                                                    |
+-----------------------+--------------------------------------------------------------------------+
| admin_state_up        | UP                                                                       |
| allowed_address_pairs |                                                                          |
| binding_host_id       | overcloud-rhv-1.localdomain                                              |
| binding_profile       |                                                                          |
| binding_vif_details   | datapath_type='system', ovs_hybrid_plug='True', port_filter='True'       |
| binding_vif_type      | ovs                                                                      |
| binding_vnic_type     | normal                                                                   |
| created_at            | 2018-01-08T14:43:41Z                                                     |
| data_plane_status     | None                                                                     |
| description           |                                                                          |
| device_id             | ab7d9b77-3f4b-4edd-b43d-5a3fa63578ef                                     |
| device_owner          | oVirt                                                                    |
| dns_assignment        | None                                                                     |
| dns_name              | None                                                                     |
| extra_dhcp_opts       |                                                                          |
| fixed_ips             | ip_address='12.0.0.14', subnet_id='b854cabd-4682-4d4e-8f09-e34b8b3200bf' |
| id                    | f4f2a451-45c2-4204-b6f6-682b19cc1894                                     |
| ip_address            | None                                                                     |
| mac_address           | 00:00:00:00:00:21                                                        |
| name                  | nic1                                                                     |
| network_id            | 1194373f-6e53-474e-96bf-581ea5c1617f                                     |
| option_name           | None                                                                     |
| option_value          | None                                                                     |
| port_security_enabled | True                                                                     |
| project_id            | 0446aa0ba1dd4df289c2590ec8a1a382                                         |
| qos_policy_id         | None                                                                     |
| revision_number       | 23                                                                       |
| security_group_ids    | a352570d-f77f-4bb7-95f3-81d6d77e6c6c                                     |
| status                | ACTIVE                                                                   |
| subnet_id             | None                                                                     |
| tags                  |                                                                          |
| trunk_details         | None                                                                     |
| updated_at            | 2018-01-09T13:56:26Z                                                     |
+-----------------------+--------------------------------------------------------------------------+

4. Port state is DOWN, the binding host wasn't changed, but ping still ok-

Port state after migration:

(overcloud) [root@overcloud-controller-0 ~]# openstack port show f4f2a451-45c2-4204-b6f6-682b19cc1894
+-----------------------+--------------------------------------------------------------------------+
| Field                 | Value                                                                    |
+-----------------------+--------------------------------------------------------------------------+
| admin_state_up        | UP                                                                       |
| allowed_address_pairs |                                                                          |
| binding_host_id       | overcloud-rhv-1.localdomain                                              |
| binding_profile       |                                                                          |
| binding_vif_details   | datapath_type='system', ovs_hybrid_plug='True', port_filter='True'       |
| binding_vif_type      | ovs                                                                      |
| binding_vnic_type     | normal                                                                   |
| created_at            | 2018-01-08T14:43:41Z                                                     |
| data_plane_status     | None                                                                     |
| description           |                                                                          |
| device_id             | ab7d9b77-3f4b-4edd-b43d-5a3fa63578ef                                     |
| device_owner          | oVirt                                                                    |
| dns_assignment        | None                                                                     |
| dns_name              | None                                                                     |
| extra_dhcp_opts       |                                                                          |
| fixed_ips             | ip_address='12.0.0.14', subnet_id='b854cabd-4682-4d4e-8f09-e34b8b3200bf' |
| id                    | f4f2a451-45c2-4204-b6f6-682b19cc1894                                     |
| ip_address            | None                                                                     |
| mac_address           | 00:00:00:00:00:21                                                        |
| name                  | nic1                                                                     |
| network_id            | 1194373f-6e53-474e-96bf-581ea5c1617f                                     |
| option_name           | None                                                                     |
| option_value          | None                                                                     |
| port_security_enabled | True                                                                     |
| project_id            | 0446aa0ba1dd4df289c2590ec8a1a382                                         |
| qos_policy_id         | None                                                                     |
| revision_number       | 24                                                                       |
| security_group_ids    | a352570d-f77f-4bb7-95f3-81d6d77e6c6c                                     |
| status                | DOWN                                                                     |
| subnet_id             | None                                                                     |
| tags                  |                                                                          |
| trunk_details         | None                                                                     |
| updated_at            | 2018-01-09T14:36:28Z                                                     |
+-----------------------+--------------------------------------------------------------------------+

Expected results:
Engine should update neutron after VM migrate that the binding host is changed to new host.

Additional info:
See also - https://bugzilla.redhat.com/show_bug.cgi?id=1518370

--- Additional comment from Michael Burman on 2018-01-09 10:02 EST ---

Comment 1 Michael Burman 2018-06-19 12:25:47 UTC
Verified on - 4.2.4.4-0.1.el7_3

Migrate to Host1 - 

 "openstack_binding_host_ids": {
        "OVIRT_PROVIDER_OVN": "8ff4eafe-3708-40c8-b909-d007101b1b6f"


2018-06-19 15:08:40,092 root From: 10.35.163.149:40760 Request: PUT /v2.0/ports/0e53f047-2968-404d-b376-5144f22cab93
2018-06-19 15:08:40,093 root Request body:
{
  "port" : {
    "binding:host_id" : "8ff4eafe-3708-40c8-b909-d007101b1b6f",
    "mac_address" : "00:00:00:00:00:54"
  }
}

Migrate to Host2 - 

"openstack_binding_host_ids": {
        "OVIRT_PROVIDER_OVN": "cede6319-3545-4d70-936c-921d8c1ede8d"


2018-06-19 15:11:05,891 root From: 10.35.163.149:40840 Request: PUT /v2.0/ports/0e53f047-2968-404d-b376-5144f22cab93
2018-06-19 15:11:05,891 root Request body:
{
  "port" : {
    "binding:host_id" : "cede6319-3545-4d70-936c-921d8c1ede8d",
    "mac_address" : "00:00:00:00:00:54"
  }
}

Migrate to Host3 -

"openstack_binding_host_ids": {
        "OVIRT_PROVIDER_OVN": "5d1b68be-08fc-4e82-94b1-6a53122b9e7c"

2018-06-19 15:23:31,671 root From: 10.35.163.149:41162 Request: PUT /v2.0/ports/0e53f047-2968-404d-b376-5144f22cab93
2018-06-19 15:23:31,671 root Request body:
{
  "port" : {
    "binding:host_id" : "5d1b68be-08fc-4e82-94b1-6a53122b9e7c",
    "mac_address" : "00:00:00:00:00:54"
  }
}


Migrate back to Host1 - 

2018-06-19 15:24:54,023 root From: 10.35.163.149:41204 Request: PUT /v2.0/ports/0e53f047-2968-404d-b376-5144f22cab93
2018-06-19 15:24:54,024 root Request body:
{
  "port" : {
    "binding:host_id" : "8ff4eafe-3708-40c8-b909-d007101b1b6f",
    "mac_address" : "00:00:00:00:00:54"
  }
}

Comment 2 Sandro Bonazzola 2018-06-26 08:40:50 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.