CN111190685B - Virtual machine quantity testing system, method and device, electronic equipment and storage medium - Google Patents
Virtual machine quantity testing system, method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111190685B CN111190685B CN201811358180.5A CN201811358180A CN111190685B CN 111190685 B CN111190685 B CN 111190685B CN 201811358180 A CN201811358180 A CN 201811358180A CN 111190685 B CN111190685 B CN 111190685B
- Authority
- CN
- China
- Prior art keywords
- physical machine
- virtual
- virtual machine
- machine
- preset parameter
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 591
- 238000000034 method Methods 0.000 title claims abstract description 78
- 238000003860 storage Methods 0.000 title claims abstract description 19
- 238000013515 script Methods 0.000 claims abstract description 316
- 230000015654 memory Effects 0.000 claims description 79
- 238000004891 communication Methods 0.000 claims description 55
- 238000004590 computer program Methods 0.000 claims description 26
- 230000006378 damage Effects 0.000 claims description 16
- 238000009826 distribution Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 25
- 238000012545 processing Methods 0.000 description 23
- 230000008569 process Effects 0.000 description 19
- 230000006870 function Effects 0.000 description 10
- 230000002093 peripheral effect Effects 0.000 description 9
- 238000007726 management method Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000003491 array Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 239000004065 semiconductor Substances 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 230000004075 alteration Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/24—Marginal checking or other specified testing methods not covered by G06F11/26, e.g. race tests
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45591—Monitoring or debugging support
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a system, a method, a device, electronic equipment and a storage medium for testing the number of virtual machines borne by a physical machine, wherein a system testing tool sends a virtual machine creation script and a testing script to the physical machine; transmitting the address information of each virtual machine and the threshold value of the preset parameter to a test instrument; the physical machine creates a corresponding virtual machine according to the received virtual machine creation script and correspondingly runs the test script; the test meter generates a first data packet for each virtual machine; determining a value of a preset parameter according to the first data packet and the second data packet; judging whether the value of the preset parameter exceeds a corresponding threshold value, if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created. In the invention, the maximum number of virtual machines which can be borne by the physical machine is determined by sending a data packet to each virtual machine in the physical machine and determining the value of a preset parameter.
Description
Technical Field
The present invention relates to the field of network function virtualization and streaming test technologies, and in particular, to a system, a method, an apparatus, an electronic device, and a readable storage medium for testing the number of virtual machines carried by a physical machine.
Background
The current test scheme predicts the number of virtual machines which can be borne by a server according to the hardware configuration of the server, and in the server, the created virtual machines are pressurized, specifically, the pressurization can be that the virtual machines execute a section of program and the like, and the performance of the server is monitored; and adjusting the number of the virtual machines according to the performance index result to obtain the maximum number of the virtual machines borne by the physical machine.
The pressure generation of the existing multi-virtual machine test technical scheme is derived from the inside of the virtual machine, and the external streaming test requirement cannot be met. In a commercially deployed cloud environment, traffic injection outside of the virtual machine into the virtual machine is an indispensable deployment scenario. The existing internal pressure test cannot meet the test requirement of external communication, the virtual machine and the external communication test can evaluate the performance of the virtual machine deployment application and the external communication model, and the evaluation of the external data packet forwarding performance index is lacked, wherein the indexes comprise packet loss rate, delay jitter and the like of the data packet forwarding, and the indexes cannot be evaluated through the internal pressure test. External streaming testing may provide a more accurate reference index to the application deployment vendor as a performance reference.
However, the current test scheme is not limited to the maximum virtual machine deployment number of the single physical machine (computing node) of the tested NFVI platform under the specified condition.
Disclosure of Invention
The embodiment of the invention provides a system, a method, a device, electronic equipment and a storage medium for testing the number of virtual machines borne by a physical machine, which are used for solving the problem that the maximum virtual machine deployment number borne by a single physical machine under a specified condition cannot be accurately determined in the prior art.
The embodiment of the invention provides a system for testing the number of virtual machines borne by a physical machine, which comprises the following steps: the physical machine, the testing tool and the testing instrument;
the test tool is used for sending the virtual machine creation script and the test script to the physical machine; receiving address information of each virtual machine created by the physical machine; transmitting the address information of each virtual machine and the threshold value of the preset parameter to the test instrument;
the physical machine is used for receiving the virtual machine creation script and the test script sent by the test tool, creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly running the test script, and sending the address information of each virtual machine to the test tool; receiving first data packets sent to each virtual machine by the test instrument, distributing each first data packet to the corresponding virtual machine, and sending second data packets returned by each received virtual machine to the test instrument;
The test instrument is used for receiving address information of each virtual machine and a threshold value of a preset parameter sent by the test tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine; receiving each second data packet returned by the physical machine; determining a value of a preset parameter according to the first data packet and the second data packet; and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Further, the test tool is specifically configured to send a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine;
the physical machine is specifically configured to create a first number of virtual machines according to the first number of virtual machines to be created, which are carried in the first virtual machine creation script;
the test instrument is further used for sending first notification information to the test tool when judging that the value of the preset parameter does not exceed the corresponding threshold value;
the test tool is further configured to receive the first notification information, send a destruction script to the physical machine, and send a second virtual machine creation script to the physical machine, where the second virtual machine creation script carries a second number of virtual machines to be created, and the second number is greater than the first number;
The physical machine is further configured to receive the destruction script, destroy the first number of virtual machines created locally, receive a second virtual machine creation script, and create a second number of virtual machines.
Further, the test tool is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, where the third number is 1;
the physical machine is specifically configured to create a third number of virtual machines according to the third number of virtual machines to be created, which is carried in the third virtual machine creation script;
the test instrument is further configured to send second notification information to the test tool when it is determined that the value of the predicted parameter does not exceed the corresponding threshold value;
the test tool is further used for receiving the second notification information and sending a third virtual machine creation script to the physical machine;
the physical machine is further configured to create a third number of virtual machines.
Further, the test instrument is specifically configured to determine, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and determine whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of virtual machines borne by the physical machine and 1.
Further, the test instrument is specifically configured to determine a value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and determine whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
The embodiment of the invention provides a method for testing the number of virtual machines borne by a physical machine, which is applied to a testing tool and comprises the following steps:
transmitting the virtual machine creation script and the test script to the physical machine;
receiving address information of each virtual machine created by the physical machine;
and sending the address information of each virtual machine and the threshold value of the preset parameter to a test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
Further, the sending the virtual machine creation script to the physical machine includes:
transmitting a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine;
the method further comprises the steps of:
receiving first notification information sent by a test instrument, wherein the first notification information is sent to the test tool when the test instrument judges that the value of a preset parameter does not exceed a corresponding threshold value;
sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
Further, the sending the virtual machine creation script to the physical machine includes:
transmitting a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, wherein the third number is 1;
the method further comprises the steps of:
receiving second notification information sent by the test instrument, wherein the second notification information is sent to the test tool when the test instrument judges that the value of the preset parameter does not exceed the corresponding threshold value;
And sending a third virtual machine creation script to the physical machine.
The embodiment of the invention also provides a method for testing the number of virtual machines borne by the physical machine, which is applied to the physical machine and comprises the following steps:
receiving a virtual machine creation script and a test script sent by a test tool;
creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
and distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The embodiment of the invention also provides a method for testing the number of virtual machines borne by the physical machine, which is applied to the test instrument and comprises the following steps:
receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in a physical machine and sent by a testing tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine;
Receiving each second data packet returned by the physical machine, and determining the value of a preset parameter according to the first data packet and the second data packet;
and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Further, the determining the value of the preset parameter according to the first data packet and the second data packet includes:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine;
the judging whether the value of the preset parameter exceeds the corresponding threshold value comprises the following steps:
judging whether the value of the preset parameter of each virtual machine exceeds a corresponding threshold value or not according to each virtual machine;
the determining the maximum number of virtual machines carried by the physical machine includes:
if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of virtual machines borne by the physical machine and 1.
Further, the determining the value of the preset parameter according to the first data packet and the second data packet includes:
determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine;
the judging whether the value of the preset parameter exceeds the corresponding threshold value comprises the following steps:
and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value.
Further, the method further comprises:
and when the value of the preset parameter is judged not to exceed the corresponding threshold value, sending notification information to the test tool.
Further, the preset parameters include at least one of the following:
packet loss rate, average delay, maximum delay, average jitter, and maximum jitter.
The embodiment of the invention provides a device for testing the number of virtual machines borne by a physical machine, which comprises:
the first sending module is used for sending the virtual machine creation script and the test script to the physical machine;
the first receiving module is used for receiving the address information of each virtual machine created by the physical machine;
the second sending module is used for sending the address information of each virtual machine and the threshold value of the preset parameter to the test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The embodiment of the invention provides a device for testing the number of virtual machines borne by a physical machine, which comprises:
the first receiving module is used for receiving the virtual machine creation script and the test script sent by the test tool;
the creation operation transmitting module is used for creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly operating the test script and transmitting the address information of each virtual machine to the test tool;
the second receiving module is used for receiving the first data packet sent to each virtual machine by the test instrument;
the distribution module is used for distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The embodiment of the invention provides a device for testing the number of virtual machines borne by a physical machine, which comprises:
the first receiving module is used for receiving the address information of each virtual machine and the threshold value of the preset parameter, which are created in the physical machine and sent by the testing tool;
The generation module is used for generating a first data packet for each virtual machine;
the sending module is used for sending each first data packet to the physical machine;
the second receiving module is used for receiving each second data packet returned by the physical machine;
the determining module is used for determining the value of a preset parameter according to the first data packet and the second data packet;
and the judging module is used for judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
The embodiment of the invention provides electronic equipment, which comprises a memory and a processor;
the processor is configured to read the program in the memory, and perform the following procedures: transmitting the virtual machine creation script and the test script to the physical machine;
receiving address information of each virtual machine created by the physical machine;
and sending the address information of each virtual machine and the threshold value of the preset parameter to a test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
Further, the processor is specifically configured to send a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine.
Further, the processor is configured to receive first notification information sent by a test instrument, where the first notification information is sent to the test tool when a value of a preset parameter of the test instrument does not exceed a corresponding threshold value; sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
Further, the processor is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, where the third number is 1.
Further, the processor is configured to receive second notification information sent by the test instrument, where the second notification information is sent to the test tool when the test instrument determines that a value of a preset parameter does not exceed a corresponding threshold value; and sending a third virtual machine creation script to the physical machine.
The embodiment of the invention provides electronic equipment, which comprises a memory and a processor;
the processor is used for receiving the virtual machine creation script and the test script sent by the test tool;
creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
and distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The embodiment of the invention provides electronic equipment, which comprises a memory and a processor;
the processor is used for receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in the physical machine and sent by the testing tool, generating a first data packet aiming at each virtual machine, and sending each first data packet to the physical machine;
Receiving each second data packet returned by the physical machine, and determining the value of a preset parameter according to the first data packet and the second data packet;
and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Further, the processor is specifically configured to determine, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine; judging whether the value of the preset parameter of each virtual machine exceeds a corresponding threshold value or not according to each virtual machine; if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of virtual machines borne by the physical machine and 1.
Further, the processor is specifically configured to determine a value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine; and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value.
Further, the processor is configured to send notification information to the test tool when it is determined that the value of the preset parameter does not exceed the corresponding threshold value.
The embodiment of the invention also provides electronic equipment, which comprises: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform any of the method steps described above as applied to a test tool.
The embodiment of the invention also provides electronic equipment, which comprises: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform any of the method steps described above as applied to a physical machine.
The embodiment of the invention also provides electronic equipment, which comprises: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory has stored therein a computer program which, when executed by the processor, causes the processor to perform any of the method steps described above as applied to a test meter.
Embodiments of the present invention also provide a computer readable storage medium storing a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform any of the above-described method steps applied to a test tool.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform any of the above-described method steps applied to a physical machine.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform any of the above-described method steps applied to a test meter.
The embodiment of the invention provides a system, a method, a device, electronic equipment and a storage medium for testing the number of virtual machines borne by a physical machine, wherein the system comprises: the physical machine, the testing tool and the testing instrument; the test tool is used for sending the virtual machine creation script and the test script to the physical machine; receiving address information of each virtual machine created by the physical machine; transmitting the address information of each virtual machine and the threshold value of the preset parameter to the test instrument; the physical machine is used for receiving the virtual machine creation script and the test script sent by the test tool, creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly running the test script, and sending the address information of each virtual machine to the test tool; receiving first data packets sent to each virtual machine by the test instrument, distributing each first data packet to the corresponding virtual machine, and sending second data packets returned by each received virtual machine to the test instrument; the test instrument is used for receiving address information of each virtual machine and a threshold value of a preset parameter sent by the test tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine; receiving each second data packet returned by the physical machine; determining a value of a preset parameter according to the first data packet and the second data packet; and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Because in the embodiment of the invention, the physical machine creates the corresponding virtual machine according to the received virtual machine creation script, sends the first data packet sent by the test instrument to the corresponding virtual machine, and sends the second data packet of each virtual machine to the test instrument; the test instrument determines the value of a preset parameter according to the information of the sent first data packet and the information of the second data packet sent by the receiving physical machine; and determining whether the number of virtual machines created by the physical machine under test is the maximum number of virtual machines which can be borne by the physical machine or not by comparing the value of the preset parameter calculated by the test instrument with the threshold value of the preset parameter. Therefore, the embodiment of the invention can determine the maximum number of the virtual machines which can be deployed by the physical machine under the condition of meeting the requirement of the preset parameters, and can fully utilize the resources of the physical machine.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a system for testing the number of virtual machines carried by a physical machine according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram of a testing process of the number of virtual machines carried by a physical machine according to embodiment 3 of the present invention;
fig. 3 is a schematic diagram of a flow chart of testing the number of virtual machines carried by a physical machine according to embodiment 5 of the present invention;
fig. 4 is a flow chart of a method for testing the number of virtual machines carried by a physical machine according to embodiment 6 of the present invention;
fig. 5 is a second flowchart of a method for testing the number of virtual machines carried by a physical machine according to embodiment 7 of the present invention;
fig. 6 is a third flowchart of a method for testing the number of virtual machines carried by a physical machine according to embodiment 8 of the present invention;
fig. 7 is a schematic structural diagram of a device for testing the number of virtual machines carried by a physical machine according to embodiment 9 of the present invention;
FIG. 8 is a second schematic diagram of a device for testing the number of virtual machines carried by a physical machine according to embodiment 10 of the present invention;
fig. 9 is a third schematic structural diagram of a device for testing the number of virtual machines carried by a physical machine according to embodiment 11 of the present invention;
fig. 10 is a schematic diagram of an electronic device according to embodiment 12 of the present invention;
FIG. 11 is a second schematic diagram of an electronic device according to embodiment 13 of the present invention;
FIG. 12 is a third schematic diagram of an electronic device according to embodiment 14 of the present invention;
fig. 13 is a schematic diagram of an electronic device according to embodiment 15 of the present invention;
FIG. 14 is a second schematic diagram of an electronic device according to embodiment 16 of the present invention;
fig. 15 is a third schematic diagram of an electronic device according to embodiment 17 of the present invention.
Detailed Description
The present invention will be described in further detail below with reference to the attached drawings, wherein it is apparent that the embodiments described are only some, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1:
the embodiment of the invention provides a system for testing the number of virtual machines borne by a physical machine, as shown in fig. 1, the system comprises: the physical machine, the testing tool and the testing instrument;
the test tool is used for sending the virtual machine creation script and the test script to the physical machine; receiving address information of each virtual machine created by the physical machine; transmitting the address information of each virtual machine and the threshold value of the preset parameter to the test instrument;
The physical machine is used for receiving the virtual machine creation script and the test script sent by the test tool, creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly running the test script, and sending the address information of each virtual machine to the test tool; receiving first data packets sent to each virtual machine by the test instrument, distributing each first data packet to the corresponding virtual machine, and sending second data packets returned by each received virtual machine to the test instrument;
the test instrument is used for receiving address information of each virtual machine and a threshold value of a preset parameter sent by the test tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine; receiving each second data packet returned by the physical machine; determining a value of a preset parameter according to the first data packet and the second data packet; and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
The physical machine comprises an independent server, namely a physically independent server, and the physical machine comprises a processor, a hard disk, a memory, a system bus and the like, which are similar to a general computer architecture, but has higher requirements on processing capacity, stability and the like because the physical machine needs to provide highly reliable services, and particularly, in the field of wireless communication, the packet loss rate is generally required to be 1e-5, and meanwhile, the time delay in system processing is also clearly restrained.
The system for testing the number of virtual machines borne by the physical machines can provide the maximum number of virtual machines which can be supported by the tested physical machines based on specific parameter preset conditions. Therefore, when the virtual machines are deployed on the physical machine, whether the physical machine meets the requirements required to be met by the physical machine in terms of processing capacity and the like after the physical machine deploys a certain number of virtual machines should be considered. Meanwhile, if only a small number of virtual machines are deployed on the physical machine, the processing capacity of the physical machine is guaranteed, but resources such as hardware configuration in the physical machine are not fully utilized, and the problems of resource waste and the like are caused. Therefore, under the condition that the value of the index to be reached by the physical machine is preset, the maximum number of virtual machines which can be borne by the physical machine is determined, and the maximum number of virtual machines is deployed in the physical machine, so that the full utilization of the physical machine resources can be realized.
In a test system for the number of virtual machines borne by a physical machine, the number of maximum virtual machines which can be deployed for the physical machine is determined through the mutual coordination and interaction of a test tool, the physical machine and a test instrument. Firstly, a virtual machine creation script provided by a test tool is needed by a physical machine to create the virtual machine, and a threshold value of a preset parameter is needed by the test tool by a test instrument. Therefore, the communication modules are arranged in the test tool, the test instrument and the physical machine and used for information transmission.
The main function of the testing tool in the embodiment of the invention is to provide the virtual machine creation script and the testing script for the physical machine, and provide the threshold value of the preset parameter and the address information of each virtual machine created in the physical machine for the testing instrument. The test tool therefore first needs to generate virtual machine creation scripts and test scripts and send the generated virtual machine creation scripts and test scripts to the physical machine. Meanwhile, after a certain number of virtual machines are created for the tested physical machine in the embodiment of the invention, the processing capability of the physical machine needs to meet certain conditions, for example, the packet loss rate requirement of the physical machine is not more than 1e-5, so that a worker is required to set a threshold value of preset parameters in a testing tool in advance, wherein the preset parameters comprise: at least one of packet loss rate, average time delay, maximum jitter and the like, and sending the set threshold value of the preset parameter to a test instrument.
The configuration of the plurality of virtual machines created by the physical machine according to the virtual machine creation script is the same, for example, the number of vCPU cores of each virtual machine is 3, the configuration of a large memory page is 1024MB, a core binding (CPU pinning) mode is configured, and the memory is 4 GB.
The process of generating the virtual machine creation script and the test script by the test tool belongs to the prior art, and in the embodiment of the present invention, the process is not described in detail. The process of setting the threshold value of the preset parameter in the test tool is the prior art, and in the embodiment of the present invention, the process is not described in detail.
Specifically, in the process of creating a virtual machine in a physical machine, a network cloud platform generally includes a plurality of physical machines, and in the embodiment of the present invention, when testing is performed on any physical machine in the network cloud platform, the maximum number of virtual machines that can be carried by the physical machine can be tested. Firstly, after a virtual machine creation script and a test script are generated by a test tool, the virtual machine creation script and the test script are sent to a network cloud platform, the network cloud platform sends the received virtual machine creation script and the test script to a physical machine to be tested, the physical machine creates the virtual machine according to the virtual machine creation script, and the test script is operated on each virtual machine created.
The physical machine receives the virtual machine creation script and the test script sent by the test tool, creates the virtual machine according to the virtual machine creation script in the physical machine, and runs the test script on the created virtual machine. Because the embodiment of the invention tests the capability of the virtual machine for forwarding the data packet, the test script is the script which enables the virtual machine to have the capability of forwarding the data packet, and after the test script is operated in the virtual machine, the virtual machine has the capability of forwarding the data packet.
After each virtual machine is created by the physical machine, the address information of each virtual machine is sent to a testing tool, and the testing tool sends the received address information of each virtual machine to a testing instrument. The test meter generates a first data packet for each virtual machine according to the received address information of each virtual machine, and sends each first data packet to the physical machine.
The main function of the test instrument in the embodiment of the invention is to calculate the value of the preset parameter according to the first data packet and the second data packet and judge whether the value of the preset parameter exceeds the corresponding threshold value, so as to determine the number of the maximum virtual machines which can be borne by the physical machine. Therefore, the test meter first needs to receive the threshold value of the preset parameter from the test tool, and receives the address information of each virtual machine from the test tool. According to address information of each virtual machine, the test meter generates a first data packet for each virtual machine, wherein the packet length of each first data packet generated by the test meter can be a fixed packet length or a mixed packet length, the fixed packet length refers to that the lengths of all first data packets generated by the test meter are fixed, for example, the lengths of all first data packets can be 1400 bytes, the mixed packet length refers to that the lengths of the first data packets generated by the test meter can be different, for example, the lengths of a part of first data packets are 1400 bytes, the lengths of a part of first data packets are 1500 bytes, the lengths of the rest of first data packets are 2000 bytes, and the like.
Specifically, each first data packet includes source address information and target address information, where the source address information specifically refers to address information of the test instrument, and the target address information specifically refers to address information of the virtual machine. And sending each generated first data packet to a physical machine, and distributing each first data packet to each virtual machine by the physical machine according to the address information of the virtual machine carried by each first data packet.
The process of generating the first data packet by the test meter is in the prior art, and in the embodiment of the present invention, the process is not described in detail.
Specifically, the test instrument sends the first data packet to the physical machine through a physical network card of the physical machine, and the physical machine sends the first data packet to the virtual machine through an interface of the virtual machine. After the virtual machine receives the first data packet, the virtual machine returns a second data packet to the physical machine through an interface of the virtual machine, and the physical machine sends the first data packet to the test instrument through the physical network card.
After receiving each first data packet sent by the test instrument, the physical machine distributes each first data packet to a corresponding virtual machine according to the address information of the virtual machine carried in each first data packet. After the test script is run on the virtual machine, if the virtual machine receives a first data packet, the first data packet is correspondingly processed and a second data packet is sent, and the physical machine sends the second data packet sent by the virtual machine to the test instrument.
After the test instrument receives each second data packet sent by the physical machine, the test instrument determines the value of the preset parameter according to the information of the first data packet and the second data packet. Judging whether the value of the preset parameter exceeds a corresponding threshold value, and determining the maximum number of virtual machines borne by the physical machine according to a judging result. Specifically, when the value of at least one preset parameter exceeds the threshold value, the maximum number of virtual machines borne by the physical machine can be determined according to the number of virtual machines borne by the current physical machine.
Because in the embodiment of the invention, the physical machine creates a corresponding virtual machine according to the received virtual machine creation script, sends each first data packet sent by the test instrument to the corresponding virtual machine, and sends the returned second data packet of each virtual machine to the test instrument; the test instrument determines the value of a preset parameter according to the information of the sent first data packet and the information of the second data packet sent by the receiving physical machine; and determining whether the number of virtual machines created by the physical machine under test is the maximum number of virtual machines which can be borne by the physical machine or not by comparing the value of the preset parameter calculated by the test instrument with the threshold value of the preset parameter. Therefore, the embodiment of the invention can determine the number of the virtual machines which can be deployed by the physical machine under the condition of meeting the preset parameter requirement, and can fully utilize the resources of the physical machine.
Example 2:
on the basis of the above embodiment, in the embodiment of the present invention, the test tool is specifically configured to send a first number of first virtual machine creation scripts carrying virtual machines to be created to the physical machine;
the physical machine is specifically configured to create a first number of virtual machines according to the first number of virtual machines to be created, which are carried in the first virtual machine creation script;
the test instrument is further used for sending first notification information to the test tool when judging that the value of the preset parameter does not exceed the corresponding threshold value;
the test tool is further configured to receive the first notification information, send a destruction script to the physical machine, and send a second virtual machine creation script to the physical machine, where the second virtual machine creation script carries a second number of virtual machines to be created, and the second number is greater than the first number;
the physical machine is further configured to receive the destruction script, destroy the first number of virtual machines created locally, receive a second virtual machine creation script, and create a second number of virtual machines.
When the testing tool sends the first virtual machine creation script to the physical machine, the number of the virtual machines to be tested can be carried in the first virtual machine creation script, so that the physical machine can create the virtual machines according to the number information carried in the first virtual machine creation script. Specifically, when the first virtual machine creation script is generated, the test tool may carry a first number of virtual machines to be created, and send the first virtual machine creation script carrying the first number of virtual machines to be created to the physical machine; the physical machine receives the first virtual machine creation script, creates virtual machines according to the first virtual machine creation script, wherein the number of created virtual machines is a first number.
For example, for this test, 3 virtual machines need to be created in a physical machine to test whether the physical machine can carry 3 virtual machines. Therefore, the first number of created virtual machines carried in the first virtual machine creation script generated by the test tool is 3, the physical machine receives the first virtual machine creation script with the first number of 3 sent by the test tool, and the physical machine creates 3 virtual machines according to the received first virtual machine creation script.
For the virtual machine created in the test, when at least one item of the value of the preset parameter calculated by the test instrument exceeds a corresponding threshold value, the maximum number of virtual machines which can be borne by the physical machine can be determined; when the values of the preset parameters calculated by the test instrument do not exceed the corresponding threshold values, the physical machine is indicated to possibly bear more virtual machines, so that the test instrument needs to send first notification information to the test instrument at the moment to inform the test instrument that the destruction script can be sent to the physical machine, and send a second virtual machine creation script to the physical machine.
The process of generating the destruction script by the test tool is in the prior art, and in the embodiment of the present invention, the process is not described in detail.
Therefore, when at least one value of the preset parameters calculated by the test instrument exceeds the corresponding threshold value, after the test instrument receives the first notification information from the test instrument, the test instrument needs to generate a second virtual machine creation script and a destruction script, wherein the second virtual machine creation script carries a second number of virtual machines to be created, and the second number is larger than the first number. The test tool sends the destroying script and the second virtual machine creating script to the physical machine, so that the physical machine performs operations such as virtual machine destroying, network deleting and the like according to the destroying script, and performs operations such as virtual machine creating and the like according to the second virtual machine creating script.
Specifically, after the physical machine receives the destruction script, the virtual machines of the first number which are locally created in the physical machine are destroyed according to the destruction script, and a second number of virtual machines are created according to the received second virtual machine creation script.
For example, 3 virtual machines are created for the physical machines in the test, namely, the first number is 3, and when the values of the preset parameters calculated by the test instrument do not exceed the corresponding threshold values, the test instrument sends first notification information to the test instrument; the testing tool sends a destroying script and a second virtual machine creating script carrying a second number to the physical machine according to the received first notification information, wherein the second number is larger than the first number, for example, the second number can be 5, and preferably the second number is 1 larger than the first number; the physical machine carries out destroying operation on the 3 locally created virtual machines according to the received destroying script, and creates 5 virtual machines according to the received second virtual machine creating script.
Example 3:
in order to more accurately create virtual machines and accurately determine the maximum number of virtual machines that a physical machine can carry, in the above embodiments, in the embodiments of the present invention, the test tool is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, where the third number is 1;
the physical machine is specifically configured to create a third number of virtual machines according to the third number of virtual machines to be created, which is carried in the third virtual machine creation script;
the test instrument is further configured to send second notification information to the test tool when it is determined that the value of the predicted parameter does not exceed the corresponding threshold value;
the test tool is further used for receiving the second notification information and sending a third virtual machine creation script to the physical machine;
the physical machine is further configured to create a third number of virtual machines.
When the maximum number of virtual machines which can be borne by the physical machine is tested, one virtual machine can be added on the basis of the number of virtual machines which are created in the last test. Specifically, if the values of the preset parameters calculated by the test instrument do not exceed the corresponding threshold values during the last test, for the test, the test tool first needs to generate a third virtual machine creation script into the physical machine, wherein the third virtual machine creation script carries a third number to be created, and specifically, the third number is 1, and the third virtual machine creation script is sent to the physical machine. And the physical machine receives the third virtual machine creation script, and based on the virtual machine created by the last test, 1 virtual machine is created again according to the third virtual machine creation script.
When the values of the preset parameters calculated by the test instrument do not exceed the corresponding threshold values, the physical machine possibly can bear more virtual machines, and the test instrument needs to send second notification information to the test instrument to inform the test instrument that the physical machine can bear the number of the virtual machines which are currently created. And after the test tool receives the second notification information sent by the test instrument, sending a third virtual machine creation script to the physical machine. And the physical machine re-creates 1 virtual machine according to the received third virtual machine creation script.
For example, for the present test, it is known that 3 virtual machines have been created in the physical machine, and none of the preset parameter values calculated by the test meter exceeds the corresponding threshold value. At this time, the test instrument sends second notification information to the test tool, and after receiving the second notification information, the test tool generates a third virtual machine creation script with a third number of 1, which carries the virtual machines to be created. The testing tool generates the third virtual machine creation script to the physical machine, and the physical machine creates 1 virtual machine according to the third virtual machine creation script, specifically, 4 virtual machines are created in the physical machine, so as to test whether 4 virtual machines can be borne in the physical machine.
For example, a schematic diagram of a test procedure of the number of virtual machines carried by a physical machine as shown in fig. 2, a diagram on the left side (left and right in the drawing) as shown in fig. 2, and when it is the first test, a virtual machine is created in the physical machine. Wherein VM1 is a virtual machine created, and a DPDK (Date planedevelopment kit) software library is configured in the physical machine and the virtual machine, and is a software library for accelerating packet data processing; the physical machine is also provided with a multi-layer virtual switch (OpenVSwitch, OVS), L2fwd is two-layer forwarding, and the packet is sent through the MAC address; a flow generator (Traffic generator) for generating data packets, in an embodiment of the invention, the flow generator is embodied as a test meter; the Host operating system (Host OS) is an operating system configured in the physical machine, and a data packet distribution mechanism, namely an SR-IOV, is also arranged in the physical machine.
When a virtual machine is created in the physical machine, when the values of preset parameters calculated by the test instrument do not exceed the corresponding threshold values, the test instrument receives second notification information sent by the test instrument, after receiving the second notification information, the test instrument sends a third virtual machine creation script with the number of 1 to the physical machine, and the physical machine creates 1 virtual machine according to the third virtual machine creation script, as shown in a right side (left and right sides in the figure) diagram of fig. 2, and creates 2 virtual machines in the physical machine, namely virtual machine VM1 and virtual machine VM2; after generating first data packets for each virtual machine, the flow generator sends each first data packet to the physical machine through a physical network card of the physical machine, the physical machine distributes each first data packet to a corresponding virtual machine VM1 and a corresponding virtual machine VM2 according to a data packet distribution mechanism, the virtual machine VM1 returns each second data packet to the physical machine after receiving each corresponding first data packet, the virtual machine VM2 returns each second data packet to the physical machine after receiving each corresponding first data packet, the physical machine sends each second data packet returned by each virtual machine to the flow generator, and the flow generator determines the value of a preset parameter according to the first data packet and the second data packet; and determining the maximum number of virtual machines which can be borne by the physical machine according to the value of the preset parameter and the corresponding threshold value.
Example 4:
in order to better determine the maximum number of virtual machines that can be borne by the physical machine, based on the above embodiments, in the embodiments of the present invention:
the test instrument is specifically configured to determine, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and determine whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of virtual machines borne by the physical machine and 1.
When judging the maximum number of virtual machines which can be borne by the physical machine, whether each virtual machine established in the physical machine can meet the threshold value of the preset parameters of the staff or not can be judged. Specifically, when the value of the preset parameter corresponding to any virtual machine exceeds the corresponding threshold value, the number of virtual machines created in the test cannot be considered to be borne in the physical machine. At this time, the number of virtual machines created at the last test may be determined to be the maximum number of virtual machines that the physical machine can carry.
Specifically, when judging whether the physical machine can bear a certain number of virtual machines, calculating a value of a preset parameter according to each virtual machine created in the physical machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value according to each virtual machine, so as to determine whether the physical machine can bear the number of the virtual machines created in the test. Specifically, when the value of the preset parameter of any virtual machine exceeds the corresponding threshold value, the number of virtual machines created in the physical machine cannot be borne by the physical machine is indicated.
Specifically, each first data packet includes source address information and destination address information, where the destination address information is address information of the virtual machine. Thus, for each virtual machine, the test meter may determine, based on the first data packet sent for that virtual machine and the second data packet returned by that virtual machine, a value of a preset parameter for that virtual machine. For the virtual machine, judging whether the calculated value of the preset parameter exceeds a corresponding threshold value, and if the value of the preset parameter exceeds the corresponding threshold value, determining the number of virtual machines which cannot be established by the physical machine in the test. And the number of virtual machines created in the last test can be determined to be the maximum number of virtual machines which can be borne by the physical machine, specifically, the difference between the number of virtual machines created at this time and 1 is the maximum number of virtual machines which can be borne by the physical machine.
For example, according to a first data packet sent by a certain virtual machine and a second data packet returned by the virtual machine, the process of calculating the value of the preset parameter of the virtual machine is that, the packet loss rate refers to the ratio of the number of lost data packets in the test to the number of sent data packets, and the packet loss rate refers to the ratio of the difference value between the number of first data packets and the number of second data packets to the number of first data packets, where the ratio is the packet loss rate of the virtual machine. The time delay is the difference between the time t1 when the test instrument receives the second data packet and the time t2 when the first data packet is sent, and the difference is the time delay of the virtual machine. The maximum time delay is the maximum time delay, the minimum time delay is the minimum time delay, and the average value of all the time delays is the average time delay.
In the embodiment of the present invention, the process of determining, by the test meter, whether the value of the preset parameter of the virtual machine exceeds the corresponding threshold value may include: packet loss rate, average delay, maximum delay, average jitter, and maximum jitter. For example, the threshold of the packet loss rate may be set to 1e-5, the threshold of the maximum delay may be set to 200ms, the threshold of the average delay may be set to 150ms, the threshold of the maximum jitter may be set to 100ms, and the threshold of the average jitter may be set to 50ms.
In the test, 8 virtual machines are created in the physical machine, and if the value of the preset parameter of each virtual machine does not exceed the corresponding threshold value, the physical machine can possibly bear more virtual machines; if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, for example, the maximum time delay of a certain virtual machine is 220ms, and the threshold value exceeding the maximum time delay is 200ms, even if the values of the rest preset parameters of the virtual machine do not exceed the corresponding threshold value, and the values of the preset parameters of other virtual machines do not exceed the corresponding threshold value, the physical machine is considered to be incapable of bearing the 8 virtual machines created at this time, and the maximum number of virtual machines which can be borne by the physical machine can be determined to be 7.
Example 5:
in order to better determine the maximum number of virtual machines that can be borne by the physical machine, based on the above embodiments, in the embodiments of the present invention:
the test instrument is specifically configured to determine a value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and determine whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
When judging the maximum number of virtual machines which can be borne by the physical machine, calculating a value of a preset parameter aiming at the physical machine, and judging whether the value of the preset parameter can meet the threshold value of the preset parameter or not, so as to determine the maximum number of virtual machines which can be borne by the physical machine.
Specifically, the value of the preset parameter of the physical machine may be determined according to all the first data packets sent to the physical machine by the test instrument and all the second data packets sent to the test instrument by the physical machine, without determining the value of the preset parameter of each virtual machine. If the value of any preset parameter is larger than the corresponding threshold value, the maximum number of virtual machines which can be borne by the physical machine can be determined. Thus, for the physical machine, the test meter may determine a value of a preset parameter for the physical machine according to each first data packet sent for the physical machine and each second data packet returned by the physical machine. Judging whether the value of the preset parameter corresponding to the physical machine exceeds the corresponding threshold value, and if at least one preset parameter exceeds the corresponding threshold value, determining the number of virtual machines which cannot be created by the physical machine in the test. And the number of virtual machines created in the last test can be determined to be the maximum number of virtual machines which can be borne by the physical machine, specifically, the difference between the number of virtual machines created at this time and 1 is the maximum number of virtual machines which can be borne by the physical machine.
For example, according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, determining the value of the preset parameter for the physical machine is that, where the packet loss rate refers to the number of lost data packets in the test that occupies the number of sent data packets, the packet loss rate is the ratio of the difference value between the total number of first data packets and the total number of second data packets to the total number of first data packets, and the ratio is the packet loss rate of the physical machine. The time delay is the difference between the time t1 when the test instrument receives the second data packet and the time t2 when the first data packet is sent, and the difference is the time delay of the physical machine. The maximum time delay is the maximum time delay, the minimum time delay is the minimum time delay, and the average value of all the time delays is the average time delay.
In the embodiment of the present invention, the process of determining, by the test meter, whether the value of the preset parameter of the physical machine exceeds the corresponding threshold value may include: packet loss rate, average delay, maximum delay, average jitter, and maximum jitter. For example, the threshold of the packet loss rate may be set to 1e-5, the threshold of the maximum delay may be set to 200ms, the threshold of the average delay may be set to 150ms, the threshold of the maximum jitter may be set to 100ms, and the threshold of the average jitter may be set to 50ms.
In the test, 8 virtual machines are created in the physical machine, and if the values of the preset parameters of the physical machine do not exceed the corresponding threshold values, the physical machine possibly can bear more virtual machines; if any value of the preset parameters exceeds the corresponding threshold value, for example, the maximum time delay of the physical machine is 220ms, and the threshold value exceeding the maximum time delay is 200ms, even if the values of the rest preset parameters do not exceed the corresponding threshold value, the physical machine is considered to be incapable of bearing the 8 virtual machines created at this time, and the maximum number of the virtual machines which the physical machine can bear can be determined to be 7.
In a specific implementation, if a test is to be performed on a physical machine in a network cloud platform, the maximum number of virtual machines that the physical machine can carry is tested, and a specific process of using the test system provided in the embodiment of the present invention is that, generally, the network cloud platform will include a plurality of physical machines, so that one of the physical machines needs to be set as a control node, the other physical machines are computing nodes, and the control node can manage the other computing nodes, and the computing nodes are used for specific processing tasks and the like. In fig. 3, a cloud platform management module VIM is a control node, that is, a physical machine, and in the embodiment of the present invention, the cloud platform management module VIM is a testing tool, and its main functions are to create a script, test the script, destroy the script, and send the script to a virtual machine, and the testing tool forwards the script to a corresponding computing node, that is, a physical machine to be tested, where the specific testing process includes the following steps:
1. The test tool sends the threshold value of the preset parameter to the test instrument.
2. The testing tool generates a virtual machine creation script and sends the virtual machine creation script to the physical machine;
3. after receiving the virtual machine creation script, the physical machine identifies the virtual machine creation script, and performs creation of the virtual machine, establishment of network connection, and the like.
4. After the physical machine creates the virtual machines, address information corresponding to each virtual machine is sent to the testing tool.
5. And after receiving the address information of each virtual machine, the test tool sends a test script to the physical machine.
6. The test tool sends the address information of each virtual machine to the test meter.
7. The test instrument receives the address information of each virtual machine, generates a first data packet for each virtual machine according to the address information of each virtual machine, and sends the first data packet for each virtual machine to a corresponding virtual machine in the physical machines.
8. And the second data packet returned by each virtual machine and received by the physical machine is sent to the test instrument, and the test instrument determines the value of the preset parameter according to the information of each first data packet and the information of each second data packet.
9. After the maximum number of virtual machines borne by the physical machine is finally determined, the test tool generates a destroying script and sends the destroying script to the physical machine.
10. The physical machine identifies the destroying script, and performs operations such as destroying the virtual machine, deleting the related network of the virtual machine, and the like.
11. And the physical machine feeds back the destroying ending information to the testing tool.
In the specific implementation, a virtual machine is deployed firstly during testing, the steps are executed after deployment, whether the tested index is within a specified threshold value or not is verified, if the tested index meets the requirement, after the execution is finished, the deployment number of the virtual machines is increased by 1, and the steps are executed again. The test is stopped until there is a threshold value that is beyond the expected value or the hardware resources are insufficient to deploy the new virtual machine. And the maximum virtual machine number N of the test result is the maximum virtual machine deployment number under the condition of meeting the threshold value. For other computing nodes in the network cloud platform, namely other physical machines, if the maximum number of virtual machines which can be borne by the physical machines needs to be calculated, the test system provided by the embodiment of the invention can be used for determining.
Example 6:
on the basis of the foregoing embodiments, in the embodiments of the present invention, a method for testing the number of virtual machines borne by a physical machine is further provided, and fig. 4 is a schematic flow chart of a method for testing the number of virtual machines borne by a physical machine, where the process includes:
S401: the virtual machine creation script and the test script are sent to the physical machine.
S402: and receiving the address information of each virtual machine created by the physical machine.
S403: and sending the address information of each virtual machine and the threshold value of the preset parameter to a test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The method provided by the embodiment of the invention is applied to a testing tool, and the testing system for the number of virtual machines borne by the physical machines provided by the embodiment of the invention can provide the maximum number of virtual machines supported by the tested physical machines based on specific parameter preset conditions. Therefore, when the virtual machines are deployed on the physical machine, whether the physical machine meets the requirements required to be met by the physical machine in terms of processing capacity and the like after the physical machine deploys a certain number of virtual machines should be considered. Meanwhile, if only a small number of virtual machines are deployed on the physical machine, the processing capacity of the physical machine is guaranteed, but resources such as hardware configuration in the physical machine are not fully utilized, and the problems of resource waste and the like are caused. Therefore, under the condition that the value of the index to be reached by the physical machine is preset, the maximum number of virtual machines which can be borne by the physical machine is determined, and the maximum number of virtual machines is deployed in the physical machine, so that the full utilization of the physical machine resources can be realized.
The main function of the testing tool in the embodiment of the invention is to provide the virtual machine creation script and the testing script for the physical machine, and provide the threshold value of the preset parameter and the address information of each virtual machine created in the physical machine for the testing instrument. The test tool therefore first needs to generate virtual machine creation scripts and test scripts and send the generated virtual machine creation scripts and test scripts to the physical machine. Meanwhile, after a certain number of virtual machines are created for the tested physical machine in the embodiment of the invention, the processing capability of the physical machine needs to meet certain conditions, for example, the packet loss rate requirement of the physical machine is not more than 1e-5, so that a worker is required to set a threshold value of preset parameters in a testing tool in advance, wherein the preset parameters comprise: at least one of packet loss rate, average time delay, maximum jitter and the like, and sending the set threshold value of the preset parameter to a test instrument.
Specifically, sending the virtual machine creation script to the physical machine includes:
transmitting a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine;
the method further comprises the steps of:
Receiving first notification information sent by a test instrument, wherein the first notification information is sent to the test tool when the test instrument judges that the value of a preset parameter does not exceed a corresponding threshold value;
sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
When the testing tool sends the first virtual machine creation script to the physical machine, the number of the virtual machines to be tested can be carried in the first virtual machine creation script, so that the physical machine can create the virtual machines according to the number information carried in the first virtual machine creation script. Specifically, when the first virtual machine creation script is generated, the test tool may carry a first number of virtual machines to be created, and send the first virtual machine creation script carrying the first number of virtual machines to be created to the physical machine; the physical machine receives the first virtual machine creation script, creates virtual machines according to the first virtual machine creation script, wherein the number of created virtual machines is a first number.
For example, for this test, 3 virtual machines need to be created in a physical machine to test whether the physical machine can carry 3 virtual machines. Therefore, the first number of created virtual machines carried in the first virtual machine creation script generated by the test tool is 3, the physical machine receives the first virtual machine creation script with the first number of 3 sent by the test tool, and the physical machine creates 3 virtual machines according to the received first virtual machine creation script.
For the virtual machine created in the test, when at least one item of the value of the preset parameter calculated by the test instrument exceeds a corresponding threshold value, the maximum number of virtual machines which can be borne by the physical machine can be determined; when the values of the preset parameters calculated by the test instrument do not exceed the corresponding threshold values, the physical machine is indicated to possibly bear more virtual machines, so that the test instrument needs to send first notification information to the test instrument at the moment to inform the test instrument that the destruction script can be sent to the physical machine, and send a second virtual machine creation script to the physical machine.
Therefore, when at least one value of the preset parameters calculated by the test instrument exceeds the corresponding threshold value, after the test instrument receives the first notification information from the test instrument, the test instrument needs to generate a second virtual machine creation script and a destruction script, wherein the second virtual machine creation script carries a second number of virtual machines to be created, and the second number is larger than the first number. The test tool sends the destroying script and the second virtual machine creating script to the physical machine, so that the physical machine performs operations such as virtual machine destroying, network deleting and the like according to the destroying script, and performs operations such as virtual machine creating and the like according to the second virtual machine creating script.
Specifically, after the physical machine receives the destruction script, the virtual machines of the first number which are locally created in the physical machine are destroyed according to the destruction script, and a second number of virtual machines are created according to the received second virtual machine creation script.
Specifically, sending the virtual machine creation script to the physical machine includes:
transmitting a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, wherein the third number is 1;
the method further comprises the steps of:
receiving second notification information sent by a test instrument, wherein the second notification information is sent to the test tool when the test instrument judges that the value of a preset parameter does not exceed a corresponding threshold value;
and sending a third virtual machine creation script to the physical machine.
When the maximum number of virtual machines which can be borne by the physical machine is tested, one virtual machine can be added on the basis of the number of virtual machines which are created in the last test. Specifically, if the values of the preset parameters calculated by the test instrument do not exceed the corresponding threshold values during the last test, for the test, the test tool first needs to generate a third virtual machine creation script into the physical machine, wherein the third virtual machine creation script carries a third number to be created, and specifically, the third number is 1, and the third virtual machine creation script is sent to the physical machine. And the physical machine receives the third virtual machine creation script, and based on the virtual machine created by the last test, 1 virtual machine is created again according to the third virtual machine creation script.
When a virtual machine is created in the physical machine, when the values of preset parameters calculated by the test instrument do not exceed the corresponding threshold values, the test instrument receives second notification information sent by the test instrument, after receiving the second notification information, the test instrument sends a third virtual machine creation script with the number of 1 to the physical machine, and the physical machine creates 1 virtual machine according to the third virtual machine creation script, as shown in a right side (left and right sides in the figure) diagram of fig. 2, and creates 2 virtual machines in the physical machine, namely virtual machine VM1 and virtual machine VM2; after generating first data packets for each virtual machine, the flow generator sends each first data packet to the physical machine through a physical network card of the physical machine, the physical machine distributes each first data packet to a corresponding virtual machine VM1 and a corresponding virtual machine VM2 according to a data packet distribution mechanism, the virtual machine VM1 returns each second data packet to the physical machine after receiving each corresponding first data packet, the virtual machine VM2 returns each second data packet to the physical machine after receiving each corresponding first data packet, the physical machine sends each second data packet returned by each virtual machine to the flow generator, and the flow generator determines the value of a preset parameter according to the first data packet and the second data packet; and determining the maximum number of virtual machines which can be borne by the physical machine according to the value of the preset parameter and the corresponding threshold value.
Example 7:
on the basis of the foregoing embodiments, in the embodiments of the present invention, a method for testing the number of virtual machines borne by a physical machine is further provided, and fig. 5 is a schematic flow chart of a method for testing the number of virtual machines borne by a physical machine, where the process includes:
s501: and receiving a virtual machine creation script and a test script sent by the test tool.
S502: and creating corresponding virtual machines according to the received virtual machine creation script, correspondingly running the test script, and sending the address information of each virtual machine to a test tool.
S503: and receiving a first data packet sent to each virtual machine by the test instrument.
S504: and distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The method is applied to a physical machine, the physical machine receives a virtual machine creation script and a test script sent by a test tool, the virtual machine is created in the physical machine according to the virtual machine creation script, and the test script is operated on the created virtual machine. Because the embodiment of the invention tests the capability of the virtual machine for forwarding the data packet, the test script is the script which enables the virtual machine to have the capability of forwarding the data packet, and after the test script is operated in the virtual machine, the virtual machine has the capability of forwarding the data packet.
After each virtual machine is created by the physical machine, the address information of each virtual machine is sent to a testing tool, and the testing tool sends the received address information of each virtual machine to a testing instrument. The test meter generates a first data packet for each virtual machine according to the received address information of each virtual machine, and sends each first data packet to the physical machine.
After receiving each first data packet sent by the test instrument, the physical machine distributes each first data packet to a corresponding virtual machine according to the address information of the virtual machine carried in each first data packet. After the test script is run on the virtual machine, if the virtual machine receives a first data packet, the first data packet is correspondingly processed and a second data packet is sent, and the physical machine sends the second data packet sent by the virtual machine to the test instrument.
After the test instrument receives each second data packet sent by the physical machine, the test instrument determines the value of the preset parameter according to the information of the first data packet and the second data packet. Judging whether the value of the preset parameter exceeds a corresponding threshold value, and determining the maximum number of virtual machines borne by the physical machine according to a judging result. Specifically, when the value of at least one preset parameter exceeds the threshold value, the maximum number of virtual machines borne by the physical machine can be determined according to the number of virtual machines borne by the current physical machine.
Because in the embodiment of the invention, the physical machine creates a corresponding virtual machine according to the received virtual machine creation script, sends each first data packet sent by the test instrument to the corresponding virtual machine, and sends the returned second data packet of each virtual machine to the test instrument; the test instrument determines the value of a preset parameter according to the information of the sent first data packet and the information of the second data packet sent by the receiving physical machine; and determining whether the number of virtual machines created by the physical machine under test is the maximum number of virtual machines which can be borne by the physical machine or not by comparing the value of the preset parameter calculated by the test instrument with the threshold value of the preset parameter. Therefore, the embodiment of the invention can determine the number of the virtual machines which can be deployed by the physical machine under the condition of meeting the preset parameter requirement, and can fully utilize the resources of the physical machine.
Example 8:
based on the foregoing embodiments, in the embodiments of the present invention, a method for testing the number of virtual machines borne by a physical machine is further provided, and fig. 6 is a schematic flow chart of a method for testing the number of virtual machines borne by a physical machine, where the process includes:
S601: and receiving the address information of each virtual machine and the threshold value of the preset parameter, which are created in the physical machine and sent by the testing tool, generating a first data packet aiming at each virtual machine, and sending each first data packet to the physical machine.
S602: and receiving each second data packet returned by the physical machine, and determining the value of a preset parameter according to the first data packet and the second data packet.
S603: and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
The method is applied to the test instrument, and the main function of the test instrument in the embodiment of the invention is to calculate the value of the preset parameter according to the first data packet and the second data packet, and judge whether the value of the preset parameter exceeds the corresponding threshold value, so as to determine the number of the maximum virtual machines which can be borne by the physical machine. Therefore, the test meter first needs to receive the threshold value of the preset parameter from the test tool, and receives the address information of each virtual machine from the test tool. According to the address information of each virtual machine, the test instrument generates a first data packet for each virtual machine, wherein the packet length of each first data packet generated by the test instrument can be a fixed packet length or a mixed packet length.
Specifically, each first data packet includes source address information and target address information, where the source address information specifically refers to address information of the test instrument, and the target address information specifically refers to address information of the virtual machine. And sending each generated first data packet to a physical machine, and distributing each first data packet to each virtual machine by the physical machine according to the address information of the virtual machine carried by each first data packet.
Specifically, determining, according to the first data packet and the second data packet, a value of a preset parameter includes:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine;
the judging whether the value of the preset parameter exceeds the corresponding threshold value comprises the following steps:
judging whether the value of the preset parameter of each virtual machine exceeds a corresponding threshold value or not according to each virtual machine;
the determining the maximum number of virtual machines carried by the physical machine includes:
if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of virtual machines borne by the physical machine and 1.
When judging the maximum number of virtual machines which can be borne by the physical machine, whether each virtual machine established in the physical machine can meet the threshold value of the preset parameters of the staff or not can be judged. Specifically, when the value of the preset parameter corresponding to any virtual machine exceeds the corresponding threshold value, the number of virtual machines created in the test cannot be considered to be borne in the physical machine. At this time, the number of virtual machines created at the last test may be determined to be the maximum number of virtual machines that the physical machine can carry.
Specifically, when judging whether the physical machine can bear a certain number of virtual machines, calculating a value of a preset parameter according to each virtual machine created in the physical machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value according to each virtual machine, so as to determine whether the physical machine can bear the number of the virtual machines created in the test. Specifically, when the value of the preset parameter of any virtual machine exceeds the corresponding threshold value, the number of virtual machines created in the physical machine cannot be borne by the physical machine is indicated.
Specifically, each first data packet includes source address information and destination address information, where the destination address information is address information of the virtual machine. Thus, for each virtual machine, the test meter may determine, based on the first data packet sent for that virtual machine and the second data packet returned by that virtual machine, a value of a preset parameter for that virtual machine. For the virtual machine, judging whether the calculated value of the preset parameter exceeds a corresponding threshold value, and if the value of the preset parameter exceeds the corresponding threshold value, determining the number of virtual machines which cannot be established by the physical machine in the test. And the number of virtual machines created in the last test can be determined to be the maximum number of virtual machines which can be borne by the physical machine, specifically, the difference between the number of virtual machines created at this time and 1 is the maximum number of virtual machines which can be borne by the physical machine.
Specifically, determining, according to the first data packet and the second data packet, a value of a preset parameter includes:
determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine;
the judging whether the value of the preset parameter exceeds the corresponding threshold value comprises the following steps:
and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value.
Specifically, the method further comprises the following steps:
and when the value of the preset parameter is judged not to exceed the corresponding threshold value, sending notification information to the test tool.
Specifically, the preset parameters include at least one of the following:
packet loss rate, average delay, maximum delay, average jitter, and maximum jitter.
When judging the maximum number of virtual machines which can be borne by the physical machine, calculating a value of a preset parameter aiming at the physical machine, and judging whether the value of the preset parameter can meet the threshold value of the preset parameter or not, so as to determine the maximum number of virtual machines which can be borne by the physical machine.
When the test instrument judges that the value of the preset parameter does not exceed the corresponding threshold value, the test instrument sends notification information to the test instrument so as to inform the test instrument that the physical machine can bear more virtual machines.
The preset parameters preset by the staff may include at least one of the following: packet loss rate, average delay, maximum delay, average jitter, and maximum jitter. Preferably, in order to better test the performance of the physical machine, the preset parameters may be set as a packet loss rate, an average delay, a maximum delay, an average jitter, and a maximum jitter.
Because in the embodiment of the invention, the physical machine creates a corresponding virtual machine according to the received virtual machine creation script, sends each first data packet sent by the test instrument to the corresponding virtual machine, and sends the returned second data packet of each virtual machine to the test instrument; the test instrument determines the value of a preset parameter according to the information of the sent first data packet and the information of the second data packet sent by the receiving physical machine; and determining whether the number of virtual machines created by the physical machine under test is the maximum number of virtual machines which can be borne by the physical machine or not by comparing the value of the preset parameter calculated by the test instrument with the threshold value of the preset parameter. Therefore, the embodiment of the invention can determine the number of the virtual machines which can be deployed by the physical machine under the condition of meeting the preset parameter requirement, and can fully utilize the resources of the physical machine.
Example 9:
on the basis of the foregoing embodiments, in the embodiment of the present invention, a device for testing the number of virtual machines borne by a physical machine is further provided, and fig. 7 is a schematic structural diagram of the device for testing the number of virtual machines borne by a physical machine, where the device includes:
a first sending module 701, configured to send a virtual machine creation script and a test script to a physical machine;
a first receiving module 702, configured to receive address information of each virtual machine created by the physical machine, where the address information is sent by the physical machine;
the second sending module 703 is configured to send the address information of each virtual machine and a threshold value of a preset parameter to the test instrument, so that the test instrument generates a first data packet for each virtual machine, determines a value of the preset parameter according to the received second data packet returned by each virtual machine, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
Further, the first sending module 701 is specifically configured to send a first number of first virtual machine creation scripts carrying virtual machines to be created to the physical machine.
Further, the first receiving module 702 is further configured to receive first notification information sent by a test meter, where the first notification information is sent to the test tool when the test meter determines that a value of a preset parameter does not exceed a corresponding threshold value.
Further, the first sending module 701 is further configured to send a destruction script to the physical machine, notify the physical machine to destroy a first number of virtual machines created locally, and send a second virtual machine creation script to the physical machine, where the second number of virtual machines to be created is carried in the second virtual machine creation script, and the second number is greater than the first number.
Further, the first sending module 701 is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, where the third number is 1.
Further, the first receiving module 702 is further configured to receive second notification information sent by a test meter, where the second notification information is sent to the test tool when the test meter determines that the value of the preset parameter does not exceed the corresponding threshold value.
Further, the first sending module 701 is further configured to send a third virtual machine creation script to the physical machine.
Example 10:
on the basis of the foregoing embodiments, in the embodiment of the present invention, a device for testing the number of virtual machines borne by a physical machine is further provided, and fig. 8 is a schematic structural diagram of the device for testing the number of virtual machines borne by a physical machine, where the device includes:
A first receiving module 801, configured to receive a virtual machine creation script and a test script sent by a test tool;
a creation and operation transmitting module 802, configured to create a corresponding virtual machine according to the received virtual machine creation script, correspondingly operate the test script, and transmit address information of each virtual machine to a test tool;
a second receiving module 803, configured to receive a first data packet sent by the test meter to each virtual machine;
the distributing module 804 is configured to distribute each first data packet to a corresponding virtual machine, and send a received second data packet returned by each virtual machine to the test meter, so that the test meter determines a value of a preset parameter according to each first data packet and each received second data packet, and determines a maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and a threshold value of the preset parameter.
Example 11:
on the basis of the foregoing embodiments, in the embodiment of the present invention, a device for testing the number of virtual machines borne by a physical machine is further provided, and fig. 9 is a schematic structural diagram of the device for testing the number of virtual machines borne by a physical machine, where the device includes:
The first receiving module 901 is configured to receive address information of each virtual machine created in the physical machine and a threshold value of a preset parameter, which are sent by the testing tool;
a generating module 902, configured to generate a first data packet for each virtual machine;
a sending module 903, configured to send each first data packet to a physical machine;
a second receiving module 904, configured to receive each second data packet returned by the physical machine;
a determining module 905, configured to determine a value of a preset parameter according to the first data packet and the second data packet;
and a judging module 906, configured to judge whether the value of the preset parameter exceeds a corresponding threshold value, and if yes, determine, according to the number of virtual machines currently created, the maximum number of virtual machines borne by the physical machine.
Further, the determining module 905 is specifically configured to determine, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine; the judging module 906 is specifically configured to judge, for each virtual machine, whether a value of a preset parameter of the virtual machine exceeds a corresponding threshold value; the determining module 905 is specifically configured to determine that the physical machine cannot carry the current number of virtual machines if at least one value of the preset parameters of the virtual machine exceeds the corresponding threshold value, and determine that the maximum number of virtual machines carried by the physical machine is a difference between the current number of virtual machines carried by the physical machine and 1.
Further, the determining module 905 is specifically configured to determine a value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine; the judging module 906 is specifically configured to judge whether a value of a preset parameter of the physical machine exceeds a corresponding threshold value.
Further, the sending module 903 is further configured to send notification information to the test tool when it is determined that the value of the preset parameter does not exceed the corresponding threshold value.
Example 12:
on the basis of the above embodiments, the embodiment of the present invention further provides an electronic device 1000, as shown in fig. 10, including a memory 1001 and a processor 1002;
the processor 1002 is configured to read the program in the memory 1001, and perform the following procedures:
transmitting the virtual machine creation script and the test script to the physical machine;
receiving address information of each virtual machine created by the physical machine;
and sending the address information of each virtual machine and the threshold value of the preset parameter to a test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
In fig. 10, a bus architecture may be comprised of any number of interconnected buses and bridges, and in particular one or more processors represented by the processor 1002 and various circuits of the memory represented by the memory 1001. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein.
Alternatively, the processor 1002 may be a CPU (Central processing Unit), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable Gate array), or CPLD (Complex Programmable Logic Device ).
The processor is specifically configured to send a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine.
The processor is used for receiving first notification information sent by the test instrument, wherein the first notification information is sent to the test tool when the test instrument judges that the value of the preset parameter does not exceed the corresponding threshold value;
Sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
The processor is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, where the third number is 1.
The processor is configured to receive second notification information sent by the test instrument, where the second notification information is sent to the test tool when the test instrument determines that a value of a preset parameter does not exceed a corresponding threshold value;
and sending a third virtual machine creation script to the physical machine.
Example 13:
on the basis of the above embodiments, the embodiment of the present invention further provides an electronic device 1100, as shown in fig. 11, including a memory 1101 and a processor 1102;
the processor 1102 is configured to read the program in the memory 1101, and perform the following procedures:
receiving a virtual machine creation script and a test script sent by a test tool;
Creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
and distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
In fig. 11, a bus architecture may be comprised of any number of interconnected buses and bridges, and in particular one or more processors represented by the processor 1102 and various circuits of memory represented by the memory 1101. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein.
Alternatively, the processor 1101 may be a CPU (Central processing Unit), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable Gate array), or CPLD (Complex Programmable Logic Device ).
Example 14:
on the basis of the above embodiments, the embodiment of the present invention further provides an electronic device 1200, as shown in fig. 12, including a memory 1201 and a processor 1202;
the processor 1202 is configured to read the program in the memory 1201, and execute the following procedures:
receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in a physical machine and sent by a testing tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine;
receiving each second data packet returned by the physical machine, and determining the value of a preset parameter according to the first data packet and the second data packet;
and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
In fig. 12, a bus architecture may be comprised of any number of interconnected buses and bridges, and in particular one or more processors represented by the processor 1202 and various circuits of memory represented by the memory 1201. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein.
Alternatively, the processor 1201 may be a CPU (Central processing Unit), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable Gate array), or CPLD (Complex Programmable Logic Device ).
The processor is specifically configured to determine, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine.
The processor is specifically configured to determine, for each virtual machine, whether a value of a preset parameter of the virtual machine exceeds a corresponding threshold value.
The processor is specifically configured to determine that the physical machine cannot carry the current number of virtual machines if at least one value of a preset parameter of the virtual machine exceeds a corresponding threshold value, and determine that the maximum number of virtual machines carried by the physical machine is a difference value between the current number of virtual machines carried by the physical machine and 1.
The processor is specifically configured to determine a value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine.
The processor is specifically configured to determine whether a value of a preset parameter of the physical machine exceeds a corresponding threshold value, where the preset parameter includes at least one of:
packet loss rate, average delay, maximum delay, average jitter, and maximum jitter.
And the processor is used for sending notification information to the test tool when judging that the value of the preset parameter does not exceed the corresponding threshold value.
Example 15:
on the basis of the above embodiments, the embodiment of the present invention further provides an electronic device 1300, as shown in fig. 13, including: processor 1301, communication interface 1302, memory 1303 and communication bus 1304, wherein processor 1301, communication interface 1302, memory 1303 complete the communication between each other through communication bus 1304;
the memory 1303 stores a computer program that, when executed by the processor 1301, causes the processor 1301 to perform the steps of:
transmitting the virtual machine creation script and the test script to the physical machine;
receiving address information of each virtual machine created by the physical machine;
and sending the address information of each virtual machine and the threshold value of the preset parameter to a test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
Further, the processor 1301 sends a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine.
Further, the processor 1301 receives first notification information sent by a test instrument, where the first notification information is sent to the test tool when the test instrument determines that a value of a preset parameter does not exceed a corresponding threshold value;
sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
Further, the processor 1301 sends a third virtual machine creation script to the physical machine that carries a third number of virtual machines to be created, wherein the third number is 1.
Further, the processor 1301 receives second notification information sent by the test instrument, where the second notification information is sent to the test tool when the test instrument determines that the value of the preset parameter does not exceed the corresponding threshold value;
And sending a third virtual machine creation script to the physical machine.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 1302 is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (Digital Signal Processing, DSP), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 16:
on the basis of the above embodiments, the embodiment of the present invention further provides an electronic device 1400, as shown in fig. 14, including: processor 1401, communication interface 1402, memory 1403 and communication bus 1404, wherein processor 1401, communication interface 1402, memory 1403 accomplish the communication between each other through communication bus 1404;
the memory 1403 stores a computer program which, when executed by the processor 1401, causes the processor 1401 to perform the steps of:
receiving a virtual machine creation script and a test script sent by a test tool;
creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
and distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 1402 is used for communication between the above-described electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (Digital Signal Processing, DSP), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 17:
on the basis of the above embodiments, the embodiment of the present invention further provides an electronic device 1500, as shown in fig. 15, including: a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 communicate with each other through the communication bus 1504;
the memory 1503 stores a computer program that, when executed by the processor 1501, causes the processor 1501 to perform the steps of:
receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in a physical machine and sent by a testing tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine;
receiving each second data packet returned by the physical machine, and determining the value of a preset parameter according to the first data packet and the second data packet;
and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Further, the processor 1501 determines, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine.
Further, the processor 1501 determines, for each virtual machine, whether a value of a preset parameter of the virtual machine exceeds a corresponding threshold.
Further, if the value of the preset parameter of at least one virtual machine exceeds the corresponding threshold value, the processor 1501 determines that the physical machine cannot carry the current number of virtual machines, and determines that the maximum number of virtual machines carried by the physical machine is the difference between the current number of virtual machines carried by the physical machine and 1.
Further, the processor 1501 determines values of preset parameters of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine.
Further, the processor 1501 determines whether a value of a preset parameter of the physical machine exceeds a corresponding threshold, where the preset parameter includes at least one of:
packet loss rate, average delay, maximum delay, average jitter, and maximum jitter.
Further, the processor 1501 sends notification information to the test tool when it is determined that the value of the preset parameter does not exceed the corresponding threshold value.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 1502 is used for the above-described electronics communication between the device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (Digital Signal Processing, DSP), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 18:
on the basis of the above embodiments, the embodiments of the present invention further provide a computer readable storage medium having stored therein a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform the steps of:
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of:
Transmitting the virtual machine creation script and the test script to the physical machine;
receiving address information of each virtual machine created by the physical machine;
and sending the address information of each virtual machine and the threshold value of the preset parameter to a test instrument so that the test instrument generates a first data packet aiming at each virtual machine, determining the value of the preset parameter according to the received second data packet returned by each virtual machine, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
Further, the processor sends a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine.
Further, the processor receives first notification information sent by a test instrument, wherein the first notification information is sent to the test tool when the test instrument judges that the value of a preset parameter does not exceed a corresponding threshold value;
sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
Further, the processor sends a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, wherein the third number is 1.
Further, the processor receives second notification information sent by the test instrument, wherein the second notification information is sent to the test tool when the test instrument judges that the value of the preset parameter does not exceed the corresponding threshold value;
and sending a third virtual machine creation script to the physical machine.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical memories such as CD, DVD, BD, HVD, etc., and semiconductor memories such as ROM, EPROM, EEPROM, nonvolatile memories (NAND FLASH), solid State Disks (SSD), etc.
Example 19:
on the basis of the above embodiments, the embodiments of the present invention further provide a computer readable storage medium having stored therein a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform the steps of:
The memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of:
receiving a virtual machine creation script and a test script sent by a test tool;
creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
and distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines the value of a preset parameter according to each first data packet and each received second data packet, and determines the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical memories such as CD, DVD, BD, HVD, etc., and semiconductor memories such as ROM, EPROM, EEPROM, nonvolatile memories (NAND FLASH), solid State Disks (SSD), etc.
Example 20:
on the basis of the above embodiments, the embodiments of the present invention further provide a computer readable storage medium having stored therein a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform the steps of:
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of:
receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in a physical machine and sent by a testing tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine;
receiving each second data packet returned by the physical machine, and determining the value of a preset parameter according to the first data packet and the second data packet;
and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Further, the processor determines, for each virtual machine, a value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine.
Further, the processor determines, for each virtual machine, whether a value of a preset parameter of the virtual machine exceeds a corresponding threshold value.
Further, if at least one value of the preset parameters of the virtual machines exceeds the corresponding threshold value, the processor determines that the physical machines cannot bear the current number of virtual machines, and determines that the maximum number of virtual machines borne by the physical machines is the difference between the current number of virtual machines borne by the physical machines and 1.
Further, the processor determines a value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine.
Further, the processor determines whether a value of a preset parameter of the physical machine exceeds a corresponding threshold value, wherein the preset parameter includes at least one of:
packet loss rate, average delay, maximum delay, average jitter, and maximum jitter.
Further, when the processor judges that the value of the preset parameter does not exceed the corresponding threshold value, the processor sends notification information to the test tool.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical memories such as CD, DVD, BD, HVD, etc., and semiconductor memories such as ROM, EPROM, EEPROM, nonvolatile memories (NAND FLASH), solid State Disks (SSD), etc.
In summary, the present invention provides a system, a method, an apparatus, an electronic device, and a storage medium for testing the number of virtual machines carried by a physical machine, where the system includes: the physical machine, the testing tool and the testing instrument; the test tool is used for sending the virtual machine creation script and the test script to the physical machine; receiving address information of each virtual machine created by the physical machine; transmitting the address information of each virtual machine and the threshold value of the preset parameter to the test instrument; the physical machine is used for receiving the virtual machine creation script and the test script sent by the test tool, creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly running the test script, and sending the address information of each virtual machine to the test tool; receiving first data packets sent to each virtual machine by the test instrument, distributing each first data packet to the corresponding virtual machine, and sending second data packets returned by each received virtual machine to the test instrument; the test instrument is used for receiving address information of each virtual machine and a threshold value of a preset parameter sent by the test tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine; receiving each second data packet returned by the physical machine; determining a value of a preset parameter according to the first data packet and the second data packet; and judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created.
Because in the embodiment of the invention, the physical machine creates the corresponding virtual machine according to the received virtual machine creation script, sends the first data packet sent by the test instrument to the corresponding virtual machine, and sends the second data packet of each virtual machine to the test instrument; the test instrument determines the value of a preset parameter according to the information of the sent first data packet and the information of the second data packet sent by the receiving physical machine; and determining whether the number of virtual machines created by the physical machine under test is the maximum number of virtual machines which can be borne by the physical machine or not by comparing the value of the preset parameter calculated by the test instrument with the threshold value of the preset parameter. Therefore, the embodiment of the invention can determine the maximum number of the virtual machines which can be deployed by the physical machine under the condition of meeting the requirement of the preset parameters, and can fully utilize the resources of the physical machine.
For the method/apparatus embodiments, the description is relatively simple as it is substantially similar to the system embodiments, with reference to the partial description of the system embodiments being relevant.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
Claims (26)
1. A system for testing the number of virtual machines carried by a physical machine, the system comprising: the physical machine, the testing tool and the testing instrument;
the test tool is used for sending the virtual machine creation script and the test script to the physical machine; receiving address information of each virtual machine created by the physical machine; transmitting the address information of each virtual machine and the threshold value of the preset parameter to the test instrument;
the physical machine is used for receiving the virtual machine creation script and the test script sent by the test tool, creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly running the test script, and sending the address information of each virtual machine to the test tool; receiving first data packets sent to each virtual machine by the test instrument, distributing each first data packet to the corresponding virtual machine, and sending second data packets returned by each received virtual machine to the test instrument;
The test instrument is used for receiving address information of each virtual machine and a threshold value of a preset parameter sent by the test tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine; receiving each second data packet returned by the physical machine; determining a value of a preset parameter according to the first data packet and the second data packet, wherein the preset parameter comprises: at least one of packet loss rate, average delay, maximum delay and maximum jitter; judging whether the value of the preset parameter exceeds a corresponding threshold value, if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created;
the test instrument is specifically used for:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
Determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
2. The system of claim 1, wherein the test tool is specifically configured to send a first number of first virtual machine creation scripts carrying virtual machines to be created to the physical machine;
the physical machine is specifically configured to create a first number of virtual machines according to the first number of virtual machines to be created, which are carried in the first virtual machine creation script;
the test instrument is further used for sending first notification information to the test tool when judging that the value of the preset parameter does not exceed the corresponding threshold value;
the test tool is further configured to receive the first notification information, send a destruction script to the physical machine, and send a second virtual machine creation script to the physical machine, where the second virtual machine creation script carries a second number of virtual machines to be created, and the second number is greater than the first number;
The physical machine is further configured to receive the destruction script, destroy the first number of virtual machines created locally, receive a second virtual machine creation script, and create a second number of virtual machines.
3. The system of claim 1, wherein the test tool is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, wherein the third number is 1;
the physical machine is specifically configured to create a third number of virtual machines according to the third number of virtual machines to be created, which is carried in the third virtual machine creation script;
the test instrument is further configured to send second notification information to the test tool when it is determined that the value of the predicted parameter does not exceed the corresponding threshold value;
the test tool is further used for receiving the second notification information and sending a third virtual machine creation script to the physical machine;
the physical machine is further configured to create a third number of virtual machines.
4. A method for testing the number of virtual machines carried by a physical machine, applied to a testing tool, the method comprising:
transmitting the virtual machine creation script and the test script to the physical machine;
Receiving address information of each virtual machine created by the physical machine;
transmitting the address information of each virtual machine and a threshold value of a preset parameter to a test instrument so that the test instrument generates a first data packet for each virtual machine, and determining the value of the preset parameter according to the received second data packet returned by each virtual machine, wherein the preset parameter comprises: at least one of packet loss rate, average time delay, maximum time delay and maximum jitter, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter;
wherein the test meter is caused to perform the steps of:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
Determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
5. The method of claim 4, wherein sending the virtual machine creation script to the physical machine comprises:
transmitting a first virtual machine creation script carrying a first number of virtual machines to be created to the physical machine;
the method further comprises the steps of:
receiving first notification information sent by a test instrument, wherein the first notification information is sent to the test tool when the test instrument judges that the value of a preset parameter does not exceed a corresponding threshold value;
sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
6. The method of claim 4, wherein sending the virtual machine creation script to the physical machine comprises:
transmitting a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, wherein the third number is 1;
the method further comprises the steps of:
receiving second notification information sent by a test instrument, wherein the second notification information is sent to the test tool when the test instrument judges that the value of a preset parameter does not exceed a corresponding threshold value;
and sending a third virtual machine creation script to the physical machine.
7. A method for testing the number of virtual machines carried by a physical machine, the method being applied to the physical machine and comprising:
receiving a virtual machine creation script and a test script sent by a test tool;
creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines a value of a preset parameter according to each first data packet and each received second data packet, wherein the preset parameter comprises: at least one of packet loss rate, average time delay, maximum time delay and maximum jitter, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter;
Wherein the test meter is caused to perform the steps of:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
8. A method for testing the number of virtual machines carried by a physical machine, applied to a test meter, the method comprising:
Receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in a physical machine and sent by a testing tool, generating a first data packet for each virtual machine, and sending each first data packet to the physical machine;
receiving each second data packet returned by the physical machine, and determining a value of a preset parameter according to the first data packet and the second data packet, wherein the preset parameter comprises: at least one of packet loss rate, average delay, maximum delay and maximum jitter;
judging whether the value of the preset parameter exceeds a corresponding threshold value, if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created;
wherein, according to the first data packet and the second data packet, determining the value of a preset parameter; judging whether the value of the preset parameter exceeds a corresponding threshold value or not comprises the following steps:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine; judging whether the value of the preset parameter of each virtual machine exceeds a corresponding threshold value or not according to each virtual machine; or,
Determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine; judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value;
the determining the maximum number of virtual machines carried by the physical machine includes:
and determining that the virtual maximum number of the physical machine load is the difference value between the current load number of the physical machine and 1.
9. The method of claim 8, wherein the method further comprises:
and when the value of the preset parameter is judged not to exceed the corresponding threshold value, sending notification information to the test tool.
10. A device for testing the number of virtual machines carried by a physical machine, applied to a testing tool, said device comprising:
the first sending module is used for sending the virtual machine creation script and the test script to the physical machine;
the first receiving module is used for receiving the address information of each virtual machine created by the physical machine;
the second sending module is configured to send address information of each virtual machine and a threshold value of a preset parameter to the test instrument, so that the test instrument generates a first data packet for each virtual machine, and determines a value of the preset parameter according to the received second data packet returned by each virtual machine, where the preset parameter includes: at least one of packet loss rate, average time delay, maximum time delay and maximum jitter, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter;
Wherein the test meter is caused to perform the steps of:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
11. A device for testing the number of virtual machines carried by a physical machine, the device being applied to the physical machine and comprising:
The first receiving module is used for receiving the virtual machine creation script and the test script sent by the test tool;
the creation operation transmitting module is used for creating a corresponding virtual machine according to the received virtual machine creation script, correspondingly operating the test script and transmitting the address information of each virtual machine to the test tool;
the second receiving module is used for receiving the first data packet sent to each virtual machine by the test instrument;
the distribution module is used for distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument so that the test instrument can determine the value of a preset parameter according to each first data packet and each received second data packet, wherein the preset parameter comprises: at least one of packet loss rate, average time delay, maximum time delay and maximum jitter, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter;
wherein the test meter is caused to perform the steps of:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
Determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
12. A device for testing the number of virtual machines carried by a physical machine, applied to a test meter, said device comprising:
the first receiving module is used for receiving the address information of each virtual machine and the threshold value of the preset parameter, which are created in the physical machine and sent by the testing tool;
the generation module is used for generating a first data packet for each virtual machine;
the sending module is used for sending each first data packet to the physical machine;
the second receiving module is used for receiving each second data packet returned by the physical machine;
the determining module is configured to determine a value of a preset parameter according to the first data packet and the second data packet, where the preset parameter includes: at least one of packet loss rate, average time delay, maximum time delay, average jitter and maximum jitter;
The judging module is used for judging whether the value of the preset parameter exceeds a corresponding threshold value, and if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created;
the determining module is specifically configured to:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine; or,
determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine;
the judging module is specifically configured to:
judging whether the value of the preset parameter of each virtual machine exceeds a corresponding threshold value or not according to each virtual machine; or,
judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value;
the determining module is specifically configured to:
and determining that the virtual maximum number of the physical machine load is the difference value between the current load number of the physical machine and 1.
13. An electronic device comprising a memory and a processor;
the processor is configured to read the program in the memory, and perform the following procedures: transmitting the virtual machine creation script and the test script to the physical machine;
Receiving address information of each virtual machine created by the physical machine;
transmitting the address information of each virtual machine and a threshold value of a preset parameter to a test instrument so that the test instrument generates a first data packet for each virtual machine, and determining the value of the preset parameter according to the received second data packet returned by each virtual machine, wherein the preset parameter comprises: at least one of packet loss rate, average time delay, maximum time delay and maximum jitter, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter;
wherein the test meter is caused to perform the steps of:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
Determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
14. The electronic device of claim 13, wherein the processor is specifically configured to send a first number of first virtual machine creation scripts carrying virtual machines to be created to the physical machine.
15. The electronic device of claim 13, wherein the processor is configured to receive first notification information sent by a test meter, wherein the first notification information is sent to the test tool when a value of a preset parameter of the test meter does not exceed a corresponding threshold value; sending a destroying script to the physical machine, informing the physical machine to destroy the first number of virtual machines which are created locally, and sending a second virtual machine creating script to the physical machine, wherein the second virtual machine creating script carries a second number of virtual machines to be created, and the second number is larger than the first number.
16. The electronic device of claim 13, wherein the processor is specifically configured to send a third virtual machine creation script carrying a third number of virtual machines to be created to the physical machine, wherein the third number is 1.
17. The electronic device of claim 13, wherein the processor is configured to receive second notification information sent by the test meter, the second notification information being sent to the test tool when the test meter determines that a value of a preset parameter does not exceed a corresponding threshold value; and sending a third virtual machine creation script to the physical machine.
18. An electronic device comprising a memory and a processor;
the processor is used for receiving the virtual machine creation script and the test script sent by the test tool;
creating corresponding virtual machines according to the received virtual machine creation scripts, correspondingly running the test scripts, and sending the address information of each virtual machine to a test tool;
receiving a first data packet sent to each virtual machine by a test instrument;
distributing each first data packet to a corresponding virtual machine, and sending the received second data packet returned by each virtual machine to the test instrument, so that the test instrument determines a value of a preset parameter according to each first data packet and each received second data packet, wherein the preset parameter comprises: at least one of packet loss rate, average time delay, maximum time delay and maximum jitter, and determining the maximum number of virtual machines borne by the physical machine according to the value of the preset parameter and the threshold value of the preset parameter;
Wherein the test meter is caused to perform the steps of:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine, and judging whether the value of the preset parameter of the virtual machine exceeds a corresponding threshold value; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
19. An electronic device comprising a memory and a processor;
The processor is used for receiving address information of each virtual machine and a threshold value of a preset parameter, which are created in the physical machine and sent by the testing tool, generating a first data packet aiming at each virtual machine, and sending each first data packet to the physical machine;
receiving each second data packet returned by the physical machine, and determining a value of a preset parameter according to the first data packet and the second data packet, wherein the preset parameter comprises: at least one of packet loss rate, average delay, maximum delay and maximum jitter;
judging whether the value of the preset parameter exceeds a corresponding threshold value, if so, determining the maximum number of virtual machines borne by the physical machine according to the number of the virtual machines currently created;
the processor is specifically configured to:
for each virtual machine, determining the value of a preset parameter of the virtual machine according to a first data packet sent to the virtual machine and a second data packet returned by the virtual machine; judging whether the value of the preset parameter of each virtual machine exceeds a corresponding threshold value or not according to each virtual machine; if at least one virtual machine with the preset parameter value exceeding the corresponding threshold value exists, determining that the physical machine cannot bear the current number of virtual machines, and determining that the virtual maximum number borne by the physical machine is the difference value between the current number borne by the physical machine and 1; or,
Determining the value of a preset parameter of the physical machine according to each first data packet sent to the physical machine and each second data packet returned by the physical machine, and judging whether the value of the preset parameter of the physical machine exceeds a corresponding threshold value; if so, determining that the physical machine cannot bear the current number of virtual machines, and determining that the maximum number of virtual machines borne by the physical machine is the difference value between the current number of the physical machine and 1.
20. The electronic device of claim 19, wherein the processor is configured to send notification information to the test tool when it is determined that the value of the preset parameter does not exceed the corresponding threshold value.
21. An electronic device, comprising: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 4-6.
22. An electronic device, comprising: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method of claim 7.
23. An electronic device, comprising: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 8-9.
24. A computer readable storage medium, characterized in that it stores a computer program executable by an electronic device, which when run on the electronic device causes the electronic device to perform the steps of the method of any one of claims 4-6.
25. A computer readable storage medium, characterized in that it stores a computer program executable by an electronic device, which when run on the electronic device causes the electronic device to perform the steps of the method of claim 7.
26. A computer readable storage medium, characterized in that it stores a computer program executable by an electronic device, which when run on the electronic device causes the electronic device to perform the steps of the method of any one of claims 8-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811358180.5A CN111190685B (en) | 2018-11-15 | 2018-11-15 | Virtual machine quantity testing system, method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811358180.5A CN111190685B (en) | 2018-11-15 | 2018-11-15 | Virtual machine quantity testing system, method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111190685A CN111190685A (en) | 2020-05-22 |
CN111190685B true CN111190685B (en) | 2023-07-21 |
Family
ID=70707102
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811358180.5A Active CN111190685B (en) | 2018-11-15 | 2018-11-15 | Virtual machine quantity testing system, method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111190685B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115225548B (en) * | 2022-05-27 | 2024-03-22 | 福建升腾资讯有限公司 | Method for evaluating cloud desktop bearing capacity by server and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015022322A (en) * | 2013-07-16 | 2015-02-02 | 日本電気株式会社 | Virtual machine management device, virtual machine management method, and program |
CN105938437A (en) * | 2016-05-30 | 2016-09-14 | 北京大学 | Co-residency-resistant virtual machine deployment method in cloud environment |
CN107632937A (en) * | 2017-10-10 | 2018-01-26 | 郑州云海信息技术有限公司 | A kind of method, apparatus tested cluster virtual machine, readable storage medium storing program for executing |
WO2018103043A1 (en) * | 2016-12-08 | 2018-06-14 | 华为技术有限公司 | Message processing method and device in a cloud computing system |
CN108628660A (en) * | 2017-03-24 | 2018-10-09 | 华为技术有限公司 | A kind of virtual machine expands capacity reduction method and virtual management equipment |
-
2018
- 2018-11-15 CN CN201811358180.5A patent/CN111190685B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015022322A (en) * | 2013-07-16 | 2015-02-02 | 日本電気株式会社 | Virtual machine management device, virtual machine management method, and program |
CN105938437A (en) * | 2016-05-30 | 2016-09-14 | 北京大学 | Co-residency-resistant virtual machine deployment method in cloud environment |
WO2018103043A1 (en) * | 2016-12-08 | 2018-06-14 | 华为技术有限公司 | Message processing method and device in a cloud computing system |
CN108628660A (en) * | 2017-03-24 | 2018-10-09 | 华为技术有限公司 | A kind of virtual machine expands capacity reduction method and virtual management equipment |
CN107632937A (en) * | 2017-10-10 | 2018-01-26 | 郑州云海信息技术有限公司 | A kind of method, apparatus tested cluster virtual machine, readable storage medium storing program for executing |
Non-Patent Citations (1)
Title |
---|
李桂林 ; 崔广章 ; 李永宝 ; .OpenStack云环境中KVM虚拟机性能测试与优化.物联网技术.2016,(02),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN111190685A (en) | 2020-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9432257B2 (en) | Traffic behavior driven dynamic zoning for distributed traffic engineering in SDN | |
EP3761170A1 (en) | Virtual machine creation method and apparatus | |
EP3059900B1 (en) | Network service template management method and device | |
US11526276B2 (en) | Upgrade management method and scheduling node, and storage system | |
EP3522449B1 (en) | Service state transition method and device | |
CN107329774A (en) | The method and apparatus for determining Redriver chip parameters | |
KR102036731B1 (en) | System and method for cluster placement of virtualization network functions | |
CN105119736A (en) | Data check method and device in network function virtualization architecture | |
CN108319492B (en) | Method, device and system for resetting physical machine | |
CN109739527A (en) | A kind of method, apparatus, server and the storage medium of the publication of client gray scale | |
CN111190685B (en) | Virtual machine quantity testing system, method and device, electronic equipment and storage medium | |
US10216593B2 (en) | Distributed processing system for use in application migration | |
CN113791792B (en) | Method, device and storage medium for acquiring application call information | |
CN112698974A (en) | Fault injection test method, device and storage medium | |
CN105490829B (en) | Method and device for controlling message transmission and network function virtualization system | |
US10348428B2 (en) | Techniques for synchronized execution of a command at network fabric nodes | |
WO2019222941A1 (en) | Method for evaluating application deployment, apparatus, computer program product, and readable medium | |
WO2021013185A1 (en) | Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium | |
CN115473780B (en) | Network target range distributed flow generation method and device | |
CN109561025A (en) | A kind of information processing method and relevant device | |
CN111404897A (en) | Message distribution method and device, storage medium and electronic equipment | |
US20220269593A1 (en) | Automatic generation of integrated test procedures using system test procedures | |
US11372463B1 (en) | Power down of power over ethernet interfaces | |
CN111090575B (en) | Test method | |
KR102621324B1 (en) | Deployment broker system and method for container-based microservice |
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 |