今天创建了一个网络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)
[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