CN116643847A - Method, device, equipment and medium for measuring service quality of virtual machine - Google Patents

Method, device, equipment and medium for measuring service quality of virtual machine Download PDF

Info

Publication number
CN116643847A
CN116643847A CN202310787941.3A CN202310787941A CN116643847A CN 116643847 A CN116643847 A CN 116643847A CN 202310787941 A CN202310787941 A CN 202310787941A CN 116643847 A CN116643847 A CN 116643847A
Authority
CN
China
Prior art keywords
virtual machine
service
time
recording
exit
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.)
Pending
Application number
CN202310787941.3A
Other languages
Chinese (zh)
Inventor
王亮
周胜利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202310787941.3A priority Critical patent/CN116643847A/en
Publication of CN116643847A publication Critical patent/CN116643847A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a device, equipment and a readable medium for measuring service quality of a virtual machine, wherein the method comprises the following steps: configuring a virtual machine monitor, and monitoring the state of the virtual machine via the virtual machine monitor; responding to monitoring that the virtual machine exits from the root state, and recording an exit reason and the starting time of service stop; responding to the virtual machine to reschedule to enter a root state, and recording the ending time of service stopping; and outputting the service quality of the virtual machine every time the threshold time passes. By using the scheme of the invention, the service quality of the virtual machine can be monitored at the level of the monitor of the virtual machine, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.

Description

