instance和network的连接关系:

在neutron数据库中,ports存储了instance和端口的关系,其中device_id表示了instance的id,在nova数据库中的instances表能够查到相应的instance,还有网卡信息,如果一个机器有多个网卡,还能用mac_address信息的做key。
在ipallocations表中存储了port和网络的对应关系及分配的ip信息
在floatingips表中存储了floating ip 分配的信息

MariaDB [neutron]> select * from ports;
+----------------------------------+--------------------------------------+------+--------------------------------------+-------------------+----------------+--------+-------------------------------------------------------------------------------+--------------------------+
| tenant_id | id | name | network_id | mac_address | admin_state_up | status | device_id | device_owner |
+----------------------------------+--------------------------------------+------+--------------------------------------+-------------------+----------------+--------+-------------------------------------------------------------------------------+--------------------------+
| de8f43bfe4244a1aa315a70a43248d60 | 08f40e39-b5a2-4dd2-b385-a397966eabd3 | | 6d1096a0-8b22-4607-b392-137ae0072106 | fa:16:3e:e8:fb:db | 1 | ACTIVE | 86baaddc-3c3e-4687-87bc-2e22f53eb7ba | compute:nova |
| d67be6b4d9734ec0a3de1ae7c250db02 | 1697f536-6fb3-4a17-a379-6d5e640f661e | | e89e1697-ca8a-42e9-9cc1-5b0a6d24b307 | fa:16:3e:04:e6:bb | 1 | ACTIVE | e61af3e6-5d31-44aa-989f-bc4146dde42a | network:router_interface |
| | 1d0c2bbf-1513-4dec-8ec3-40803daec518 | | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | fa:16:3e:69:85:45 | 1 | N/A | dee22b07-440c-4752-bad7-ff5ba96d8973 | network:floatingip |
| d67be6b4d9734ec0a3de1ae7c250db02 | 20f1af00-df84-4264-b0fe-21b032dc5cd5 | | e89e1697-ca8a-42e9-9cc1-5b0a6d24b307 | fa:16:3e:be:10:10 | 1 | ACTIVE | reserved_dhcp_port | network:dhcp |
| 30ede715c60246069a1e1655d2746d6e | 2bfea5a2-fba6-450d-b2bc-6a6bc1c1580a | | 5afc8548-9d50-464d-a127-4c287657d332 | fa:16:3e:a1:c0:83 | 1 | ACTIVE | reserved_dhcp_port | network:dhcp |
| 41e63787b9a64db29a0a3845a2490aa5 | 3d2b1863-3654-40f6-8a80-05f9c895f566 | | 91bc583e-bd73-49ac-b3bf-6ec0f9416e7f | fa:16:3e:be:44:3c | 1 | ACTIVE | 834877ad-ca0f-4462-bc97-2657699e61c4 | network:router_interface |
| 761f503edd7541e6840138d91ffd3254 | 524116b4-29ed-41b9-ac66-a833e22a9b3c | | a441887d-77e8-42cb-9612-02afb4dbf500 | fa:16:3e:bf:58:1f | 1 | ACTIVE | dhcp7b60c1d9-602e-5110-8c89-a9475b89732c-a441887d-77e8-42cb-9612-02afb4dbf500 | network:dhcp |
| de8f43bfe4244a1aa315a70a43248d60 | 6268e0a4-dbaf-4e77-ac64-357d2e64b3af | | 6d1096a0-8b22-4607-b392-137ae0072106 | fa:16:3e:6b:23:2d | 1 | ACTIVE | reserved_dhcp_port | network:dhcp |
| | 6c57b5d5-6e96-47c9-afd4-56b189504566 | | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | fa:16:3e:06:e2:92 | 1 | ACTIVE | 3d8bf067-a4d3-44f8-84d6-f687231af340 | network:router_gateway |
| | 76690f67-6cb8-4727-946e-28108fb4ac04 | | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | fa:16:3e:a2:8d:d3 | 1 | ACTIVE | c66be488-ee93-4fed-b7e7-d0fb3a3b15b8 | network:router_gateway |
| de8f43bfe4244a1aa315a70a43248d60 | 7ee5d14d-9557-48e7-abbf-1195cefc47bd | | 6d1096a0-8b22-4607-b392-137ae0072106 | fa:16:3e:15:4a:b4 | 1 | ACTIVE | 39b71578-bcc1-4107-9402-156ee46ac219 | compute:nova |
| de8f43bfe4244a1aa315a70a43248d60 | 8ae777f1-a00f-420c-bcf3-73f7373c2637 | | 6d1096a0-8b22-4607-b392-137ae0072106 | fa:16:3e:4d:4c:22 | 1 | ACTIVE | 8fd34c9e-323b-40b0-8d8a-3976fd115074 | network:router_interface |
| | 99aeb320-b17d-4acd-8377-510b35aa45b8 | | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | fa:16:3e:71:66:c3 | 1 | ACTIVE | e61af3e6-5d31-44aa-989f-bc4146dde42a | network:router_gateway |
| 761f503edd7541e6840138d91ffd3254 | a3873458-f30b-413d-9cc8-6bfef04c11e8 | | a441887d-77e8-42cb-9612-02afb4dbf500 | fa:16:3e:82:33:96 | 1 | ACTIVE | 3d8bf067-a4d3-44f8-84d6-f687231af340 | network:router_interface |
| | daac2675-9b43-4ed0-abad-e4fb2c4f0b78 | | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | fa:16:3e:56:1a:a0 | 1 | ACTIVE | 8fd34c9e-323b-40b0-8d8a-3976fd115074 | network:router_gateway |
| 761f503edd7541e6840138d91ffd3254 | dafd73c2-eed1-45c0-a098-f62b09d34a09 | | a441887d-77e8-42cb-9612-02afb4dbf500 | fa:16:3e:24:dc:ea | 1 | ACTIVE | 78645fed-1376-4998-acd2-0e5d59507c59 | compute:None |
| 41e63787b9a64db29a0a3845a2490aa5 | db292066-4339-4fe5-bbf5-cc09d82a1b9e | | 91bc583e-bd73-49ac-b3bf-6ec0f9416e7f | fa:16:3e:35:0f:38 | 1 | ACTIVE | reserved_dhcp_port | network:dhcp |
| 30ede715c60246069a1e1655d2746d6e | f076a973-d245-4ce5-8d89-6d4e4caecc43 | | 5afc8548-9d50-464d-a127-4c287657d332 | fa:16:3e:56:c2:e8 | 1 | ACTIVE | c66be488-ee93-4fed-b7e7-d0fb3a3b15b8 | network:router_interface |
| | f74a22ce-ffef-484e-880a-562be539d1f1 | | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | fa:16:3e:01:80:b6 | 1 | ACTIVE | 834877ad-ca0f-4462-bc97-2657699e61c4 | network:router_gateway |
+----------------------------------+--------------------------------------+------+--------------------------------------+-------------------+----------------+--------+-------------------------------------------------------------------------------+--------------------------+
19 rows in set (0.00 sec)

