OpenStack neutron删除网络设备出错解决办法
目标:要删除外网Ext-Net2
直接删网络也会出错:因为有一个或多个端口在使用该网络
root@controller:~# neutron net-list
+--------------------------------------+-------------+----------------------------------------------------+
| id | name | subnets |
+--------------------------------------+-------------+----------------------------------------------------+
| 739485b6-bc45-4a53-953d-f3c4cb07f601 | Ext-Net2 | ef86e785-8cec-486a-b67f-dcbba5311293 10.100.0.0/24 |
| 7c22bbd9-166c-4610-9a3d-3b8b92c77518 | tenantA-Net | c37d8ed0-372e-4b24-9ba2-897c38c6ddbf 10.0.0.0/24 |
| c8699820-7c6d-4441-9602-3425f2c630ec | Ext-Net | 2c4155c9-5a2e-471c-a4d8-40a86b45ab0a 10.1.101.0/24 |
+--------------------------------------+-------------+----------------------------------------------------+
root@controller:~# neutron net-delete 739485b6-bc45-4a53-953d-f3c4cb07f601
Unable to complete operation on network 739485b6-bc45-4a53-953d-f3c4cb07f601. There are one or more ports still in use on the network.
查看子网:删除子网会出错:一个或多个端口用了这个子网分配的浮动IP。
root@controller:~# neutron subnet-list
+--------------------------------------+-----------------+---------------+--------------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+-----------------+---------------+--------------------------------------------------+
| 2c4155c9-5a2e-471c-a4d8-40a86b45ab0a | | 10.1.101.0/24 | {"start": "10.1.101.80", "end": "10.1.101.100"} |
| c37d8ed0-372e-4b24-9ba2-897c38c6ddbf | | 10.0.0.0/24 | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| ef86e785-8cec-486a-b67f-dcbba5311293 | subNet-Ext-Net2 | 10.100.0.0/24 | {"start": "10.100.0.100", "end": "10.100.0.120"} |
+--------------------------------------+-----------------+---------------+--------------------------------------------------+
root@controller:~# neutron subnet-delete ef86e785-8cec-486a-b67f-dcbba5311293
409-{u'NeutronError': {u'message': u'Unable to complete operation on subnet ef86e785-8cec-486a-b67f-dcbba5311293. One or more ports have an IP allocation from this subnet.', u'type': u'SubnetInUse', u'detail': u''}}
直接删port会出错,因为端口有浮点IP所以不能直接删除
root@controller:~# neutron port-list
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| 1653ec91-ad7d-40d9-b777-f74aec697026 | | fa:16:3e:51:a2:97 | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.9"} |
| 2df7c3ed-dfbb-480d-9cd3-fdefa079e66a | | fa:16:3e:da:41:49 | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.3"} |
| 81388454-30e0-45e4-b3dd-b7b2e8dbf067 | | fa:16:3e:f7:e6:9c | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.1"} |
| accd8dbf-0f16-4aec-b797-bbb33abcdc83 | | fa:16:3e:97:ee:cb | {"subnet_id": "ef86e785-8cec-486a-b67f-dcbba5311293", "ip_address": "10.100.0.103"} |
| bfe7eaa4-26bc-4fe9-9da2-550abf44beaa | | fa:16:3e:e1:00:41 | {"subnet_id": "2c4155c9-5a2e-471c-a4d8-40a86b45ab0a", "ip_address": "10.1.101.83"} |
| d7233b80-9d4b-4ef6-a60d-19b3be661069 | | fa:16:3e:75:e0:5a | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.10"} |
| eb60f9c4-2ddb-49ee-8b78-2fc2564a7600 | | fa:16:3e:78:39:e9 | {"subnet_id": "2c4155c9-5a2e-471c-a4d8-40a86b45ab0a", "ip_address": "10.1.101.80"} |
| f6812a11-c4ce-4880-8566-2206afcc612a | | fa:16:3e:9e:75:a2 | {"subnet_id": "2c4155c9-5a2e-471c-a4d8-40a86b45ab0a", "ip_address": "10.1.101.82"} |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
root@controller:~# neutron port-delete accd8dbf-0f16-4aec-b797-bbb33abcdc83
409-{u'NeutronError': {u'message': u'Port accd8dbf-0f16-4aec-b797-bbb33abcdc83 has owner network:floatingip and therefore cannot be deleted directly via the port API.', u'type': u'L3PortInUse', u'detail': u''}}
但是却查不到浮动IP
root@controller:~# nova floating-ip-list
+----+-----------+----------+------+
| Ip | Server Id | Fixed Ip | Pool |
+----+-----------+----------+------+
+----+-----------+----------+------+
root@controller:~# nova floating-ip-delete 10.100.0.103
ERROR: Floating ip 10.100.0.103 not found.
解除绑定浮动IP:这样做也不可行,因为这个ID不是虚拟机的ID。
root@controller:~# neutron port-list
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| 1653ec91-ad7d-40d9-b777-f74aec697026 | | fa:16:3e:51:a2:97 | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.9"} |
| 2df7c3ed-dfbb-480d-9cd3-fdefa079e66a | | fa:16:3e:da:41:49 | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.3"} |
| 81388454-30e0-45e4-b3dd-b7b2e8dbf067 | | fa:16:3e:f7:e6:9c | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.1"} |
| accd8dbf-0f16-4aec-b797-bbb33abcdc83 | | fa:16:3e:97:ee:cb | {"subnet_id": "ef86e785-8cec-486a-b67f-dcbba5311293", "ip_address": "10.100.0.103"} |
| bfe7eaa4-26bc-4fe9-9da2-550abf44beaa | | fa:16:3e:e1:00:41 | {"subnet_id": "2c4155c9-5a2e-471c-a4d8-40a86b45ab0a", "ip_address": "10.1.101.83"} |
| d7233b80-9d4b-4ef6-a60d-19b3be661069 | | fa:16:3e:75:e0:5a | {"subnet_id": "c37d8ed0-372e-4b24-9ba2-897c38c6ddbf", "ip_address": "10.0.0.10"} |
| eb60f9c4-2ddb-49ee-8b78-2fc2564a7600 | | fa:16:3e:78:39:e9 | {"subnet_id": "2c4155c9-5a2e-471c-a4d8-40a86b45ab0a", "ip_address": "10.1.101.80"} |
| f6812a11-c4ce-4880-8566-2206afcc612a | | fa:16:3e:9e:75:a2 | {"subnet_id": "2c4155c9-5a2e-471c-a4d8-40a86b45ab0a", "ip_address": "10.1.101.82"} |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
root@controller:~# nova floating-ip-disassociate accd8dbf-0f16-4aec-b797-bbb33abcdc83 10.100.0.103
ERROR: No server with a name or ID of 'accd8dbf-0f16-4aec-b797-bbb33abcdc83' exists.
通过horizon查看,发现该浮动IP,没有被分配,但是用命令却查不到
root@controller:~# nova --os-tenant-name TenantA --os-username UserA --os-password password --os-auth-url=http://localhost:5000/v2.0 floating-ip-list
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-294eb77b-1615-46fb-93de-d10660a46b70)
没办法,只能手动从horizon释放掉浮动IP了。登录UserA,手动释放掉浮动IP10.100.0.3,现在就可以正常删除了。
现在删除Ext-Net2就没问题了。
root@controller:~# neutron net-list
+--------------------------------------+-------------+----------------------------------------------------+
| id | name | subnets |
+--------------------------------------+-------------+----------------------------------------------------+
| 739485b6-bc45-4a53-953d-f3c4cb07f601 | Ext-Net2 | ef86e785-8cec-486a-b67f-dcbba5311293 10.100.0.0/24 |
| 7c22bbd9-166c-4610-9a3d-3b8b92c77518 | tenantA-Net | c37d8ed0-372e-4b24-9ba2-897c38c6ddbf 10.0.0.0/24 |
| c8699820-7c6d-4441-9602-3425f2c630ec | Ext-Net | 2c4155c9-5a2e-471c-a4d8-40a86b45ab0a 10.1.101.0/24 |
+--------------------------------------+-------------+----------------------------------------------------+
root@controller:~# neutron net-delete 739485b6-bc45-4a53-953d-f3c4cb07f601
Deleted network: 739485b6-bc45-4a53-953d-f3c4cb07f601
总结:用admin删除网络时注意,admin看不到租户分配的浮动IP,所以得用租户登录释放掉浮动IP。
目标:删除租户的网络
root@sc-ctrl01:~# neutron net-list
+--------------------------------------+-------------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+-------------+-------------------------------------------------------+
| 3ccfd309-df88-4301-bd96-7f9852bec855 | TenantB-Net | aa4b016f-dbf2-435e-9388-57824ae2c235 192.168.0.0/24 |
| b009f565-10b5-407b-93e4-e187636cd99d | ext-net | ba2ddac5-5eaf-409a-a9c1-fdafd04d21d9 10.0.200.0/24 |
+--------------------------------------+-------------+-------------------------------------------------------+
root@sc-ctrl01:~# neutron net-delete TenantB-Net
Unable to complete operation on network 3ccfd309-df88-4301-bd96-7f9852bec855. There are one or more ports still in use on the network. (HTTP 409) (Request-ID: req-bcb58ccf-f95b-4a02-8f28-5384562dc0eb)
看一下子网
root@sc-ctrl01:~# neutron subnet-list
+--------------------------------------+--------------------+------------------+------------------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+--------------------+------------------+------------------------------------------------------+
| aa4b016f-dbf2-435e-9388-57824ae2c235 | TenantB-Net-SubNet | 192.168.0.0/24 | {"start": "192.168.0.2", "end": "192.168.0.254"} |
| ba2ddac5-5eaf-409a-a9c1-fdafd04d21d9 | ext-subnet | 10.0.200.0/24 | {"start": "10.0.200.100", "end": "10.0.200.250"} |
| 7fa4a398-b67b-462b-a9b3-c65802952f79 | sub_lxp_net | 192.168.1.0/24 | {"start": "192.168.1.150", "end": "192.168.1.200"} |
| 2e985c9f-3668-417f-8b40-d7f551e668c0 | sub_lxp_net2 | 192.168.100.0/24 | {"start": "192.168.100.1", "end": "192.168.100.254"} |
+--------------------------------------+--------------------+------------------+------------------------------------------------------+
root@sc-ctrl01:~# neutron port-list
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+
| 6d0ec7ba-37e8-4784-8076-b2e39c3b8f00 | | fa:16:3e:8b:62:98 | {"subnet_id": "2e985c9f-3668-417f-8b40-d7f551e668c0", "ip_address": "192.168.100.3"} |
| 7915e60f-a4d6-4f2c-875b-b402f8828571 | | fa:16:3e:54:f1:51 | {"subnet_id": "2e985c9f-3668-417f-8b40-d7f551e668c0", "ip_address": "192.168.100.1"} |
| 963ceaa8-3750-449b-bebd-3f8e89e6dd0d | | fa:16:3e:96:29:98 | {"subnet_id": "7fa4a398-b67b-462b-a9b3-c65802952f79", "ip_address": "192.168.1.150"} |
| a56330b4-3409-4b40-aadf-b0f2302b2c16 | | fa:16:3e:be:c9:54 | {"subnet_id": "2e985c9f-3668-417f-8b40-d7f551e668c0", "ip_address": "192.168.100.2"} |
| b7792c1a-d284-494c-b1b8-8609f33957c3 | | fa:16:3e:1d:c1:d1 | {"subnet_id": "aa4b016f-dbf2-435e-9388-57824ae2c235", "ip_address": "192.168.0.1"} |
| cdabb78e-11f1-4b0d-ab4d-59abba4c0ab1 | | fa:16:3e:1e:32:7f | {"subnet_id": "ba2ddac5-5eaf-409a-a9c1-fdafd04d21d9", "ip_address": "10.0.200.100"} |
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+
root@sc-ctrl01:~# neutron port-delete b7792c1a-d284-494c-b1b8-8609f33957c3
Port b7792c1a-d284-494c-b1b8-8609f33957c3 has owner network:router_interface and therefore cannot be deleted directly via the port API. (HTTP 409) (Request-ID: req-500d34ea-9cdc-4566-b931-25fb934d9864)
要删port,先看路由
root@sc-ctrl01:~# neutron router-list
+--------------------------------------+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
| id | name | external_gateway_info | distributed | ha |
+--------------------------------------+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
| 9a5054d7-35a4-441f-a0fb-d5bf7070edc7 | TenantB-Router | {"network_id": "b009f565-10b5-407b-93e4-e187636cd99d", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "ba2ddac5-5eaf-409a-a9c1-fdafd04d21d9", "ip_address": "10.0.200.100"}]} | False | False |
+--------------------------------------+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
root@sc-ctrl01:~# neutron router-delete TenantB-Router
Router 9a5054d7-35a4-441f-a0fb-d5bf7070edc7 still has ports (HTTP 409) (Request-ID: req-282fe122-4cab-4595-9f63-825ad81f13b9)
路由接着外网和私网的子网。
所以先删路由上的网关
root@sc-ctrl01:~# neutron router-gateway-clear TenantB-Router
Removed gateway from router TenantB-Router
再删路由上的接口,删除某个路由的某个接口
root@sc-ctrl01:~# neutron router-interface-delete TenantB-Router TenantB-Net-SubNet
Removed interface from router TenantB-Router.
root@sc-ctrl01:~#
port是关联路由和子网的。所以清掉路由上的接口,那port就没有了。
root@sc-ctrl01:~# neutron router-delete TenantB-Router
Deleted router: TenantB-Router
接着删子网
root@sc-ctrl01:~# neutron subnet-delete TenantB-Net-SubNet
Deleted subnet: TenantB-Net-SubNet
最后网络就可以删掉了
root@sc-ctrl01:~# neutron net-delete TenantB-Net
Deleted network: TenantB-Net
OpenStack neutron删除网络设备出错解决办法的更多相关文章
- 黄聪:C#使用Application.Restart重启程序出错解决办法
调用 Application.Restart重启程序出错 解决办法,就是给程序的.exe文件,加上下面的设置
- npm中npm install 始终出错解决办法
npm中npm install 始终出错解决办法 错误信息: C:\Windows\System32>npm install -g gulp npm ERR! Windows_NT 6.1.76 ...
- 安装openstack同步数据库时出错解决方法
错误提示:(2003, "Can't connect to MySQL server on 'controller' ([Errno -2] Name or service not know ...
- ARM64平台编译stream、netperf出错解决办法 解决办法:指定编译平台为alpha [root@localhost netperf-2.6.0]# ./configure –build=alpha
ARM64平台编译stream.netperf出错解决办法 http://ilinuxkernel.com/?p=1738 stream编译出错信息: [root@localhost stream]# ...
- dpkg:处理 xxx (--configure)时出错解决办法,也可用于卸载软件出错的情况
dpkg:处理 xxx (--configure)时出错解决办法今早安装nfs时出现问题,找到该文,备份留用.然后在网上找到了这片文章,按步骤走就解决了,中间会提示自动卸载一下,执行那个命令就好了,我 ...
- ORBSLAM2与OPENCV3.1.0出错解决办法
用opencv3.1.0做ORBSLAM2运行一下命令时cd ORB_SLAM2 chmod +x build.sh ./build.sh出错:/usr/bin/ld: CMakeFiles/mono ...
- iTunes.exe 在win7系统中运行出错解决办法
重新安装了iTunes打开后就报错,然后直接退出 查windows日志提示错误应用程序名称: iTunes.exe 错误模块名称: KERNELBASE.dll 重新安装iTunes问题依旧,后来在G ...
- Maven引入hadoop依赖包出错解决办法
错误: ArtifactTransferException: Failure to transfer org.apache.hadoop:hadoop-hdfs:jar:2.6.0 from http ...
- Windows下文件或文件夹不能删除时的解决办法
windows在删除文件或文件夹时,提示文件或文件夹被占用而无法删除 解决办法:win7: winxp:需要借助第三方工具Unlocker.360.Process Explorer(这个是微软支持的) ...
随机推荐
- 关于VS2010中的TraceDebugging文件夹浅说
最近一段时间发现C盘莫名其妙的变小了,各种清理各种卸载还是没有.最后只能一个文件夹一个文件夹的找,最后针对“C:\ProgramData”(win7系统)文件夹,发现这个文件夹有3.9GB大小.然后一 ...
- sql apply
可以给表值函数传column,而join不可以
- ahjesus ubuntu10.4安装ruby2.1.1
sudo apt-get install python-software-properties sudo apt-add-repository ppa:brightbox/ruby-ng sudo a ...
- JSON详解 .net
之前json掌握的不好,浪费了好多时间在查找一些json有关的转换问题,我所知道的方法只有把json序列化和反序列化一下,但是太麻烦了我觉得,所以就在找一些更简单又方便使用的方法.也许这个会有用吧,所 ...
- Bootstrap-用ICheck插件给CheckBox换新装
直接来吧! 下面是添加上复选框以后的树形菜单效果: 这样看起来有种驴唇不对马嘴的感觉. 所以就要想办法给这些复选框添加1些样式,让全部界面看起来搭配1些. 通过查询得知,有个叫ICheck的第3方Bo ...
- javascript数组浅谈2
上次说了数组元素的增删,的这次说说数组的一些操作方法 join()方法: ,,] arr.join("_") //1_2_3 join方法会返回一个由数组中每个值的字符串形式拼接而 ...
- MySQL到MsSQL的迁移工具——SSMA
SQL Server迁移助手(SSMA)团队开发了针对MySQL的迁移助手Microsoft SQL Server Migration Assistant 2008 for MySQL.微软同时发布了 ...
- GridControl列自动匹配宽度
//自动调整所有字段宽度this.gridView1.BestFitColumns(); //调整某列字段宽度this.gridView1.Columns[n].BestFit(); 大多是网上零散找 ...
- Microsoft Dynamics 2013 --Social Pane
Microsoft Dynamics 2013 有一个新的东西--Social Pane (图1) 进入窗体设置,发现改选项卡的详细设置如下 (图2) Tab键的选项有3种[活动][公告][注释],若 ...
- 在 SharePoint Server 2013 中配置建议和使用率事件类型
http://technet.microsoft.com/zh-cn/library/jj715889.aspx 适用于: SharePoint Server 2013 利用使用事件,您可以跟踪用户与 ...