Bug 1530531 - When removing router interface the provider doesn't remove the attachment to the subnet
Summary: When removing router interface the provider doesn't remove the attachment to ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-provider-ovn
Classification: oVirt
Component: provider
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.2.2
: ---
Assignee: Dominik Holler
QA Contact: Mor
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-03 09:45 UTC by Mor
Modified: 2018-03-29 11:02 UTC (History)
6 users (show)

Fixed In Version: ovirt-provider-ovn-1.2.7-2
Doc Type: Bug Fix
Doc Text:
Cause: When deleting a router attached to subnet ovirt-provider-ovn doesn't remove the attachment to the subnet. Consequence: It was not possible to delete the subnet. Fix: If there is a subnet associated with a router interface, on removing this interface the subnet is disconnected from the router, even if the interface is removed by a port. Result: It is possible to delete a subnet after it is detached from a router.
Clone Of:
Environment:
Last Closed: 2018-03-29 11:02:30 UTC
oVirt Team: Network
Embargoed:
ylavi: ovirt-4.2+
ylavi: exception+


Attachments (Terms of Use)
ovirt-provider-ovn.log (328.07 KB, text/plain)
2018-01-03 09:45 UTC, Mor
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 86449 0 master MERGED Disconnect subnet on removing router interface by port 2018-02-01 13:45:19 UTC

Description Mor 2018-01-03 09:45:01 UTC
Created attachment 1376235 [details]
ovirt-provider-ovn.log

Description of problem:
When creating OVN router, OVN network, OVN subnet attached to the OVN network, and adding router interface by subnet, if the router is deleted, it is impossible remove the subnet using the provider. Provider error is logged: "Unable to delete subnet <SUBNET_ID> because it is connected to router <ROUTER_ID>. Please disconnect the subnet from the router first."

Version-Release number of selected component (if applicable):
ovirt-provider-ovn-1.2.2-1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create OVN network:
{
    "network": {
        "name": "test_network",
        "admin_state_up": true
    }
}

NOTE network_id in response.

2. Create OVN subnet and attach it to the OVN network:
{
    "subnet": {
        "name": "test_subnet",
        "network_id": "<OVN_NET_ID>",
        "ip_version": 4,
        "cidr": "<CIDR>/24",
        "gateway_ip": "<CIDR_GW>"
    }
}

NOTE subnet_id in response.

3. Create OVN router:
{
    "router": {
        "name": "test_router",
        "admin_state_up": true
    }
}

NOTE router_id in response.

4. Create interface router by subnet:
{
    "subnet_id": "<OVN_SUBNET_ID>"
}

5. Delete the router:
DELETE on https://<SERVER>:9696/v2.0/routers/<OVN_ROUTER_ID>

6. Try to delete the subnet:
DELETE on https://<SERVER>:9696/v2.0/subnets/<OVN_SUBNET_ID>
{
  "error": {
    "message": "Unable to delete subnet <SUBNET_ID> because it is connected to router <ROUTER_ID. Please disconnect the subnet from the router first.",
    "code": 400,
    "title": "Bad Request"
  }
}

Actual results:
You cannot remove the subnet from the provider using API requests, only by using OVN commands.

Expected results:
All interfaces of a router should be removed once the router is deleted.

Additional info:

Comment 1 Mor 2018-02-22 13:25:01 UTC
Verified on: ovirt-provider-ovn-1.2.7-2.el7ev.noarch

I used the following flow to verify the bug:
1. Create network.
2. Create subnet and attach it to network.
3. Create router.
4. Add interface to router by subnet from step 2.
5. Remove interface by subnet from step 2. --> Step needed to remove the subnet.
6. Remove the router.

Comment 2 Sandro Bonazzola 2018-03-29 11:02:30 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 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.


Note You need to log in before you can comment on or make changes to this bug.