MariaDB [neutron]> select * from networks;
+----------------------------------+--------------------------------------+-----------------+--------+----------------+--------+------+------------------+
| tenant_id | id | name | status | admin_state_up | shared | mtu | vlan_transparent |
+----------------------------------+--------------------------------------+-----------------+--------+----------------+--------+------+------------------+
| 30ede715c60246069a1e1655d2746d6e | 5afc8548-9d50-464d-a127-4c287657d332 | default_network | ACTIVE | 1 | 0 | 0 | NULL |
| de8f43bfe4244a1aa315a70a43248d60 | 6d1096a0-8b22-4607-b392-137ae0072106 | int | ACTIVE | 1 | 0 | 0 | NULL |
| 41e63787b9a64db29a0a3845a2490aa5 | 91bc583e-bd73-49ac-b3bf-6ec0f9416e7f | default_network | ACTIVE | 1 | 0 | 0 | NULL |
| 761f503edd7541e6840138d91ffd3254 | a441887d-77e8-42cb-9612-02afb4dbf500 | default_network | ACTIVE | 1 | 0 | 0 | NULL |
| de8f43bfe4244a1aa315a70a43248d60 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | ext | ACTIVE | 1 | 1 | 0 | NULL |
| d67be6b4d9734ec0a3de1ae7c250db02 | e89e1697-ca8a-42e9-9cc1-5b0a6d24b307 | default_network | ACTIVE | 1 | 0 | 0 | NULL |
+----------------------------------+--------------------------------------+-----------------+--------+----------------+--------+------+------------------+
6 rows in set (0.00 sec)

