CN112463296B - Method and device for creating virtual machine - Google Patents

Method and device for creating virtual machine Download PDF

Info

Publication number
CN112463296B
CN112463296B CN202011335034.8A CN202011335034A CN112463296B CN 112463296 B CN112463296 B CN 112463296B CN 202011335034 A CN202011335034 A CN 202011335034A CN 112463296 B CN112463296 B CN 112463296B
Authority
CN
China
Prior art keywords
virtual machine
target
type
hardware
metadata
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
CN202011335034.8A
Other languages
Chinese (zh)
Other versions
CN112463296A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011335034.8A priority Critical patent/CN112463296B/en
Publication of CN112463296A publication Critical patent/CN112463296A/en
Application granted granted Critical
Publication of CN112463296B publication Critical patent/CN112463296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for creating a virtual machine, which belong to the technical field of cloud computing and specifically comprise the following steps: acquiring a creation request, wherein the creation request carries resource specification information specified by a user; acquiring target metadata based on the resource specification information; determining a virtual machine type based on the target metadata; selecting target hardware for the virtual machine type; and acquiring a configuration file matched with the target hardware, and creating the target virtual machine by using the configuration file and the target hardware. The invention selects proper hardware according to the creation request of the user, and creates the virtual machine required by the user by combining the configuration file, thereby ensuring the specificity of the hardware, further realizing the technical effects of automatically creating the virtual machine and improving the utilization rate of corresponding hardware resources.

Description

