[go: up one dir, main page]

CN103001953B - Virtual machine network resource allocation methods and device - Google Patents

Virtual machine network resource allocation methods and device Download PDF

Info

Publication number
CN103001953B
CN103001953B CN201210476239.7A CN201210476239A CN103001953B CN 103001953 B CN103001953 B CN 103001953B CN 201210476239 A CN201210476239 A CN 201210476239A CN 103001953 B CN103001953 B CN 103001953B
Authority
CN
China
Prior art keywords
virtual machine
physical host
resources
vlan resource
request message
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.)
Active
Application number
CN201210476239.7A
Other languages
Chinese (zh)
Other versions
CN103001953A (en
Inventor
沃天宇
兰博
李博
杨晓宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201210476239.7A priority Critical patent/CN103001953B/en
Publication of CN103001953A publication Critical patent/CN103001953A/en
Application granted granted Critical
Publication of CN103001953B publication Critical patent/CN103001953B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明提供了一种虚拟机网络资源分配方法及装置,方法包括:第一物理主机接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源;若所述虚拟机资源请求消息请求分配一台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源,所述私有VLAN资源用于在二层网络隔离虚拟机;若所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。本发明通过上述方法及装置,实现了海量用户的需求。

The present invention provides a virtual machine network resource allocation method and device. The method includes: a first physical host receives a virtual machine resource request message sent by a user, and the virtual machine resource request message is used to request network allocation of at least one virtual machine resources; if the virtual machine resource request message requests to allocate network resources of a virtual machine, then the first physical host allocates private VLAN resources for the user in the private VLAN resource pool of the first physical host, so The private VLAN resources are used to isolate virtual machines on a Layer 2 network; if the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical host is in the community VLAN of the first physical host The user is allocated community VLAN resources in the resource pool, and the community VLAN resources are used to connect virtual machines on the Layer 2 network. The present invention realizes the needs of a large number of users through the above method and device.

Description

虚拟机网络资源分配方法及装置Virtual machine network resource allocation method and device

技术领域technical field

本发明涉及计算机技术,尤其涉及一种虚拟机网络资源分配方法及装置。The invention relates to computer technology, in particular to a virtual machine network resource allocation method and device.

背景技术Background technique

802.1Q VLAN(Virtual Local Area Network)即虚拟局域网,是一种通过将局域网内的设备逻辑地而不是物理地划分成一个个网段从而实现虚拟工作组的技术。VLAN技术允许网络管理者将一个物理的LAN逻辑地划分成不同的广播域,每一个VLAN都包含一组有着相同需求的计算机工作站,与物理上形成的LAN有着相同的属性。802.1Q VLAN (Virtual Local Area Network) is a virtual local area network, which is a technology that realizes a virtual workgroup by logically rather than physically dividing devices in a local area network into network segments. VLAN technology allows network managers to logically divide a physical LAN into different broadcast domains. Each VLAN includes a group of computer workstations with the same requirements, and has the same attributes as the physically formed LAN.

现有技术中,为每一个租户分配一个VLAN,然而在这种模式下,由于802.1Q VLAN协议的限制最多只能支持4094个VLAN,因此,最多只能服务4094个租户,无法满足海量用户的需求。In the prior art, a VLAN is assigned to each tenant. However, in this mode, due to the limitation of the 802.1Q VLAN protocol, it can only support up to 4094 VLANs. Therefore, it can only serve up to 4094 tenants, which cannot meet the needs of a large number of users. need.

发明内容Contents of the invention

本发明提供了一种虚拟机网络资源分配方法及装置,用于实现海量用户的需求。The present invention provides a virtual machine network resource allocation method and device, which are used to realize the demands of a large number of users.

一方面,本发明提供了一种虚拟机网络资源分配方法,包括:In one aspect, the present invention provides a virtual machine network resource allocation method, including:

第一物理主机接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源;The first physical host receives a virtual machine resource request message sent by a user, where the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine;

若所述虚拟机资源请求消息请求分配一台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源,所述私有VLAN资源用于在二层网络隔离虚拟机;If the virtual machine resource request message requests to allocate network resources of a virtual machine, the first physical host allocates private VLAN resources to the user in the private VLAN resource pool of the first physical host, and the private VLAN resources are used to isolate virtual machines on the Layer 2 network;

若所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。If the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical host allocates community VLAN resources to the user in the community VLAN resource pool of the first physical host, and the Community VLAN resources are used to connect VMs on a Layer 2 network.

另一方面,本发明提供了一种虚拟机网络资源分配装置,包括:In another aspect, the present invention provides a virtual machine network resource allocation device, including:

接收模块,用于接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源;A receiving module, configured to receive a virtual machine resource request message sent by a user, where the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine;

分配模块,用于所述虚拟机资源请求消息请求分配一台虚拟机的网络资源时,所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源,所述私有VLAN资源用于在二层网络隔离虚拟机;所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源时,所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。An allocation module, configured to allocate private VLAN resources to the user in the private VLAN resource pool of the first physical host by the first physical host when the virtual machine resource request message requests allocation of network resources of a virtual machine , the private VLAN resource is used to isolate virtual machines on a Layer 2 network; when the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical host is in the community of the first physical host The user is allocated community VLAN resources in the VLAN resource pool, and the community VLAN resources are used to connect virtual machines on the Layer 2 network.

本发明提供的虚拟机网络资源分配方法及装置,如果用户请求一台虚拟机的网络资源,则物理机可以在私有VLAN资源池中为虚拟机分配私有VLAN资源以使虚拟机在二层网络隔离;如果用户请求至少两台虚拟机的网络资源,物理机可以在社区VLAN资源池中为虚拟机分配社区VLAN资源以使用户请求的至少两台虚拟机可以在二层网络通信,私有VLAN资源可以复用,从而满足了海量用户的需求。In the method and device for allocating virtual machine network resources provided by the present invention, if a user requests network resources of a virtual machine, the physical machine can allocate private VLAN resources for the virtual machine in the private VLAN resource pool so that the virtual machine is isolated on the second-layer network ; If the user requests network resources of at least two virtual machines, the physical machine can allocate community VLAN resources for the virtual machines in the community VLAN resource pool so that the at least two virtual machines requested by the user can communicate on the Layer 2 network, and private VLAN resources can be Reuse, so as to meet the needs of a large number of users.

附图说明Description of drawings

图1为本发明虚拟机网络资源分配方法一实施例的流程图;FIG. 1 is a flowchart of an embodiment of a method for allocating virtual machine network resources according to the present invention;

图2为本发明虚拟机网络资源分配方法另一实施例的流程图;FIG. 2 is a flow chart of another embodiment of the method for allocating virtual machine network resources according to the present invention;

图3为本发明虚拟机网络资源分配方法又一实施例的流程图;FIG. 3 is a flowchart of another embodiment of the method for allocating virtual machine network resources according to the present invention;

图4为本发明虚拟机网络资源分配方法再一实施例的流程图;FIG. 4 is a flow chart of still another embodiment of the method for allocating virtual machine network resources according to the present invention;

图5为本发明跨物理子网的虚拟机网络互联示意图;Fig. 5 is a schematic diagram of virtual machine network interconnection across physical subnets in the present invention;

图6为本发明虚拟机网络资源分配装置一实施例的结构示意图;FIG. 6 is a schematic structural diagram of an embodiment of a virtual machine network resource allocation device according to the present invention;

图7为本发明虚拟机网络资源分配装置另一实施例的结构示意图。FIG. 7 is a schematic structural diagram of another embodiment of an apparatus for allocating virtual machine network resources according to the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

图1为本发明虚拟机网络资源分配方法一实施例的流程图,如图1所示,虚拟机网络资源分配方法包括:Fig. 1 is a flowchart of an embodiment of a method for allocating virtual machine network resources according to the present invention. As shown in Fig. 1, the method for allocating virtual machine network resources includes:

101、第一物理主机接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源。101. The first physical host receives a virtual machine resource request message sent by a user, where the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine.

本发明实施例中,物理主机接收到用户的虚拟机资源分配请求时,可以针对不同用户对虚拟机资源的不同需求,分配不同的网络资源。本发明将虚拟网络资源聚合为资源池,包括一组虚拟交换机、私有虚拟局域网络VLAN资源池和社区虚拟局域网络VLAN资源池。具体的,将所有的虚拟交换机的2层端口设置为中继trunk模式,用于虚拟交换机之间的连接;可以在每一台物理主机上创建虚拟交换机,可以为所有虚拟交换机初始化一个私有VLAN资源池和一个社区VLAN资源池,并且将所有资源池信息记录到数据中心的数据库中。In the embodiment of the present invention, when the physical host receives a user's virtual machine resource allocation request, it can allocate different network resources according to different needs of different users for virtual machine resources. The invention aggregates virtual network resources into resource pools, including a group of virtual switches, private virtual local area network VLAN resource pools and community virtual local area network VLAN resource pools. Specifically, set the Layer 2 ports of all virtual switches to trunk mode for connection between virtual switches; create a virtual switch on each physical host, and initialize a private VLAN resource for all virtual switches pool and a community VLAN resource pool, and record all resource pool information into the database of the data center.

102、若所述虚拟机资源请求消息请求分配一台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源,所述私有VLAN资源用于在二层网络隔离虚拟机。102. If the virtual machine resource request message requests to allocate network resources of a virtual machine, the first physical host allocates private VLAN resources to the user in the private VLAN resource pool of the first physical host, and The above private VLAN resources are used to isolate virtual machines on the Layer 2 network.

如果用户请求分配一台虚拟机的网络资源,则表明该用户的虚拟机运行时通常不希望与其他用户的虚拟机通信,从而受到其他用户的干扰,因此,可以在该用户请求分配虚拟机网络资源的物理主机的私有VLAN资源池中,为虚拟机分配网络资源。根据虚拟交换机的三层路由功能,使得该虚拟机在二层网络中与其他的虚拟机相互隔离。If a user requests to allocate a virtual machine's network resources, it indicates that the user's virtual machine usually does not want to communicate with other users' virtual machines when it is running, so that it will be interfered by other users. In the private VLAN resource pool of the physical host of the resource, network resources are allocated to the virtual machine. According to the layer-3 routing function of the virtual switch, the virtual machine is isolated from other virtual machines in the layer-2 network.

私有VLAN资源可以在不同的物理机上复用,因为分配到私有VLAN资源的各虚拟机分别属于不同的用户,所以上述各虚拟机在交换机二层是不能通信的。Private VLAN resources can be reused on different physical machines, because the virtual machines allocated to private VLAN resources belong to different users, so the above-mentioned virtual machines cannot communicate at the second layer of the switch.

103、若所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。103. If the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical host allocates community VLAN resources to the user in the community VLAN resource pool of the first physical host, The community VLAN resources are used to connect virtual machines on a Layer 2 network.

如果用户请求分配至少两台虚拟机的网络资源,由于这些虚拟机同属同一用户,或者用于同一用户进行相同的业务,因此,用户通常希望上述至少两台虚拟机之间可以进行通信,以方便用户同一操作和管理。因此,可以在该用户请求分配虚拟机网络资源的物理主机的社区VLAN资源池中,为虚拟机分配网络资源。同时根据交换机的三层路由功能,使得该组虚拟机之间在二层网络中可以进行通信,而该组虚拟机在二层网络中与分配到私有VLAN资源的虚拟机是不能通信的。If a user requests to allocate network resources of at least two virtual machines, since these virtual machines belong to the same user, or are used by the same user for the same business, the user usually hopes that the at least two virtual machines can communicate with each other for convenience. User same operation and management. Therefore, network resources can be allocated to the virtual machine in the community VLAN resource pool of the physical host that the user requests to allocate the network resources of the virtual machine. At the same time, according to the layer-3 routing function of the switch, the group of virtual machines can communicate in the layer-2 network, but the group of virtual machines cannot communicate with the virtual machines assigned to the private VLAN resources in the layer-2 network.

本发明提供的虚拟机网络资源分配方法,如果用户请求一台虚拟机的网络资源,则物理机可以在私有VLAN资源池中为虚拟机分配私有VLAN资源以使虚拟机在二层网络隔离;如果用户请求至少两台虚拟机的网络资源,物理机可以在社区VLAN资源池中为虚拟机分配社区VLAN资源以使用户请求的至少两台虚拟机可以在二层网络通信,私有VLAN资源可以复用,从而满足了海量用户的需求。In the virtual machine network resource allocation method provided by the present invention, if the user requests the network resources of a virtual machine, the physical machine can allocate private VLAN resources for the virtual machine in the private VLAN resource pool so that the virtual machine is isolated in the two-layer network; if When a user requests network resources of at least two virtual machines, the physical machine can allocate community VLAN resources to the virtual machines in the community VLAN resource pool so that at least two virtual machines requested by the user can communicate on the Layer 2 network, and private VLAN resources can be reused , so as to meet the needs of a large number of users.

图2为本发明虚拟机网络资源分配方法另一实施例的流程图,如图2所示,当前物理主机中的私有VLAN资源不足以为一台虚拟机分配时,该方法可以包括:Fig. 2 is the flow chart of another embodiment of the virtual machine network resource allocation method of the present invention, as shown in Fig. 2, when the private VLAN resource in the current physical host is not enough to allocate for a virtual machine, the method may include:

201、第一物理主机接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源。201. The first physical host receives a virtual machine resource request message sent by a user, where the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine.

202、若所述虚拟机资源请求消息请求分配一台虚拟机的网络资源时,第一物理主机进行判断其私有VLAN资源池内的私有VLAN资源是否能够满足所述虚拟机资源请求消息请求分配的一台虚拟机的网络资源,若满足,则执行步骤203;若不满足,则执行步骤204。202. If the virtual machine resource request message requests to allocate a network resource of a virtual machine, the first physical host judges whether the private VLAN resources in its private VLAN resource pool can meet the allocation requirement of the virtual machine resource request message. If the network resources of one virtual machine are satisfied, then step 203 is performed; if not, then step 204 is performed.

当用户向物理主机请求为一台虚拟机分配网络资源时,可能会出现物理主机上剩余的私有VLAN资源不足。所以在物理主机为虚拟机分配虚拟网络资源之前,可以先进行判断,以确定该物理主机剩余的私有VLAN资源是否可为用户分配。When a user requests the physical host to allocate network resources for a virtual machine, the remaining private VLAN resources on the physical host may be insufficient. Therefore, before the physical host allocates virtual network resources to the virtual machine, a judgment can be made to determine whether the remaining private VLAN resources of the physical host can be allocated to users.

203、若所述第一物理主机的私有VLAN资源池内的私有VLAN资源可以满足所述虚拟机资源请求消息请求分配的一台虚拟机的网络资源,则所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源。203. If the private VLAN resources in the private VLAN resource pool of the first physical host can satisfy the network resources of a virtual machine allocated by the virtual machine resource request message, then the first physical host in the first The private VLAN resource is allocated to the user in the private VLAN resource pool of the physical host.

204、若所述第一物理主机的私有VLAN资源池内的私有VLAN资源不能满足所述虚拟机资源请求消息请求分配的一台虚拟机的网络资源,则所述第一物理主机确定将所述虚拟机资源请求消息请求分配的一台虚拟机迁移至第二物理主机,以使所述第二物理主机在所述第二物理主机的私有VLAN资源中为所述用户分配私有VLAN资源。204. If the private VLAN resources in the private VLAN resource pool of the first physical host cannot satisfy the network resources of a virtual machine allocated by the virtual machine resource request message, the first physical host determines to assign the virtual machine The machine resource request message requests the allocated virtual machine to migrate to the second physical host, so that the second physical host allocates private VLAN resources for the user in the private VLAN resources of the second physical host.

在接收到用户请求为虚拟机分配网络资源后,物理主机检测到本机拥有的网络资源可以为虚拟机分配,则在该物理主机的私有VLAN资源池中为用户虚拟机分配资源;物理主机检测到本机拥有的网络资源不足以为虚拟机分配,则将该虚拟机通过虚拟机交换机迁移至另一台物理主机,由目标物理主机为在其私有VLAN资源池中为虚拟机分配资源。这样,虽然该虚拟机不属于目标物理主机,仍然可以保证网络资源的分配和业务的正常运行。After receiving a user request to allocate network resources for a virtual machine, the physical host detects that the network resources owned by the machine can be allocated for the virtual machine, and then allocates resources for the user virtual machine in the private VLAN resource pool of the physical host; the physical host detects If the network resources owned by this machine are not enough to allocate for the virtual machine, then the virtual machine is migrated to another physical host through the virtual machine switch, and the target physical host allocates resources for the virtual machine in its private VLAN resource pool. In this way, although the virtual machine does not belong to the target physical host, the allocation of network resources and the normal operation of services can still be guaranteed.

本发明提供的虚拟机网络资源分配方法,如果用户请求一台虚拟机的网络资源,则物理机可以在私有VLAN资源池中为虚拟机分配私有VLAN资源以使虚拟机在二层网络隔离;如果用户请求至少两台虚拟机的网络资源,物理机可以在社区VLAN资源池中为虚拟机分配社区VLAN资源以使用户请求的至少两台虚拟机可以在二层网络通信,私有VLAN资源可以复用,从而满足了海量用户的需求。又通过虚拟机在不同物理主机之间的迁移,实现了跨越物理主机的资源调配,同时可以保证虚拟机上业务的正常运行。In the virtual machine network resource allocation method provided by the present invention, if the user requests the network resources of a virtual machine, the physical machine can allocate private VLAN resources for the virtual machine in the private VLAN resource pool so that the virtual machine is isolated in the two-layer network; if When a user requests network resources of at least two virtual machines, the physical machine can allocate community VLAN resources to the virtual machines in the community VLAN resource pool so that at least two virtual machines requested by the user can communicate on the Layer 2 network, and private VLAN resources can be reused , so as to meet the needs of a large number of users. Through the migration of virtual machines between different physical hosts, resource allocation across physical hosts is realized, and the normal operation of services on virtual machines can be guaranteed.

图3为本发明虚拟机网络资源分配方法又一实施例的流程图,如图3所示,当前物理主机中的社区VLAN资源不足以为至少两台虚拟机分配时,该方法可以包括:Fig. 3 is a flowchart of another embodiment of the virtual machine network resource allocation method of the present invention. As shown in Fig. 3, when the community VLAN resources in the current physical host are insufficient to allocate at least two virtual machines, the method may include:

301、第一物理主机接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源。301. The first physical host receives a virtual machine resource request message sent by a user, where the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine.

302、若所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源时,第一物理机判断其社区VLAN资源池内的社区VLAN资源是否能够满足所述虚拟机资源请求消息请求分配的至少两台虚拟机的网络资源,若满足,则执行步骤303;若不满足,则执行步骤304。302. If the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical machine judges whether the community VLAN resources in its community VLAN resource pool can satisfy at least the resource allocation requested by the virtual machine resource request message. If the network resources of the two virtual machines are satisfied, go to step 303; if not, go to step 304.

同样,当用户向物理主机请求为两台或两台以上虚拟机分配网络资源时,如果物理主机上剩余的网络资源不足以分配给两台或两台以上创建在该物理主机上的虚拟机,无法保证虚拟机之间业务的运行。所以在物理主机为虚拟机分配社区VLAN资源之前,可以进行判断,检查该物理主机是否还拥有足够的社区VLAN资源以供分配。Similarly, when a user requests a physical host to allocate network resources for two or more virtual machines, if the remaining network resources on the physical host are not enough to allocate to the two or more virtual machines created on the physical host, The operation of services between virtual machines cannot be guaranteed. Therefore, before the physical host allocates community VLAN resources to the virtual machine, it can be judged to check whether the physical host still has enough community VLAN resources for allocation.

303、若所述第一物理主机的社区VLAN资源池内的社区VLAN资源可以满足所述虚拟机资源请求消息请求分配的至少两台虚拟机网络资源,则所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。303. If the community VLAN resources in the community VLAN resource pool of the first physical host can satisfy the network resources of at least two virtual machines allocated by the virtual machine resource request message, then the first physical host in the first The community VLAN resource is allocated to the user in the community VLAN resource pool of the physical host, and the community VLAN resource is used to connect the virtual machine on the Layer 2 network.

304、若所述第一物理主机的社区VLAN资源池内的社区VLAN资源不能满足所述虚拟机资源请求消息请求分配的至少两台虚拟机网络资源,则所述第一物理主机确定将所述不能满足所述虚拟机资源请求消息请求分配的至少一台虚拟机迁移至第三物理主机,以使所述第三物理主机在所述第三物理主机的社区VLAN资源中为所述用户分配社区VLAN资源。304. If the community VLAN resources in the community VLAN resource pool of the first physical host cannot satisfy the at least two virtual machine network resources allocated by the virtual machine resource request message, the first physical host determines that the incapable At least one virtual machine that satisfies the allocation requested by the virtual machine resource request message is migrated to a third physical host, so that the third physical host allocates a community VLAN for the user in the community VLAN resource of the third physical host resource.

同样,在接收到用户请求为两台或两台以上虚拟机分配网络资源后,物理主机检测到本机拥有的社区VLAN资源是否满足为两台或两台以上虚拟机分配,若满足,则在该物理主机的社区VLAN资源池中为用户虚拟机分配资源;若不满足,则将至少一台虚拟机通过虚拟机交换机迁移至另一台物理主机,由目标物理主机为在其社区VLAN资源池中为虚拟机分配资源。这样,虽然这两台或两台以上虚拟机不属于目标物理主机,仍然可以保证网络资源的分配和业务的正常运行。并且,该组虚拟机在二层网络是连通的,而与其他的虚拟机在二层网络是隔离的,也保证了同一业务内部的交互和与其他业务的安全隔离。Similarly, after receiving a user request to allocate network resources for two or more virtual machines, the physical host detects whether the community VLAN resources owned by the machine meet the allocation requirements for two or more virtual machines. Allocate resources for user virtual machines in the community VLAN resource pool of the physical host; if not satisfied, at least one virtual machine will be migrated to another physical host through the virtual machine switch, and the target physical host will be assigned resources in its community VLAN resource pool. Allocate resources to virtual machines. In this way, although the two or more virtual machines do not belong to the target physical host, the allocation of network resources and the normal operation of services can still be guaranteed. Moreover, this group of virtual machines is connected on the layer 2 network, but isolated from other virtual machines on the layer 2 network, which also ensures the interaction within the same service and the security isolation from other services.

305、验证分别在第一物理主机和第三物理主机上分配社区VLAN资源的虚拟机之间在二层网络是否可以通信。305. Verify whether the virtual machines allocated community VLAN resources on the first physical host and the third physical host can communicate on the Layer 2 network.

本发明提供的虚拟机网络资源分配方法,如果用户请求一台虚拟机的网络资源,则物理机可以在私有VLAN资源池中为虚拟机分配私有VLAN资源以使虚拟机在二层网络隔离;如果用户请求至少两台虚拟机的网络资源,物理机可以在社区VLAN资源池中为虚拟机分配社区VLAN资源以使用户请求的至少两台虚拟机可以在二层网络通信,私有VLAN资源可以复用,从而满足了海量用户的需求。又通过虚拟机在不同物理主机之间的迁移,实现了跨越物理主机的虚拟机之间的通讯和资源调配,同时可以保证虚拟机上业务的正常运行。In the virtual machine network resource allocation method provided by the present invention, if the user requests the network resources of a virtual machine, the physical machine can allocate private VLAN resources for the virtual machine in the private VLAN resource pool so that the virtual machine is isolated in the two-layer network; if When a user requests network resources of at least two virtual machines, the physical machine can allocate community VLAN resources to the virtual machines in the community VLAN resource pool so that at least two virtual machines requested by the user can communicate on the Layer 2 network, and private VLAN resources can be reused , so as to meet the needs of a large number of users. Through the migration of virtual machines between different physical hosts, the communication and resource allocation between virtual machines across physical hosts are realized, and the normal operation of services on virtual machines can be guaranteed at the same time.

图4为本发明虚拟机网络资源分配方法再一实施例的流程图,如图4所示,当前物理主机中的社区VLAN资源不足以为至少两台虚拟机分配,且所迁移至的目标物理主机与原物理主机不属于同一物理子网时,该方法可以包括:Fig. 4 is a flowchart of another embodiment of the virtual machine network resource allocation method of the present invention. As shown in Fig. 4, the community VLAN resources in the current physical host are not enough to allocate at least two virtual machines, and the target physical host to which the virtual machine is migrated When the original physical host does not belong to the same physical subnet, the method may include:

401、第一物理主机接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源。401. The first physical host receives a virtual machine resource request message sent by a user, where the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine.

402、若所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源,第一物理及判断其社区VLAN资源池内的社区VLAN资源能够满足所述虚拟机资源请求消息请求分配的至少两台虚拟机的网络资源。402. If the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical server judges that the community VLAN resources in its community VLAN resource pool can satisfy at least two of the virtual machine resource request messages. Network resources for the virtual machine.

403、若所述第一物理主机的社区VLAN资源池内的社区VLAN资源可以满足所述虚拟机资源请求消息请求分配的至少一台虚拟机网络资源,则所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。403. If the community VLAN resources in the community VLAN resource pool of the first physical host can satisfy at least one virtual machine network resource allocated by the virtual machine resource request message, then the first physical host in the first The community VLAN resource is allocated to the user in the community VLAN resource pool of the physical host, and the community VLAN resource is used to connect the virtual machine on the Layer 2 network.

404、若所述第一物理主机的社区VLAN资源池内的社区VLAN资源不能满足所述虚拟机资源请求消息请求分配的至少一台虚拟机网络资源,则所述第一物理主机确定将所述不能满足所述虚拟机资源请求消息请求分配的至少一台虚拟机迁移至第三物理主机。404. If the community VLAN resources in the community VLAN resource pool of the first physical host cannot satisfy at least one virtual machine network resource allocated by the virtual machine resource request message, then the first physical host determines that the incapable At least one virtual machine satisfying the allocation requested by the virtual machine resource request message is migrated to the third physical host.

405、第一物理主机判断所述第三物理主机与所述第一物理主机是否属于同一物理子网;若属于同一子网,则执行步骤406,若干不属于同一子网,则执行步骤407。405. The first physical host determines whether the third physical host and the first physical host belong to the same physical subnet; if they belong to the same subnet, perform step 406, and if some do not belong to the same subnet, perform step 407.

406、直接将虚拟机连接至所述第三物理主机的虚拟交换机,以使所述第一物理主机上为所述用户分配的虚拟机与所述第三物理主机上为所述用户分配的虚拟机在二层网络通信,以使所述第三物理主机在所述第三物理主机的社区VLAN资源中为所述用户分配社区VLAN资源。406. Directly connect the virtual machine to the virtual switch of the third physical host, so that the virtual machine allocated to the user on the first physical host is the same as the virtual machine allocated to the user on the third physical host. The host communicates on the Layer 2 network, so that the third physical host allocates community VLAN resources to the user in the community VLAN resources of the third physical host.

407、所述第三物理主机创建孤立虚拟交换机IVS,并在所述IVS和所述第一物理主机所属的物理子网之间建立双向GRE隧道,以使所述第一物理主机上为所述用户分配的虚拟机与所述第三物理主机上为所述用户分配的虚拟机在二层网络通信,以使所述第三物理主机在所述第三物理主机的社区VLAN资源中为所述用户分配社区VLAN资源。407. The third physical host creates an isolated virtual switch IVS, and establishes a bidirectional GRE tunnel between the IVS and the physical subnet to which the first physical host belongs, so that the first physical host is the The virtual machine allocated by the user communicates with the virtual machine allocated to the user on the third physical host on the Layer 2 network, so that the third physical host is the third physical host in the community VLAN resource of the third physical host for the Users allocate community VLAN resources.

考虑到如下情况:如果一个用户需要分配3台虚拟机,而当前的物理子网内物理主机的社区VLAN资源只够分配两台虚拟机所用的资源时,第三台需要放置到另外的物理子网的服务器内,用户当然希望三台虚拟机彼此之间都可以再2层进行通讯。由于需要跨越不同物理子网,第三台虚拟机需要通过路由和其他两台虚拟机进行通讯。Considering the following situation: If a user needs to allocate 3 virtual machines, and the community VLAN resource of the physical host in the current physical subnet is only enough to allocate the resources used by the two virtual machines, the third one needs to be placed in another physical subnet. In the server of the network, the user certainly hopes that the three virtual machines can communicate with each other at the second layer. Due to the need to span different physical subnets, the third virtual machine needs to communicate with the other two virtual machines through a router.

本发明通过在不同物理子网之间建立2层隧道保证虚拟机在2层互联。如图5所示,物理子网2中的一台虚拟机需要迁移至物理子网1内进行社区VLAN资源分配,则在物理子网1中创建孤立虚拟交换机(IVS,Isolated Virtual Switch)1,通过双向通用路由封装(GRE,General RoutingEncapsulation)隧道将该IVS1连接至目标物理子网2中;同样,物理子网3中另一台虚拟机需要迁移至物理子网1内进行社区VLAN资源分配,则在物理子网1中创建IVS2,通过双向GRE隧道将该IVS2连接至目标物理子网3中,继而实现跨越物理子网之间的虚拟机网络资源分配。The invention ensures the interconnection of virtual machines at the layer 2 by establishing layer 2 tunnels between different physical subnets. As shown in Figure 5, a virtual machine in physical subnet 2 needs to be migrated to physical subnet 1 for community VLAN resource allocation, then create an isolated virtual switch (IVS, Isolated Virtual Switch) 1 in physical subnet 1, Connect the IVS1 to the target physical subnet 2 through a bidirectional General Routing Encapsulation (GRE, General Routing Encapsulation) tunnel; similarly, another virtual machine in the physical subnet 3 needs to be migrated to the physical subnet 1 for community VLAN resource allocation, Create an IVS2 in physical subnet 1, connect the IVS2 to the target physical subnet 3 through a bidirectional GRE tunnel, and then realize network resource allocation of virtual machines across physical subnets.

408、验证分别在第一物理主机和第三物理主机上分配社区VLAN资源的虚拟机之间在二层网络是否可以通信。408. Verify whether the virtual machines allocated community VLAN resources on the first physical host and the third physical host can communicate on the Layer 2 network.

本发明提供的虚拟机网络资源分配方法,如果用户请求一台虚拟机的网络资源,则物理机可以在私有VLAN资源池中为虚拟机分配私有VLAN资源以使虚拟机在二层网络隔离;如果用户请求至少两台虚拟机的网络资源,物理机可以在社区VLAN资源池中为虚拟机分配社区VLAN资源以使用户请求的至少两台虚拟机可以在二层网络通信,私有VLAN资源可以复用,从而满足了海量用户的需求。又通过虚拟机在不同物理子网的物理主机之间的迁移,并创建IVS,同时通过GRE隧道连接不同物理子网,实现了跨越物理子网的虚拟机之间的通讯和资源调配,同时可以保证虚拟机上业务的正常运行。In the virtual machine network resource allocation method provided by the present invention, if the user requests the network resources of a virtual machine, the physical machine can allocate private VLAN resources for the virtual machine in the private VLAN resource pool so that the virtual machine is isolated in the two-layer network; if When a user requests network resources of at least two virtual machines, the physical machine can allocate community VLAN resources to the virtual machines in the community VLAN resource pool so that at least two virtual machines requested by the user can communicate on the Layer 2 network, and private VLAN resources can be reused , so as to meet the needs of a large number of users. Through the migration of virtual machines between physical hosts in different physical subnets, IVS is created, and at the same time, GRE tunnels are used to connect different physical subnets to realize communication and resource allocation between virtual machines across physical subnets. Ensure the normal operation of services on the virtual machine.

图6为本发明虚拟机网络资源分配装置一实施例的流程图,如图6所示,该装置包括:FIG. 6 is a flow chart of an embodiment of a virtual machine network resource allocation device according to the present invention. As shown in FIG. 6, the device includes:

接收模块61,用于接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源;The receiving module 61 is configured to receive a virtual machine resource request message sent by a user, and the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine;

分配模块62,用于所述虚拟机资源请求消息请求分配一台虚拟机的网络资源时,所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源,所述私有VLAN资源用于在二层网络隔离虚拟机;所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源时,所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。The allocation module 62 is configured to allocate a private VLAN to the user in the private VLAN resource pool of the first physical host by the first physical host when the virtual machine resource request message requests to allocate network resources of a virtual machine resources, the private VLAN resources are used to isolate virtual machines on a Layer 2 network; when the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical host is on the first physical host The community VLAN resource is allocated to the user in the community VLAN resource pool, and the community VLAN resource is used to connect the virtual machine on the Layer 2 network.

图7为本发明虚拟机网络资源分配装置另一实施例的流程图,如图7所示,该装置可以包括:Fig. 7 is a flowchart of another embodiment of the device for allocating virtual machine network resources according to the present invention. As shown in Fig. 7, the device may include:

接收模块71,用于接收用户发送的虚拟机资源请求消息,所述虚拟机资源请求消息用于请求分配至少一台虚拟机的网络资源;The receiving module 71 is configured to receive a virtual machine resource request message sent by a user, and the virtual machine resource request message is used to request allocation of network resources of at least one virtual machine;

分配模块74,用于所述虚拟机资源请求消息请求分配一台虚拟机的网络资源时,所述第一物理主机在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源,所述私有VLAN资源用于在二层网络隔离虚拟机;所述虚拟机资源请求消息请求分配至少两台虚拟机的网络资源时,所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源,所述社区VLAN资源用于在二层网络连通虚拟机。The allocation module 74 is configured to allocate a private VLAN to the user in the private VLAN resource pool of the first physical host by the first physical host when the virtual machine resource request message requests to allocate network resources of a virtual machine resources, the private VLAN resources are used to isolate virtual machines on a Layer 2 network; when the virtual machine resource request message requests to allocate network resources of at least two virtual machines, the first physical host is on the first physical host The community VLAN resource is allocated to the user in the community VLAN resource pool, and the community VLAN resource is used to connect the virtual machine on the Layer 2 network.

可选的,虚拟机网络资源分配装置还可以包括:Optionally, the device for allocating virtual machine network resources may also include:

判断模块72,用于在所述第一物理主机的私有VLAN资源池中为所述用户分配私有VLAN资源之前,判断所述第一物理主机的私有VLAN资源池内的私有VLAN资源是否能够满足所述虚拟机资源请求消息请求分配的一台虚拟机的网络资源;A judging module 72, configured to judge whether the private VLAN resources in the private VLAN resource pool of the first physical host can meet the requirements before allocating private VLAN resources to the user in the private VLAN resource pool of the first physical host. The virtual machine resource request message requests the allocated network resources of a virtual machine;

迁移模块73,用于在所述第一物理主机的私有VLAN资源池内的私有VLAN资源不能满足所述虚拟机资源请求消息请求分配的一台虚拟机的网络资源时,所述第一物理主机确定将所述虚拟机资源请求消息请求分配的一台虚拟机迁移至第二物理主机,以使所述第二物理主机在所述第二物理主机的私有VLAN资源中为所述用户分配私有VLAN资源。The migration module 73 is configured to, when the private VLAN resources in the private VLAN resource pool of the first physical host cannot satisfy the network resources of a virtual machine allocated by the virtual machine resource request message, the first physical host determines migrating a virtual machine allocated by the virtual machine resource request message to a second physical host, so that the second physical host allocates private VLAN resources for the user in the private VLAN resources of the second physical host .

可选的,判断模块72还可以用于:Optionally, the judging module 72 can also be used for:

在所述第一物理主机在所述第一物理主机的社区VLAN资源池中为所述用户分配社区VLAN资源之前,判断所述第一物理主机的社区VLAN资源池内的社区VLAN资源是否能够满足所述虚拟机资源请求消息请求分配的至少两台虚拟机的网络资源;Before the first physical host allocates community VLAN resources to the user in the community VLAN resource pool of the first physical host, it is judged whether the community VLAN resources in the community VLAN resource pool of the first physical host can meet the requirements. The network resource of at least two virtual machines allocated by the virtual machine resource request message;

可选的,迁移模块73还可以用于:Optionally, the migration module 73 can also be used for:

在所述第一物理主机的社区VLAN资源池内的社区VLAN资源不能满足所述虚拟机资源请求消息请求分配的至少一台虚拟机网络资源时,所述第一物理主机确定将所述不能满足所述虚拟机资源请求消息请求分配的至少一台虚拟机迁移至第三物理主机,以使所述第三物理主机在所述第三物理主机的社区VLAN资源中为所述用户分配社区VLAN资源。When the community VLAN resource in the community VLAN resource pool of the first physical host cannot satisfy at least one virtual machine network resource allocated by the virtual machine resource request message, the first physical host determines that the The virtual machine resource request message requests at least one allocated virtual machine to migrate to a third physical host, so that the third physical host allocates community VLAN resources for the user in the community VLAN resources of the third physical host.

可选的,判断模块72还可以用于:Optionally, the judging module 72 can also be used for:

所述第一物理主机确定将所述不能满足所述虚拟机资源请求消息请求分配的至少一台虚拟机迁移至第三物理主机之前,判断所述第三物理主机与所述第一物理主机是否属于同一物理子网;Before the first physical host determines to migrate the at least one virtual machine that cannot satisfy the allocation requested by the virtual machine resource request message to a third physical host, determine whether the third physical host and the first physical host belong to the same physical subnet;

可选的,迁移模块73还可以用于;Optionally, the migration module 73 can also be used for;

在所述第三物理主机与所述第一物理主机属于不同物理子网时,所述第一物理主机创建孤立虚拟交换机IVS,并在所述IVS和所述第一物理主机所属的物理子网之间建立双向通用路由封装GRE隧道,以使所述第一物理主机上为所述用户分配的虚拟机与所述第三物理主机上为所述用户分配的虚拟机在二层网络通信。When the third physical host and the first physical host belong to different physical subnets, the first physical host creates an isolated virtual switch IVS, and creates an isolated virtual switch IVS on the physical subnet to which the IVS and the first physical host belong A bidirectional general routing encapsulation GRE tunnel is established between them, so that the virtual machine allocated to the user on the first physical host communicates with the virtual machine allocated to the user on the third physical host on a Layer 2 network.

可选的,虚拟机网络资源分配装置还可以包括:Optionally, the device for allocating virtual machine network resources may also include:

验证模块75,用于验证分配所述社区VLAN资源的虚拟机之间在二层网络是否可以通信。A verification module 75, configured to verify whether the virtual machines allocated the community VLAN resources can communicate on the Layer 2 network.

本实施例中虚拟机内存共享装置是与虚拟机网络资源分配方法的执行设备,其执行虚拟机网络资源分配方法的具体过程可参见本发明图1-图5所示方法实施例中的相关描述,此处不再赘述。In this embodiment, the virtual machine memory sharing device is an execution device related to the virtual machine network resource allocation method. For the specific process of executing the virtual machine network resource allocation method, please refer to the relevant descriptions in the method embodiments shown in FIGS. 1-5 of the present invention. , which will not be repeated here.

本发明提供的虚拟机网络资源分配装置,如果用户请求一台虚拟机的网络资源,则物理机可以在私有VLAN资源池中为虚拟机分配私有VLAN资源以使虚拟机在二层网络隔离;如果用户请求至少两台虚拟机的网络资源,物理机可以在社区VLAN资源池中为虚拟机分配社区VLAN资源以使用户请求的至少两台虚拟机可以在二层网络通信,私有VLAN资源可以复用,从而满足了海量用户的需求。The virtual machine network resource allocation device provided by the present invention, if the user requests the network resources of a virtual machine, the physical machine can allocate private VLAN resources for the virtual machine in the private VLAN resource pool so that the virtual machine is isolated on the two-layer network; if When a user requests network resources of at least two virtual machines, the physical machine can allocate community VLAN resources to the virtual machines in the community VLAN resource pool so that at least two virtual machines requested by the user can communicate on the Layer 2 network, and private VLAN resources can be reused , so as to meet the needs of a large number of users.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.

Claims (10)

1. a virtual machine network resource allocation methods, is characterized in that, comprising:
First physical host receives the resources of virtual machine request message that user sends, and described resources of virtual machine request message is used for the Internet resources of request dispatching at least one virtual machine;
Each physical host creates virtual switch, is the privately owned VLAN resource pool of all virtual switch initialization one and a community VLAN resource pool, and all resource pool information is recorded in the database of data center;
If described resources of virtual machine request message requests distributes the Internet resources of a virtual machine, then described first physical host distributes privately owned VLAN resource for described user in the privately owned VLAN resource pool of described first physical host, and described privately owned VLAN resource is used at double layer network isolation virtual machine;
If described resources of virtual machine request message requests distributes the Internet resources of at least two virtual machines, then described first physical host distributes community VLAN resource for described user in the community VLAN resource pool of described first physical host, and described community VLAN resource is used for being communicated with virtual machine at double layer network.
2. virtual machine network resource allocation methods according to claim 1, is characterized in that, described first physical host is, before described user distributes privately owned VLAN resource, also comprise in the privately owned VLAN resource pool of described first physical host:
Described first physical host judges whether the privately owned VLAN resource in the privately owned VLAN resource pool of described first physical host can meet the Internet resources of the virtual machine that described resources of virtual machine request message requests is distributed;
If the privately owned VLAN resource in the privately owned VLAN resource pool of described first physical host can not meet the Internet resources of the virtual machine that described resources of virtual machine request message requests is distributed, then described first physical host is determined, by virtual machine (vm) migration to the second physical host of described resources of virtual machine request message requests distribution, to distribute privately owned VLAN resource to make described second physical host in the privately owned VLAN resource of described second physical host for described user.
3. virtual machine network resource allocation methods according to claim 1, is characterized in that, described first physical host is, before described user distributes community VLAN resource, also comprise in the community VLAN resource pool of described first physical host:
Described first physical host judges whether the community VLAN resource in the community VLAN resource pool of described first physical host can meet the Internet resources of at least two virtual machines that described resources of virtual machine request message requests is distributed;
If the community VLAN resource in the community VLAN resource pool of described first physical host can not meet at least two virtual machine network resources that described resources of virtual machine request message requests is distributed, then described first physical host determine by described can not meet described resources of virtual machine request message requests distribute described at least one virtual machine (vm) migration at least two virtual machines to the 3rd physical host, in the community VLAN resource of described 3rd physical host, distribute community VLAN resource for described user to make described 3rd physical host.
4. virtual machine network resource allocation methods according to claim 3, it is characterized in that, described first physical host determine by described can not meet described resources of virtual machine request message requests distribute described in before at least one virtual machine (vm) migration at least two virtual machines to the 3rd physical host, also comprise:
Described first physical host judges whether described 3rd physical host and described first physical host belong to Same Physical subnet;
If described 3rd physical host belongs to different physical subnets from described first physical host, then described 3rd physical host creates isolated virtual switch IVS, and two-way generic route encapsulation gre tunneling is set up between the physical subnets belonging to described IVS and described first physical host, communicate at double layer network with the virtual machine that described 3rd physical host distributes for described user to make the virtual machine that described first physical host distributes for described user.
5. the virtual machine network resource allocation methods according to any one of claim 1,3,4, is characterized in that, described first physical host is, after described user distributes community VLAN resource, also comprise in the community VLAN resource pool of described first physical host:
Whether can communicate at double layer network between the virtual machine of the described community VLAN resource of described first physical host checking distribution.
6. a virtual machine network resource allocation device, is characterized in that, comprising:
Receiver module, for receiving the resources of virtual machine request message that user sends, described resources of virtual machine request message is used for the Internet resources of request dispatching at least one virtual machine;
Distribution module, for creating virtual switch on each physical host, being the privately owned VLAN resource pool of all virtual switch initialization one and a community VLAN resource pool, and being recorded in the database of data center by all resource pool information; When described resources of virtual machine request message requests distributes the Internet resources of a virtual machine, first physical host distributes privately owned VLAN resource for described user in the privately owned VLAN resource pool of described first physical host, and described privately owned VLAN resource is used at double layer network isolation virtual machine; When described resources of virtual machine request message requests distributes the Internet resources of at least two virtual machines, described first physical host distributes community VLAN resource for described user in the community VLAN resource pool of described first physical host, and described community VLAN resource is used for being communicated with virtual machine at double layer network.
7. virtual machine network resource allocation device according to claim 6, is characterized in that, described virtual machine network resource allocation device also comprises:
Judge module, for being before described user distributes privately owned VLAN resource in the privately owned VLAN resource pool of described first physical host, judge whether the privately owned VLAN resource in the privately owned VLAN resource pool of described first physical host can meet the Internet resources of the virtual machine that described resources of virtual machine request message requests is distributed;
Transferring module, when can not meet the Internet resources of the virtual machine that described resources of virtual machine request message requests is distributed for the privately owned VLAN resource in the privately owned VLAN resource pool of described first physical host, described first physical host determines virtual machine (vm) migration to the second physical host described resources of virtual machine request message requests distributed, and distributes privately owned VLAN resource to make described second physical host in the privately owned VLAN resource of described second physical host for described user.
8. virtual machine network resource allocation device according to claim 7, is characterized in that, described judge module also for:
For before described user distributes community VLAN resource in the community VLAN resource pool of described first physical host at described first physical host, judge whether the community VLAN resource in the community VLAN resource pool of described first physical host can meet the Internet resources of at least two virtual machines that described resources of virtual machine request message requests is distributed;
Described transferring module also for, when community VLAN resource in the community VLAN resource pool of described first physical host can not meet at least two virtual machine network resources of described resources of virtual machine request message requests distribution, described first physical host determine by described can not meet described resources of virtual machine request message requests distribute at least two virtual machines at least one virtual machine (vm) migration to the 3rd physical host, in the community VLAN resource of described 3rd physical host, distribute community VLAN resource for described user to make described 3rd physical host.
9. virtual machine network resource allocation device according to claim 7, is characterized in that, described judge module also for:
Described first physical host is determined, by before at least one virtual machine (vm) migration in described at least two virtual machines that can not meet the distribution of described resources of virtual machine request message requests to the 3rd physical host, to judge whether described 3rd physical host and described first physical host belong to Same Physical subnet;
Described transferring module also for, when described 3rd physical host belongs to different physical subnets from described first physical host, described 3rd physical host creates isolated virtual switch IVS, and two-way generic route encapsulation gre tunneling is set up between the physical subnets belonging to described IVS and described first physical host, communicate at double layer network with the virtual machine that described 3rd physical host distributes for described user to make the virtual machine that described first physical host distributes for described user.
10. the virtual machine network resource allocation device according to any one of claim 6,8,9, is characterized in that, described virtual machine network resource allocation device also comprises:
Authentication module, in the community VLAN resource pool of described first physical host at described first physical host for after described user distributes community VLAN resource, whether can communicate at double layer network between the virtual machine that checking distributes described community VLAN resource.
CN201210476239.7A 2012-11-21 2012-11-21 Virtual machine network resource allocation methods and device Active CN103001953B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210476239.7A CN103001953B (en) 2012-11-21 2012-11-21 Virtual machine network resource allocation methods and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210476239.7A CN103001953B (en) 2012-11-21 2012-11-21 Virtual machine network resource allocation methods and device

Publications (2)

Publication Number Publication Date
CN103001953A CN103001953A (en) 2013-03-27
CN103001953B true CN103001953B (en) 2015-09-09

Family

ID=47930097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210476239.7A Active CN103001953B (en) 2012-11-21 2012-11-21 Virtual machine network resource allocation methods and device

Country Status (1)

Country Link
CN (1) CN103001953B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219096B (en) * 2014-09-05 2018-03-20 东软集团股份有限公司 A kind of resource reconfiguration method and device
TWI522921B (en) * 2014-11-14 2016-02-21 廣達電腦股份有限公司 Systems and methods for creating virtual machine
CN104486192B (en) * 2014-12-05 2019-02-01 国云科技股份有限公司 A kind of virtual network partition method
CN104660479A (en) * 2015-02-13 2015-05-27 南京华讯方舟通信设备有限公司 Networking method and network system
CN105592089B (en) * 2015-12-29 2018-11-27 中国银联股份有限公司 A kind of tenant security isolation method under cloud computing
CN110147344B (en) * 2019-05-21 2022-02-11 优刻得科技股份有限公司 Method, apparatus, storage medium, and system for communicating between multiple physical machines
CN115686839A (en) * 2022-10-24 2023-02-03 阿里巴巴(中国)有限公司 Resource management method, device, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN101436966A (en) * 2008-12-23 2009-05-20 北京航空航天大学 Network monitoring and analysis system under virtual machine circumstance
CN101593133A (en) * 2009-06-29 2009-12-02 北京航空航天大学 Virtual machine resource load balancing method and device
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429630B2 (en) * 2005-09-15 2013-04-23 Ca, Inc. Globally distributed utility computing cloud
US20110283278A1 (en) * 2010-05-13 2011-11-17 Vmware, Inc. User interface for managing a distributed virtual switch
US8670450B2 (en) * 2011-05-13 2014-03-11 International Business Machines Corporation Efficient software-based private VLAN solution for distributed virtual switches

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN101436966A (en) * 2008-12-23 2009-05-20 北京航空航天大学 Network monitoring and analysis system under virtual machine circumstance
CN101593133A (en) * 2009-06-29 2009-12-02 北京航空航天大学 Virtual machine resource load balancing method and device
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform

Also Published As

Publication number Publication date
CN103001953A (en) 2013-03-27

Similar Documents

Publication Publication Date Title
CN103001953B (en) Virtual machine network resource allocation methods and device
CN105284080B (en) The virtual network management method and data center systems of data center
CN104468574B (en) A kind of method, system and device of virtual machine dynamic access IP address
CN110088732B (en) A data packet processing method, host and system
CN109040276B (en) A method, device, computer storage medium and terminal for building a cloud platform
EP2491684B1 (en) Method and apparatus for transparent cloud computing with a virtualized network infrastructure
US8670450B2 (en) Efficient software-based private VLAN solution for distributed virtual switches
US10361970B2 (en) Automated instantiation of wireless virtual private networks
KR101774326B1 (en) Employing overlays for securing connections across networks
US8750311B2 (en) Fibre channel host virtualization
US20240098088A1 (en) Resource allocation for virtual private label clouds
CN107769938A (en) The system and method that a kind of Openstack platforms support Multi net voting region
US20130297752A1 (en) Provisioning network segments based on tenant identity
CN109787938B (en) Method and device for realizing access to virtual private cloud and computer readable storage medium
WO2018019299A1 (en) Virtual broadband access method, controller, and system
CN106209562A (en) In a kind of network VLAN ID distribution method and controller
CN103973673A (en) Virtual firewall partitioning method and equipment
CN103684861A (en) Method and device for processing network configuration and communication system
CN105681087A (en) Virtual control plane resource management method of light weight virtual machine
CN106254095B (en) The backup processing method and equipment of tunnel traffic
CN104753852A (en) Virtualization platform and security protection method and device
CN112929206B (en) Method and device for configuring cloud physical machine in cloud network environment
CN103580979A (en) Logic channel establishing method and system, edge virtual bridging station and bridges
CN102480403A (en) Method, device and system for providing virtual private network services
CN107294857B (en) Multicast distribution processing method, device 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