MariaDB [neutron]> select * from ipallocations ;
+--------------------------------------+---------------+--------------------------------------+--------------------------------------+
| port_id | ip_address | subnet_id | network_id |
+--------------------------------------+---------------+--------------------------------------+--------------------------------------+
| 08f40e39-b5a2-4dd2-b385-a397966eabd3 | 192.168.1.12 | dbef5acb-df7a-4f25-b181-0f1c582761cb | 6d1096a0-8b22-4607-b392-137ae0072106 |
| 1697f536-6fb3-4a17-a379-6d5e640f661e | 172.18.0.1 | 2de3d1b4-4b8b-4b6f-9556-118da5efd01d | e89e1697-ca8a-42e9-9cc1-5b0a6d24b307 |
| 1d0c2bbf-1513-4dec-8ec3-40803daec518 | 9.111.222.246 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c |
| 20f1af00-df84-4264-b0fe-21b032dc5cd5 | 172.18.0.2 | 2de3d1b4-4b8b-4b6f-9556-118da5efd01d | e89e1697-ca8a-42e9-9cc1-5b0a6d24b307 |
| 2bfea5a2-fba6-450d-b2bc-6a6bc1c1580a | 172.17.0.2 | 9cda92af-bd52-408f-9a53-c2764d9ba44f | 5afc8548-9d50-464d-a127-4c287657d332 |
| 3d2b1863-3654-40f6-8a80-05f9c895f566 | 172.19.0.1 | e2b98f15-b066-4481-8245-54d587c4fe0c | 91bc583e-bd73-49ac-b3bf-6ec0f9416e7f |
| 524116b4-29ed-41b9-ac66-a833e22a9b3c | 172.20.0.2 | 3d997f37-ef63-4612-aa7e-6ca03a2ad33a | a441887d-77e8-42cb-9612-02afb4dbf500 |
| 6268e0a4-dbaf-4e77-ac64-357d2e64b3af | 192.168.1.11 | dbef5acb-df7a-4f25-b181-0f1c582761cb | 6d1096a0-8b22-4607-b392-137ae0072106 |
| 6c57b5d5-6e96-47c9-afd4-56b189504566 | 9.111.222.244 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c |
| 76690f67-6cb8-4727-946e-28108fb4ac04 | 9.111.222.241 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c |
| 7ee5d14d-9557-48e7-abbf-1195cefc47bd | 192.168.1.15 | dbef5acb-df7a-4f25-b181-0f1c582761cb | 6d1096a0-8b22-4607-b392-137ae0072106 |
| 8ae777f1-a00f-420c-bcf3-73f7373c2637 | 192.168.1.1 | dbef5acb-df7a-4f25-b181-0f1c582761cb | 6d1096a0-8b22-4607-b392-137ae0072106 |
| 99aeb320-b17d-4acd-8377-510b35aa45b8 | 9.111.222.242 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c |
| a3873458-f30b-413d-9cc8-6bfef04c11e8 | 172.20.0.1 | 3d997f37-ef63-4612-aa7e-6ca03a2ad33a | a441887d-77e8-42cb-9612-02afb4dbf500 |
| daac2675-9b43-4ed0-abad-e4fb2c4f0b78 | 9.111.222.245 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c |
| dafd73c2-eed1-45c0-a098-f62b09d34a09 | 172.20.0.7 | 3d997f37-ef63-4612-aa7e-6ca03a2ad33a | a441887d-77e8-42cb-9612-02afb4dbf500 |
| db292066-4339-4fe5-bbf5-cc09d82a1b9e | 172.19.0.2 | e2b98f15-b066-4481-8245-54d587c4fe0c | 91bc583e-bd73-49ac-b3bf-6ec0f9416e7f |
| f076a973-d245-4ce5-8d89-6d4e4caecc43 | 172.17.0.1 | 9cda92af-bd52-408f-9a53-c2764d9ba44f | 5afc8548-9d50-464d-a127-4c287657d332 |
| f74a22ce-ffef-484e-880a-562be539d1f1 | 9.111.222.243 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c |
+--------------------------------------+---------------+--------------------------------------+--------------------------------------+
19 rows in set (0.00 sec)

