CN108259634B - Virtual machine MAC address multiplexing method and device - Google Patents

Virtual machine MAC address multiplexing method and device Download PDF

Info

Publication number
CN108259634B
CN108259634B CN201710576929.2A CN201710576929A CN108259634B CN 108259634 B CN108259634 B CN 108259634B CN 201710576929 A CN201710576929 A CN 201710576929A CN 108259634 B CN108259634 B CN 108259634B
Authority
CN
China
Prior art keywords
virtual machine
desktop
desktop pool
address
pool
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
CN201710576929.2A
Other languages
Chinese (zh)
Other versions
CN108259634A (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.)
New H3C Cloud Technologies Co Ltd
Original Assignee
New H3C Cloud Technologies Co Ltd
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 New H3C Cloud Technologies Co Ltd filed Critical New H3C Cloud Technologies Co Ltd
Priority to CN201710576929.2A priority Critical patent/CN108259634B/en
Publication of CN108259634A publication Critical patent/CN108259634A/en
Application granted granted Critical
Publication of CN108259634B publication Critical patent/CN108259634B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3015Name registration, generation or assignment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The application provides a virtual machine MAC address multiplexing method and a device, the method is applied to a virtual machine management server, and the method comprises the following steps: creating a desktop pool group, and creating at least two desktop pools in the desktop pool group; creating at least one virtual machine in each desktop pool; determining a desktop pool comprising the most virtual machines from the at least two desktop pools, and determining the number N of the virtual machines in the desktop pool; and generating a MAC address group comprising N MAC addresses, wherein at least two desktop pools in the desktop pool group multiplex the MAC address group in a time-sharing mode. The method realizes the time-sharing multiplexing of the IP address of the virtual machine by realizing the time-sharing multiplexing of the MAC address of the virtual machine, and different virtual machines use the same MAC address to apply for the same IP address at different time periods, thereby saving the use amount of the IP address and realizing the reasonable utilization of the IP address.

Description