Method, device, equipment and medium for measuring service quality of virtual machine
Technical Field
The present invention relates to the field of computers, and more particularly, to a method, apparatus, device, and readable medium for measuring virtual machine quality of service.
Background
The method is most reliable and consistent with the evaluation method of the physical machine, but the method needs to be measured in the virtual machine and is inconsistent with the use scenes of public clouds and a part of private clouds, in the scenes, a service provider cannot install the measuring tool in the virtual machine, in addition, the method is only suitable for being used in debugging, occupies the performances of a CPU (Central Processing Unit, a central processing unit), a memory, IO (Input/Output) and the like in the virtual machine, and cannot be monitored all the time.
Disclosure of Invention
Accordingly, an object of the embodiments of the present invention is to provide a method, apparatus, device and readable medium for measuring service quality of a virtual machine, by using the technical solution of the present invention, the service quality of the virtual machine can be monitored at the level of a virtual machine monitor, and the service quality of the virtual machine at the level of CPU, memory, IO, etc. can be obtained without any operation in the virtual machine.
Based on the above object, an aspect of an embodiment of the present invention provides a method for measuring a quality of service of a virtual machine, including the steps of:
configuring a virtual machine monitor, and monitoring the state of the virtual machine via the virtual machine monitor;
responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason and the starting time of service stop;
recording the end time of service stop in response to the virtual machine rescheduling to enter the root user state;
determining a service duration according to the start time and the end time;
outputting a stopping reason and service duration of the virtual machine every time a threshold time passes;
a quality of service for the virtual machine is determined and output based on the stop reason and the service duration.
According to one embodiment of the invention, the exit causes include memory transaction causes, input-output transaction causes, and central processor transaction causes.
According to one embodiment of the invention, the memory transaction causes include virtual machine exit root user state caused by memory configuration errors or memory page table misses, the input-output transaction causes include virtual machine exit root user state caused by input-output instructions, and the central processor transaction causes include virtual machine exit root user state caused by system scheduling, interrupts, and/or instruction emulation.
According to one embodiment of the invention, in response to monitoring the virtual machine to exit the root user state, recording the exit reason and the start time of the service stop includes:
responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason;
recording the starting time of each CPU core service stop when the virtual machine exits the root user state.
According to one embodiment of the invention, responsive to the virtual machine rescheduling into the root user state, recording the end time of the service stop comprises:
in response to the virtual machine rescheduling into the root user state, an end time for each central processor core service stop is recorded.
According to one embodiment of the present invention, further comprising:
subtracting the service stopping starting time from the service stopping ending time of each central processor core to obtain the service stopping duration of each central processor core;
the duration of the service stop for each central processor core is weighted averaged to obtain a final service stop time.
According to one embodiment of the present invention, outputting the quality of service of the virtual machine per threshold time comprises:
the cause of the service stoppage and the stoppage time are displayed on the display means every time the threshold time elapses.
In another aspect of the embodiment of the present invention, there is also provided an apparatus for measuring service quality of a virtual machine, including:
a setting module configured to configure a virtual machine monitor and monitor a state of a virtual machine via the virtual machine monitor;
the first recording module is configured to record the exit reason and the starting time of service stop in response to monitoring the state of the virtual machine exit root user;
a second recording module configured to record an end time of service stop in response to the virtual machine rescheduling into the root user state;
a decision and output module configured to determine a service duration from the start time and the end time, an
A quality of service for the virtual machine is determined and output based on the stop reason and the service duration.
In another aspect of the embodiments of the present invention, there is also provided a computer apparatus including:
at least one processor; and
and a memory storing computer instructions executable on the processor, the instructions when executed by the processor performing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the methods described above.
The invention has the following beneficial technical effects: the method for measuring the service quality of the virtual machine provided by the embodiment of the invention comprises the steps of configuring a virtual machine monitor and monitoring the state of the virtual machine through the virtual machine monitor; responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason and the starting time of service stop; recording the end time of service stop in response to the virtual machine rescheduling to enter the root user state; determining a service duration according to the start time and the end time; outputting a stopping reason and service duration of the virtual machine every time a threshold time passes; based on the technical scheme that the service quality of the virtual machine is determined and output based on the stopping reason and the service duration, the service quality of the virtual machine can be monitored at the level of a virtual machine monitor, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method of measuring virtual machine quality of service according to one embodiment of the invention;
FIG. 2 is a diagram illustrating a memory transaction cause service stall according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of IO transaction cause service stall in accordance with one embodiment of the present invention;
FIG. 4 is a schematic diagram of an apparatus for measuring virtual machine quality of service according to one embodiment of the invention;
FIG. 5 is a schematic diagram of a computer device according to one embodiment of the invention;
fig. 6 is a schematic diagram of a computer-readable storage medium according to one embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
With the above object in view, in a first aspect, an embodiment of a method for measuring quality of service of a virtual machine is provided. Fig. 1 shows a schematic flow chart of the method.
As shown in fig. 1, the method may include the steps of:
s1, configuring a virtual machine monitor, and monitoring the state of the virtual machine through the virtual machine monitor. The virtual machine monitor (Virtual Machine Monitor, VMM) is a system software that maintains an efficient, isolated program environment that supports users directly accessing real hardware, and such a program environment is referred to as a virtual machine. A virtual machine is a copy of the hardware and software of a truly-existing computer system, wherein some subset of the virtual processor instructions execute in a native (active) manner on a host (host) processor and other portions of the instructions execute in an emulated manner. As can be seen from the above definition, the VMM manages the real resources of the computer system, providing an interface for the virtual machine. The use of a VMM has the following advantages: a) The implementation of the VMM is much simpler than the implementation of operating systems like Linux or Windows. Because the VMM avoids high level abstractions like TCWIP Sockets and file systems, this would be advantageous for security and reliability, as well as for expansion and modification. b) The VMM allows a system administrator to configure the environment in which the virtual machine is running. Each setting of the virtual machine can be different from that of the real machine, for example, the real machine has 512MB of memory, and the virtual machine memory can be set to 64MB, so that the software can be tested by a developer under various environments. c) The VMM allows different operating systems to be executed simultaneously on the same hardware, known as gueastos. The system manager can combine multiple inadequately used distributed computers with this capability, enhancing isolation for untrusted and unsafe code, while enhancing reliability, and software failure in one virtual machine will not affect other virtual machines. d) When the operating system is upgraded, early developed software can still be run in the virtual machine, so that the software development cost can be reduced. While the cost reduction also results from reduced purchase of hardware products. e) The VMM can conveniently develop powerful and reliable system software for scalable computers with 10-100 processors. f) The virtual machine controls the entire software environment in which the program runs, including the operating system and application software, so that the program address space and process states can be encapsulated, and then the entire work environment is thermally migrated (hot migration) on different hardware, thereby improving performance and achieving load balancing. The monitored state of the virtual machine mainly comprises that the virtual machine exits from the virtual state to the root state through vmexit, and the virtual machine enters the root state through system call, and finally enters the virtual state through vmexit.
S2, responding to monitoring that the virtual machine exits from the root state, and recording the exit reason and the starting time of service stop. The exit reasons mainly comprise memory transaction reasons, IO transaction reasons and CPU transaction reasons, wherein the memory transaction reasons comprise virtual machine exit root states caused by memory configuration errors or memory page table deletions, the IO transaction reasons comprise virtual machine exit root states caused by IO instructions, and the CPU transaction reasons comprise virtual machine exit root states caused by system scheduling, interrupt and/or instruction simulation. When the virtual machine exits the root state, according to the recorded exit reason, stopping the service when exiting, and recording the starting time of stopping the service at the same time, specifically recording the starting time of stopping the service of each CPU core when the virtual machine exits the root state.
S3, responding to the virtual machine to reschedule to enter a root state, and recording the ending time of service stopping. When the virtual machine is rescheduled to enter a root state, the virtual machine provides service again, and the end time of service stop is recorded, namely the end time of service stop of each CPU core is recorded. The duration of service stop of each CPU core may be obtained by the end time of service stop and the start time of service stop of each CPU core, and then the duration of service stop of each CPU core is weighted-averaged to obtain the final service stop time.
S4, determining service duration according to the starting time and the ending time.
S5, outputting the stopping reason and the service duration of the virtual machine every time the threshold time passes.
S6, determining and outputting the service quality of the virtual machine based on the stopping reason and the service duration. The cause of the service stop and the duration are output every time a threshold time elapses.
The invention records the time difference between vmentry and vmexit, and calculates the exit time by analyzing the virtual machine exit reason classification, thereby obtaining the time of stopping the service of the virtual machine, and further obtaining the service quality of the virtual machine.
By using the technical scheme of the invention, the service quality of the virtual machine can be monitored at the level of the monitor of the virtual machine, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.
In a preferred embodiment of the present invention, the exit causes include memory transaction causes, IO transaction causes, and CPU transaction causes. The virtual machine exit root state caused by memory configuration errors such as EPT or memory page table deletion and the like is classified as a memory transaction reason, the virtual machine exit root state caused by IO instructions is classified as an IO transaction reason, and other virtual machine exit root states caused by system scheduling, interrupt, instruction simulation and the like are classified as CPU transaction reasons. The exit reasons are divided, so that the abnormal reasons can be quickly known when the virtual machine is abnormal, and the maintenance of the virtual machine is facilitated.
In a preferred embodiment of the present invention, the memory transaction cause includes a virtual machine exit root state caused by a memory configuration error or a memory page table miss, the IO transaction cause includes a virtual machine exit root state caused by an IO instruction, and the CPU transaction cause includes a virtual machine exit root state caused by system scheduling, interrupt, and/or instruction emulation.
In a preferred embodiment of the present invention, in response to monitoring that the virtual machine exits the root state, recording the exit reason and the start time of the service stop includes:
responding to monitoring that the virtual machine exits from the root state, and recording an exit reason;
and recording the starting time of stopping the service of each CPU core when the virtual machine exits from the root state. By recording the starting time of each CPU core, the starting time of the service stop of the CPU can be accurately obtained, and the time recording is more accurate.
In a preferred embodiment of the present invention, in response to the virtual machine rescheduling into the root state, recording the end time of the service stop comprises:
and responding to the rescheduling of the virtual machine to enter a root state, and recording the ending time of each CPU core service stop. By recording the end time of each CPU core, the end time of the service stop of the CPU can be accurately obtained, and the time recording is more accurate.
In a preferred embodiment of the present invention, further comprising:
subtracting the starting time of the service stop from the ending time of the service stop of each CPU core to obtain the duration of the service stop of each CPU core;
the duration of the service stop for each CPU core is weighted averaged to obtain a final service stop time. Recording the starting time and the ending time respectively when vmexit and vmentiy occur, at this time, the VMM records the time according to the reason of process exit or re-execution, records the starting time of service stop when the process exits, and records the ending time of service stop when re-execution, the difference value of the starting time and the ending time is the time that the virtual machine cannot perform service due to the reason of exit, and when a system administrator or a monitor program reads at regular time, the virtual machine exit time on all CPUs is counted, and then weighted average is performed and then displayed.
In a preferred embodiment of the present invention, outputting the quality of service of the virtual machine per threshold time comprises:
the cause of the service stoppage and the stoppage time are displayed on the display means every time the threshold time elapses. The quality of service data may also be sent to the administrator or user's mobile device at regular intervals.
In some embodiments, if the reason for exiting the virtual machine is a memory transaction, after the virtual machine vmexit, the kernel state processes a processing program such as a page table miss, where the virtual machine causes a service stop due to the memory reason, the time for the service stop is shown in fig. 2, assuming that the virtual machine has two vcpus, the reason for exiting the virtual machine may be recorded by the reason for recording the service stop time of the virtual machine due to the memory transaction, the time recording module records the service stop times of vcpu0 and vcpu1 respectively, and since the time recording module inserts the process of obtaining the time at both vmexit and vmentiy, the service stop time is all the time between vmexit and vmentiy, and since vcpu0 and vcpu1 are running asynchronously, the exit time and the service stop time are all random, so the time counting module obtains the service stop times of all vcpu from the time recording module, and the weighted average is provided for the system administrator and the monitor program to access.
In some embodiments, if the virtual machine exit is an IO transaction, after vmexit, the virtual machine needs to be notified to the qmeu emulators to perform IO device simulation, at this time, the virtual machine is stopped due to the IO cause, the service stop time is shown in fig. 3, it is assumed that the virtual machine has two vcpus, the exit cause recording module records the service stop time of the virtual machine due to the IO transaction, the time recording module records the service stop times of vcpu0 and vcpu1 respectively, the service stop time is all the times between vmexit and vmentiy, and includes the time after vmexit for the vcpu to notify the emulators to perform IO device simulation, so that the time recording is more accurate, and finally the time statistics module obtains the service stop times of all vcpu from the time recording module and provides access to a system administrator and a monitor after weighted average.
In some embodiments, the service quality corresponding to various reasons in the history can be counted, a threshold is set according to the historical service quality, the current counted service quality is compared with the threshold, if the current counted service quality exceeds the threshold, a corresponding warning is sent, the abnormal state of the virtual machine can be found in time through setting the threshold, and stable operation of the virtual machine is ensured.
By using the technical scheme of the invention, the service quality of the virtual machine can be monitored at the level of the monitor of the virtual machine, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.
It should be noted that, it will be understood by those skilled in the art that all or part of the procedures in implementing the methods of the above embodiments may be implemented by a computer program to instruct related hardware, and the above program may be stored in a computer readable storage medium, and the program may include the procedures of the embodiments of the above methods when executed. Wherein the storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like. The computer program embodiments described above may achieve the same or similar effects as any of the method embodiments described above.
Furthermore, the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When executed by a CPU, performs the functions defined above in the methods disclosed in the embodiments of the present invention.
With the above object in mind, in a second aspect of the embodiments of the present invention, there is provided an apparatus for measuring service quality of a virtual machine, as shown in fig. 4, the apparatus 200 includes:
the setting module is configured to configure a virtual machine monitor, monitor the state of the virtual machine through the virtual machine monitor, wherein the monitored state of the virtual machine mainly comprises that the virtual machine exits from the virtual state to the root state through vmexit, the virtual machine enters the root state through system call, and finally enters the virtual state through vmexiy;
the first recording module is configured to record the exit reason and the starting time of service stop in response to the monitoring of the virtual machine exit root user state, wherein the exit reason mainly comprises a memory transaction reason, an IO transaction reason and a CPU transaction reason, the memory transaction reason comprises a virtual machine exit root state caused by a memory configuration error or a memory page table deletion, the IO transaction reason comprises a virtual machine exit root state caused by an IO instruction, and the CPU transaction reason comprises a virtual machine exit root state caused by system scheduling, interruption and/or instruction simulation. When the virtual machine exits the root state, according to the recorded exit reason, stopping the service when exiting, and recording the starting time of stopping the service at the same time, specifically recording the starting time of stopping the service of each CPU core when the virtual machine exits the root state;
and the second recording module is configured to respond to the rescheduling of the virtual machine to enter the root user state, record the ending time of service stop, and when the rescheduling of the virtual machine to enter the root state, the virtual machine provides the service again, and record the ending time of service stop, namely record the ending time of service stop of each CPU core. The duration of service stop of each CPU core can be obtained through the ending time of service stop and the starting time of service stop of each CPU core, and then the duration of service stop of each CPU core is weighted and averaged to obtain the final service stop time;
and the judging and outputting module is configured to determine service duration according to the starting time and the ending time, determine and output the service quality of the virtual machine based on the stopping reason and the service duration, output the reason and the duration of stopping the service every time a threshold time passes, and send the reason and the duration to a mobile device or a mailbox of an administrator or a user.
In a preferred embodiment of the present invention, the exit causes include memory transaction causes, IO transaction causes, and CPU transaction causes.
In a preferred embodiment of the present invention, the memory transaction cause includes a virtual machine exit root state caused by a memory configuration error or a memory page table miss, the IO transaction cause includes a virtual machine exit root state caused by an IO instruction, and the CPU transaction cause includes a virtual machine exit root state caused by system scheduling, interrupt, and/or instruction emulation.
In a preferred embodiment of the invention, the first recording module is further configured to:
responding to monitoring that the virtual machine exits from the root state, and recording an exit reason;
and recording the starting time of stopping the service of each CPU core when the virtual machine exits from the root state.
In a preferred embodiment of the invention, the second recording module is further configured to:
and responding to the rescheduling of the virtual machine to enter a root state, and recording the ending time of each CPU core service stop.
In a preferred embodiment of the present invention, further comprising a calculation module configured to:
subtracting the starting time of the service stop from the ending time of the service stop of each CPU core to obtain the duration of the service stop of each CPU core;
the duration of the service stop for each CPU core is weighted averaged to obtain a final service stop time.
In a preferred embodiment of the invention, the output module is further configured to:
the cause of the service stoppage and the stoppage time are displayed on the display means every time the threshold time elapses.
By using the technical scheme of the invention, the service quality of the virtual machine can be monitored at the level of the monitor of the virtual machine, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.
Based on the above object, a third aspect of the embodiments of the present invention proposes a computer device. Fig. 5 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 5, an embodiment of the present invention includes the following means: at least one processor 21; and a memory 22, the memory 22 storing computer instructions 23 executable on the processor, the instructions when executed by the processor performing the method of:
configuring a virtual machine monitor, and monitoring the state of the virtual machine via the virtual machine monitor;
responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason and the starting time of service stop;
recording the end time of service stop in response to the virtual machine rescheduling to enter the root user state;
determining a service duration according to the start time and the end time;
outputting a stopping reason and service duration of the virtual machine every time a threshold time passes;
a quality of service for the virtual machine is determined and output based on the stop reason and the service duration.
In a preferred embodiment of the present invention, the exit causes include memory transaction causes, IO transaction causes, and CPU transaction causes.
In a preferred embodiment of the present invention, the memory transaction cause includes a virtual machine exit root state caused by a memory configuration error or a memory page table miss, the IO transaction cause includes a virtual machine exit root state caused by an IO instruction, and the CPU transaction cause includes a virtual machine exit root state caused by system scheduling, interrupt, and/or instruction emulation.
In a preferred embodiment of the present invention, in response to monitoring that the virtual machine exits the root state, recording the exit reason and the start time of the service stop includes:
responding to monitoring that the virtual machine exits from the root state, and recording an exit reason;
and recording the starting time of stopping the service of each CPU core when the virtual machine exits from the root state.
In a preferred embodiment of the present invention, in response to the virtual machine rescheduling into the root state, recording the end time of the service stop comprises:
and responding to the rescheduling of the virtual machine to enter a root state, and recording the ending time of each CPU core service stop.
In a preferred embodiment of the present invention, further comprising:
subtracting the starting time of the service stop from the ending time of the service stop of each CPU core to obtain the duration of the service stop of each CPU core;
the duration of the service stop for each CPU core is weighted averaged to obtain a final service stop time.
In a preferred embodiment of the present invention, outputting the quality of service of the virtual machine per threshold time comprises:
the cause of the service stoppage and the stoppage time are displayed on the display means every time the threshold time elapses.
By using the technical scheme of the invention, the service quality of the virtual machine can be monitored at the level of the monitor of the virtual machine, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.
Based on the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 6 is a schematic diagram illustrating one embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 6, the computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the following method:
configuring a virtual machine monitor, and monitoring the state of the virtual machine via the virtual machine monitor;
responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason and the starting time of service stop;
recording the end time of service stop in response to the virtual machine rescheduling to enter the root user state;
determining a service duration according to the start time and the end time;
outputting a stopping reason and service duration of the virtual machine every time a threshold time passes;
a quality of service for the virtual machine is determined and output based on the stop reason and the service duration.
In a preferred embodiment of the present invention, the exit causes include memory transaction causes, IO transaction causes, and CPU transaction causes.
In a preferred embodiment of the present invention, the memory transaction cause includes a virtual machine exit root state caused by a memory configuration error or a memory page table miss, the IO transaction cause includes a virtual machine exit root state caused by an IO instruction, and the CPU transaction cause includes a virtual machine exit root state caused by system scheduling, interrupt, and/or instruction emulation.
In a preferred embodiment of the present invention, in response to monitoring that the virtual machine exits the root state, recording the exit reason and the start time of the service stop includes:
responding to monitoring that the virtual machine exits from the root state, and recording an exit reason;
and recording the starting time of stopping the service of each CPU core when the virtual machine exits from the root state.
In a preferred embodiment of the present invention, in response to the virtual machine rescheduling into the root state, recording the end time of the service stop comprises:
and responding to the rescheduling of the virtual machine to enter a root state, and recording the ending time of each CPU core service stop.
In a preferred embodiment of the present invention, further comprising:
subtracting the starting time of the service stop from the ending time of the service stop of each CPU core to obtain the duration of the service stop of each CPU core;
the duration of the service stop for each CPU core is weighted averaged to obtain a final service stop time.
In a preferred embodiment of the present invention, outputting the quality of service of the virtual machine per threshold time comprises:
the cause of the service stoppage and the stoppage time are displayed on the display means every time the threshold time elapses.
By using the technical scheme of the invention, the service quality of the virtual machine can be monitored at the level of the monitor of the virtual machine, and the service quality of the virtual machine at the levels of CPU, memory, IO and the like can be obtained without any operation in the virtual machine.
Furthermore, the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. The above-described functions defined in the methods disclosed in the embodiments of the present invention are performed when the computer program is executed by a processor.
Furthermore, the above-described method steps and system units may also be implemented using a controller and a computer-readable storage medium storing a computer program for causing the controller to implement the above-described steps or unit functions.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general purpose or special purpose computer or general purpose or special purpose processor. Further, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The foregoing embodiment of the present invention has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the invention, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the invention, and many other variations of the different aspects of the embodiments of the invention as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present invention.

