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