OpenStack database gets a virtual machine of floating_ip, fix_ip, PROJECT_NAME, user_name, hostname, host

Source: Internet
Author: User

Reprint Please specify

Http://www.cnblogs.com/juandx/p/5418204.html

OpenStack has 3 libraries, nova,neutron,keystone, what I need to do now is cross-Library tables to query VM information

Get a virtual machine for floating_ip, fix_ip, PROJECT_NAME, user_name, hostname, host  (don't know what the difference between host and node in the Instances table) select J.floating_ip_address as Floating_ip, I.fix_ip, i.port_id, I.project_name, I.user_name, i.hostname,i.host from Neutron.floatingips as J Right join (select H.ip_address as fix_ip,h.port_id, G.project_name, G.user_name, g.hostname,g.h OST from Neutron.ipallocations as H right join (select F.name as project_name,e.name as User_name,e.hostname,e.port_id,e.h OST from Keystone.project as F right joins (select a.name,b.* from Keystone.user as a right join (select substring (substrin G_index (C.network_info, ' Ovs_interfaceid ', -1), 5,36) as port_id, d.* from Nova.instance_info_caches as C right join Nova.instances as D on C.instance_uuid=d.uuid where d.deleted=0) as-B on a.id=b.user_id) as-E on f.id=e.project_id) as G O n g.port_id=h.port_id) as I on i.port_id=j.fixed_port_id order by HOST,PROJECT_NAME,USER_NAME,FLOATING_IP;

  

The connection between Nova and Neutron is in the Nova.instance_info_caches table, which has the fix IP port, You can go to neutron.ipallocations this table to find the corresponding assigned IP, and then go to neutron.floatingips the table to find the corresponding FLOATINGIP

The connection between Nova and Keystone is nova.instances user_id and project_id, which is simple.

But the information in instance_info_caches is a mediumstest type of JSON, so I use MSYQL substring_index filter port information, not to find in such data directly with the method of Key,value, If the great God knows please tell me.

OpenStack database gets a virtual machine of floating_ip, fix_ip, PROJECT_NAME, user_name, hostname, host

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.