CN102315968A - Network configuration method in virtual machine environment - Google Patents
Network configuration method in virtual machine environment Download PDFInfo
- Publication number
- CN102315968A CN102315968A CN201110278346A CN201110278346A CN102315968A CN 102315968 A CN102315968 A CN 102315968A CN 201110278346 A CN201110278346 A CN 201110278346A CN 201110278346 A CN201110278346 A CN 201110278346A CN 102315968 A CN102315968 A CN 102315968A
- Authority
- CN
- China
- Prior art keywords
- network
- virtual machine
- physical machine
- information
- broadcast
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种虚拟化环境下的网络配置方法,包括以下步骤:虚拟机启动,向网络发送广播消息;物理机的服务端解析广播消息,并判断广播消息是否来自其对应的虚拟机;若广播消息是来自其对应的虚拟机,则物理机的服务端响应广播消息;物理机的服务端查询网络资源池,按照预设的策略执行网络资源分配,并返回分配结果;若分配结果显示资源分配成功,则物理机的服务端根据分配结果生成网络配置参数;物理机的服务端将网络配置参数以广播消息的方式发送到虚拟机;虚拟机根据网络配置参数配置网络;物理机的服务端更新网络资源池的状态信息。本发明能够高效地配置虚拟机网络,降低网络开销,同时还具有良好的透明性和可扩展性。
The present invention provides a network configuration method in a virtualized environment, comprising the following steps: starting a virtual machine, and sending a broadcast message to the network; the server of the physical machine analyzes the broadcast message, and judges whether the broadcast message comes from its corresponding virtual machine; If the broadcast message is from its corresponding virtual machine, the server of the physical machine responds to the broadcast message; the server of the physical machine queries the network resource pool, performs network resource allocation according to the preset strategy, and returns the allocation result; if the allocation result shows If the resource allocation is successful, the server of the physical machine generates network configuration parameters according to the allocation result; the server of the physical machine sends the network configuration parameters to the virtual machine in the form of a broadcast message; the virtual machine configures the network according to the network configuration parameters; the service of the physical machine The terminal updates the state information of the network resource pool. The invention can efficiently configure the virtual machine network, reduce network overhead, and has good transparency and scalability.
Description
技术领域 technical field
本发明涉及虚拟机技术领域,更具体地说,本发明涉及一种虚拟机环境下的网络配置方法。The present invention relates to the technical field of virtual machines, and more specifically, the present invention relates to a network configuration method in a virtual machine environment.
背景技术 Background technique
动态主机配置协议(Dynamic Host Configuration Protocol,简称DHCP)被广泛用于管理物理局域网络。然而,在不考虑虚拟机网络特性的情况下,把DHCP服务僵硬的应用到虚拟化环境中,会造成服务端效率低、网络负载重等缺点,对多虚拟机的网络管理造成诸多不便,不符合多虚拟机对资源高效、动态、透明管理的要求。Dynamic Host Configuration Protocol (DHCP for short) is widely used to manage physical local area networks. However, if the DHCP service is applied rigidly to the virtualization environment without considering the network characteristics of the virtual machine, it will cause disadvantages such as low server efficiency and heavy network load, which will cause a lot of inconvenience to the network management of multiple virtual machines, and will not be It meets the requirements of multi-virtual machines for efficient, dynamic and transparent management of resources.
发明内容 Contents of the invention
有鉴于此,本发明的目的在于提供一种虚拟机环境下的网络配置方法,实现多虚拟机网络的初始化与动态自动配置,该方法能够高效地配置虚拟机网络,降低网络开销,同时还具有良好的透明性和可扩展性。In view of this, the purpose of the present invention is to provide a network configuration method in a virtual machine environment to realize the initialization and dynamic automatic configuration of multi-virtual machine networks. The method can efficiently configure virtual machine networks, reduce network overhead, and also has Good transparency and scalability.
虚拟化环境下的网络配置方法,包括以下步骤:A network configuration method in a virtualized environment, comprising the following steps:
虚拟机启动,向网络发送广播消息;The virtual machine starts and sends a broadcast message to the network;
物理机的服务端解析广播消息,并判断广播消息是否来自其对应的虚拟机;The server of the physical machine parses the broadcast message and judges whether the broadcast message comes from its corresponding virtual machine;
若广播消息是来自其对应的虚拟机,则物理机的服务端响应广播消息;If the broadcast message is from its corresponding virtual machine, the server of the physical machine responds to the broadcast message;
物理机的服务端查询网络资源池,按照预设的策略执行网络资源分配,并返回分配结果;The server of the physical machine queries the network resource pool, performs network resource allocation according to the preset strategy, and returns the allocation result;
若分配结果显示资源分配成功,则物理机的服务端根据分配结果生成网络配置参数;If the allocation result shows that the resource allocation is successful, the server of the physical machine generates network configuration parameters according to the allocation result;
物理机的服务端将网络配置参数以广播消息的方式发送到虚拟机;The server of the physical machine sends the network configuration parameters to the virtual machine in the form of a broadcast message;
虚拟机根据网络配置参数配置网络;The virtual machine configures the network according to the network configuration parameters;
物理机的服务端更新网络资源池的状态信息。The server of the physical machine updates the state information of the network resource pool.
本发明的方法进一步包括:若广播消息不是来自其对应的虚拟机,则丢弃广播消息。The method of the present invention further includes: discarding the broadcast message if the broadcast message is not from its corresponding virtual machine.
本发明的方法进一步包括:若分配结果显示资源分配不成功,则返回无可用网络资源信息。The method of the present invention further includes: if the allocation result shows that the resource allocation is unsuccessful, returning the information of no available network resources.
广播消息包括用于指示广播信息是来自虚拟机还是来自物理机的指令标识位字段、用于指示虚拟机的虚拟硬件信息的媒体访问控制字段、用于标识虚拟机的通用唯一识别码字段、以及用于保存网络配置参数的网络配置信息字段。The broadcast message includes an instruction identification bit field for indicating whether the broadcast information is from a virtual machine or a physical machine, a media access control field for indicating virtual hardware information of the virtual machine, a universally unique identifier field for identifying the virtual machine, and Network configuration information field used to save network configuration parameters.
物理机的服务端查询网络资源池,按照预设的策略执行网络资源分配,并返回分配结果的步骤进一步包括:The server of the physical machine queries the network resource pool, performs network resource allocation according to a preset strategy, and returns the allocation result. The steps further include:
读取物理机的服务端的网络设置,以获取物理机的网段信息;Read the network settings of the server of the physical machine to obtain the network segment information of the physical machine;
物理机的服务端将网段信息发往网络资源池,以查询网段信息中网段范围内的空闲IP,并返回查询结果;The server of the physical machine sends the network segment information to the network resource pool to query the free IP within the range of the network segment in the network segment information, and returns the query result;
若查询结果为空,则在网络资源池中统计各网段中已被使用的IP的数量,以确定具有最多已被使用的IP、并且还有空闲IP的网段,并返回网段信息;If the query result is empty, count the number of used IPs in each network segment in the network resource pool to determine the network segment with the most used IPs and free IPs, and return the network segment information;
物理机的服务端将网段信息发往网络资源池,以查询网段信息中网段范围内的空闲IP,并返回查询结果;The server of the physical machine sends the network segment information to the network resource pool to query the free IP within the range of the network segment in the network segment information, and returns the query result;
若查询结果为空,则返回无可用网络资源信息。If the query result is empty, it will return no available network resource information.
物理机的服务端查询网络资源池,按照预设的策略执行网络资源分配,并返回分配结果的步骤进一步包括:若查询结果不为空,则从查询结果中取出IP信息,将其作为分配结果返回。The server of the physical machine queries the network resource pool, executes the network resource allocation according to the preset strategy, and returns the allocation result. The step further includes: if the query result is not empty, take out the IP information from the query result and use it as the allocation result return.
与现有技术相比,本发明具有以下优点:Compared with the prior art, the present invention has the following advantages:
(1)高效率:本发明采用优化的网络通信结构,简化了网络配置的处理过程,有效的减少虚拟机网络初始化和按需配置过程的时间,提高了虚拟机网络配置的效率。(1) High efficiency: the present invention adopts an optimized network communication structure, simplifies the processing process of network configuration, effectively reduces the time of virtual machine network initialization and on-demand configuration process, and improves the efficiency of virtual machine network configuration.
(2)低开销:本发明的虚拟机网络基础通信模型使用精简的数据通信格式,避免了大量冗余数据的传输,从而降低了网络资源开销。(2) Low overhead: the virtual machine network basic communication model of the present invention uses a simplified data communication format, which avoids the transmission of a large amount of redundant data, thereby reducing network resource overhead.
(3)透明性:本发明基于按需的网络资源分配策略动态维护网络资源池,提供虚拟机自动网络初始化及配置,虚拟机使用者不需要手动操作来配置网络,整个过程对用户是透明的。(3) Transparency: The present invention dynamically maintains the network resource pool based on the on-demand network resource allocation strategy, provides virtual machine automatic network initialization and configuration, and the virtual machine user does not need to manually configure the network, and the whole process is transparent to the user .
(4)可扩展性:本发明通过物理网络端管理各个物理服务器上运行的虚拟机网络,实现了虚拟机网络的局部配置管理,增强了虚拟机网络配置系统的可扩展性。(4) Scalability: the present invention manages the virtual machine network running on each physical server through the physical network end, realizes local configuration management of the virtual machine network, and enhances the scalability of the virtual machine network configuration system.
附图说明 Description of drawings
图1是本发明虚拟化环境下的网络配置方法的流程图。Fig. 1 is a flow chart of the network configuration method in the virtualization environment of the present invention.
图2是虚拟机与物理机的服务端之间广播消息的格式示意图。FIG. 2 is a schematic diagram of a format of a broadcast message between a server of a virtual machine and a physical machine.
图3是本发明步骤(4)的细化流程图。Fig. 3 is a detailed flowchart of step (4) of the present invention.
图4是本发明虚拟化环境下的网络配置方法的系统功能示意图。FIG. 4 is a schematic diagram of system functions of the network configuration method in the virtualization environment of the present invention.
具体实施方式 Detailed ways
下面结合附图对本发明作进一步详细的说明。The present invention will be described in further detail below in conjunction with the accompanying drawings.
如图1所示,本发明的网络配置方法包括以下步骤:As shown in Figure 1, the network configuration method of the present invention comprises the following steps:
(1)虚拟机启动,向网络发送广播消息;(1) The virtual machine starts and sends a broadcast message to the network;
(2)物理机的服务端解析广播消息,并判断广播消息是否来自其对应的虚拟机;若广播消息是来自其对应的虚拟机,则转入步骤(3),否则丢弃该广播消息;(2) The server of the physical machine parses the broadcast message, and judges whether the broadcast message is from its corresponding virtual machine; if the broadcast message is from its corresponding virtual machine, then proceed to step (3), otherwise discard the broadcast message;
(3)物理机的服务端响应广播消息;(3) The server of the physical machine responds to the broadcast message;
(4)物理机的服务端查询网络资源池,按照预设的策略执行网络资源分配,并返回分配结果;(4) The server of the physical machine queries the network resource pool, performs network resource allocation according to the preset strategy, and returns the allocation result;
(5)若分配结果显示资源分配成功,则转入步骤(6);若分配结果显示资源分配不成功,则返回无可用网络资源信息;(5) If the allocation result shows that the resource allocation is successful, then proceed to step (6); if the allocation result shows that the resource allocation is unsuccessful, then return the information that there is no available network resource;
(6)物理机的服务端根据分配结果生成网络配置参数;(6) The server of the physical machine generates network configuration parameters according to the distribution result;
(7)物理机的服务端将网络配置参数以广播消息的方式发送到虚拟机;(7) The server of the physical machine sends the network configuration parameters to the virtual machine in the form of a broadcast message;
(8)虚拟机根据网络配置参数配置网络;(8) The virtual machine configures the network according to the network configuration parameters;
(9)物理机的服务端更新网络资源池的状态信息。(9) The server of the physical machine updates the status information of the network resource pool.
参考图2,虚拟机与物理机的服务端之间交互的广播信息,包括以下字段:Referring to Figure 2, the broadcast information exchanged between the server of the virtual machine and the physical machine includes the following fields:
1.指令标识位(2位):1. Instruction identification bit (2 bits):
表头的最前两位是指令标识码,虚拟机和物理机的服务端就是通过标识码的值来判断消息的性质与功能。若标识码的值是“is”,它表示此数据是虚拟机网络在初始化阶段发给网络的广播信息;若标识码的值是“rt”,它表示此数据是由物理机的服务端发给虚拟机的确认信息;若标识码的值是“st”,它表示这是由物理机的服务端发给虚拟机的网络配置参数。The first two digits of the header are the instruction identification code, and the server of the virtual machine and the physical machine judges the nature and function of the message through the value of the identification code. If the value of the identification code is "is", it means that the data is broadcast information sent by the virtual machine network to the network during the initialization phase; if the value of the identification code is "rt", it means that the data is sent by the server of the physical machine Confirmation information for the virtual machine; if the value of the identification code is "st", it indicates that this is a network configuration parameter sent to the virtual machine by the server of the physical machine.
2.媒体访问控制(Media Access Control,简称MAC)地址(17位):2. Media Access Control (MAC) address (17 digits):
其表示虚拟机的网络MAC地址,在虚拟机启动阶段填入。Mac字段是初始化时的特有字段,字段中填入的是虚拟机的虚拟硬件信息,其他类型消息中的MAC字段将被清零,而以通用唯一识别码(Universally UniqueIdentifier,简称UUID)字段作为唯一标示符。It indicates the network MAC address of the virtual machine, which is filled in during the virtual machine startup phase. The Mac field is a unique field during initialization. The virtual hardware information of the virtual machine is filled in the field. The MAC field in other types of messages will be cleared, and the Universally Unique Identifier (UUID) field will be used as the unique Identifier.
3.UUID(36位):3. UUID (36 bits):
每个虚拟机在创建时生成的全局编码,能唯一标识该虚拟机。The global code generated when each virtual machine is created can uniquely identify the virtual machine.
4.网络配置信息(不定位数):4. Network configuration information (no positioning number):
其用于保存分配给虚拟机的网络配置参数,包括IP地址、网关、域名系统(Domain Name System,简称DNS)等数据。It is used to save the network configuration parameters assigned to the virtual machine, including IP address, gateway, Domain Name System (Domain Name System, DNS for short) and other data.
在步骤(1)中,当虚拟机启动时,会将广播消息的指令标识位字段设为“is”,并查询本机的MAC地址,将其填入MAC字段,然后将此广播消息在网络中发送。消息发送以后,若客户端在设定的时间内没有收到服务端返回的消息,会自动进入超时状态,并在间隔一定时间后重新发送网络配置请求,若在规定的次数内请求不成功,则返回错误信息。In step (1), when the virtual machine is started, the instruction identification bit field of the broadcast message will be set to "is", and the MAC address of the machine will be queried, filled in the MAC field, and then the broadcast message will be sent to the network sent in. After the message is sent, if the client does not receive the message returned by the server within the set time, it will automatically enter the timeout state and resend the network configuration request after a certain interval. If the request is unsuccessful within the specified number of times, An error message is returned.
在步骤(2)中,物理机的服务端首先判断广播消息的指令标识位是否为“is”,如是则读取后面的MAC地址,对比查询本机上运行的虚拟机列表,如果找到带有匹配MAC地址的虚拟机,则取出该虚拟机注册的UUID,作为请求接收确认信息,设置指令标识位为“rt”,回复给该虚拟机,同时向网络资源池申请网络资源。In step (2), the server of the physical machine first judges whether the instruction flag of the broadcast message is "is", if so, reads the following MAC address, compares and queries the list of virtual machines running on the machine, and if it finds a command flag with For a virtual machine that matches the MAC address, take out the UUID registered by the virtual machine as the request receipt confirmation information, set the instruction flag to "rt", reply to the virtual machine, and apply for network resources from the network resource pool at the same time.
在步骤(4)中,网络资源分配采用物理机优先分配和局域网最大化分配相结合的策略,其具体操作过程如图3所示,包括以下子步骤:In step (4), the network resource allocation adopts the strategy of combining physical machine priority allocation and local area network maximum allocation, and its specific operation process is shown in Figure 3, including the following sub-steps:
(41)读取物理机的服务端的网络设置,以获取物理机的网段信息;(41) read the network settings of the service end of the physical machine to obtain the network segment information of the physical machine;
(42)物理机的服务端将网段信息发往网络资源池,以查询网段信息中网段范围内的空闲IP,并返回查询结果;(42) The service end of the physical machine sends the network segment information to the network resource pool to query the free IP within the network segment range in the network segment information, and returns the query result;
(43)若查询结果为空,则在网络资源池中统计各网段中已被使用的IP的数量,以确定具有最多已被使用的IP、并且还有空闲IP的网段,并返回网段信息,然后进入步骤(44),若查询结果不为空,则从查询结果中取出IP信息,将其作为分配结果返回;(43) If the query result is empty, count the number of used IPs in each network segment in the network resource pool to determine the network segment with the most used IPs and idle IPs, and return the network segment information, then enter step (44), if the query result is not empty, then take out the IP information from the query result, and return it as the distribution result;
(44)物理机的服务端将网段信息发往网络资源池,以查询网段信息中网段范围内的空闲IP,并返回查询结果,若查询结果不为空,则从查询结果中取出IP信息,将其作为分配结果返回,若查询结果为空,则返回无可用网络资源信息。(44) The server of the physical machine sends the network segment information to the network resource pool to query the idle IP within the range of the network segment in the network segment information, and returns the query result. If the query result is not empty, take it out from the query result IP information, which will be returned as the allocation result. If the query result is empty, no available network resource information will be returned.
物理机优先分配策略将虚拟机自动分配到与宿主物理机相同网段,使物理机与客户虚拟机成为组成局域网内网结构,可以减少因在不同网段通信而带来的路由寻址,提高虚拟机与物理机的通信效率。当物理机所处网段IP资源不足时,按照局域网最大化分配策略,把虚拟机分配到现有虚拟机数量最多的局域网网段中,以保证新加入的虚拟机能够与现有网络中最多的虚拟机进行高效的网络通信。The physical machine priority allocation strategy automatically allocates the virtual machine to the same network segment as the host physical machine, so that the physical machine and the client virtual machine form an intranet structure of the LAN, which can reduce the routing addressing caused by communication in different network segments and improve Communication efficiency between virtual machine and physical machine. When the IP resource of the network segment where the physical machine is located is insufficient, the virtual machine is allocated to the LAN segment with the largest number of existing virtual machines according to the maximum allocation policy of the LAN, so as to ensure that the newly added virtual machine can be connected with the largest number of existing network virtual machines for efficient network communication.
在步骤(6)中,物理机的服务端将请求资源的虚拟机的UUID填入广播消息的UUID字段,并根据网络资源池分配的IP信息以及相应的网关和DNS资源,生成一个可用的网络资源包,填入广播消息的网络配置信息字段。In step (6), the server of the physical machine fills the UUID of the virtual machine requesting resources into the UUID field of the broadcast message, and generates an available network based on the IP information allocated by the network resource pool and the corresponding gateway and DNS resources. Resource package, fill in the network configuration information field of the broadcast message.
在步骤(7)中,物理机的服务端把生成的广播消息的指令标识位设置为“st”,然后将此广播消息用广播方式发送到网络。In step (7), the server of the physical machine sets the instruction identification bit of the generated broadcast message to "st", and then sends the broadcast message to the network in a broadcast manner.
在步骤(8)中,虚拟机监听到发来的指令标识位为“st”的消息时,查看其UUID字段内容是否与自己的UUID一致,若是则读取网络配置参数,按照指定的数据设置自己的虚拟网络;若不同则丢弃数据包,继续进行监听。In step (8), when the virtual machine listens to the message whose command identification bit is "st", it checks whether the content of its UUID field is consistent with its own UUID, if so, reads the network configuration parameters, and sets them according to the specified data Your own virtual network; if it is different, discard the data packet and continue to monitor.
在步骤(9)中,网络资源池接收到虚拟机配置成功的消息后,将此虚拟机的网络资源设置为已使用状态,并更新对应网段的IP使用数。In step (9), after receiving the message that the virtual machine is configured successfully, the network resource pool sets the network resource of the virtual machine to the used state, and updates the number of IPs used in the corresponding network segment.
示例example
以一个IBM高性能集群构建虚拟机网络自动配置系统为例,IBM高性能计算集群包括1个前端机,2个I/O节点以及39个计算节点,其具体配置如表1所示。集群内部局域网是1000M以太网,外部局域网是100M以太网。具体测试环境配置信息请参照以下表1所示:Taking an IBM high-performance cluster to build a virtual machine network automatic configuration system as an example, the IBM high-performance computing cluster includes 1 front-end machine, 2 I/O nodes and 39 computing nodes. The specific configuration is shown in Table 1. The internal LAN of the cluster is 1000M Ethernet, and the external LAN is 100M Ethernet. For specific test environment configuration information, please refer to the following table 1:
表1 测试环境配置信息Table 1 Test environment configuration information
本方法具体实施时,采用较为独立的两层结构来构造虚拟机自动网络配置系统。网络通信层是整个系统的核心,负责构建和管理整个虚拟网络的具体任务;逻辑控制层是整个系统的控制和数据中心,负责控制流的正常运行、数据的正确存放和系统错误的有效处理。During the specific implementation of the method, a relatively independent two-layer structure is adopted to construct a virtual machine automatic network configuration system. The network communication layer is the core of the entire system, responsible for building and managing the specific tasks of the entire virtual network; the logic control layer is the control and data center of the entire system, responsible for the normal operation of the control flow, the correct storage of data, and the effective handling of system errors.
如图4所示,网络资源池和逻辑控制台属于逻辑控制层,运行在集群其前端机上。逻辑控制台负责控制信息的分发与管理,并根据需要与网络资源池进行数据交换,实现控制流的正常运行和网络数据的正确存放。物理网络端和虚拟网络端属于网络通信层,它们分别运行在集群计算节点和虚拟机上,它们之间的有效信息交互决定着虚拟机网络的正常通信。As shown in Figure 4, the network resource pool and logical console belong to the logical control layer and run on the front-end machine of the cluster. The logic console is responsible for the distribution and management of control information, and exchanges data with the network resource pool as needed, so as to realize the normal operation of the control flow and the correct storage of network data. The physical network end and the virtual network end belong to the network communication layer. They run on cluster computing nodes and virtual machines respectively. The effective information exchange between them determines the normal communication of the virtual machine network.
一台虚拟机启动完成之后,需要对网络进行配置,它通过内部的基础通信模块向所在的物理机发送网络资源请求,逻辑控制台在收到请求后,应用资源分配策略从网络资源池中取出相应数据,将数据通过物理机的物理网络端发送给虚拟机中的虚拟网络端,进行相应的配置。若配置成功,控制台将更新网络资源池中的数据,以保证实时数据的一致性;若不成功,则间隔一定时间以后自动重复网络初始化的所有操作,若重复数次仍不成功,则判定为虚拟机网络初始化失败。这样就完成一次简单的网络配置通信。After a virtual machine is started, it needs to configure the network. It sends a network resource request to the physical machine through the internal basic communication module. After receiving the request, the logical console applies the resource allocation strategy to take it out of the network resource pool. The corresponding data is sent to the virtual network end in the virtual machine through the physical network end of the physical machine for corresponding configuration. If the configuration is successful, the console will update the data in the network resource pool to ensure the consistency of real-time data; if it is unsuccessful, it will automatically repeat all the operations of network initialization after a certain period of time. Network initialization for the virtual machine failed. This completes a simple network configuration communication.
在8号集群计算节点上启动一台虚拟机V,当它启动完成之后,开始对网络进行配置。虚拟网络端生成如表2的通信消息,设置指令标识位为“is”,填入虚拟机V的网络Mac地址,其他字段为空,通过广播端口发送。Start a virtual machine V on cluster computing node No. 8, and start configuring the network after it is started. The virtual network terminal generates a communication message as shown in Table 2, sets the instruction flag to "is", fills in the network Mac address of the virtual machine V, and leaves other fields empty, and sends it through the broadcast port.
表2 虚拟机发出的广播消息Table 2 Broadcast messages sent by virtual machines
8号集群计算节点的物理网络端通过监听端口接收到广播消息,经判断指令标识位为“is”,读取MAC地址,在本机的虚拟机列表中查询,发现匹配的MAC地址,读取该虚拟机的UUID。然后生成申请确认的通信消息,如表2所示,通过广播方式发送到网络。同时,远程调用集群前端节点的逻辑控制台的GetResource函数。The physical network end of the No. 8 cluster computing node receives the broadcast message through the listening port. After judging that the instruction flag is "is", read the MAC address, query in the virtual machine list of the local machine, find the matching MAC address, and read The UUID of this virtual machine. Then generate a communication message for application confirmation, as shown in Table 2, and send it to the network by broadcasting. At the same time, remotely call the GetResource function of the logical console of the front-end node of the cluster.
表3 物理机发出的请求确认信息Table 3 Request confirmation information sent by the physical machine
虚拟机V的网络端从监听端口接收到8号计算节点发出的广播消息后,通过指令标识位判断为物理网络端回复的确认信息,检查MAC地址为虚拟机V的MAC地址,读取UUID字段,记录为本虚拟机V的UUID。After the network side of virtual machine V receives the broadcast message sent by computing node 8 from the listening port, it judges the confirmation information replied by the physical network side through the instruction identification bit, checks that the MAC address is the MAC address of virtual machine V, and reads the UUID field , which is recorded as the UUID of the virtual machine V.
逻辑控制台执行资源分配程序。首先查询消息来源,即8号计算节点的IP,截取网段为“192.168.100.0”,查询网络资源池,从该网段的空闲IP结果集中选取一个可用IP“192.168.100.102”。然后,根据此IP获取相关网络资源,包括网关、DNS等,生成网络配置参数包,返回给8号集群计算节点。The logical console executes the resource allocation program. First query the source of the news, that is, the IP of computing node No. 8, intercept the network segment as "192.168.100.0", query the network resource pool, and select an available IP "192.168.100.102" from the free IP result set of this network segment. Then, obtain relevant network resources according to this IP, including gateway, DNS, etc., generate a network configuration parameter package, and return it to cluster computing node No. 8.
物理网络端获取返回的网络参数后,生成一个广播信息,如表4所示。该广播消息的指令标识位设置为“st”,MAC地址字段被清空,UUID字段填写为目标虚拟机V的UUID,网络配置的参数填写进广播信息的网络配置信息字段。此广播消息也是以广播方式发送。After obtaining the returned network parameters, the physical network end generates a broadcast message, as shown in Table 4. The instruction identification bit of the broadcast message is set to "st", the MAC address field is cleared, the UUID field is filled with the UUID of the target virtual machine V, and the network configuration parameters are filled in the network configuration information field of the broadcast message. This broadcast message is also sent in broadcast mode.
表4 物理机发出的广播信息Table 4 Broadcast information sent by the physical machine
虚拟机V的网络端从监听端口接收到该广播消息后,首先根据指令标识位确定为网络配置消息,然后检查UUID,发现与自己的UUID一致,因此读取后面的网络配置信息字段,解析出IP地址等配置参数并进行网络设置。网络设置完成后,即向8号计算节点发送网络配置成功消息。After the network side of virtual machine V receives the broadcast message from the listening port, it first determines that it is a network configuration message according to the command identification bit, then checks the UUID and finds that it is consistent with its own UUID, so it reads the following network configuration information field and parses out Configure parameters such as IP address and make network settings. After the network setting is completed, the network configuration success message is sent to computing node No. 8.
8号计算节点接收到虚拟机V返回的配置成功消息后,调用逻辑控制台的SetIPPool函数,将资源池数据库里的IP地址“192.168.100.102”的状态修改为“已使用”。After receiving the successful configuration message returned by virtual machine V, computing node No. 8 calls the SetIPPool function of the logical console to change the status of the IP address "192.168.100.102" in the resource pool database to "used".
至此,虚拟机V的网络自动配置工作完成。So far, the automatic network configuration of the virtual machine V is completed.
Claims (6)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 201110278346 CN102315968B (en) | 2011-09-19 | 2011-09-19 | Network configuration method in virtual machine environment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 201110278346 CN102315968B (en) | 2011-09-19 | 2011-09-19 | Network configuration method in virtual machine environment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102315968A true CN102315968A (en) | 2012-01-11 |
| CN102315968B CN102315968B (en) | 2013-12-18 |
Family
ID=45428805
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 201110278346 Expired - Fee Related CN102315968B (en) | 2011-09-19 | 2011-09-19 | Network configuration method in virtual machine environment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102315968B (en) |
Cited By (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102752137A (en) * | 2012-06-28 | 2012-10-24 | 用友软件股份有限公司 | Device and method for actively setting network parameters of virtual machine |
| CN103297548A (en) * | 2012-02-23 | 2013-09-11 | 上海盛霄云计算技术有限公司 | Method and device for updating domain name resolution rules in cloud computing environment |
| CN103703724A (en) * | 2013-08-15 | 2014-04-02 | 华为技术有限公司 | A method of distributing resources |
| CN103716416A (en) * | 2012-09-29 | 2014-04-09 | 北京搜狐互联网信息服务有限公司 | IP configuration method and apparatus under cloud computing platform |
| CN103944867A (en) * | 2013-01-23 | 2014-07-23 | 华为技术有限公司 | Dynamic host configuration protocol (DHCP) message processing method, device and system |
| WO2014173265A1 (en) * | 2013-04-25 | 2014-10-30 | Hangzhou H3C Technologies Co., Ltd. | Network resource monitoring |
| CN104219096A (en) * | 2014-09-05 | 2014-12-17 | 东软集团股份有限公司 | Resource reallocation method and device |
| CN104699522A (en) * | 2015-03-17 | 2015-06-10 | 成都艺辰德迅科技有限公司 | Virtual machine dynamic migration method |
| CN105162897A (en) * | 2015-09-16 | 2015-12-16 | 浪潮集团有限公司 | System and method for allocating IP address for virtual machine and network virtual machine |
| CN105656795A (en) * | 2014-11-14 | 2016-06-08 | 腾讯科技(深圳)有限公司 | Flow control method of virtual machine and physical machine |
| CN108089910A (en) * | 2016-11-23 | 2018-05-29 | 北京国双科技有限公司 | The method and apparatus for configuring virtual machine IP address |
| CN115002151A (en) * | 2022-05-07 | 2022-09-02 | 通号城市轨道交通技术有限公司 | Method and device for building test system of automatic train monitoring system |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060117342A1 (en) * | 2004-11-30 | 2006-06-01 | Park Pyung K | Method for acquiring channel information and registering for reception of multicast based IP TV broadcasting in access network |
| US20100180014A1 (en) * | 2009-01-14 | 2010-07-15 | International Business Machines Corporation | Providing network identity for virtual machines |
| CN102067533A (en) * | 2009-05-15 | 2011-05-18 | 思科技术公司 | Port grouping for association with virtual interfaces |
-
2011
- 2011-09-19 CN CN 201110278346 patent/CN102315968B/en not_active Expired - Fee Related
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060117342A1 (en) * | 2004-11-30 | 2006-06-01 | Park Pyung K | Method for acquiring channel information and registering for reception of multicast based IP TV broadcasting in access network |
| US20100180014A1 (en) * | 2009-01-14 | 2010-07-15 | International Business Machines Corporation | Providing network identity for virtual machines |
| CN102067533A (en) * | 2009-05-15 | 2011-05-18 | 思科技术公司 | Port grouping for association with virtual interfaces |
Non-Patent Citations (1)
| Title |
|---|
| R.DROMS: "《IETF standards RFC 2131》", 31 March 1997 * |
Cited By (21)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103297548A (en) * | 2012-02-23 | 2013-09-11 | 上海盛霄云计算技术有限公司 | Method and device for updating domain name resolution rules in cloud computing environment |
| CN103297548B (en) * | 2012-02-23 | 2017-12-19 | 上海盛大网络发展有限公司 | The update method and device of domain name mapping rule in a kind of cloud computing environment |
| CN102752137B (en) * | 2012-06-28 | 2015-10-21 | 用友网络科技股份有限公司 | The apparatus and method of virtual machine network parameter are initiatively set |
| CN102752137A (en) * | 2012-06-28 | 2012-10-24 | 用友软件股份有限公司 | Device and method for actively setting network parameters of virtual machine |
| CN103716416A (en) * | 2012-09-29 | 2014-04-09 | 北京搜狐互联网信息服务有限公司 | IP configuration method and apparatus under cloud computing platform |
| CN103716416B (en) * | 2012-09-29 | 2017-02-22 | 北京搜狐互联网信息服务有限公司 | IP configuration method and apparatus under cloud computing platform |
| CN103944867A (en) * | 2013-01-23 | 2014-07-23 | 华为技术有限公司 | Dynamic host configuration protocol (DHCP) message processing method, device and system |
| CN103944867B (en) * | 2013-01-23 | 2017-09-12 | 华为技术有限公司 | Processing method, the device and system of dynamic host configuration protocol message |
| US9825817B2 (en) | 2013-04-25 | 2017-11-21 | Hewlett Packard Enterprise Development Lp | Network configuration auto-deployment |
| US9762451B2 (en) | 2013-04-25 | 2017-09-12 | Hewlett Packard Enterprise Development Lp | Network resource matching |
| WO2014173265A1 (en) * | 2013-04-25 | 2014-10-30 | Hangzhou H3C Technologies Co., Ltd. | Network resource monitoring |
| CN103703724A (en) * | 2013-08-15 | 2014-04-02 | 华为技术有限公司 | A method of distributing resources |
| US9999030B2 (en) | 2013-08-15 | 2018-06-12 | Huawei Technologies Co., Ltd. | Resource provisioning method |
| CN104219096A (en) * | 2014-09-05 | 2014-12-17 | 东软集团股份有限公司 | Resource reallocation method and device |
| CN104219096B (en) * | 2014-09-05 | 2018-03-20 | 东软集团股份有限公司 | A kind of resource reconfiguration method and device |
| CN105656795A (en) * | 2014-11-14 | 2016-06-08 | 腾讯科技(深圳)有限公司 | Flow control method of virtual machine and physical machine |
| CN104699522A (en) * | 2015-03-17 | 2015-06-10 | 成都艺辰德迅科技有限公司 | Virtual machine dynamic migration method |
| CN104699522B (en) * | 2015-03-17 | 2017-10-13 | 成都麦进斗科技有限公司 | A kind of dynamic migration of virtual machine method |
| CN105162897A (en) * | 2015-09-16 | 2015-12-16 | 浪潮集团有限公司 | System and method for allocating IP address for virtual machine and network virtual machine |
| CN108089910A (en) * | 2016-11-23 | 2018-05-29 | 北京国双科技有限公司 | The method and apparatus for configuring virtual machine IP address |
| CN115002151A (en) * | 2022-05-07 | 2022-09-02 | 通号城市轨道交通技术有限公司 | Method and device for building test system of automatic train monitoring system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102315968B (en) | 2013-12-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102315968B (en) | Network configuration method in virtual machine environment | |
| US12278842B2 (en) | Method and system for virtual machine aware policy management | |
| US11487690B2 (en) | Universal host and non-volatile memory express storage domain discovery for non-volatile memory express over fabrics | |
| US8086713B2 (en) | Determining a subscriber device has failed gracelessly without issuing a DHCP release message and automatically releasing resources reserved for the subscriber device within a broadband network upon determining that another subscriber device requesting the reservation of a network address has the same context information as the failed subscriber device | |
| EP3664420B1 (en) | Managing address spaces across network elements | |
| WO2014190791A1 (en) | Method for setting identity of gateway device and management gateway device | |
| US20130044754A1 (en) | Method, apparatus and system for acquiring media access control address | |
| US20080028071A1 (en) | Communication load reducing method and computer system | |
| CN108322506A (en) | A kind of methods, devices and systems of internet of things equipment access network | |
| CN105993161B (en) | Element, method, system and computer readable storage device for resolving an address | |
| CN102025630A (en) | Load balancing method and load balancing system | |
| CN105656653A (en) | Network access method of newly added node in distributed coordination system, device and system | |
| CN110012118B (en) | Method and controller for providing Network Address Translation (NAT) service | |
| CN113612866B (en) | Address detection method and device, computer equipment and storage medium | |
| CN114095430A (en) | Processing method, system and working node of access message | |
| CN110798329A (en) | IoT gateway access method, device and storage medium | |
| CN101521606A (en) | Log information processing method, log server and communication system | |
| CN105722040B (en) | Method, device and system for transmitting business messages | |
| CN108881506A (en) | A kind of domain name analytic method and device based on more available partition AZ | |
| WO2016202016A1 (en) | Device management method, apparatus and system | |
| CN117650984A (en) | Equipment upgrading method and device, electronic equipment and storage medium | |
| CN105897758A (en) | Container access control method and device | |
| US8855015B2 (en) | Techniques for generic pruning in a trill network | |
| CN101534255A (en) | A method and device for realizing oriented processing of certain request | |
| EP4216510A1 (en) | Method for acquiring address, apparatus and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20131218 Termination date: 20200919 |