Claims (10)

1. A method for measuring quality of service of a virtual machine, comprising the steps of:
configuring a virtual machine monitor, and monitoring the state of the virtual machine via the virtual machine monitor;
responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason and the starting time of service stop;
recording the end time of service stop in response to the virtual machine rescheduling to enter the root user state;
determining a service duration according to the start time and the end time;
outputting a stopping reason and service duration of the virtual machine every time a threshold time passes;
a quality of service for the virtual machine is determined and output based on the stop reason and the service duration.
2. The method of claim 1, wherein the exit causes include a memory transaction cause, an input-output transaction cause, and a central processor transaction cause.
3. The method of claim 2, wherein the memory transaction cause comprises a virtual machine exit root user state caused by a memory configuration error or a memory page table miss, the input output transaction cause comprises a virtual machine exit root user state caused by an input output instruction, and the central processor transaction cause comprises a virtual machine exit root user state caused by system scheduling, interrupts, and/or instruction emulation.
4. The method of claim 1, wherein in response to monitoring the virtual machine to exit the root user state, recording the exit cause and the start time of the service stop comprises:
responding to the monitoring of the state of the virtual machine exiting the root user, and recording the exiting reason;
recording the starting time of each CPU core service stop when the virtual machine exits the root user state.
5. The method of claim 4, wherein in response to the virtual machine rescheduling into the root user state, recording the end time of the service stop comprises:
in response to the virtual machine rescheduling into the root user state, an end time for each central processor core service stop is recorded.
6. The method as recited in claim 5, further comprising:
subtracting the service stopping starting time from the service stopping ending time of each central processor core to obtain the service stopping duration of each central processor core;
the duration of the service stop for each central processor core is weighted averaged to obtain a final service stop time.
7. The method of claim 1, wherein outputting the quality of service of the virtual machine per threshold time comprises:
the cause of the service stoppage and the stoppage time are displayed on the display means every time the threshold time elapses.
8. An apparatus for measuring virtual machine quality of service, the apparatus comprising:
a setting module configured to configure a virtual machine monitor and monitor a state of a virtual machine via the virtual machine monitor;
the first recording module is configured to record the exit reason and the starting time of service stop in response to monitoring the state of the virtual machine exit root user;
a second recording module configured to record an end time of service stop in response to the virtual machine rescheduling into the root user state;
a decision and output module configured to determine a service duration from the start time and the end time, an
A quality of service for the virtual machine is determined and output based on the stop reason and the service duration.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, which when executed by the processor, perform the steps of the method of any one of claims 1-7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of any one of claims 1-7.
CN202310787941.3A 2023-06-30 2023-06-30 Method, device, equipment and medium for measuring service quality of virtual machine Pending CN116643847A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310787941.3A CN116643847A (en) 2023-06-30 2023-06-30 Method, device, equipment and medium for measuring service quality of virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310787941.3A CN116643847A (en) 2023-06-30 2023-06-30 Method, device, equipment and medium for measuring service quality of virtual machine

