分享

Openstack 网络问题

yefeng245 发表于 2015-1-23 15:35:24 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 11057
今天创建了一个网络root@ubuntu:/# nova network-list +--------------------------------------+-------+------------------+
| ID                                   | Label | Cidr             |
+--------------------------------------+-------+------------------+
| cc022683-a9d3-4c31-8471-9fda8e5d6694 | net1  | 192.168.110.0/24 |
+--------------------------------------+-------+------------------+
之后创建了一个instance,然后执行了
root@ubuntu:/# nova delete 85cbfb49-2cb8-4470-b864-7bd2db94673a
Request to delete server 85cbfb49-2cb8-4470-b864-7bd2db94673a has been accepted.:
状态一直就是deleting:
root@ubuntu:/# nova list
+--------------------------------------+-----------+--------+------------+-------------+--------------------+
| ID                                   | Name      | Status | Task State | Power State | Networks           |
+--------------------------------------+-----------+--------+------------+-------------+--------------------+
| 85cbfb49-2cb8-4470-b864-7bd2db94673a | instance1 | ERROR  | deleting   | NOSTATE     | net1=192.168.110.3 |
+--------------------------------------+-----------+--------+------------+-------------+--------------------+


然后尝试删除net1:
root@ubuntu:/# nova network-delete cc022683-a9d3-4c31-8471-9fda8e5d6694
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-19c8124c-8dad-4ffb-96a1-6cdf991cd977)


之后实在解决不了问题了,我就试着重启了虚拟机:
然后NOVA的服务就变成这样了:
root@ubuntu:/# nova service-list
+----+------------------+--------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host   | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+--------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-scheduler   | ubuntu | internal | enabled | down  | 2015-01-23T04:21:49.000000 | -               |
| 2  | nova-conductor   | ubuntu | internal | enabled | up    | 2015-01-23T07:13:01.000000 | -               |
| 3  | nova-compute     | ubuntu | nova     | enabled | up    | 2015-01-23T07:13:08.000000 | -               |
| 4  | nova-cert        | ubuntu | internal | enabled | down  | 2015-01-23T04:21:57.000000 | -               |
| 5  | nova-consoleauth | ubuntu | internal | enabled | up    | 2015-01-23T07:13:02.000000 | -               |
| 6  | nova-network     | ubuntu | internal | enabled | down  | 2015-01-23T02:56:56.000000 | -               |
+----+------------------+--------+----------+---------+-------+----------------------------+-----------------+


报错的日志为:Stderr: u'Cannot find device "192.168.110.1"\n'


想请各位大神问我改如何才能删除自己创建的instance和net1


已有(3)人评论

跳转到指定楼层
muyannian 发表于 2015-1-23 16:47:52
命令都是假删除,想真正删除,到数据库里找找
回复

使用道具 举报

徐超 发表于 2015-1-23 19:44:06
本帖最后由 徐超 于 2015-1-23 19:48 编辑

下面是举个列子

如果 nova-manage network list 发现有以前留下的网络需要 delete 掉,删除所有以前残留的网络然后重新创建一个
172.16.38.0/23 新网络:
$ sudo nova-manage network delete 192.168.3.0/24 1 255
$ sudo nova-manage network create 172.16.38.0/23 1 512
$ sudo nova-manage network list
network            netmask         start address   DNS            
172.16.38.0/23     255.255.254.0   172.16.38.2     8.8.4.4

[root@station140 ~(keystone_admin)]# nova help | grep float  
    add-floating-ip     Add a floating IP address to a server.  
    floating-ip-bulk-create  
                        Bulk create floating ips by range.  
    floating-ip-bulk-delete  
                        Bulk delete floating ips by range.  
    floating-ip-bulk-list  
                        List all floating ips.  
    floating-ip-create  Allocate a floating IP for the current tenant.  
    floating-ip-delete  De-allocate a floating IP.  
    floating-ip-list    List floating ips for this tenant.  
    floating-ip-pool-list  
                        List all floating ip pools.  
    remove-floating-ip  Remove a floating IP address from a server.  
生成 浮动 IP
[root@station140 ~(keystone_admin)]# nova floating-ip-create pub1  
+----------------+-------------+----------+------+  
| Ip             | Instance Id | Fixed Ip | Pool |  
+----------------+-------------+----------+------+  
| 192.168.48.143 | None        | None     | pub1 |  
+----------------+-------------+----------+------+  
分配
[root@station140 ~(network_admin)]# nova add-floating-ip terry_instance1 192.168.48.143  

查询浮动 IP 分配情况
[root@station140 ~(keystone_admin)]# nova floating-ip-list  
+----------------+--------------------------------------+-----------+------+  
| Ip             | Instance Id                          | Fixed Ip  | Pool |  
+----------------+--------------------------------------+-----------+------+  
| 192.168.48.143 | 93d0c9c1-b38b-4fe3-9ae3-400f43276f60 | 10.0.0.50 | pub1 |  
+----------------+--------------------------------------+-----------+------+  
移除浮动 IP
[root@station140 ~(keystone_admin)]# nova floating-ip-delete 192.168.48.143  

回复

使用道具 举报

yefeng245 发表于 2015-1-24 14:07:46
muyannian 发表于 2015-1-23 16:47
命令都是假删除,想真正删除,到数据库里找找

谢谢,最后就是通过数据库里面删除搞定的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条