Method and device for creating virtual machine
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method and a device for creating a virtual machine.
Background
At present, with the technology development of AI, machine learning, deep learning and the like becoming faster and faster, various applications emerge endlessly, and the machine learning inference model trains more by using GPU resources on a physical machine and neglecting CPU resources, which causes the waste of CPU resources, and at the same time, the GPU resources can only be used by a single user, which causes the low utilization rate of GPU resources. For individuals or small-scale enterprises, when a physical machine is built to use or learn the AI, a hardware environment needs to be built, a long time is wasted for installing and deploying an inference operation environment, the building of the machine learning environment is too complex, the prices of hardware platforms such as a CPU (central processing unit) suitable for operating the AI and a GPU (graphics processing unit) are high, the learning cost and complexity are invisibly increased, the use of a new person is inconvenient for the new person who just contacts with the machine learning, and the popularization of deep learning is not facilitated.
Disclosure of Invention
The embodiment of the invention provides a method and a device for creating a virtual machine, solves the technical problems that a machine learning platform is complex to build and the utilization rate of hardware resources is low in the prior art, and achieves the technical effects of automatically creating the virtual machine and improving the utilization rate of corresponding hardware resources.
In a first aspect, the present invention provides a method for creating a virtual machine according to an embodiment of the present invention, including: acquiring a creating request, wherein the creating request carries resource specification information specified by a user; acquiring target metadata based on the resource specification information; determining a virtual machine type based on the target metadata; selecting target hardware for the virtual machine type; and acquiring a configuration file matched with the target hardware, and creating a target virtual machine by using the configuration file and the target hardware.
Preferably, the determining the virtual machine type based on the target metadata includes: identifying the target metadata; and determining the type of the virtual machine to be a vCPU type virtual machine or a vGPU type virtual machine according to the identification result.
Preferably, the determining, according to the identification result, that the virtual machine type is a vCPU type virtual machine or the virtual machine type is a vGPU type virtual machine includes: and if the target metadata is identified to contain CPU metadata, RAM metadata and hard disk metadata, determining the type of the virtual machine to be a vCPU type virtual machine, otherwise determining the type of the virtual machine to be a vGPU type virtual machine.
Preferably, the selecting target hardware for the virtual machine type includes: if the virtual machine type is a vCPU type virtual machine, selecting hardware corresponding to the vCPU type virtual machine from cloud host resources as candidate hardware, and selecting the target hardware from the candidate hardware by using a filtering algorithm; or if the virtual machine type is a vGPU type virtual machine, selecting hardware corresponding to the vGPU type virtual machine from cloud host resources as candidate hardware, and selecting the target hardware from the candidate hardware by using a filtering algorithm.
Preferably, the creating a target virtual machine by using the configuration file and the target hardware includes: and binding the CPU of the target virtual machine with a physical CPU by using the configuration file, setting a hard disk of the target virtual machine as a direct hard disk, and setting the RAM of the target virtual machine as a large-page memory.
Preferably, after the determining the type of the virtual machine based on the target metadata, the method further includes: and checking the acquired creation request and the target metadata, and if the acquired creation request and the target metadata pass the checking, executing the step of selecting target hardware aiming at the type of the virtual machine.
Preferably, after the obtaining the configuration file matched with the target hardware and creating the target virtual machine by using the configuration file and the target hardware, the method further includes: and starting the target virtual machine and outputting prompt information, wherein the prompt information comprises the creation state of the target virtual machine.
In a second aspect, the present invention provides an apparatus for creating a virtual machine, including: the interactive interface is used for acquiring a creation request, and the creation request carries resource specification information specified by a user; an acquisition unit that acquires target metadata based on the resource specification information; a determination unit that determines a virtual machine type based on the target metadata; a selection unit that selects target hardware for the virtual machine type; and the creating unit is used for acquiring the configuration file matched with the target hardware and creating the target virtual machine by using the configuration file and the target hardware.
In a third aspect, an embodiment of the present invention provides an apparatus for creating a virtual machine, including: a memory, a processor, and code stored on the memory and executable on the processor, the controller implementing the method of any of the embodiments of the first aspect when executing the code.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method according to any one of the embodiments of the first aspect.
One or more technical schemes provided in the embodiments of the present invention have at least the following technical effects or advantages:
the embodiment of the invention discloses a method for creating a virtual machine, which comprises the steps of firstly obtaining a creation request, wherein the creation request carries resource specification information specified by a user; based on the resource specification information, target metadata can be acquired; determining a virtual machine type based on the target metadata; selecting target hardware aiming at the type of the virtual machine; and acquiring a configuration file matched with the target hardware, and creating the target virtual machine by using the configuration file and the target hardware. Therefore, the appropriate hardware can be selected according to the resource specification information specified by the user, the virtual machine required by the user is created by combining the configuration file, the specificity of the hardware is ensured, the virtual machine is automatically created, and the created virtual machine is matched with the hardware, so that the utilization rate of corresponding hardware resources is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a flow chart of a method for creating a virtual machine in an embodiment of the invention;
FIG. 2 is a functional block diagram of an apparatus for creating a virtual machine according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus for creating a virtual machine according to an embodiment of the present invention;
fig. 4 is a block diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method and a device for creating a virtual machine, which are used for solving the technical problems that the machine learning platform is complex to build and the utilization rate of hardware resources is low in the prior art.
In order to solve the technical problems, the embodiment of the invention provides the following general ideas:
the method comprises the steps of firstly obtaining a creating request, obtaining target metadata based on resource specification information as the creating request carries the resource specification information specified by a user, determining the type of a virtual machine with the target metadata, selecting target hardware aiming at the type of the virtual machine, then obtaining a configuration file matched with the target hardware, and finally creating the target virtual machine by using the configuration file and the target hardware.
According to the technical scheme, only the proper hardware is selected according to the resource specification information specified by the user, and the virtual machine required by the user is created by combining the configuration file, so that the specificity of the hardware is ensured, and the technical effects of automatically creating the virtual machine and improving the utilization rate of corresponding hardware resources are further achieved.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
First, it is stated that the term "and/or" appearing herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Example one
This embodiment provides a method for creating a virtual machine, where the method may run in an OS operating system in the form of a code, and the OS operating system may specifically be: windows operating system, DOS operating system, MAC operating system, etc., and the embodiment is not limited in particular.
The method for creating the virtual machine provided by the embodiment of the invention can be applied to a cloud computing management platform, and the cloud computing management platform can be an OpenStack framework: the OpenStack is an open source cloud computing management platform project, is a combination of a series of software open source projects, and can also adopt other similar architectures. As shown in fig. 1, the method comprises the steps of:
step S101: and acquiring a creating request, wherein the creating request carries the resource specification information specified by the user.
In a specific implementation process, after obtaining an input instruction of a user, the cloud computing management platform generates a creation request for creating a virtual machine, where the creation request carries resource specification information specified by the user, for example, the input instruction may be a specification of a CPU, a GPU, a RAM, and a hard disk resource, and the resource specification information specified by the user is obtained based on a resource specification selected by the user from a cloud host resource specification (browser). Specifically, the cloud computing management platform implemented in the present invention is a cloud platform that provides computing, networking, and storage capabilities based on hardware resources and software resource services.
In a specific embodiment, a User may input an instruction on a UI (User Interface) by way of mouse click, touch screen click, voice command issue, or keyboard input, so as to select a required hardware In a self-defined manner, for example, select two 10-core CPUs, two GPUs each having 20GB display, a 256GB RDIMM (Registered Dual In-line Memory Module) DDR4(The fourth generation synchronous dynamic random access Memory) type rdi (The resource generation double-data rate synchronous dynamic random access Memory), and a 960GB solid-state disk, where after The UI obtains The input instruction of The User, The UI generates a creation request for creating a virtual machine, carries resource specification information specified by The User, and selects corresponding resource specification information from The cloud host resource specification; on the other hand, the User may also input an instruction on a UI (User Interface) by clicking with a mouse, clicking with a touch screen, issuing a voice command, or inputting with a keyboard to select a classification recommended by the UI, for example, the UI displays hardware suitable for deep learning as an "deep learning class", displays hardware suitable for image classification as an "image classification class", displays hardware suitable for image recognition as an "image recognition class", and selects the "deep learning class" from these classifications, so that after acquiring the input instruction of the User, the UI generates a creation request for creating a virtual machine, and selects corresponding resource specification information from the cloud host resource specification.
Step S102: and acquiring target metadata based on the resource specification information.
In the specific implementation process, the cloud computing management platform has a large amount of metadata, and the metadata is used for describing attributes of the resource specification information and supporting functions such as indicating storage positions, historical data, resource searching, file recording and the like. After the cloud computing management platform obtains the resource specification information specified by the user, the cloud computing management platform can reversely obtain the target metadata from a large amount of metadata.
For example, after the cloud computing management platform acquires the resource specification information specified by the user, for example, the acquired resource specification information is: since the metadata has corresponding target metadata to describe the attributes of the resource specification information, the target metadata can be obtained through the resource specification information specified by the user, for example, hw, CPU _ policy ═ divided, aggregate _ instance _ extra _ tasks, pghs ═ true, avx512_ vnni, and hw, men _ page _ size ═ 1G.
Step S103: based on the target metadata, a virtual machine type is determined.
In the specific implementation process, the target metadata is identified, and the virtual machine type is determined to be a vCPU type virtual machine or a vGPU type virtual machine according to the identification result. More specifically, if the target metadata is identified to contain CPU metadata, RAM metadata and hard disk metadata at the same time, the virtual machine type is determined to be a vCPU type virtual machine, otherwise, the virtual machine type is determined to be a vGPU type virtual machine.
For example, the cloud computing management platform acquires target metadata, such as metadata of hw, CPU _ policy ═ determined, aggregate _ instance _ extra _ tasks, hpgs ═ true, avx512_ vnni, hw, men _ page _ size ═ 1G, and identifies that these target metadata exist simultaneously, determines that the virtual machine type is a vCPU type virtual machine, and sends a request for creating the vCPU type virtual machine at the same time, otherwise determines that the virtual machine type is a vCPU type virtual machine, and sends a request for creating the vCPU type virtual machine at the same time, where hw, CPU _ policy ═ determined is CPU metadata, hw, men _ page _ size ═ 1G, and aggregate _ instance _ extra _ tasks, hpgs ═ avx512 is hard disk metadata.
As an alternative embodiment, after step S103, the method further includes: and checking the acquired creation request and the target metadata, and if the creation request and the target metadata pass the checking, executing a step of selecting target hardware according to the type of the virtual machine.
Specifically, after receiving a creation request for creating a virtual machine, the nova-api service of the cloud computing management platform checks the creation request, target metadata and a virtual machine type to be created, if the creation request and the target metadata both meet a preset check condition, the virtual machine type to be created passes the check, for example, the virtual machine type to be created corresponds to the identification result of the target metadata, the virtual machine type to be created is considered to pass the check, and after the check is passed, the nova-api service transmits a request for creating a vCPU type virtual machine to the nova-vector service; otherwise, the creation process is ended, or a prompt is sent out, so that the probability of wrong selection caused by factors such as BUG (BUG in computer field) and crash of the program is reduced.
Step S104: target hardware is selected for the virtual machine type.
In a specific implementation process, if the type of the virtual machine is a vCPU type virtual machine, selecting hardware corresponding to the vCPU type virtual machine from cloud host resources as candidate hardware, and selecting target hardware from the candidate hardware by using a filtering algorithm; or if the virtual machine type is a vGPU type virtual machine, selecting hardware corresponding to the vGPU type virtual machine from cloud host resources as candidate hardware, and selecting target hardware from the candidate hardware by using a filtering algorithm.
For example, if the nova-conductor service receives a request for creating a vCPU type virtual machine, the nova-conductor service queries a resource management service according to information in a cloud computing management platform, finds candidate hardware suitable for creating the vCPU type virtual machine from a cloud host resource specification, for example, the candidate hardware is a 28-core CPU, a DDR4 memory supporting ECC, a solid state disk, and a large video memory GPU, and then the nova-scheduler service selectively filters the candidate hardware according to filtering algorithms such as a native CPU, a memory, and a large page memory of the cloud computing management platform, so as to obtain target hardware, for example, the target hardware is a 28-core processor, two GPUs each having a 22GB video memory, a 256GB RDIMM type DDR4, and 960GB solid state disks; if the nova-conductor service receives a request for creating a vGPU type virtual machine, the nova-conductor service queries a resource management service according to information in a cloud computing management platform, finds candidate hardware suitable for creating the vGPU type virtual machine from the cloud host resource specification, for example, the found candidate hardware is a 10-core CPU, a DDR4 memory supporting ECC, a solid state disk and a GPU for high floating point operation, and then the nova-scheduler service selectively filters the found candidate hardware according to filtering algorithms of a native CPU, a memory, a large page memory and the like in the cloud computing management platform to obtain target hardware, for example, the target hardware comprises: a 10-core CPU, four GPUs with 22GB video memory, 512GB RDIMM DDR4, 1.2TB solid state disk.
Step S105: and acquiring a configuration file matched with the target hardware, and creating the target virtual machine by using the configuration file and the target hardware.
In the specific implementation process, the CPU of the target virtual machine is bound with the physical CPU by using the configuration file, the hard disk of the target virtual machine is set as a direct hard disk, and the RAM of the target virtual machine is set as a large-page memory.
For example, firstly installing software stacks such as Intel OpenVINO and the like in a VM (Virtual Machine) image, uploading the manufactured VM image to a gloss service in a cloud computing management platform, obtaining a configuration file corresponding to the vCPU Virtual Machine by the nova-computer service after the nova-conductor service in the cloud computing management platform sends a request for creating the vCPU Virtual Machine to the nova-computer service, reading information such as CPU pin, numa, CPU passthrough, target metadata and the like from the configuration file, then calling a bottom layer service of libvirt to generate an xml file about the vCPU Virtual Machine, creating the vCPU Virtual Machine after the VM image is installed by the libvirt, and binding the CPU metadata hw of the CPU Virtual Machine with the CPU metadata hpu after the vCPU Virtual Machine is started by the libvirt, so that the CPU Virtual Machine can be bound with the CPU Virtual Machine, and the CPU can be improved; setting the CPU of the vCPU type virtual machine to be in a host direct-through mode through the CPU metadata avx512_ vnni; the RAM of the vCPU-type virtual machine is set as a large-page memory by RAM metadata hw, men _ page _ size ═ 1G, aggregate _ instance _ extra _ specs:hpgs ═ true.
As an alternative embodiment, after step S105, the method further includes: and starting the target virtual machine and outputting prompt information, wherein the prompt information comprises the creation state of the target virtual machine.
For example, a cloud computing management platform starts a vCPU type virtual machine through libvirt, a nova-computer service in the cloud computing management platform sends information that the vCPU type virtual machine is successfully started to a nova-api service, and the nova-api service sends information that the vCPU type virtual machine is successfully created to a UI.
Furthermore, the full life cycle of the target virtual machine of the inference operation can be managed through the cloud computing management platform, and the management comprises one-key establishment of the inference operation virtual machine, centralized operation and maintenance management of the inference operation virtual machine and the like. The method innovatively realizes the service provision for the reasoning and operation virtual machine by using the mixed resource of the GPU and the CPU. The operation and maintenance efficiency is greatly improved, the cost is saved, the resource utilization rate is improved, and the application scene of the cloud platform is expanded. The virtual machine which only supports the reasoning and operation by the VCPU resources is optimized, the speed of the reasoning and operation model is obviously improved, and the effect that the virtual GPU resources support the reasoning and operation virtual machine is achieved.
The physical resources of the GPU and the CPU are virtualized by means of a virtualization technology, the virtualized GPU and CPU resources are distributed to a plurality of virtual machines, and a user runs reasoning operation service in the virtual machines. The method has the advantages that the one-click establishment of the reasoning operation virtual machine is realized by means of the cloud platform of the OpenStack, and the operation complexity of the construction of the reasoning operation environment is greatly reduced.
The method has the advantages that the mixed resources of the GPU and the CPU are utilized to provide services for the reasoning and operation virtual machines, the performance of the virtual machines is optimized, the reasoning and operation services are operated in the virtual machines, the influence on other virtual machines operated on the same server is avoided, each virtual machine can operate different reasoning and operation models, if the environment of the virtual machine is damaged, the environment of the virtual machine can be established very quickly, more users can use the virtual machine at the same time, and the resource utilization rate of the server is improved.
The technical scheme in the embodiment of the invention at least has the following technical effects or advantages:
the method for creating the virtual machine disclosed in the embodiment of the invention comprises the steps of firstly obtaining a creation request, wherein the creation request carries resource specification information specified by a user; based on the resource specification information, target metadata can be acquired; determining a virtual machine type based on the target metadata; selecting target hardware aiming at the type of the virtual machine; and acquiring a configuration file matched with the target hardware, and creating the target virtual machine by using the configuration file and the target hardware. The method selects proper hardware according to the creation request of the user, and creates the virtual machine required by the user by combining the configuration file, thereby ensuring the specificity of the hardware, further realizing the technical effects of automatically creating the virtual machine and improving the utilization rate of corresponding hardware resources.
Example two
Based on the same inventive concept, the embodiment of the invention provides a device for creating a virtual machine, which is used for creating the virtual machine. Referring to fig. 2, an apparatus for creating a virtual machine according to an embodiment of the present invention includes:
an interactive interface 201, configured to obtain a creation request, where the creation request carries resource specification information specified by a user;
an acquisition unit 202 that acquires target metadata based on the resource specification information;
a determination unit 203 that determines a virtual machine type based on the target metadata;
a selection unit 204 that selects target hardware for the virtual machine type;
and the creating unit 205 is configured to acquire the configuration file matched with the target hardware, and create the target virtual machine by using the configuration file and the target hardware.
In an optional implementation, the determining unit 203 includes:
a data identification subunit for identifying the target metadata;
and the type determining subunit is used for determining the type of the virtual machine to be a vCPU type virtual machine or a vGPU type virtual machine according to the identification result.
In an optional implementation manner, the type determining subunit is specifically configured to:
and if the target metadata is identified to contain CPU metadata, RAM metadata and hard disk metadata, determining the type of the virtual machine to be a vCPU type virtual machine, otherwise determining the type of the virtual machine to be a vGPU type virtual machine.
In an optional implementation manner, the selecting unit 204 is specifically configured to:
if the virtual machine type is a vCPU type virtual machine, selecting hardware corresponding to the vCPU type virtual machine from cloud host resources as candidate hardware, and selecting the target hardware from the candidate hardware by using a filtering algorithm; or
And if the virtual machine type is a vGPU type virtual machine, selecting hardware corresponding to the vGPU type virtual machine from cloud host resources as candidate hardware, and selecting the target hardware from the candidate hardware by using a filtering algorithm.
In an optional implementation, the creating unit 205 includes:
and the optimizing subunit is configured to bind, by using the configuration file, the CPU of the target virtual machine with a physical CPU, set the hard disk of the target virtual machine as a direct hard disk, and set the RAM of the target virtual machine as a large-page memory.
In an optional embodiment, the apparatus further comprises:
and the verification unit is used for verifying the acquired creation request and the target metadata, and if the creation request and the target metadata pass the verification, executing the step of selecting the target hardware according to the type of the virtual machine.
In an optional embodiment, the apparatus further comprises:
and the starting unit is used for starting the target virtual machine and outputting prompt information, and the prompt information comprises the creation state of the target virtual machine.
Since the apparatus for creating a virtual machine described in this embodiment is an electronic device used for implementing the method for creating a virtual machine in the embodiment of the present invention, based on the method for creating a virtual machine described in the embodiment of the present invention, a person skilled in the art can understand a specific implementation manner of the electronic device in this embodiment and various variations thereof, so that how to implement the method in the embodiment of the present invention by the electronic device is not described in detail here. The electronic device used by a person skilled in the art to implement the method for creating a virtual machine in the embodiments of the present invention is within the scope of the present invention.
The technical scheme in the embodiment of the invention at least has the following technical effects or advantages:
the device for creating the virtual machine disclosed in the embodiment of the invention comprises the following components: an interactive interface 201, configured to obtain a creation request, where the creation request carries resource specification information specified by a user; an acquisition unit 202 that acquires target metadata based on the resource specification information; a determination unit 203 that determines a virtual machine type based on the target metadata; a selection unit 204 that selects target hardware for the virtual machine type; and the creating unit 205 is configured to acquire the configuration file matched with the target hardware, and create the target virtual machine by using the configuration file and the target hardware. The device can select proper hardware according to the creation request of the user, and combines the configuration file to create the virtual machine required by the user, thereby ensuring the specificity of the hardware, further realizing the technical effects of automatically creating the virtual machine and improving the utilization rate of corresponding hardware resources.
EXAMPLE III
Based on the same inventive concept, the embodiment of the invention provides equipment for creating a virtual machine.
Referring to fig. 3, an apparatus for creating a virtual machine according to an embodiment of the present invention includes: memory 304, processor 302, and code stored on memory 304 and executable on processor 302, when executing the code, implements any of the foregoing method embodiments of creating a virtual machine.
Where in fig. 3 a bus architecture (represented by bus 300), bus 300 may include any number of interconnected buses and bridges, bus 300 linking together various circuits including one or more processors, represented by processor 302, and memory, represented by memory 304. The bus 300 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 306 provides an interface between the bus 300 and the receiver 301 and transmitter 303. The receiver 301 and the transmitter 303 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 302 is responsible for managing the bus 300 and general processing, and the memory 304 may be used for storing data used by the processor 302 in performing operations.
Example four
Based on the same inventive concept, as shown in fig. 4, the present embodiment provides a computer-readable storage medium 400, on which a computer program 401 is stored, where the computer program 401, when executed by a processor, implements any one of the above embodiments of the method for creating a virtual machine.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the invention may take the form of a computer product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable code embodied therein.
The present invention has been 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer instructions. These computer 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 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 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. Therefore, it is intended that the appended claims be interpreted as including 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 changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method of creating a virtual machine, comprising:
acquiring a creating request, wherein the creating request carries resource specification information specified by a user;
acquiring target metadata based on the resource specification information;
determining a virtual machine type based on the target metadata, including: identifying the target metadata; determining the type of the virtual machine to be a vCPU type virtual machine or a vGPU type virtual machine according to the identification result;
selecting target hardware for the virtual machine type;
acquiring a configuration file matched with the target hardware, and creating a target virtual machine by using the configuration file and the target hardware;
wherein the identifying the target metadata; according to the identification result, determining the type of the virtual machine to be a vCPU type virtual machine or a vGPU type virtual machine, comprising the following steps: and if the target metadata is identified to contain CPU metadata, RAM metadata and hard disk metadata, determining the type of the virtual machine to be a vCPU type virtual machine, otherwise determining the type of the virtual machine to be a vGPU type virtual machine.
2. The method of claim 1, wherein the selecting target hardware for the virtual machine type comprises:
if the virtual machine type is a vCPU type virtual machine, selecting hardware corresponding to the vCPU type virtual machine from cloud host resources as candidate hardware, and selecting the target hardware from the candidate hardware by using a filtering algorithm; or
And if the virtual machine type is a vGPU type virtual machine, selecting hardware corresponding to the vGPU type virtual machine from cloud host resources as candidate hardware, and selecting the target hardware from the candidate hardware by using a filtering algorithm.
3. The method of claim 2, wherein creating a target virtual machine using the configuration file and the target hardware comprises:
and binding the CPU of the target virtual machine with a physical CPU by using the configuration file, setting the hard disk of the target virtual machine as a direct connection hard disk, and setting the RAM of the target virtual machine as a large-page memory.
4. The method of claim 1, wherein after the determining the type of virtual machine based on the target metadata, further comprising:
and checking the acquired creation request and the target metadata, and if the acquired creation request and the target metadata pass the checking, executing the step of selecting target hardware aiming at the type of the virtual machine.
5. The method of claim 1, wherein after said obtaining a configuration file matching said target hardware and creating a target virtual machine using said configuration file and said target hardware, further comprising:
and starting the target virtual machine and outputting prompt information, wherein the prompt information comprises the creation state of the target virtual machine.
6. An apparatus for creating a virtual machine, comprising:
the interactive interface is used for acquiring a creation request, and the creation request carries resource specification information specified by a user;
an acquisition unit that acquires target metadata based on the resource specification information;
a determining unit that determines a virtual machine type based on the target metadata, including: if the target metadata is identified to contain CPU metadata, RAM metadata and hard disk metadata at the same time, determining that the type of the virtual machine is a vCPU type virtual machine, and otherwise determining that the type of the virtual machine is a vGPU type virtual machine;
a selection unit that selects target hardware for the virtual machine type;
and the creating unit is used for acquiring the configuration file matched with the target hardware and creating the target virtual machine by using the configuration file and the target hardware.
7. An apparatus to create a virtual machine, comprising: memory, processor and code stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1-5 when executing the code.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
CN202011335034.8A 2020-11-25 2020-11-25 Method and device for creating virtual machine Active CN112463296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011335034.8A CN112463296B (en) 2020-11-25 2020-11-25 Method and device for creating virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011335034.8A CN112463296B (en) 2020-11-25 2020-11-25 Method and device for creating virtual machine