Virtual machine MAC address multiplexing method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for multiplexing a virtual machine MAC (media Access Control) address.
Background
As an underlying technology of cloud computing, virtual software has become more mature. Through the virtual software, an administrator can create one or more virtual computers on one physical server, and the virtual machines can work like real computers, such as installing an operating system, installing application programs, accessing network resources and the like. As for an application program running in a virtual machine, the virtual machine is a real computer and has hardware environments such as a CPU (Central Processing Unit), a memory, a hard disk, a motherboard, and a network card.
The virtual machine may obtain an IP (Internet Protocol) address through a DHCP (Dynamic Host Configuration Protocol) to perform service communication. As the number of virtual machines increases, more and more IP address resources may be occupied. Particularly, in some special scenarios, for example, when a virtual machine is powered off and turned off within a lease duration stipulated by DHCP, an applied IP address is not released in time, and a new group of virtual machines is started to automatically apply for a new IP address, which results in that although the number of virtual machines actually running is not large, IP address resources in a DHCP address pool are quickly exhausted, and a newly started virtual machine may not apply for an IP address later.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for multiplexing MAC addresses of virtual machines, which achieve reasonable control of the number of IP addresses allocated to the virtual machines by reasonably controlling the number of MAC addresses allocated to the virtual machines.
Specifically, the method is realized through the following technical scheme:
in a first aspect of the present application, a method for multiplexing a MAC address of a virtual machine is provided, where the method is applied to a virtual machine management server, and the method includes:
creating a desktop pool group, and creating at least two desktop pools in the desktop pool group;
creating at least one virtual machine in each desktop pool;
determining a desktop pool comprising the most virtual machines from the at least two desktop pools, and determining the number N of the virtual machines in the desktop pool;
generating a MAC address group comprising N MAC addresses; and at least two desktop pools in the desktop pool group multiplex the MAC address group in a time-sharing mode.
In a second aspect of the present application, a virtual machine MAC address multiplexing apparatus is provided, which is applied to a virtual machine management server and has a function of implementing the foregoing method. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
In one implementation, the apparatus includes:
the grouping unit is used for creating a desktop pool group and creating at least two desktop pools in the desktop pool group;
a virtual machine creating unit for creating at least one virtual machine in each desktop pool;
the MAC address generating unit is used for determining a desktop pool comprising the most virtual machines from the at least two desktop pools and determining the number N of the virtual machines in the desktop pool; generating a MAC address group comprising N MAC addresses; and at least two desktop pools in the desktop pool group multiplex the MAC address group in a time-sharing mode.
In another implementation, the apparatus may include a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to perform the method of the first aspect.
According to the technical scheme, the problem of how to reasonably allocate the IP address of the virtual machine is converted into the problem of how to reasonably allocate the MAC address of the virtual machine aiming at the characteristic that the DHCP server allocates the IP address, the time-sharing multiplexing of the IP address of the virtual machine is realized by realizing the time-sharing multiplexing of the MAC address of the virtual machine, different virtual machines use the same MAC address to apply for the same IP address in time-sharing periods, the use amount of the IP address is saved, and the reasonable utilization of the IP address is realized, for example, the IP address which is recovered due to lease expiration can be allocated to other virtual machines at any time under the condition that a DHCP address pool is not exhausted.
Drawings
FIG. 1 is a system architecture diagram provided herein;
FIG. 2 is a flow chart of a method provided herein;
FIG. 3 is a diagram of MAC address time-division multiplexing provided herein;
fig. 4 is a block diagram of functional modules of the device provided in the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
With the increase in the number of virtual machines, network IP address resources are becoming increasingly strained. In order to reasonably utilize the IP address resources, a feasible way is to adjust the lease duration of the DHCP, for example, shorten the lease duration, so that even if the virtual machine is powered off and closed, the DHCP server can timely release the IP address occupied by the virtual machine after judging that the lease duration of the virtual machine has expired.
However, this implementation has the following drawbacks:
first, adjusting the lease duration of DHCP may affect network traffic. For example, if the lease duration is too short, the virtual machine frequently sends a lease message to the DHCP server, which may cause loss of network bandwidth and increase the pressure on the DHCP server.
Secondly, even if the IP address occupied by the virtual machine which is powered off and closed is released in time by adjusting the lease duration of the DHCP, the part of the IP address which is applied for by the virtual machine and is used cannot be allocated to other virtual machines for use at any time. The reason is that the DHCP server records the correspondence between the MAC address or Client ID (Client ID) of the virtual machine and the IP address requested by the virtual machine for a long time, and the correspondence is not deleted by releasing the IP address. When a DHCP server receives an IP address application request of a virtual machine, firstly, judging whether the MAC address or the Client ID of the virtual machine is recorded in the corresponding relation, if so, reallocating the IP address recorded in the corresponding relation to the virtual machine, and if not, allocating a new IP address from a DHCP address pool to the virtual machine; the IP address which is applied for using by the virtual machine is reallocated only when the IP address resource in the DHCP address pool is exhausted.
The method realizes reasonable utilization of IP address resources by improving the allocation method of the MAC address of the virtual machine. The design idea of the application is as follows: as can be seen from the above-described feature of the DHCP server allocating an IP address, on the premise that a recycled IP address is not assigned, a virtual machine with the same MAC address or the same Client ID (the Client ID is calculated based on the MAC address and the port number of the virtual machine) can generally apply for the same IP address whenever applying for an IP address from the DHCP server. This means that if different virtual machines are given the same MAC address for a period of time, they can apply for the same IP address, so that the recovered IP address can be used by other virtual machines at any time and IP address resources in the network can be saved.
Based on this, the problem that this application will solve first is: the multiplexing problem of the MAC address of the virtual machine.
In order to solve the problem, the application provides a virtual machine MAC address multiplexing method. The system to which the method provided by the present application is applied is described below with reference to fig. 1:
referring to fig. 1, fig. 1 is a system architecture diagram provided in the present application, which mainly includes a terminal device, a DHCP server, and a virtual machine management server.
The user can use the terminal device to access the cloud desktop provided by the virtual machine through the cloud desktop connection protocol, and in the application, the terminal device is only used as a display end and is responsible for receiving and feeding back the operation of external devices such as a mouse and a keyboard.
The DHCP server is used for allocating IP addresses for the virtual machines. The DHCP server stores the corresponding relation between the MAC address (or the Client ID) of the virtual machine and the IP address applied by the MAC address, can allocate the IP address according to the MAC address (or the Client ID) of the virtual machine after receiving the IP address application request of the virtual machine, and preferentially allocates the IP address to the virtual machine if the MAC address (or the Client ID) of the virtual machine is found to have applied for the IP address.
And the virtual machine management server is used for grouping the virtual machines and distributing the MAC addresses to the virtual machines. In the present application, a set of virtual machines is referred to as a desktop pool, and a set of desktop pools is referred to as a desktop pool group. The virtual machine management server can create at least one desktop pool group, and realize that virtual machines in different desktop pools are switched and use a set of fixed MAC address groups under the same desktop pool group.
The following describes a virtual machine MAC address multiplexing method provided in the present application with reference to fig. 2. For any desktop pool group, the virtual machine management server may allocate MAC addresses to the virtual machines in the desktop pool group according to the method shown in fig. 2, so as to implement MAC address multiplexing between different desktop pools in the same desktop pool group. As shown in fig. 2, the method may include the steps of:
step 201: the virtual machine management server creates a desktop pool group and creates at least two desktop pools within the desktop pool group.
Here, the reason for creating at least two desktop pools in one desktop pool group is to enable the at least two desktop pools to use the same set of MAC address group subsequently, so as to achieve the purpose of MAC address multiplexing.
Step 202: the virtual machine management server creates at least one virtual machine within each desktop pool.
In the application, the virtual machine management server may create an equal amount of virtual machines in each desktop pool, or may create a different number of virtual machines in each desktop pool.
As one example, the configuration of virtual machines belonging to the same desktop pool may be consistent.
Step 203: the virtual machine management server determines a desktop pool comprising the most virtual machines from the created at least two desktop pools, and determines the number N of the virtual machines in the desktop pool.
As described in step 202, in the case that the number of virtual machines included in each desktop pool is the same, N here is the number of virtual machines included in any desktop pool; in the case that the number of virtual machines included in each desktop pool is not exactly the same, N is the maximum value among the number of virtual machines included in each desktop pool.
Step 204: the virtual machine management server generates a MAC address group comprising N MAC addresses, and at least two desktop pools in the desktop pool group multiplex the MAC address group in a time-sharing mode.
The MAC address is an identifier for each station on the internet, and is represented by a hexadecimal number, and has six bytes (48 bits), for example, 9c:06:1b:70: d7:01 is a MAC address. The first three bytes (i.e. the first 24 bits) of the MAC address are codes assigned by the Registration Authority (RA) of IEEE to different vendors, and are also called "organized Unique Identifier", and the last three bytes (i.e. the last 24 bits) of the MAC address are called extended identifiers, and can be used by customization. The number of the used extended identifier bits can be adjusted according to the number of the required desktop pool groups and the number of the required virtual machines.
For example, assuming there are 8 groups of desktop pools, with a maximum of 16 virtual machines in each desktop pool, the last 7 bits of the MAC address may be used to generate the MAC address.
As an embodiment, the virtual machine management server may generate the MAC address group by: and generating a MAC address group comprising N MAC addresses according to the desktop pool grouping identification and the virtual machine identification, wherein the N MAC addresses comprise the same desktop pool grouping identification and different virtual machine identifications. The resulting N MAC addresses may be provided to the desktop pool group to identify the corresponding desktop pool group for use.
Following the above example, if the last 7 bits of the MAC address are used to generate the MAC address to be provided to the 8 desktop pool packets for use, the first 3 bits of the last 7 bits may be used as the desktop pool packet identifier, and the last 4 bits of the last 7 bits may be used as the virtual machine identifier.
In the present application, one desktop pool group uses a fixed MAC address group, and different desktop pool groups use different MAC address groups.
In the application, the virtual machine management server may create a desktop pool group, a desktop pool, a virtual machine and a MAC address group in advance and allocate a MAC address, or create the desktop pool group, the desktop pool, the virtual machine and the MAC address group in real time and allocate the MAC address in real time according to an external instruction.
How the time-division multiplexing is performed on the MAC address groups generated in step 204 is described below.
The virtual machine management server receives a desktop pool opening instruction, wherein the instruction comprises information such as a desktop pool group to be opened and a desktop pool. After receiving the instruction, the virtual machine management server does not immediately start the desktop pool to which the instruction is directed, but first determines whether the MAC address group corresponding to the desktop pool group to which the instruction is directed is being used. If the MAC address included in the MAC address group is being used, the vm management server needs to first offline the vm in the desktop pool that is using the MAC address group collectively, for example, the vm may be offline in a power-off manner, so as to avoid MAC address collision. When determining that the MAC address group is no longer used by any virtual machine, the virtual machine management server will start the virtual machine in the desktop pool to which the instruction is directed, and the MAC address assigned to the virtual machine in the desktop pool belongs to the MAC address group.
And after the virtual machines in the desktop pool are online, sending an IP address application request to a DHCP server. Here, if the DHCP server allocates an IP address based on the MAC address, the IP address application request needs to carry the MAC address of the virtual machine; if the DHCP server allocates the IP address based on the Client ID, the IP address application request needs to carry the Client ID of the virtual machine. The Client ID of the virtual machine is obtained by the virtual machine through calculation according to the MAC address and the port number of the virtual machine, and in order to ensure that the Client ID obtained through calculation by the virtual machine with the same MAC address is always the same, the virtual machine with the same MAC address can be configured to always use the same port number to calculate the Client ID.
After receiving the IP address application request sent by the virtual machine in the desktop pool, the DHCP server first determines whether an IP address allocation record (i.e., the correspondence between the IP address and the MAC address described above) corresponding to the MAC address of the virtual machine in the desktop pool (i.e., the MAC address group generated in step 204) already exists locally. If the IP address exists, the virtual machines in other desktop pools under the same desktop pool group are indicated to use the MAC address group to apply for the IP address from the DHCP server, so that the DHCP server can directly re-allocate the applied IP address recorded in the IP address allocation record to the virtual machine in the desktop pool to be started currently, and thus, the multiplexing of the same IP address on different virtual machines is realized. Correspondingly, if the DHCP server does not locally have an IP address assignment record matching the MAC address of the virtual machine in the desktop pool, the DHCP server may assign a new IP address to the virtual machine in the desktop pool to be started currently from the DHCP address pool, and record a correspondence between the IP address assigned to the virtual machine and the MAC address of the virtual machine in the IP address assignment record.
As can be seen from the flow shown in fig. 2, the multiplexing of MAC addresses is realized by grouping virtual machines. Different desktop pools in the same desktop pool group use the same set of MAC address group, and each desktop pool in the same desktop pool group is allocated with an MAC address from the fixed MAC address group when being started, so that the DHCP server allocates the same IP address to each desktop pool in the same desktop pool group every time.
It should be noted that, in the present application, different desktop pools in the same desktop pool group cannot be started simultaneously. If a virtual machine in a desktop pool is to be started, the virtual machine in the desktop pool currently in the starting state needs to be closed first. It should be noted that, in the present application, after the virtual machine in the desktop pool is closed, the virtual machine management server may select to delete the virtual machine in the desktop pool to save resources, or may select to reserve the virtual machine in the desktop pool to improve the starting efficiency of the virtual machine in the desktop pool when starting next time.
Fig. 3 is a schematic diagram of time division multiplexing of MAC addresses. In fig. 3, a desktop pool group 1 includes two desktop pools, and each desktop pool includes four virtual machines. The MAC address group allocated to the desktop pool group 1 by the virtual machine management server is 9c:06:1b:70 d7: 01-9 c:06:1b:70 d7: 04. When the desktop pool 1 is opened, the desktop pool 2 is in a closed state, the virtual machine management server allocates four MAC addresses 9c:06:1b:70: d7: 01-9 c:06:1b:70: d7:04 to the virtual machine A, B, C, D in the desktop pool 1, the four virtual machines allocate the MAC addresses and then apply for IP addresses to a DHCP server, and the IP addresses allocated by the DHCP server for the virtual machine A, B, C, D are 192.168.11, 192.168.1.12, 192.168.1.13 and 192.168.1.14 in sequence. Subsequently, when the desktop pool 1 is closed and the desktop pool 2 is opened, the virtual machine management server allocates the four MAC addresses 9c:06:1b:70: d7: 01-9 c:06:1b:70: d7:04 to the virtual machine E, F, G, H in the desktop pool 2 again, and the four virtual machines apply for an IP address to the DHCP server after being allocated with the MAC address. Since the correspondence between the four MAC addresses 9c:06:1b:70: d7: 01-9 c:06:1b:70: d7:04 and the four IP addresses 192.168.11-192.168.1.14 respectively is recorded on the DHCP server, 192.168.11-192.168.1.14 are preferentially allocated to the virtual machine E, F, G, H. As can be seen from fig. 3, although the total number of virtual machines used in the desktop pool group 1 is 8, the number of actually occupied IP addresses is 4, and 4 IP addresses are saved.
In the present application, the utilization of the IP address is related to the number of desktop pools that the desktop pool group includes, the number of virtual machines that the desktop pool group includes, and the number of virtual machines that the desktop pool includes.
For example, on the premise that the number of desktop pools included in the desktop pool groups and the number of virtual machines included in the desktop pool groups are certain, the utilization rate of the IP address is higher in a grouping manner in which the number of virtual machines included in each desktop pool is the same, compared with a grouping manner in which the number of virtual machines included in each desktop pool is not completely the same. For example, assume that a desktop pool group includes two desktop pools, which group has 100 virtual machines in total; if each desktop pool includes the same number of virtual machines, i.e., each desktop pool includes 50 virtual machines, the 100 virtual machines only need to occupy 50 IP addresses. If the number of virtual machines included in each desktop pool is not exactly the same, for example, one desktop pool includes 30 virtual machines and the other desktop pool includes 70 virtual machines, the 100 virtual machines need to occupy 70 IP addresses.
For another example, on the premise that the number of virtual machines included in the desktop pool group is constant and the number of virtual machines included in each desktop pool is the same, the greater the number of desktop pools included in the desktop pool group is, the higher the utilization rate of the IP address is. For example, assume that there are 100 virtual machines in a desktop pool group, and each desktop pool in the desktop pool group includes the same number of virtual machines; if the desktop pool group includes 2 desktop pools, each desktop pool includes 50 virtual machines, and these 100 virtual machines need to occupy 50 IP addresses. If the desktop pool group includes 4 desktop pools, each desktop pool includes 25 virtual machines, and these 100 virtual machines need only occupy 25 IP addresses.
For another example, on the premise that the number of desktop pools included in the desktop pool group is constant and the number of virtual machines included in each desktop pool is the same, the greater the number of virtual machines included in the desktop pool group is, the higher the utilization rate of the IP address is. For example, assume that there are 2 desktop pools in a desktop pool group, and the two desktop pools include the same number of virtual machines; if the group of the desktop pools comprises 50 virtual machines, each desktop pool comprises 25 virtual machines, and the 50 virtual machines only occupy 25 IP addresses, so that 25 IP addresses can be saved; if there are 100 virtual machines in the group of desktop pools, each desktop pool includes 50 virtual machines, and these 100 virtual machines only occupy 50 IP addresses, which can save 50 IP addresses.
In summary, according to the characteristics of the DHCP server for allocating the IP address, the problem of how to reasonably allocate the IP address of the virtual machine is converted into the problem of how to reasonably allocate the MAC address of the virtual machine, the time division multiplexing of the IP address of the virtual machine is realized by realizing the time division multiplexing of the MAC address of the virtual machine, different virtual machines use the same MAC address to apply for the same IP address in time division, the usage amount of the IP address is saved, and the reasonable utilization of the IP address is realized, for example, for the IP address which is recovered due to lease expiration, the IP address can be allocated to other virtual machines at any time under the condition that the DHCP address pool is not exhausted.
In order to make it clear and obvious for those skilled in the art, the implementation process of the present application is described below in conjunction with a teaching scenario of VDI (Virtual Desktop architecture).
VDI is a technique for virtualizing a user's desktop by running an operating system on a server in a data center. In a VDI teaching scenario, students can log in virtual machines through terminal devices in a classroom, the virtual machines are grouped according to courses, and configurations (including operating systems, application programs, files, and the like) of virtual machine groups corresponding to different courses can be different. For example, for a programming course, the virtual machine management server may configure the operating system as a Linux system, a virtual machine group including programming software; for cultural courses, the virtual machine management server can configure the operating system as a Windows system and a virtual machine group containing specific literature data. The VDI is applied in the teaching scene, so that the teaching resources can be managed in a centralized way along with the virtual machine, and the loss is avoided; and virtual machines with different configurations can be provided for different courses.
The user may input the number of classrooms configured with terminal devices included in the school, the number of terminal devices included in each classroom, and the number of courses to be performed in each classroom to the virtual machine management server through an external interface of the virtual machine management server, which may be a web page (web) interface, a command line interface, a human-machine interface, or other form of interface, in advance or in real time. After receiving the information, the virtual machine management server executes the following steps:
in the first step, according to the number of classrooms, the virtual machine management server creates a desktop pool group corresponding to the number of classrooms. That is, one classroom corresponds to one desktop pool group.
And secondly, aiming at any classroom, the virtual machine management server creates a desktop pool with the corresponding class number in the corresponding desktop pool group according to the number of the classes to be carried out in the classroom. That is, multiple classes conducted in a classroom correspond to multiple desktop pools in a group of desktop pools.
And thirdly, the virtual machine management server creates virtual machines with the number corresponding to the number of the terminal devices in each desktop pool in the corresponding desktop pool grouping according to the number of the terminal devices included in the classroom. That is, the number of terminal devices included in one classroom corresponds to the number of virtual machines in each desktop pool under one desktop pool group.
And fourthly, the virtual machine management server generates MAC addresses corresponding to the number of the terminal devices according to the classroom number and the terminal device number of the classroom to obtain an MAC address group.
Fifthly, when the classroom gives lessons of the course 1, the virtual machine management server starts the virtual machine in the desktop pool 1 corresponding to the course 1, and the MAC address used by the virtual machine in the desktop pool 1 comes from the MAC address group obtained in the fourth step. And after the virtual machine is allocated to the MAC address, the virtual machine applies for an IP address to a DHCP server to start service.
Sixthly, if the courses are switched, for example, the classroom starts to give the course 2 after the course 1 is finished, the virtual machine management server may close the virtual machine in the desktop pool 1 corresponding to the course 1. After the closing is completed, the virtual machine management server starts the virtual machine in the desktop pool 2 corresponding to the course 2, and the MAC address used by the virtual machine in the desktop pool 2 is also from the MAC address group obtained in the fourth step. And after the virtual machines in the desktop pool 2 are started, the DHCP server applies for IP addresses, and the DHCP server reallocates the IP addresses allocated to the virtual machines in the desktop pool 1 in the fifth step to the virtual machines in the desktop pool 2 according to the existing IP address allocation records.
Through the steps, no matter how many courses are carried out in a classroom and how many virtual machines are used, the number of IP addresses occupied by the terminal equipment in the classroom is only related to the number of the terminal equipment in the classroom.
The methods provided herein are described above. The apparatus provided in the present application is described below.
Referring to fig. 4, fig. 4 is a functional block diagram of a virtual machine MAC address multiplexing apparatus provided in the present application, where the apparatus is applied to a virtual machine management server. As shown in fig. 4, the apparatus may include the following units:
a grouping unit 401, configured to create a desktop pool group, and create at least two desktop pools within the desktop pool group.
A virtual machine creating unit 402 for creating at least one virtual machine in each desktop pool.
A MAC address generating unit 403, configured to determine a desktop pool including the most virtual machines from the at least two desktop pools, and determine the number N of virtual machines included in the desktop pool; and generates a MAC address group including N MAC addresses.
In one embodiment, the apparatus may further include a desktop pool switching unit 404 configured to: receiving a desktop pool opening instruction; after receiving the instruction, judging whether the MAC address included in the MAC address group is used; and when the virtual machine in the desktop pool to which the instruction is directed is determined to be unused, starting the virtual machine in the desktop pool to which the instruction is directed, wherein the MAC address of the virtual machine in the desktop pool belongs to the MAC address group, so that a Dynamic Host Configuration Protocol (DHCP) server judges whether an IP address allocation record matched with the MAC address of the virtual machine in the desktop pool exists or not when receiving an IP address application request of the virtual machine in the desktop pool, if so, the IP address which is recorded in the IP address allocation record and has been applied is reallocated to the virtual machine in the desktop pool, and if not, a new IP address is allocated to the virtual machine in the desktop pool from the address pool, and the corresponding relation between the IP address allocated to the virtual machine and the MAC address of the virtual machine is recorded in the IP address allocation record.
In one embodiment, the MAC address generating unit 403 is configured to: and generating a MAC address group comprising N MAC addresses according to the desktop pool grouping identification and the virtual machine identification, wherein the N MAC addresses comprise the same desktop pool grouping identification and different virtual machine identifications.
In one embodiment, the virtual machine creating unit 402 is configured to: an equal number of virtual machines are created within each desktop pool.
In one embodiment, when the apparatus is applied to an instructional scene,
the grouping unit 401 is configured to create desktop pool groups corresponding to the number of classrooms according to the number of the classrooms; aiming at any classroom, according to the number of courses in the classroom, desktop pools corresponding to the number of courses are created in the desktop pool groups corresponding to the classroom.
The virtual machine creating unit 402 is configured to create virtual machines corresponding to the number of terminal devices in each desktop pool according to the number of terminal devices included in the classroom.
The MAC address generating unit 403 is configured to generate MAC addresses corresponding to the number of terminal devices according to the classroom number and the terminal device number of the classroom.
It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The application also provides a virtual machine MAC address multiplexing device, which includes a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the method shown in fig. 2.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A multiplexing method for a Media Access Control (MAC) address of a virtual machine is applied to a virtual machine management server, and comprises the following steps:
creating a desktop pool group, and creating at least two desktop pools in the desktop pool group;
creating at least one virtual machine in each desktop pool;
determining a desktop pool comprising the most virtual machines from the at least two desktop pools, and determining the number N of the virtual machines in the desktop pool;
and generating a MAC address group comprising N MAC addresses, wherein at least two desktop pools in the desktop pool group multiplex the MAC address group in a time-sharing mode.
2. The method of claim 1, wherein the method further comprises:
receiving a desktop pool opening instruction;
after receiving the instruction, judging whether the MAC address included in the MAC address group is used;
and when the virtual machine in the desktop pool to which the instruction is directed is determined to be unused, starting the virtual machine in the desktop pool to which the instruction is directed, wherein the MAC address of the virtual machine in the desktop pool belongs to the MAC address group, so that a Dynamic Host Configuration Protocol (DHCP) server judges whether an IP address allocation record matched with the MAC address of the virtual machine in the desktop pool exists or not when receiving an IP address application request of the virtual machine in the desktop pool, if so, the IP address which is recorded in the IP address allocation record and has been applied is reallocated to the virtual machine in the desktop pool, and if not, a new IP address is allocated to the virtual machine in the desktop pool from the address pool, and the corresponding relation between the IP address allocated to the virtual machine and the MAC address of the virtual machine is recorded in the IP address allocation record.
3. The method of claim 1, wherein the generating the MAC address group comprising the N MAC addresses comprises:
and generating a MAC address group comprising N MAC addresses according to the desktop pool grouping identification and the virtual machine identification, wherein the N MAC addresses comprise the same desktop pool grouping identification and different virtual machine identifications.
4. The method of claim 1, wherein creating at least one virtual machine within each desktop pool comprises:
an equal number of virtual machines are created within each desktop pool.
5. The method of claim 1, when applied in a teaching scene; creating a desktop pool group, and creating at least two desktop pools in the desktop pool group; creating at least one virtual machine in each desktop pool; determining a desktop pool comprising the most virtual machines from the at least two desktop pools, and determining the number N of the virtual machines in the desktop pool; generating a MAC address group comprising N MAC addresses; the method comprises the following steps:
according to the number of classrooms, creating desktop pool groups corresponding to the number of the classrooms;
aiming at any classroom, according to the number of courses in the classroom, creating a desktop pool corresponding to the number of courses in a desktop pool group corresponding to the classroom; according to the number of the terminal devices included in the classroom, virtual machines corresponding to the number of the terminal devices are created in each desktop pool; and generating MAC addresses corresponding to the number of the terminal devices according to the classroom number and the terminal device number of the classroom.
6. A virtual machine Media Access Control (MAC) address multiplexing device is applied to a virtual machine management server and comprises the following components:
the grouping unit is used for creating a desktop pool group and creating at least two desktop pools in the desktop pool group;
a virtual machine creating unit for creating at least one virtual machine in each desktop pool;
the MAC address generating unit is used for determining a desktop pool comprising the most virtual machines from the at least two desktop pools and determining the number N of the virtual machines in the desktop pool; and generating a MAC address group comprising N MAC addresses, wherein at least two desktop pools in the desktop pool group multiplex the MAC address group in a time-sharing mode.
7. The apparatus of claim 6, further comprising a desktop pool switching unit to:
receiving a desktop pool opening instruction;
after receiving the instruction, judging whether the MAC address included in the MAC address group is used;
and when the virtual machine in the desktop pool to which the instruction is directed is determined to be unused, starting the virtual machine in the desktop pool to which the instruction is directed, wherein the MAC address of the virtual machine in the desktop pool belongs to the MAC address group, so that a Dynamic Host Configuration Protocol (DHCP) server judges whether an IP address allocation record matched with the MAC address of the virtual machine in the desktop pool exists or not when receiving an IP address application request of the virtual machine in the desktop pool, if so, the IP address which is recorded in the IP address allocation record and has been applied is reallocated to the virtual machine in the desktop pool, and if not, a new IP address is allocated to the virtual machine in the desktop pool from the address pool, and the corresponding relation between the IP address allocated to the virtual machine and the MAC address of the virtual machine is recorded in the IP address allocation record.
8. The apparatus of claim 6, wherein the MAC address generation unit is to:
and generating a MAC address group comprising N MAC addresses according to the desktop pool grouping identification and the virtual machine identification, wherein the N MAC addresses comprise the same desktop pool grouping identification and different virtual machine identifications.
9. The apparatus of claim 6, wherein the virtual machine creation unit is to:
an equal number of virtual machines are created within each desktop pool.
10. The apparatus of claim 6, when applied to an instructional scene;
the grouping unit is used for creating desktop pool groups corresponding to the number of classrooms according to the number of the classrooms; aiming at any classroom, according to the number of courses in the classroom, creating a desktop pool corresponding to the number of courses in a desktop pool group corresponding to the classroom;
the virtual machine creating unit is used for creating virtual machines corresponding to the number of the terminal devices in each desktop pool according to the number of the terminal devices included in the classroom;
and the MAC address generating unit is used for generating MAC addresses corresponding to the number of the terminal devices according to the classroom number and the terminal device number of the classroom.
CN201710576929.2A 2017-07-14 2017-07-14 Virtual machine MAC address multiplexing method and device Active CN108259634B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710576929.2A CN108259634B (en) 2017-07-14 2017-07-14 Virtual machine MAC address multiplexing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710576929.2A CN108259634B (en) 2017-07-14 2017-07-14 Virtual machine MAC address multiplexing method and device

