Invention content
For current virtual machine and the especially nested deployment scenario of container mixed deployment, the present invention proposes a kind of virtual machine
The virtual network management method of nested framework is mixed with container.Realize the unified fusion management of virtual machine network and capacitor network.
The present invention combines the advantages of centralization and distributed director, using two-step evolution device structure, by control plane
Partial function is sunk in the local controller on hypervisor servers, centralized controller be responsible for global data safeguard with
And pipe platform interface is transported with third party, local controller is responsible for the maintenance of the flow table on native virtual machine interchanger, can effectively be dropped
The pressure of low overall situation centralized controller, promotes the performance of virtual network management.
Concrete operation step is:
1) local network controllers are introduced in server internal(local controller), abbreviation LC;
2) virtual machine on server and container are all connected to internal virtual switch(virtual switch-L0);
3) the nested scene for container operation on a virtual machine, container network interface card are connected to the virtual switch in virtual machine
(virtual switch-L1);
4) LC is from Unified Network controller(Unified Network Controller, abbreviation UNC)It is middle to obtain the necessary overall situation
Information, such as each tenant's virtual machine, the essential information of container and its physical distribution;
5) create virtual machine or when container, LC according to native virtual machine, container essential information under virtual switch-L0
Flow table is sent out, the access way of native virtual machine or container is got through, is isolated with vlan between tenant;
6) when virtual machine or container are deleted, LC is deleted on virtual switch-L0 and the relevant flow table of the virtual machine;
7) when virtual machine or container migrate, LC deletes before migration that virtual switch-L0 on host are upper and the void
The relevant flow table of quasi- machine, related flow table is re-issued after the completion of migration by the LC of target host machine;
8) the nested scene in virtual machine is operated in for container, when creating, delete in virtual machine, migrating container, host
LC will issue or delete corresponding flow table to virtual switch-L0, and the virtual switch virtual in virtual machine
Switch-L1 is then common Layer2 switching pattern;
9) when virtual machine or container cross-node communicate, virtual switch-L0 will be encapsulated according to the type of tenant network
It is sent for its corresponding format, as the network encapsulation of vlan types is vlan messages, is encapsulated as if the network of vxlan types
Vxlan messages;
If 10) tenant network is vlan types, configured firstly the need of the vlan for carrying out physical network;
If 11) tenant network is vxlan types, the vxlan between each server connects tunnel and is responsible for foundation by UNC entirely.
Due to UNC itself and the virtual management of not responsible virtual machine and container works, and UNC needs and third party cloud
Pipe platform interacts, and takes over its virtual network management service, and the events such as establishment, deletion, migration for monitoring virtual machine and container.
When creating virtual machine, UNC is by other respective fictionals of the relevant information of the virtual machine and current tenant network
The essential information and distribution situation of machine and container are advertised to the LC on hypervisor servers where the virtual machine, from the LC to
Its local virtual interchanger virtual switch-L0 issue flow table, get through other virtual machines in the virtual machine to tenant network
Or the communication port of container.In addition it is also necessary to which it is indoor other that the information of the virtual machine and distribution situation are advertised to this rent network
The LC on hypervisor servers where virtual machine or container, from these LC to its local virtual interchanger virtual
Switch-L0 issues flow table, gets through these virtual machines to the communication port of newly-built virtual machine, so far creates virtual machine and tenant's net
The bi-directional communication channels of other virtual machines or container are just set up in network.
When deleting virtual machine, UNC is by the relevant information announcement of the virtual machine to all virtual machines or appearance in tenant network
The LC on hypervisor servers where device is deleted by these LC on local virtual interchanger virtual switch-L0
With the relevant flow table of the virtual machine.
But when virtual machine (vm) migration, the relevant location information before the virtual machine (vm) migration is advertised in tenant network by UNC to be owned
The LC on hypervisor servers where virtual machine or container deletes local virtual interchanger virtual by these LC
Switch-L0 is upper with the relevant flow table of the virtual machine, while the location information after virtual machine (vm) migration is advertised to target after migration
In LC and tenant network on hypervisor servers on other virtual machines and hypervisor servers where container
LC is added and the relevant flow table of the virtual machine from these LC on respective local virtual interchanger virtual switch-L0.
The establishment of container, deletion, the establishment for migrating flow and above-mentioned virtual machine, deletion, migration flow are substantially similar, herein
It repeats no more, the nested virtualization scene that container operates in virtual machine is described below.
When creating nested, newly-built virtual machine is needed first, creates process as described above, when virtual machine creating is completed
Afterwards, container is created in the virtual machine internal(It is created by Container Management platform, such as kubernetes), UNC monitoring container establishment things
Other containers and virtual machine information of the relevant information of container and current tenant network are advertised to where it by part
LC on hypervisor servers issues flow table from the LC to its local virtual interchanger virtual switch-L0, gets through
The communication port of other virtual machines or container in the container to tenant network.In addition it is also necessary to by the information of the container and distribution
Situation is advertised to the LC on the hypervisor servers where other virtual machines in this tenant network or container, from these LC to
Its local virtual interchanger virtual switch-L0 issue flow table, and the communication for getting through these virtual machines to newly-built virtual machine is logical
Road so far creates virtual machine and is just set up with the bi-directional communication channels of other virtual machines or container in tenant network.
Container operates under the deletion of the container under the nested virtualization scene in virtual machine and migration and non-nested environment
Flow is almost the same, and details are not described herein again.
Communication process in tenant between virtual machine or container is also classified into several scenes, specifically includes as follows:
1)Communication between virtual machine inner pressurd vessel.Since the container in virtual machine belongs to same tenant, two kinds can be divided into again
Situation then can be communicated directly by virtual switch-L1, another kind is first, communicating pair is located at same subnet
Both sides are located at different sub-network(Between different sub-network can not direct communication, gateway need to be passed through), then need through virtual switch-
Message is sent to gateway by L0, then is sent back to after the addresses message purpose mac are changed to the addresses mac of target container network interface card by gateway
Virtual switch-L0, and virtual switch-L1 are sent to by virtual switch-L0, and finally it is sent to target appearance
Device.
2)Container in virtual machine and with the communication between the virtual machine or container on hypervisor servers.With 1)Class
Seemingly, being also classified into two kinds of situations of same subnet and different sub-network can directly pass through if source and destination belongs in same subnet
Communication is directly established in related flow table forwarding on virtual switch-L0, if source and destination belongs to different sub-network, message is first
Gateway first is given by virtual switch-L0, is sent back to after purpose mac is changed to the mac of target virtual machine or container by gateway
Virtual switch-L0, then specific virtual machine or container are sent to according to flow table forwarding by virtual switch-L0.
3)With on hypervisor servers between virtual machine and virtual machine, between virtual machine and container, container and container
Between communication.Communication process and 2)It is similar, it repeats no more.
4)Cross-node communicates.It is the same that cross-node, which is communicated with not cross-node communication nature process, and maximum difference is exactly,
When not cross-node communicates, communication is directly established by local virtual machine network between source and destination, is not necessarily to additional package(Such as
Vlan and vxlan encapsulation), and overstate node communication when, no matter source and destination whether be located at same subnet, be required to by additional
Encapsulation could establish communication process, and in addition to this other processes are almost the same.
The present invention also provides a kind of virtual machines to mix the virtual network management system of nested framework with container, includes mainly
Centralized controller and distributed director.
Centralized controller is responsible for safeguarding global information and interacts the phases such as acquisition virtual machine, container with third party cloud pipe platform
Information and distribution situation are closed, the dependent event of virtual machine and container is monitored, such as creates, delete, migration.
Distributed director(Or local controller)It is responsible for obtaining relevant information from centralized controller and safeguards local
Virtual machine or the relevant forwarding flow table of container.
Internal virtual network connection, L0 grades of virtual friendships are connected and composed by two-stage virtual machine interchanger in virtualized server
The virtual switch-L0 that change planes are flow table forward mode, are operated on hypervisor, L1 grades of virtual switches
Virtual switch-L1 are common forward mode, operate in virtual machine internal.
The tenant of virtual machine and container isolation is by L0 virtual switch virtual switch-L0 on each virtual port
It is isolated with vlan and is realized, each container on L1 grades of interchanger virtual switch-L1 is not due to belonging to same tenant's container, therefore not
It does and is isolated.
When virtual machine or container create, UNC is by virtual machine or container essential information with distributing position information announcement to place
The LC on all hypervisor servers in tenant network, local virtual interchanger virtual is safeguarded by each LC
The communication flow table of virtual machine or container and other virtual machines and container in tenant network is created on switch-L0.
When virtual machine or container are deleted, UNC owns virtual machine or the relevant information announcement of container in tenant network
LC on hypervisor servers, is deleted that local virtual interchanger virtual switch-L0 are upper and the virtual machine by each LC
Or the relevant flow table of container.
When virtual machine or container migrate, the relevant information before UNC migrates virtual machine or container is advertised in tenant network
LC on all hypervisor servers, is deleted that local virtual interchanger virtual switch-L0 are upper and the void by each LC
Quasi- machine or the relevant flow table of container, the relevant information after UNC migrates virtual machine or container in addition are advertised to institute in tenant network
There is the LC on hypervisor servers, the virtual machine on local virtual interchanger virtual switch-L0 is safeguarded by each LC
Or the communication flow table of container and other virtual machines and container in tenant network.
The beneficial effects of the invention are as follows
1) virtual machine is put on an equal footing with container, can realize the Unified Network management of virtual machine and container;
2) container is supported to operate in the virtual network management of the nested virtualization scene in virtual machine;
3) on control plane section bottom to hypervisor servers, virtual network management of performance can be promoted.
Specific implementation mode
More detailed elaboration is carried out to present disclosure below:
The mixed deployment of virtual machine and container is divided into following several scenes:1)Virtual machine operates on physical server;2)Container
It operates on physical server;3)Container nesting operates in virtual machine;4)Virtual machine nesting is run in a reservoir;5)Virtual machine
Nesting operates in virtual machine;6)Container nesting is run in a reservoir.From the demand of current cloud calculation service and the value of application
From the point of view of, 1 and 2 belong to most typical application scenarios, and scene 3 can meet certain special application demands, such as to resource isolation
It is contemplated that and is deployed in inside independent virtual machine with the higher container of security requirement, and 4,5, the 6 currently practical application of scene
Less, application value is also little, may not necessarily temporarily consider, Unified Network management method proposed by the present invention primarily directed to
1,2,3 scene, as shown in Figure 1.
Unified Network management method proposed by the invention, including:
12) local network controllers are introduced in server internal(local controller), abbreviation LC;
13) virtual machine on server and container are all connected to internal virtual switch(virtual switch-L0);
14) the nested scene for container operation on a virtual machine, container network interface card are connected to the virtual switch in virtual machine
(virtual switch-L1);
15) LC is from Unified Network controller(Unified Network Controller, abbreviation UNC)It is middle to obtain the necessary overall situation
Information, such as each tenant's virtual machine, the essential information of container and its physical distribution;
16) create virtual machine or when container, LC according to native virtual machine, container essential information to virtual switch-L0
Flow table is issued, the access way of native virtual machine or container is got through, is isolated with vlan between tenant;
17) when virtual machine or container are deleted, LC is deleted on virtual switch-L0 and the relevant flow table of the virtual machine;
18) when virtual machine or container migrate, LC deletes before migration that virtual switch-L0 on host are upper and the void
The relevant flow table of quasi- machine, related flow table is re-issued after the completion of migration by the LC of target host machine;
19) the nested scene in virtual machine is operated in for container, when creating, delete in virtual machine, migrating container, host
LC will issue or delete corresponding flow table to virtual switch-L0, and the virtual switch virtual in virtual machine
Switch-L1 is then common Layer2 switching pattern;
20) when virtual machine or container cross-node communicate, virtual switch-L0 will be encapsulated according to the type of tenant network
It is sent for its corresponding format, as the network encapsulation of vlan types is vlan messages, is encapsulated as if the network of vxlan types
Vxlan messages;
If 21) tenant network is vlan types, configured firstly the need of the vlan for carrying out physical network;
If 22) tenant network is vxlan types, the vxlan between each server connects tunnel and is responsible for foundation by UNC entirely.
Fig. 2 is the connection relation of server internal virtual network, and the container and virtual machine on hypervisor servers are equal
Pass through tap mouthfuls or virtual port(Such as veth)It is connected to local virtual interchanger virtual switch-L0, virtual
Switch-L0 is operated in flow table forward mode, and flow table rule is issued by local controller LC.Container in virtual machine then passes through
Tap mouthfuls of virtual ports(Such as veth)It is connected to virtual switch the virtual switch-L1, virtual of virtual machine internal
Switch-L1 is operated in common L2 forward modes(Because the container in a virtual machine belongs to a tenant, therefore in virtual machine
Container between without vlan be isolated), since the tap of virtual machine is articulated on virtual switch-L0,
Virtual switch-L0 are connected to virtual switch-L1, since there may be multiple rents on hypervisor servers
The virtual machine or container at family, therefore need on the virtual port of virtual switch-L0 to open tenant's virtual machine or container
Vlan is isolated, and one only local No. vlan is distributed to different tenants, when virtual machine or across the physical node communication of container, need
By local No. vlan replace with actual physics network No. vlan in message(Vlan is encapsulated)Or the vni of vxlan(vxlan
Encapsulation).
Fig. 3 is the general frame of unified virtual network management system, with traditional virtual Networking Solutions & provisioned(Such as neutron)
Unlike, the present invention is using centralization in maintenance one in the distributed control plane being combined, system is global
Centre controller UNC, UNC are responsible for safeguarding the essential information of the global information of data center network and virtual machine and container(Call phase
It closes interface to obtain from third-party platform, such as openstack or kubernetes), additionally in each hypervisor servers
The upper local controller LC, LC for opening a lightweight is responsible for safeguarding on virtual switch virtual switch-L0 local empty
Quasi- machine and the relevant flow table rule of container, hide LC needs and obtain enough global informations from UNC, as tenant container with it is virtual
Machine essential information and distribution situation etc..
The unified virtual machine network management method that the present invention is carried, virtual machine is made no exception with container, is put on an equal footing, is carried
The virtual network managerial ability that container is merged with virtual machine is supplied, and it is empty to support that container operates in the nesting in virtual machine
Quasi-ization scene enriches the application scenarios of virtualization.