CN109814982B - Method and system for automatically starting virtual machine - Google Patents

Method and system for automatically starting virtual machine Download PDF

Info

Publication number
CN109814982B
CN109814982B CN201910151639.2A CN201910151639A CN109814982B CN 109814982 B CN109814982 B CN 109814982B CN 201910151639 A CN201910151639 A CN 201910151639A CN 109814982 B CN109814982 B CN 109814982B
Authority
CN
China
Prior art keywords
starting
virtual machine
virtual
virtual machines
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910151639.2A
Other languages
Chinese (zh)
Other versions
CN109814982A (en
Inventor
苑贵全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhangjiakou Dongchu Technology Co.,Ltd.
Original Assignee
Beijing Longpu Intelligent 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 Beijing Longpu Intelligent Technology Co ltd filed Critical Beijing Longpu Intelligent Technology Co ltd
Priority to CN201910151639.2A priority Critical patent/CN109814982B/en
Publication of CN109814982A publication Critical patent/CN109814982A/en
Application granted granted Critical
Publication of CN109814982B publication Critical patent/CN109814982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a method and a system for automatically starting a virtual machine, wherein the method for automatically starting the virtual machine specifically comprises the following steps: obtaining a physical machine starting index by using a neural network prediction model; inputting a physical machine starting index into a classification model to obtain a starting list of a virtual machine; according to the starting list of the virtual machines, putting the virtual machines to be started into a starting queue; and starting the virtual machine in the starting queue. The virtual machine can be automatically started according to the starting index of the physical machine, manual starting is not needed, and the starting cycle time of the virtual machine is shortened.

Description

Method and system for automatically starting virtual machine
Technical Field
The present application relates to the field of virtual machine startup, and in particular, to a method and a system for automatically starting a virtual machine.
Background
In the prior art, distributed computer application is generated along with the ubiquitous idea of interconnection, so that the application of a virtualization technology becomes wider, and the virtual machine can be used for effectively shielding and isolating hardware heterogeneity, so that the virtual machine technology is widely developed, a common virtual machine is started on a physical machine, but in the starting process, starting resources are required to be manually read from a hard disk, the process is complicated and slow, and the user experience is reduced.
Disclosure of Invention
The application aims to provide a method and a system for automatically starting a virtual machine, which can automatically start the virtual machine, reduce response time for manually starting the virtual machine, judge whether a memory occupied by the virtual machine meets conditions such as a physical machine memory requirement before starting, and prevent the problem that the physical machine cannot run when the memory is full in the running process.
In order to achieve the above object, the present application provides a method for automatically starting a virtual machine, which specifically includes the following steps: obtaining a physical machine starting index by using a neural network prediction model; inputting a physical machine starting index into a classification model to obtain a starting list of a virtual machine; according to the starting list of the virtual machines, putting the virtual machines to be started into a starting queue; and starting the virtual machine in the starting queue.
As above, before using the neural network prediction model, obtaining historical operation information of the physical machine, and training the neural network prediction model in advance by using the historical operation information, so as to obtain a trained neural network prediction model, wherein the training of the neural network prediction model specifically includes the following steps: acquiring historical operation information of a physical machine; taking historical operation information as an input vector, and initializing a neural network; calculating hidden layer output; and calculating output layer output.
As above, wherein the physical machine start index includes one or more of an average time index of virtual machine start, a maximum number of virtual machines start, a storage capacity of the physical machine, and a storage capacity index required by the virtual machine that started last time.
After the virtual machines to be started are put into the start queue according to the specified sequence, the method further comprises the step of sequencing according to the memory occupation rule and/or the required memory capacity rule of the virtual machines.
As above, before the virtual machines are placed in the start queue, the state of each virtual machine in the virtual machine start list is judged; if the virtual machine is in a working state, removing the virtual machine from the starting list; and if the virtual machine is in a non-working state, starting the virtual machine according to the specified sequence.
As above, wherein a flag bit is set in the virtual machine in advance, the flag bit indicating the state of the virtual machine.
As above, wherein the virtual machines in the boot list are booted in response to the virtual machines in the physical machines releasing their memory.
As above, before starting the virtual machine in the startup queue, it is further determined whether the memory in the running physical machine satisfies the memory required by the virtual machine in the startup queue.
As above, if the memory of the physical machine can meet the memory required by the virtual machine in the startup queue, the virtual machine in the startup queue is started normally; and if the memory of the physical machine cannot meet the memory required by the virtual machines in the starting queue, temporarily not starting the virtual machines in the starting queue, and judging the number of the started virtual machines and the number of the preset virtual machines.
A virtual machine self-starting system comprises a processor and a memory, wherein the processor on the virtual machine self-starting system executes the virtual machine self-starting method.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a flowchart of a method for automatically starting a virtual machine according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application are clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application relates to a method and a system for automatically starting a virtual machine. According to the method and the device, the virtual machine can be automatically started, the response time for manually starting the virtual machine is reduced, whether the memory occupied by the virtual machine meets the conditions such as the memory requirement of a physical machine or not is judged before starting, and the problem that the physical machine cannot run due to the fact that the memory is fully occupied in the running process is prevented.
Fig. 1 is a flowchart illustrating a method for automatically starting a virtual machine according to the present application.
Step S110: a physical machine start index is obtained using a neural network prediction model.
Preferably, the neural network prediction model in this embodiment is a BP neural network prediction model.
The starting index of the physical machine comprises data such as average starting time of the virtual machine, historical starting type of the virtual machine, historical maximum number of the virtual machines which can be started by the physical machine, and storage capacity of the physical machine.
Preferably, before using the neural network prediction model, firstly obtaining historical operation information of a physical machine, and training the neural network prediction model in advance by using the historical operation information, so as to obtain a trained neural network prediction model, wherein the training of the neural network prediction model in the previous stage specifically comprises the following steps:
step D1: historical operating information of the physical machine is obtained.
The historical operation information of the physical machine comprises information data such as the model of the physical machine, the starting time of the physical machine, the operation environment of the physical machine, the resource use condition of the physical machine and the like.
Step D2: and taking the historical operation information as an input vector, and initializing the neural network.
And (3) putting the input vector into a neural network prediction model to initialize the network, wherein the node number of the input layer, the node number of the hidden layer, the node number of the output layer of the network, and the connection weight value, the threshold value of the hidden layer and the threshold value of the output layer among the input layer, the output layer and the hidden layer are determined according to an initialization result.
The number of nodes of the network input layer, the number of nodes of the hidden layer, the number of nodes of the output layer, and the connection weight values, thresholds of the hidden layer and the output layer among the input layer, the output layer and the hidden layer can be obtained through the prior art, and are not explained herein.
Step D3: the hidden layer output is computed.
And calculating the hidden layer output according to the input vector, the connection weight between the input layer and the hidden layer and the threshold value of the hidden layer.
Step D4: and calculating output layer output.
And calculating the predicted output of the BP neural network according to the hidden layer output, the connection weight between the layers and the output layer threshold value, and obtaining the starting index of the physical machine.
And obtaining a physical machine starting index by using the trained neural network prediction model. The physical machine starting index is an evaluation of the overall situation of the physical machine predicted according to the current operation information of the physical machine, for example, a higher physical machine starting index is given under the condition that the current operation information is good, and a lower physical machine starting index is given on the contrary. The physical machine starting index further comprises indexes such as average virtual machine starting time index, maximum virtual machine starting number, storage capacity of the physical machine, storage capacity required by the virtual machine which is started last time and the like.
Step S120: and inputting the physical machine starting index into the classification model to obtain a starting list of the virtual machine.
Specifically, the physical machine starting index is input into the classification model, and the classification model determines a plurality of lists of the started virtual machines, for example, the lists are the starting lists of the virtual machines determined according to the virtual machine starting average time index in the physical machine starting index, and for example, the virtual machines in the lists can be sorted according to the starting average time length; further, the second list is a virtual machine list determined according to the storage capacity index of the physical machine in the physical machine startup index and the storage capacity index required by the virtual machine.
Step S130: and according to the starting list of the virtual machine, putting the virtual machine to be started into a starting queue.
Specifically, the virtual machines to be started are placed in a start queue according to a specified sequence, and preferably, the virtual machines are sorted according to one or more rules such as memory occupation or required storage capacity of the virtual machines.
Preferably, the number of the start queues may be multiple, and the virtual machines are placed into different start queues according to the types of the virtual machines, for example, a virtual machine with the same or similar memory size is placed into the first start queue, and a virtual machine with the same or similar CPU size is placed into the second start queue. One or more virtual machines may be selected for booting in a plurality of boot queues. As another embodiment, the first several bits of virtual machines in the start list may be extracted and placed in the first start queue, and the specified number of virtual machines after the first several bits may be extracted and placed in the second start queue, in order from front to back in the start list.
Further, before the virtual machines are placed in the start queue, the state of each virtual machine in the virtual machine start list is also judged, specifically, whether the virtual machines in the start list are in the working state of being started or running is judged, and if the virtual machines are in the working state, the virtual machines are removed from the start list; and if the virtual machine is in a non-working state, starting the virtual machine according to the specified sequence.
Still further, a flag bit is set in the virtual machine in advance, a flag bit of 1 indicates that the virtual machine is in a working state, and a flag bit of 0 indicates that the virtual machine is in a non-working state. And judging the working state of the virtual machine according to the change of the zone bit.
Step S140: and starting the virtual machine in the starting queue.
Specifically, in response to a virtual machine exiting from the physical machine or a working virtual machine releasing the occupied memory of the physical machine, the virtual machines in the start list are started. Further, before starting the virtual machines in the start queue, it should be determined whether the memory in the running physical machine meets the memory required by the virtual machines in the start queue, and if the memory of the physical machine can meet the memory requirement, the virtual machines in the start queue are normally started.
If the memory of the physical machine cannot meet the memory required by the virtual machines in the starting queue, the virtual machines in the starting queue are not started for the moment, and the number of the started virtual machines and the number of the preset virtual machines are judged.
The preset number of the virtual machines is the maximum number of the virtual machines which can be started by the physical machine, if the number of the started virtual machines exceeds the preset number of the virtual machines, the number of the virtual machines waiting to be started in the starting queue is correspondingly decreased progressively, and the decreased number is determined according to the number of the virtual machines exceeding the preset number.
And if the number of the started virtual machines does not exceed the preset number of the virtual machines, keeping the number of the virtual machines in the starting list unchanged, and waiting for the started virtual machines to close or release the memory.
Further, if the virtual machines in the multiple boot queues are started simultaneously, preferably, the method further includes a step of judging the capacity of a boot disk in the physical machine, and judging whether the capacity of the boot disk can start the virtual machines in the multiple boot queues, if the capacity meets the requirement, loading the virtual machines in the multiple boot queues simultaneously, otherwise, sorting the boot queues according to the execution condition, and preferably executing the boot queues that are sorted in the front.
For example, if the memory of the physical machine is to be reduced to a preset minimum value during execution, in this case, it is preferable to start the virtual machine in the start queue occupying a smaller memory, to prevent the physical machine from being occupied with the memory and unable to run, add the remaining virtual machines that are not started into the wait queue, and start the virtual machine from the wait queue when a condition is met, for example, when other virtual machines are shut down.
The present application also includes a system for providing virtual machine bootstrapping, the system having the structure of a general purpose server on which a processor executes a virtual machine bootstrapping method as described above, the bootstrapping method being stored in the form of computer instructions on a storage medium of the system. The application has the following beneficial effects:
(1) according to the method and the system for automatically starting the virtual machine, the virtual machine can be automatically started according to the starting index of the physical machine, manual starting is not needed, and the virtual machine starting cycle time is shortened.
(2) The method and the system for automatically starting the virtual machine can judge the memory required by the virtual machine and the occupied memory during starting in the process of automatically starting the virtual machine, and prevent the physical machine from stopping running due to the fact that the memory is full in the running process.
Although the present application has been described with reference to examples, which are intended to be illustrative only and not to be limiting of the application, changes, additions and/or deletions may be made to the embodiments without departing from the scope of the application.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for automatically starting a virtual machine is characterized by comprising the following steps:
obtaining a physical machine starting index by using a neural network prediction model;
inputting a physical machine starting index into a classification model to obtain a starting list of a virtual machine;
according to the starting list of the virtual machines, putting the virtual machines to be started into a starting queue;
starting the virtual machine in the starting queue;
the method comprises the steps that a plurality of starting queues are arranged, the virtual machines are placed into different starting queues according to the types of the virtual machines, and the virtual machines in a starting list are started in response to the fact that the virtual machines quit from a physical machine or the virtual machines in work release occupied memory of the physical machine;
the method comprises the steps of putting virtual machines into different starting queues, starting the virtual machines of one or more starting queues, judging the capacity of a starting disk in a physical machine if the virtual machines in the starting queues are started simultaneously, judging whether the capacity of the starting disk can start the virtual machines in the starting queues or not, loading the virtual machines in the starting queues simultaneously if the capacity meets the requirement, and sequencing the starting queues, wherein the starting queue with the front sequencing is preferably executed if the capacity does not meet the requirement.
2. The method for automatically starting the virtual machine according to claim 1, wherein before using the neural network prediction model, historical operation information of the physical machine is obtained, and the neural network prediction model is trained in advance by using the historical operation information, so as to obtain the trained neural network prediction model, wherein the training of the neural network prediction model specifically comprises the following steps:
acquiring historical operation information of a physical machine;
taking historical operation information as an input vector, and initializing a neural network;
calculating hidden layer output;
and calculating output layer output.
3. The method of virtual machine auto-start according to claim 1, wherein the physical machine start index comprises one or more of a virtual machine start average time index, a virtual machine start maximum number, a physical machine storage capacity, and a storage capacity required index of a last started virtual machine.
4. The method according to claim 1, wherein after the virtual machines to be started are placed in the start queue according to the designated sequence, the method further comprises sorting according to the rule that the virtual machines occupy the memory and/or the rule of the required storage capacity.
5. The method according to claim 4, wherein before the virtual machine is placed in the start queue, the state of each virtual machine in the virtual machine start list is determined;
if the virtual machine is in a working state, removing the virtual machine from the starting list;
and if the virtual machine is in a non-working state, starting the virtual machine according to the specified sequence.
6. The method for automatically starting a virtual machine according to claim 5, wherein a flag bit is set in the virtual machine in advance, and the flag bit indicates the state of the virtual machine.
7. The method of claim 5, wherein the virtual machines in the launch list are launched in response to a virtual machine in the physical machine releasing its memory.
8. The method of claim 7, further comprising, before starting the virtual machines in the start queue, determining whether memory in the running physical machine satisfies memory required by the virtual machines in the start queue.
9. The method according to claim 8, wherein if the memory of the physical machine can satisfy the memory required by the virtual machine in the startup queue, the virtual machine in the startup queue is started normally;
if the memory of the physical machine cannot meet the memory required by the virtual machines in the starting queue, the virtual machines in the starting queue are not started for the moment, and the number of the started virtual machines and the number of the preset virtual machines are judged.
10. A virtual machine bootstrapping system comprising a processor and a memory, the processor thereon performing the virtual machine bootstrapping method according to one of claims 1 to 9.
CN201910151639.2A 2019-02-28 2019-02-28 Method and system for automatically starting virtual machine Active CN109814982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910151639.2A CN109814982B (en) 2019-02-28 2019-02-28 Method and system for automatically starting virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910151639.2A CN109814982B (en) 2019-02-28 2019-02-28 Method and system for automatically starting virtual machine

Publications (2)

Publication Number Publication Date
CN109814982A CN109814982A (en) 2019-05-28
CN109814982B true CN109814982B (en) 2021-10-08

Family

ID=66607754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910151639.2A Active CN109814982B (en) 2019-02-28 2019-02-28 Method and system for automatically starting virtual machine

Country Status (1)

Country Link
CN (1) CN109814982B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023092430A1 (en) * 2021-11-25 2023-06-01 国云科技股份有限公司 Virtual machine initialization method and apparatus, terminal device, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103608765A (en) * 2011-06-17 2014-02-26 微软公司 Virtual machine snapshotting and analysis
US8738781B2 (en) * 2009-06-22 2014-05-27 Red Hat Israel, Ltd. Launching a virtual machine associated with a client during startup
CN104850441A (en) * 2015-05-26 2015-08-19 北京汉柏科技有限公司 Auto-start system and method of virtual machines in cloud computing platform
CN107122225A (en) * 2016-02-25 2017-09-01 华为技术有限公司 A kind of method and apparatus for starting virtual machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117269A (en) * 2018-07-26 2019-01-01 郑州云海信息技术有限公司 A kind of distributed system dispatching method of virtual machine, device and readable storage medium storing program for executing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8738781B2 (en) * 2009-06-22 2014-05-27 Red Hat Israel, Ltd. Launching a virtual machine associated with a client during startup
CN103608765A (en) * 2011-06-17 2014-02-26 微软公司 Virtual machine snapshotting and analysis
CN104850441A (en) * 2015-05-26 2015-08-19 北京汉柏科技有限公司 Auto-start system and method of virtual machines in cloud computing platform
CN107122225A (en) * 2016-02-25 2017-09-01 华为技术有限公司 A kind of method and apparatus for starting virtual machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云计算环境下虚拟机部署技术研究;赵帅宇;《中国优秀硕士学位论文全文数据库 信息科技辑》;20140930;第3章 *

Also Published As

Publication number Publication date
CN109814982A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
US9465734B1 (en) Coalition based memory management
US8635493B2 (en) High availability system allowing conditionally reserved computing resource use and reclamation upon a failover
US8413144B1 (en) Providing application-aware high availability of virtual machines
KR20130127445A (en) Application lifetime management
CN108153594B (en) Resource fragment sorting method of artificial intelligence cloud platform and electronic equipment
US12001868B2 (en) VM migration system and VM migration method
JP5181121B2 (en) Task number control device, task number control method, and computer program
CN109814982B (en) Method and system for automatically starting virtual machine
CN106020984B (en) Method and device for creating process in electronic equipment
US20120054762A1 (en) Scheduling apparatus and method for a multicore device
JP6915336B2 (en) Information processing system and virtual machine
CN107423114B (en) Virtual machine dynamic migration method based on service classification
CN114968565A (en) Resource management method, device, electronic equipment, storage medium and server
CN114461365A (en) Process scheduling processing method, device, equipment and storage medium
CN114327894A (en) Resource allocation method, device, electronic equipment and storage medium
EP4163798A1 (en) Method and apparatus for managing model file in inference application
CN114443211A (en) Virtual machine live migration method, equipment and storage medium
CN112650449B (en) Method and system for releasing cache space, electronic device and storage medium
CN109992356B (en) Method and system for automatically starting virtual machine
CN117112222A (en) Request processing method and device, electronic equipment and storage medium
CN108776611B (en) Cloud host management method and device based on cloud management platform
CN114035901B (en) Method and device for constructing container for running process and electronic equipment
CN107544840A (en) A kind of process management method and device
CN114936106A (en) Method, device and medium for processing host fault
CN113032033B (en) Automatic optimization method for big data processing platform configuration

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
TR01 Transfer of patent right

Effective date of registration: 20211208

Address after: 276000 Room 518, administrative service center, No. 1, Renmin Road, Pingshang Town, Lingang Economic Development Zone, Linyi City, Shandong Province

Patentee after: Linyi xingchuangda Intellectual Property Operation Co.,Ltd.

Address before: 101300 Beijing Shunyi District Airport Street, No. 1 Anhua Street, 1st Building, 1st Floor, No. 2159

Patentee before: BEIJING LONGPU INTELLIGENT TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230704

Address after: Room 1503, Hongqilou Business Building, No. 11, Gongye East Street, Qiaodong District, Zhangjiakou City, Hebei Province, 075000

Patentee after: Zhangjiakou Dongchu Technology Co.,Ltd.

Address before: 276000 Room 518, administrative service center, No. 1, Renmin Road, Pingshang Town, Lingang Economic Development Zone, Linyi City, Shandong Province

Patentee before: Linyi xingchuangda Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190528

Assignee: Hebei Yuncha Technology Co.,Ltd.

Assignor: Zhangjiakou Dongchu Technology Co.,Ltd.

Contract record no.: X2023980049711

Denomination of invention: A method and system for automatic startup of virtual machines

Granted publication date: 20211008

License type: Common License

Record date: 20231204

EE01 Entry into force of recordation of patent licensing contract