Publications (2)

Publication Number Publication Date
CN112463296A CN112463296A (en) 2021-03-09
CN112463296B true CN112463296B (en) 2022-06-03

Family

ID=74798902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011335034.8A Active CN112463296B (en) 2020-11-25 2020-11-25 Method and device for creating virtual machine

Country Status (1)

Country Link
CN (1) CN112463296B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419814B (en) * 2021-05-27 2022-03-08 济南浪潮数据技术有限公司 Virtual machine creating method, device, equipment and storage medium in cloud platform
CN113766005B (en) * 2021-07-29 2023-04-28 苏州浪潮智能科技有限公司 RDMA-based method and system for batch creation of cloud hosts
CN117707704A (en) * 2023-12-20 2024-03-15 慧之安信息技术股份有限公司 Java virtual machine configuration method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929691A (en) * 2012-11-09 2013-02-13 北京航空航天大学 System virtual machine facing Advanced RISC Machines (ARM) multi-core processor server platform
CN104954400A (en) * 2014-03-27 2015-09-30 中国电信股份有限公司 Cloud computing system and realizing method thereof
US20160078585A1 (en) * 2014-09-12 2016-03-17 Vmware, Inc. Dynamically Using System Memory as Video Memory for Virtual Graphics Processing Units
CN109471701A (en) * 2018-11-06 2019-03-15 郑州云海信息技术有限公司 The management method and device of virtual machine image file
CN114296943A (en) * 2021-12-31 2022-04-08 武汉路特斯汽车有限公司 Resource allocation method, device and equipment based on virtualization technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929691A (en) * 2012-11-09 2013-02-13 北京航空航天大学 System virtual machine facing Advanced RISC Machines (ARM) multi-core processor server platform
CN104954400A (en) * 2014-03-27 2015-09-30 中国电信股份有限公司 Cloud computing system and realizing method thereof
US20160078585A1 (en) * 2014-09-12 2016-03-17 Vmware, Inc. Dynamically Using System Memory as Video Memory for Virtual Graphics Processing Units
CN109471701A (en) * 2018-11-06 2019-03-15 郑州云海信息技术有限公司 The management method and device of virtual machine image file
CN114296943A (en) * 2021-12-31 2022-04-08 武汉路特斯汽车有限公司 Resource allocation method, device and equipment based on virtualization technology