Publications (1)

Publication Number Publication Date
CN116643847A true CN116643847A (en) 2023-08-25

Family

ID=87624896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310787941.3A Pending CN116643847A (en) 2023-06-30 2023-06-30 Method, device, equipment and medium for measuring service quality of virtual machine

Country Status (1)

Country Link
CN (1) CN116643847A (en)

Similar Documents

Publication Publication Date Title
US10838803B2 (en) Resource provisioning and replacement according to a resource failure analysis in disaggregated data centers
US11050637B2 (en) Resource lifecycle optimization in disaggregated data centers
US9485160B1 (en) System for optimization of input/output from a storage array
KR102236522B1 (en) Method and apparatus for processing information
Suneja et al. Exploring vm introspection: Techniques and trade-offs
US10754720B2 (en) Health check diagnostics of resources by instantiating workloads in disaggregated data centers
US10802847B1 (en) System and method for reproducing and resolving application errors
WO2023115999A1 (en) Device state monitoring method, apparatus, and device, and computer-readable storage medium
US11188408B2 (en) Preemptive resource replacement according to failure pattern analysis in disaggregated data centers
US20110071811A1 (en) Using event correlation and simulation in authorization decisions
CN106598796A (en) Method for testing hardware information stability in reboot
US10761915B2 (en) Preemptive deep diagnostics and health checking of resources in disaggregated data centers
US10831580B2 (en) Diagnostic health checking and replacement of resources in disaggregated data centers
TW201347459A (en) Management method and system using the same
CN104956331A (en) Management system for managing computer system and management method thereof
Magalhaes et al. SHo WA: a self-healing framework for Web-based applications
Di Sanzo et al. Machine learning for achieving self-* properties and seamless execution of applications in the cloud
JP2012022614A (en) Computer system management method and management system
US10817400B2 (en) Management apparatus and management method
CN116643847A (en) Method, device, equipment and medium for measuring service quality of virtual machine
US10776240B2 (en) Non-intrusive performance monitor and service engine
US20180203790A1 (en) Detection of software errors
JP2011227700A (en) Peripheral device failure simulation system, peripheral device failure simulation method and peripheral device failure simulation program
CN114328103A (en) Method, system and related equipment for OpenBMC monitoring and management of discrete sensor
US10915252B2 (en) System and method for managing a group of storage devices using their wear levels and a target wearing profile

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