Blog
  • Welcome to egonzalez blog
  • Software Supply Chain Security
    • Software Supply Chain Security: Why It Matters
    • Software Supply Chain Security: A Technical Deep Dive
    • SLSA and the Software Supply Chain Security: Time to Get Serious
  • Provenance
    • Understanding Provenance in Software Supply Chain Security
  • Building a secure development framework
  • Hacking
    • Index
      • Hack the box writeups
        • Dyplesher HTB writeup
        • Fatty HTB writeup
        • Oouch HTB writeup
        • Sauna HTB writeup
      • Python Vulnerabilities
        • Data Deserialization
          • Pickle
          • XML
          • YAML
      • Hacking cheatsheet
  • DevSecOps
    • Index
      • Gitlab CI minikube development environment
      • Gerrit review minikube
      • Gerrit and gitlab replication and CI job hooks on k8s
      • Vault integration with Gitlab CI
      • Gitlab CI template for DefectDojo
      • Falco real time runtime thread detection on k8s
      • Zarf - Airgap deployment in kubernetes
      • OWASP Dependency-track
      • OpenDaylight in a Docker
      • To conditional or to skip, that's the Ansible question
      • Spacewalk Red Hat Satellite v5 in a Docker container PoC
      • Ansible INI file module
  • OpenStack
    • Index
      • OpenStack tacker and service function chaining sfc with kolla
      • Deploy OpenStack designate with kolla-ansible
      • OpenStack keystone zero downtime upgrade process newton to ocata
      • Midonet integration with OpenStack Mitaka
      • OpenStack kolla deployment
      • Magnum in RDO OpenStack Liberty
      • Nova VNC flows under the hood
      • Ceph Ansible baremetal deployment
      • Rally OpenStack benchmarking with Docker
      • OpenStack affinity/anti-affinity groups
      • Migrate keystone v2.0 to keystone v3 OpenStack
      • Neutron DVR OpenStack Liberty
      • OpenStack segregation with availability zones and host aggregates
      • Nova Docker driver
      • Murano in RDO OpenStack manual installation
      • Ceph RadosGW admin Ops
      • Multiple store locations for glance images
      • List all tenants belonging an user
      • Load balancer as a service OpenStack LbaaS
      • OpenStack nova API start error
      • Delete OpenStack neutron networks
Powered by GitBook
On this page

Was this helpful?

  1. OpenStack
  2. Index

Delete OpenStack neutron networks

Fix to unable to complete operation on subnet

[root@rdoicehouse ~(keystone_admin)]# neutron router-list
+--------------------------------------+------------------+-----------------------------------------------------------------------------+
| id                                   | name             | external_gateway_info                                                       |
+--------------------------------------+------------------+-----------------------------------------------------------------------------+
 e34d94ad-7fe1-4704-8156-d255a2daa167 | demodeleterouter | {"network_id": "8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc", "enable_snat": true} |
--------------------------------------+------------------+-----------------------------------------------------------------------------+
[root@rdoicehouse ~(keystone_admin)]# neutron router-gateway-clear e34d94ad-7fe1-4704-8156-d255a2daa167
Removed gateway from router e34d94ad-7fe1-4704-8156-d255a2daa167

[root@rdoicehouse ~(keystone_admin)]# neutron router-port-list e34d94ad-7fe1-4704-8156-d255a2daa167

If Apply: 
         [[ neutron router-interface-delete <router-id> <subnet-id> ]]

[root@rdoicehouse ~(keystone_admin)]# neutron router-delete e34d94ad-7fe1-4704-8156-d255a2daa167
Deleted router: e34d94ad-7fe1-4704-8156-d255a2daa167