Publications (2)

Publication Number Publication Date
CN108259634A CN108259634A (en) 2018-07-06
CN108259634B true CN108259634B (en) 2021-01-26

Family

ID=62721252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710576929.2A Active CN108259634B (en) 2017-07-14 2017-07-14 Virtual machine MAC address multiplexing method and device

Country Status (1)

Country Link
CN (1) CN108259634B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112367256B (en) * 2020-10-15 2022-09-30 深信服科技股份有限公司 Creation method, device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012142750A1 (en) * 2011-04-19 2012-10-26 华为技术有限公司 Method, apparatus and system for address resolution
US8437790B1 (en) * 2011-12-08 2013-05-07 Microsoft Corporation Location determination for white space utilization
CN104283983B (en) * 2014-10-27 2018-01-09 新华三技术有限公司 Virtual machine IP address distribution method and device in a kind of software defined network
CN105162897A (en) * 2015-09-16 2015-12-16 浪潮集团有限公司 System and method for allocating IP address for virtual machine and network virtual machine

Also Published As

Publication number Publication date
CN108259634A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
US8554890B2 (en) Method of deploying a production environment using a development environment
CN108924268B (en) Container cloud service system and pod creation method and device
US8423632B2 (en) Method, network management center, and a related device for configuring a network policy for a virtual port
CN103078965B (en) The IP address management method of virtual machine
US11947697B2 (en) Method and system to place resources in a known state to be used in a composed information handling system
JP5272709B2 (en) Address assignment method, computer, physical machine, program, and system
CN112202624B (en) Real equipment fast access system and method for network target range scene arrangement
US9569242B2 (en) Implementing dynamic adjustment of I/O bandwidth for virtual machines using a single root I/O virtualization (SRIOV) adapter
CN102932408B (en) A kind of management method of server cluster and platform
CN103703724A (en) Resource payment method
CN104050045A (en) Method and device for distributing virtual resources based on disk IO
EP3481007A1 (en) Method, device, and equipment for processing resource pool
JP2013168140A (en) Method for deploying virtual machines
EP3740868A1 (en) Server support for multiple audio/video operating systems
CN104506654A (en) Cloud computing system and backup method of dynamic host configuration protocol server
CN103905232A (en) Virtual-machine management system and method
WO2015192583A1 (en) Internet protocol (ip) address allocation method and apparatus, server and terminal
CN108259634B (en) Virtual machine MAC address multiplexing method and device
CN105786732A (en) Data access method and apparatus
Marian et al. Automatic Allocation Mechanism for Virtual Machines Interface Addresses IP Address Interfaces Provisioning
CN107547247B (en) IP address allocation method and device for three-layer management network in intelligent elastic architecture
US8832235B1 (en) Deploying and releasing logical servers
CN113127144B (en) Processing method, processing device and storage medium
CN103841200A (en) Method and device for controlling software licensing
US10642639B2 (en) Static IP retention for multi-homed VMs on migration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant