Difference between revisions of "Deleting a public network in openstack"
Jump to navigation
Jump to search
(Created page with "<syntaxhighlight> [david@hairybacon vscaler]$ cat delete-a-network.txt # clean out a user profile source vscaler-openrc.sh # delete instances nova list nova delete cc7884dc-b24f-4ce0...") |
(No difference)
|
Latest revision as of 09:58, 8 January 2018
[david@hairybacon vscaler]$ cat delete-a-network.txt
# clean out a user profile
source vscaler-openrc.sh
# delete instances
nova list
nova delete cc7884dc-b24f-4ce0-81b4-f6c54bcd8cc7# delete the ports
# delete ports
[root@head ~]# neutron port-list
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+
| 461349e7-08db-49f4-8cad-99a9135c000d | | fa:16:3e:17:06:90 | {"subnet_id": "8a1924bb-03d5-4ae8-90c7-9422eaf50bd6", "ip_address": "172.16.1.2"} |
| 735d2194-1054-47ec-a309-191eccda36cc | | fa:16:3e:6a:ad:06 | {"subnet_id": "8a1924bb-03d5-4ae8-90c7-9422eaf50bd6", "ip_address": "172.16.1.1"} |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+
[root@head ~]# neutron port-delete 461349e7-08db-49f4-8cad-99a9135c000d
Deleted port: 461349e7-08db-49f4-8cad-99a9135c000d
[root@head ~]# neutron port-delete 735d2194-1054-47ec-a309-191eccda36cc
Port 735d2194-1054-47ec-a309-191eccda36cc cannot be deleted directly via the port API: has device owner network:router_interface
# let delete the ports on the router so
[root@head ~]# neutron router-list
+--------------------------------------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | name | external_gateway_info |
+--------------------------------------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 60eba715-5a1c-4178-9da4-db55b34ed42f | router | {"network_id": "ca4c0ab1-9ffd-413b-9809-51017b553f7d", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "7a01af22-cf63-4ee9-9cac-aa96a7508e2b", "ip_address": "160.5.169.59"}]} |
+--------------------------------------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[root@head ~]# neutron router-delete 60eba715-5a1c-4178-9da4-db55b34ed42f
Router 60eba715-5a1c-4178-9da4-db55b34ed42f still has ports
# we'll need to clear the gateway if one exists (If the router is attached to any given network, and has a gateway set, first the gateway needs to be cleared and no ports should be in use. Then we can delete the Router.)
[root@head ~]# neutron router-show 60eba715-5a1c-4178-9da4-db55b34ed42f
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | True |
| external_gateway_info | {"network_id": "ca4c0ab1-9ffd-413b-9809-51017b553f7d", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "7a01af22-cf63-4ee9-9cac-aa96a7508e2b", "ip_address": "160.5.169.59"}]} |
| id | 60eba715-5a1c-4178-9da4-db55b34ed42f |
| name | router |
| routes | |
| status | ACTIVE |
| tenant_id | 63353742c16b44e0a8245b2d61bed075 |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
[root@head ~]# neutron router-gateway-clear 60eba715-5a1c-4178-9da4-db55b34ed42f
Removed gateway from router 60eba715-5a1c-4178-9da4-db55b34ed42f
[root@head ~]# neutron router-port-list 60eba715-5a1c-4178-9da4-db55b34ed42f
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+
| 735d2194-1054-47ec-a309-191eccda36cc | | fa:16:3e:6a:ad:06 | {"subnet_id": "8a1924bb-03d5-4ae8-90c7-9422eaf50bd6", "ip_address": "172.16.1.1"} |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+
[root@head ~]# neutron subnet-list
+--------------------------------------+---------+-----------------+--------------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+---------+-----------------+--------------------------------------------------+
| 7a01af22-cf63-4ee9-9cac-aa96a7508e2b | public | 160.5.169.32/27 | {"start": "160.5.169.47", "end": "160.5.169.51"} |
| | | | {"start": "160.5.169.33", "end": "160.5.169.40"} |
| | | | {"start": "160.5.169.53", "end": "160.5.169.61"} |
| 8a1924bb-03d5-4ae8-90c7-9422eaf50bd6 | private | 172.16.1.0/24 | {"start": "172.16.1.2", "end": "172.16.1.254"} |
+--------------------------------------+---------+-----------------+--------------------------------------------------+
[root@head ~]# neutron router-interface-delete 60eba715-5a1c-4178-9da4-db55b34ed42f 8a1924bb-03d5-4ae8-90c7-9422eaf50bd6
Removed interface from router 60eba715-5a1c-4178-9da4-db55b34ed42f.
[root@head ~]# neutron router-port-list 60eba715-5a1c-4178-9da4-db55b34ed42f
[root@head ~]# neutron router-delete 60eba715-5a1c-4178-9da4-db55b34ed42f
Deleted router: 60eba715-5a1c-4178-9da4-db55b34ed42f
[root@head ~]# neutron router-list
[root@head ~]#
# now we can delete the public net as admin
[root@head ~]# source admin-openrc.sh
[root@head ~]# neutron net-list
+--------------------------------------+---------+------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+------------------------------------------------------+
| ca4c0ab1-9ffd-413b-9809-51017b553f7d | public | 7a01af22-cf63-4ee9-9cac-aa96a7508e2b 160.5.169.32/27 |
| e72f1ccb-45df-443d-982d-8084786e3a36 | private | 8a1924bb-03d5-4ae8-90c7-9422eaf50bd6 172.16.1.0/24 |
+--------------------------------------+---------+------------------------------------------------------+
[root@head ~]# neutron router-list
[root@head ~]# neutron net-delete ca4c0ab1-9ffd-413b-9809-51017b553f7d
Deleted network: ca4c0ab1-9ffd-413b-9809-51017b553f7d
[root@head ~]# neutron subnet-list
+--------------------------------------+---------+---------------+------------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+---------+---------------+------------------------------------------------+
| 8a1924bb-03d5-4ae8-90c7-9422eaf50bd6 | private | 172.16.1.0/24 | {"start": "172.16.1.2", "end": "172.16.1.254"} |
+--------------------------------------+---------+---------------+------------------------------------------------+
[root@head ~]# neutron net-list
+--------------------------------------+---------+----------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+----------------------------------------------------+
| e72f1ccb-45df-443d-982d-8084786e3a36 | private | 8a1924bb-03d5-4ae8-90c7-9422eaf50bd6 172.16.1.0/24 |
+--------------------------------------+---------+----------------------------------------------------+
[david@hairybacon vscaler]$