[root@rdoicehouse ~(keystone_admin)]# neutron subnet-list
+--------------------------------------+------------------+------------------+--------------------------------------------------------+
| id                                   | name             | cidr             | allocation_pools                                       |
+--------------------------------------+------------------+------------------+--------------------------------------------------------+
| d50e28f7-47ee-4bdf-8594-e1108f25586b | demosubnetdelete | 192.168.137.0/24 | {"start": "192.168.137.100", "end": "192.168.137.120"} |
| c93fd5a7-d672-4b0c-8f2e-6e74f487e45d | private_subnet   | 10.0.0.0/24      | {"start": "10.0.0.2", "end": "10.0.0.254"}             |
+--------------------------------------+------------------+------------------+--------------------------------------------------------+
[root@rdoicehouse ~(keystone_admin)]# neutron subnet-delete d50e28f7-47ee-4bdf-8594-e1108f25586b
409-{u'NeutronError': {u'message': u'Unable to complete operation on subnet d50e28f7-47ee-4bdf-8594-e1108f25586b. One or more ports have an IP allocation from this subnet.', u'type': u'SubnetInUse', u'detail': u''}}

[root@rdoicehouse ~(keystone_admin)]# neutron port-list
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                              |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+
| 4655e13a-9767-4750-8f44-4eee8410ca70 |      | fa:16:3e:03:c7:cf | {"subnet_id": "d50e28f7-47ee-4bdf-8594-e1108f25586b", "ip_address": "192.168.137.103"} |
| 767f2f83-f99a-46d1-b2c2-2e47bae4bb90 |      | fa:16:3e:ff:94:28 | {"subnet_id": "d50e28f7-47ee-4bdf-8594-e1108f25586b", "ip_address": "192.168.137.102"} |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+

[root@rdoicehouse ~(keystone_admin)]# neutron port-delete 767f2f83-f99a-46d1-b2c2-2e47bae4bb90
Deleted port: 767f2f83-f99a-46d1-b2c2-2e47bae4bb90

[root@rdoicehouse ~(keystone_admin)]# neutron port-delete 4655e13a-9767-4750-8f44-4eee8410ca70
409-{u'NeutronError': {u'message': u'Port 4655e13a-9767-4750-8f44-4eee8410ca70 has owner network:floatingip and therefore cannot be deleted directly via the port API.', u'type': u'L3PortInUse', u'detail': u''}}

[root@rdoicehouse ~(keystone_admin)]# neutron floatingip-list
+--------------------------------------+------------------+---------------------+---------+
| id                                   | fixed_ip_address | floating_ip_address | port_id |
+--------------------------------------+------------------+---------------------+---------+
| 0a74679b-b469-4ae5-97a0-08c3aeeb2129 |                  | 192.168.137.103     |         |
+--------------------------------------+------------------+---------------------+---------+

[root@rdoicehouse ~(keystone_admin)]# neutron floatingip-delete 0a74679b-b469-4ae5-97a0-08c3aeeb2129
Deleted floatingip: 0a74679b-b469-4ae5-97a0-08c3aeeb2129

[root@rdoicehouse ~(keystone_admin)]# neutron port-list

[root@rdoicehouse ~(keystone_admin)]# neutron subnet-delete d50e28f7-47ee-4bdf-8594-e1108f25586b
Deleted subnet: d50e28f7-47ee-4bdf-8594-e1108f25586b

[root@rdoicehouse ~(keystone_admin)]# neutron net-list
+--------------------------------------+------------+--------------------------------------------------+
| id                                   | name       | subnets                                          |
+--------------------------------------+------------+--------------------------------------------------+
| 77dd5a93-b63e-44be-84d6-f6ef4fd8771b | private    | c93fd5a7-d672-4b0c-8f2e-6e74f487e45d 10.0.0.0/24 |
| 8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc | demodelete |                                                  |
+--------------------------------------+------------+--------------------------------------------------+
[root@rdoicehouse ~(keystone_admin)]# neutron net-delete 8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc
Deleted network: 8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc

[root@rdoicehouse ~(keystone_admin)]# neutron router-gateway-clear e34d94ad-7fe1-4704-8156-d255a2daa167 Removed gateway from router e34d94ad-7fe1-4704-8156-d255a2daa167

[root@rdoicehouse ~(keystone_admin)]# neutron router-port-list e34d94ad-7fe1-4704-8156-d255a2daa167

If Apply: [[ neutron router-interface-delete ]]

[root@rdoicehouse ~(keystone_admin)]# neutron router-delete e34d94ad-7fe1-4704-8156-d255a2daa167 Deleted router: e34d94ad-7fe1-4704-8156-d255a2daa167