MariaDB [neutron]> select * from subnets;
+----------------------------------+--------------------------------------+----------------+--------------------------------------+------------+----------------+-------------+-------------+--------+--------------+-------------------+---------------+
| tenant_id | id | name | network_id | ip_version | cidr | gateway_ip | enable_dhcp | shared | ipv6_ra_mode | ipv6_address_mode | subnetpool_id |
+----------------------------------+--------------------------------------+----------------+--------------------------------------+------------+----------------+-------------+-------------+--------+--------------+-------------------+---------------+
| d67be6b4d9734ec0a3de1ae7c250db02 | 2de3d1b4-4b8b-4b6f-9556-118da5efd01d | default_subnet | e89e1697-ca8a-42e9-9cc1-5b0a6d24b307 | 4 | 172.18.0.0/16 | 172.18.0.1 | 1 | 0 | NULL | NULL | NULL |
| de8f43bfe4244a1aa315a70a43248d60 | 3ce0480c-8548-449d-99b4-b9a3bb978a64 | ext-subnet | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | 4 | 9.111.222.0/24 | 9.111.222.1 | 0 | 1 | NULL | NULL | NULL |
| 761f503edd7541e6840138d91ffd3254 | 3d997f37-ef63-4612-aa7e-6ca03a2ad33a | default_subnet | a441887d-77e8-42cb-9612-02afb4dbf500 | 4 | 172.20.0.0/16 | 172.20.0.1 | 1 | 0 | NULL | NULL | NULL |
| 30ede715c60246069a1e1655d2746d6e | 9cda92af-bd52-408f-9a53-c2764d9ba44f | default_subnet | 5afc8548-9d50-464d-a127-4c287657d332 | 4 | 172.17.0.0/16 | 172.17.0.1 | 1 | 0 | NULL | NULL | NULL |
| de8f43bfe4244a1aa315a70a43248d60 | dbef5acb-df7a-4f25-b181-0f1c582761cb | int-subnet | 6d1096a0-8b22-4607-b392-137ae0072106 | 4 | 192.168.1.0/24 | 192.168.1.1 | 1 | 0 | NULL | NULL | NULL |
| 41e63787b9a64db29a0a3845a2490aa5 | e2b98f15-b066-4481-8245-54d587c4fe0c | default_subnet | 91bc583e-bd73-49ac-b3bf-6ec0f9416e7f | 4 | 172.19.0.0/16 | 172.19.0.1 | 1 | 0 | NULL | NULL | NULL |
+----------------------------------+--------------------------------------+----------------+--------------------------------------+------------+----------------+-------------+-------------+--------+--------------+-------------------+---------------+
6 rows in set (0.00 sec)

MariaDB [neutron]> select * from floatingips ;
+----------------------------------+--------------------------------------+---------------------+--------------------------------------+--------------------------------------+--------------------------------------+------------------+--------------------------------------+----------------------+--------+
| tenant_id | id | floating_ip_address | floating_network_id | floating_port_id | fixed_port_id | fixed_ip_address | router_id | last_known_router_id | status |
+----------------------------------+--------------------------------------+---------------------+--------------------------------------+--------------------------------------+--------------------------------------+------------------+--------------------------------------+----------------------+--------+
| de8f43bfe4244a1aa315a70a43248d60 | dee22b07-440c-4752-bad7-ff5ba96d8973 | 9.111.222.246 | c7af4bc4-a160-4a42-992a-cdfbd3dd707c | 1d0c2bbf-1513-4dec-8ec3-40803daec518 | 08f40e39-b5a2-4dd2-b385-a397966eabd3 | 192.168.1.12 | 8fd34c9e-323b-40b0-8d8a-3976fd115074 | NULL | ACTIVE |
+----------------------------------+--------------------------------------+---------------------+--------------------------------------+--------------------------------------+--------------------------------------+------------------+--------------------------------------+----------------------+--------+
1 row in set (0.00 sec)

MariaDB [neutron]>

