在 OpenStack 中重用分离的浮动 IP [英] Reuse detached floating IPs in OpenStack

查看:59
本文介绍了在 OpenStack 中重用分离的浮动 IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何命令可以从池中获取已创建的浮动 IP,并且不再分配给任何 VM 实例?

Is there any command to get already created floating IPs from a pool and which aren't assigned anymore to any VM instance ?

这是我的用例:

  1. 我创建了一个浮动 IP 并使用以下命令将其分配给虚拟机:
    • nova浮动ip创建[MyPool]
    • nova add-floating-ip [MyVM] [created_ip]
  • 池 MyPool 中不再有浮动 ips

推荐答案

openstack floating ip list -f json | jq  '.[] | select(.["Fixed IP Address"] == null ) | .["Floating IP Address"] '

这可能会奏效.我从 StackOverflow 本身得到了这个命令.请检查,如果工作正常,很好,否则 Python 代码将发挥所需的作用.

This may work. I got this command from StackOverflow itself. Kindly check, if working, well and good, else Python code will do the magic required.

这篇关于在 OpenStack 中重用分离的浮动 IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