Bug 2218405

Summary: The status of network trunk doesn't become ACTIVE after adding a port which was detached before to an instance on OSP17.0.1.
Product: Red Hat OpenStack Reporter: Ryo Hayakawa <rhayakaw>
Component: openstack-neutronAssignee: Rodolfo Alonso <ralonsoh>
Status: CLOSED NEXTRELEASE QA Contact: Eran Kuris <ekuris>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17.0 (Wallaby)CC: chrisw, ralonsoh, scohen
Target Milestone: ga   
Target Release: 17.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-03 11:19:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ryo Hayakawa 2023-06-29 02:49:13 UTC
Description of problem:

In OSP17.0.1, the status of network trunk doesn't become ACTIVE after the following procedure:

1. Create a parent trunk port and a network trunk.
2. Stop a instance and attach the parent trunk port to the instance.
3. Start the instance and check the status of the network trunk with `openstack network trunk show`.
  -> It should show `ACTIVE`.

4. Stop the instance and detach the parent trunk port from the instance.
5. Start the instance and check the status of the network trunk with `openstack network trunk show`.
  -> It should show `DOWN`.

6. Stop the instance and attach the parent trunk port to the instance again.
7. Start the instance and check the status of the network trunk with `openstack network trunk show`.
  -> It showed `DOWN` 

According to the customer who reported this issue, the status of the network trunk is `ACTIVE` in OSP13 after the above step7. However, it is `DOWN` in OSP17.0.1 .

Is this an expected behavior in OSP17.0.1?


Version-Release number of selected component (if applicable):

Red Hat OpenStack Platform 17.0.1


How reproducible:

Always

Steps to Reproduce:
1. Create a parent trunk port:

  $ openstack port create --network private parent-trunk-port-0

2. Create a network trunk:

  $ openstack network trunk create --parent-port parent-trunk-port-0 parent-trunk-0
  (At this point, the output showed `ACTIVE` as `status`)

3. Create an instance:

  $ openstack server create --flavor m1.small \
    --network private --key-name mykeypair \
    --security-group default \
    --image  cirros_image --wait myserver0

5. Stop the instance:

  $ openstack server stop myserver0

4. Attach the parent trunk port to the instance:

  $ openstack server add port myserver0 parent-trunk-port-0

6. Start the instance:

  $ openstack server start myserver0
  
7. View the status of the network trunk:

  $ openstack network trunk show parent-trunk-0

    +-----------------+--------------------------------------+
    | Field           | Value                                |
    +-----------------+--------------------------------------+
        : (snip)
    | status          | ACTIVE                               |
        : (snip)
    +-----------------+--------------------------------------+

8. Stop the instance again to detach the port from the instance:

  $ openstack server stop myserver0

9. Detach the port from the instance:

  $ openstack server remove port myserver0 parent-trunk-port-0

10. Start the instance:

  $ openstack server start myserver0

11. View the status of the network trunk:

  $ openstack network trunk show parent-trunk-0

    +-----------------+--------------------------------------+
    | Field           | Value                                |
    +-----------------+--------------------------------------+
        : (snip)
    | status          | DOWN                                 |
        : (snip)
    +-----------------+--------------------------------------+

12. Stop the instance again to attach the port to the instance:

  $ openstack server stop myserver0


13. Attach the parent trunk port to the instance again:

  $ openstack server add port myserver0 parent-trunk-port-0

14. Start the instance:

  $ openstack server start myserver0

15. View the status of the network trunk:

  $ openstack network trunk show parent-trunk-0

    +-----------------+--------------------------------------+
    | Field           | Value                                |
    +-----------------+--------------------------------------+
        : (snip)
    | status          | DOWN                                 |
        : (snip)
    +-----------------+--------------------------------------+

Actual results:

At the step 15 in `Steps to Reproduce`, it shows `DOWN` as `status`.

Expected results:

At the step 15 in `Steps to Reproduce`, it should show `ACTIVE` as `status` the same as OSP13.

Additional info:

If there is a subport in the network trunk, I found that the status became `ACTIVE` after doing unset the subport by using the following:

$ openstack network trunk unset --subport <subport id> parent-trunk-0.