openstack中虚拟机和其网络的联系方法 instance and network的更多相关文章

  1. OpenStack中虚拟机获取不到IP地址的解决方法

    OpenStack源码交流群: 538850354 系统环境: centos6.5 + icehouse多节点部署 问题描述: 使用测试镜像cirros,虚拟机实例可以正常启动,但是不能从IP池中获取 ...

  2. openstack中虚拟机怎么与物理机通信

    How-to-connection-ns-outside 环境配置 网络接口 vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE ...

  3. 也谈OpenStack中的虚拟机HA

    OpenStack是一个旨在为公共及私有云的建设与管理提供软件的开源项目. 它的社区拥有超过130家企业及1350位开发人员,这些机构与个人都将OpenStack作为基础设施即服务(IaaS)资源的通 ...

  4. 034-openstack中虚拟机启动后主机名设置问题

    openstack中虚拟机启动后主机名设置问题,在centos7中设置hostname后怎么都是原来的hostname,根本无效. 方法一: 在centos7中除了修改hosts文件和network文 ...

  5. 022-OpenStack 中虚拟机hostname问题

    第一种: openstack中直接使用 hostnamectl 修改主机名,主机名在内核中的信息会被立即修改,但是当系统重启之后,主机名又重新变成原来的主机名称了.openstack主机名由cloud ...

  6. Windows Azure 虚拟网络中虚拟机的网络隔离选项

     最近我们发布了一份<Windows网络安全白皮书>(单击此处下载),文中深入说明了客户可以如何利用该平台的本地功能,为他们的信息资产提供最好的保护. 由首席顾问Walter Myer ...

  7. openstack中使用linux_bridge实现vxlan网络

    openstack环境: 1 版本:ocata 2 系统:ubuntu16.04.2 3 控制节点 1个 + 计算节点 1个 4 控制节点网卡为ens33,ip = 172.171.5.200 ens ...

  8. 浅谈openstack中使用linux_bridge实现vxlan网络

    openstack环境: 1 版本:ocata 2 系统:ubuntu16.04.2 3 控制节点 1个 + 计算节点 1个 4 控制节点网卡为ens33,ip = 172.171.5.200 ens ...

  9. Vmare虚拟机中的3种网络连接方式

    安装完虚拟机后,默认安装了两个虚拟网卡,VMnet1和VMnet8,其他的未安装(当然也可以手动安装其他的). 其中: VMnet1是host网卡,用于host方式连接网络的. VMnet8是NAT网 ...

随机推荐

  1. Laravel 5 服务的注册和使用

    首先我们需要创建一个服务的类,比如叫CqhServiceProvider,最简单的方式就是用artisan来帮我们创建 php artisan make:provider CqhServiceProv ...

  2. IT人的自我导向型学习:开篇杂谈

    报考大学时,家人让我报的是计算机系,那个时候,普遍都认为读计算机专业的人将来不用愁找不到工作.为何得出这样的结论不得而知,但是在过去三十年中,的确有很多响当当赚了大钱的IT人在影响着我们. 顺利的考取 ...

  3. 使用Kibana 分析Nginx 日志并在 Dashboard上展示

    一.Kibana之Visualize 功能 在首页上Visualize 标签页用来设计可视化图形.你可以保存之前在discovery中的搜索来进行画图,然后保存该visualize,或者加载合并到 d ...

  4. 关于eclipse中MAVEN WEB工程中编译问题

    这几天是被java的环境搞疯了,我先是搭了一个spring+springmvc+mybatis的工程,在家里跑了一下,没有问题,把工程带到公司里用,却一直不能使用. 按常理来说,只要工程发生一点变化, ...

  5. 仿照微信的效果,实现了一个支持多选、选原图和视频的图片选择器,适配了iOS6-9系统,3行代码即可集成.

    提示:如果你发现了Bug,请尝试更新到最新版.目前最新版是1.6.4,此前的版本或多或少存在一些bug的~如果你已经是最新版了,请留一条评论,我看到了会尽快处理和修复哈~ 关于升级iOS10和Xcdo ...

  6. QCustomplot使用分享(四) QCPAbstractItem

    一.是什么 说起图,大家一下就可能想到折线图.柱状图和饼图等,但是除了这些显眼的东西以外其实还有很多东西辅助的存在着,有了这些辅助的东西图才会看起来有意义,或者说更加的真实.有说服力.这些东西都包括那 ...

  7. 安卓使ScrollView滚动到底部代码

    在开发中,我们经常需要更新列表,并将列表拉倒最底部,比如发表微博,聊天界面等等, 这里有两种办法,第一种,使用scrollTo(): public static void scrollToBottom ...

  8. jquery实现表格内容筛选

    对于表格来说,当数据比较多的时候,我们无法一页一页的查找,这时可以通过一个搜索框来实现搜索. 对于这个搜素框,我们为了更好的体验可以利用keyup事件实现在用户输入的时候就开始筛选,而不是填完以后点击 ...

  9. C# 通用验证类 支持 WPF,MVC,Winform

    验证方式,   通过继承 IDataErrorInfo接口 和 DataAnnotations 解释标记语言而实现, 为了能在WPF上通用,所了也要继承属性更改通知接口INotifyPropertyC ...

  10. ASP.NET AJAX Control Toolkit

    https://ajaxcontroltoolkit.codeplex.com/ 警告 7 未能找到引用的组件“Antlr3.Runtime”. 警告 6 未能找到引用的组件“HtmlAgilityP ...