[root@rdoicehouse ~(keystone_admin)]# neutron subnet-list +--------------------------------------+------------------+------------------+--------------------------------------------------------+ | id | name | cidr | allocation_pools | +--------------------------------------+------------------+------------------+--------------------------------------------------------+ | d50e28f7-47ee-4bdf-8594-e1108f25586b | demosubnetdelete | 192.168.137.0/24 | {"start": "192.168.137.100", "end": "192.168.137.120"} | | c93fd5a7-d672-4b0c-8f2e-6e74f487e45d | private_subnet | 10.0.0.0/24 | {"start": "10.0.0.2", "end": "10.0.0.254"} | +--------------------------------------+------------------+------------------+--------------------------------------------------------+ [root@rdoicehouse ~(keystone_admin)]# neutron subnet-delete d50e28f7-47ee-4bdf-8594-e1108f25586b 409-{u'NeutronError': {u'message': u'Unable to complete operation on subnet d50e28f7-47ee-4bdf-8594-e1108f25586b. One or more ports have an IP allocation from this subnet.', u'type': u'SubnetInUse', u'detail': u''}}

[root@rdoicehouse ~(keystone_admin)]# neutron port-list +--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+ | id | name | mac_address | fixed_ips | +--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+ | 4655e13a-9767-4750-8f44-4eee8410ca70 | | fa:16:3e:03:c7:cf | {"subnet_id": "d50e28f7-47ee-4bdf-8594-e1108f25586b", "ip_address": "192.168.137.103"} | | 767f2f83-f99a-46d1-b2c2-2e47bae4bb90 | | fa:16:3e:ff:94:28 | {"subnet_id": "d50e28f7-47ee-4bdf-8594-e1108f25586b", "ip_address": "192.168.137.102"} | +--------------------------------------+------+-------------------+----------------------------------------------------------------------------------------+

[root@rdoicehouse ~(keystone_admin)]# neutron port-delete 767f2f83-f99a-46d1-b2c2-2e47bae4bb90 Deleted port: 767f2f83-f99a-46d1-b2c2-2e47bae4bb90

[root@rdoicehouse ~(keystone_admin)]# neutron port-delete 4655e13a-9767-4750-8f44-4eee8410ca70 409-{u'NeutronError': {u'message': u'Port 4655e13a-9767-4750-8f44-4eee8410ca70 has owner network:floatingip and therefore cannot be deleted directly via the port API.', u'type': u'L3PortInUse', u'detail': u''}}

[root@rdoicehouse ~(keystone_admin)]# neutron floatingip-list +--------------------------------------+------------------+---------------------+---------+ | id | fixed_ip_address | floating_ip_address | port_id | +--------------------------------------+------------------+---------------------+---------+ | 0a74679b-b469-4ae5-97a0-08c3aeeb2129 | | 192.168.137.103 | | +--------------------------------------+------------------+---------------------+---------+

[root@rdoicehouse ~(keystone_admin)]# neutron floatingip-delete 0a74679b-b469-4ae5-97a0-08c3aeeb2129 Deleted floatingip: 0a74679b-b469-4ae5-97a0-08c3aeeb2129

[root@rdoicehouse ~(keystone_admin)]# neutron port-list

[root@rdoicehouse ~(keystone_admin)]# neutron subnet-delete d50e28f7-47ee-4bdf-8594-e1108f25586b Deleted subnet: d50e28f7-47ee-4bdf-8594-e1108f25586b

[root@rdoicehouse ~(keystone_admin)]# neutron net-list +--------------------------------------+------------+--------------------------------------------------+ | id | name | subnets | +--------------------------------------+------------+--------------------------------------------------+ | 77dd5a93-b63e-44be-84d6-f6ef4fd8771b | private | c93fd5a7-d672-4b0c-8f2e-6e74f487e45d 10.0.0.0/24 | | 8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc | demodelete | | +--------------------------------------+------------+--------------------------------------------------+ [root@rdoicehouse ~(keystone_admin)]# neutron net-delete 8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc Deleted network: 8b2ceda2-4d77-4c5c-ae21-6a7ba133e4fc

PreviousOpenStack nova API start error

Last updated 5 years ago

Was this helpful?