Also Published As

Publication number Publication date
CN112463296A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN112463296B (en) Method and device for creating virtual machine
US20160378554A1 (en) Parallel and Distributed Computing Using Multiple Virtual Machines
CN100527085C (en) Systems and methods for initializing multiple virtual processors within a single virtual machine
US9413683B2 (en) Managing resources in a distributed system using dynamic clusters
CN113168569A (en) Decentralized distributed deep learning
CN104965757A (en) Virtual machine live migration method, virtual machine migration management apparatus, and virtual machine live migration system
CN102193824A (en) Virtual machine homogenization to enable migration across heterogeneous computers
CN107679832A (en) Task management method, device and server
CN105573830A (en) Virtual machine migration method
US20210158131A1 (en) Hierarchical partitioning of operators
US10318343B2 (en) Migration methods and apparatuses for migrating virtual machine including locally stored and shared data
CN111209115A (en) Cloud desktop vGPU (virtual graphics processing Unit) over-allocation method
CN105556473A (en) I/O task processing method, device and system
CN111679889B (en) Conversion migration method and system of virtual machine
CN112286633A (en) Virtual machine creating method, device, equipment and storage medium based on CloudStack platform
CN112328365A (en) Virtual machine migration method, device, equipment and storage medium
CN112463294A (en) Physical GPU virtualization management method, system, equipment and product
CN113687779B (en) Data migration method, device, electronic equipment and readable storage medium
US9971785B1 (en) System and methods for performing distributed data replication in a networked virtualization environment
CN105677481A (en) Method and system for processing data and electronic equipment
KR102315102B1 (en) Method, device, apparatus, and medium for booting a virtual machine
US20170153920A1 (en) Recruiting additional resource for hpc simulation
CN111598768A (en) Image optimization processing method and device, computer equipment and storage medium
CN113296876B (en) Equipment direct connection method, equipment and storage medium of virtual machine
CN103631648A (en) Task processing method and system

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