Deeper on the networking parts when booting an instance

asked 2015-01-22 19:50:46 -0600

GLaupre gravatar image

updated 2015-01-26 12:25:42 -0600

This thread continues this one. Taking the same steps, I want to understand more than just the concepts. I have trouble to find the resources I need in the codebase. Feel free to edit my post and put the answer directly on it, like for a wiki

1 - During nova-boot, the nova-compute does the REST-call to neutron-server for creating a port

which function launches the REST-call to neutron-server?

(/nova/network/neutronv2/ def allocate_for_instance(self, context, instance, **kwargs) Allocate network resources for the instances.

(/nova/network/neutronv2/ def allocate_port_for_instance(self, context, instance, port_id, network_id=None, requested_ip=None) Allocate a port for the instance

What information nova does provide to neutron-server concerning the port?

(/nova/network/neutronv2/ def _create_port(self, port_client, instance, network_id, port_req_body, fixed_ip=None, security_group_ids=None, available_macs=None, dhcp_opts=None) Attemps to create a port for the instance on the given network.

What does the neutron-server return as answer/acknowledgment

2 - in this call, neutron-server simply adds the new port details into the neutron database

What function pushes the information about the port into the neutron database?

(/neutron/db/ def create_port(self, context, port) The information pushed in the database are tenant_id, name, port_id, network_id, admin_state_up, status, device_id, device_owner and the mac_address if specified. Then, the IP is updated for the specific port.

How is a port represented in neutron?

(neutron/db/ class Port(model_base.BASEV2, HasId, HasTenant) Represents a port on a Neutron v2 network

3 - At the same time , the neutron-agent(ovs, linuxbridge) running on compute node keeps polling on br-int for new instance and make the rpc_call 'get_device_details' (neutron/agent/ to neutron-server , the neutron-server returns the following dictionary `*

[{u'status': u'BUILD', 
u'binding:host_id': u'openstack-cn1', 
u'name': u'', 
u'allowed_address_pairs': [], 
u'admin_state_up': True, 
u'network_id': u'4fbc872e-9877-4d31-87f7-66b3690b2880', 
u'segmentation_id': 2001, 
u'extra_dhcp_opts': [], 
u'mac_address': u'fa:16:3e:5a:a8:05', 
u'network_type': u'vlan', 
u'binding:vif_type': u'other', 
u'device_owner': u'compute:nova', 
u'physical_network': u'physnet1', 
u'binding:capabilities': {u'port_filter': True}, 
u'tenant_id': u'f87e711648a9484290d73a518d50627c',
u'fixed_ips': [{u'subnet_id': u'4b4a7ce2-add4-435f-9775-5bee1756db64',
u'ip_address': u''}], u'id': u'd53f4f29-2798-42cd-b820-3f24fe0daa51',
u'security_groups': [u'1759cd27-e740-4059-894d-cf2fc21994f6'], 
u'device_id': u'288af4f1-e9e9-4315-b8f7-b483ea584d4e'}]

By what mechanism neutron server asks the neutron agent to create a port and with what information

4 - In the meanwhile, nova compute should tell the hypervisor the create a tap device.

Using what method and what information nova asks the hypervisor to create the tap device?

5 - finally neutron-agent creates the port on br-int

When and how the Type and Mechanism Driver do enter in the game to create the port in the topology and verify that it is well attached to the subnet

6 - L2 Agent sends a port_up to Neutron service which sends to Nova compute

7 - nova compute boots the VM

The steps with the DHCP agent are absent because it is done in parallel and I think the post ...

edit retag flag offensive close merge delete


If some important steps are missing, feel free to add them also. Thank you very much :)

GLaupre gravatar imageGLaupre ( 2015-01-23 11:47:40 -0600 )edit