WO2021120841A1 - 虚拟机创建及cpu资源分配方法、装置、设备 - Google Patents

虚拟机创建及cpu资源分配方法、装置、设备 Download PDF

Info

Publication number
WO2021120841A1
WO2021120841A1 PCT/CN2020/123210 CN2020123210W WO2021120841A1 WO 2021120841 A1 WO2021120841 A1 WO 2021120841A1 CN 2020123210 W CN2020123210 W CN 2020123210W WO 2021120841 A1 WO2021120841 A1 WO 2021120841A1
Authority
WO
WIPO (PCT)
Prior art keywords
cpu
virtual
virtual machine
physical
idle logical
Prior art date
Application number
PCT/CN2020/123210
Other languages
English (en)
French (fr)
Inventor
王鹏
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021120841A1 publication Critical patent/WO2021120841A1/zh

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Definitions

  • This application relates to the field of virtual computing technology, and in particular to a method, device, device, and storage medium for virtual machine creation and CPU resource allocation.
  • the virtualization system allows multiple operating systems to run concurrently on the same physical server, use the same hardware, and do not affect each other.
  • the present application provides a method, device, device, and storage device for virtual machine creation and CPU resource allocation, which can avoid contention for virtual CPU resources, improve virtual CPU computing performance, and satisfy customer applications.
  • a technical solution adopted in this application is to provide a method for virtual machine creation and CPU resource allocation, which includes the following steps:
  • Create a virtual machine according to the configuration instruction make the virtual machine include the configured number of the virtual CPUs, and allocate a corresponding physical CPU to each of the virtual CPUs, and the physical CPUs include idle logical cores;
  • a technical solution adopted by this application is to provide a virtual machine creation and CPU resource allocation device, which includes:
  • An obtaining module configured to obtain a configuration instruction for a user to create a virtual machine, where the configuration instruction includes the configuration number of the virtual CPU;
  • the creation module is used to create a virtual machine according to the configuration instruction, so that the virtual machine includes the configured number of virtual CPUs, and allocates a corresponding physical CPU to each virtual CPU, and the physical CPU includes Idle logic core;
  • the allocation module is configured to allocate at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU.
  • a technical solution adopted by this application is to provide a virtual machine creation and CPU resource allocation device, the virtual machine creation and CPU resource allocation device includes a processor and is coupled to the processor The memory of, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor is caused to perform the following steps:
  • Create a virtual machine according to the configuration instruction make the virtual machine include the configured number of the virtual CPUs, and allocate a corresponding physical CPU to each of the virtual CPUs, and the physical CPUs include idle logical cores;
  • a technical solution adopted by this application is to provide a storage medium storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, one or Multiple processors perform the following steps:
  • Create a virtual machine according to the configuration instruction make the virtual machine include the configured number of the virtual CPUs, and allocate a corresponding physical CPU to each of the virtual CPUs, and the physical CPUs include idle logical cores;
  • the virtual machine creation and CPU resource allocation method, device, device, and storage device proposed in this application can be automatically completed during the creation process by creating a virtual machine and allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU
  • the virtual CPU is bound to resources. After the allocation is completed, there is no competition for the virtual CPU and can run stably, which improves the performance and stability of the virtual machine, thereby enhancing the customer experience. Further, the allocation of virtual CPU resources is completed through the serial number and the name of the virtual machine, which avoids manual calculations, does not need to manually bind, and improves the accuracy of resource allocation. Further, after the allocation is completed, the correctness of the allocation result is checked by querying the configuration, which further guarantees the accuracy of resource allocation.
  • FIG. 1 is a schematic flowchart of a method for creating a virtual machine and allocating CPU resources according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a virtual machine creation and CPU resource allocation apparatus according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a virtual machine creation and CPU resource allocation device according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a storage medium according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a method for creating a virtual machine and allocating CPU resources according to an embodiment of the present application.
  • the virtual machine creation and CPU resource allocation method can be run on a local server, a remote server, or a remote cloud platform.
  • the local server, the remote server, or the remote cloud platform is connected through a wireless network such as WIFI or a wired network such as Ethernet. It can communicate with a user terminal, and the user terminal may be any terminal that can be operated by the user, such as a mobile phone, a tablet computer, a notebook, and the like.
  • the method of the present application is not limited to the sequence of the process shown in FIG. 1. As shown in Figure 1, the method includes steps:
  • Step S101 Obtain a configuration instruction for a user to create a virtual machine, where the configuration instruction includes the configuration number of virtual CPUs.
  • the configuration instruction may include a virtual machine Name, number of virtual CPUs configured, operating system type, system disk size, memory size, it can be understood that the virtual machine name, the number of virtual CPUs configured in the configuration instruction, the operating system type, and The size of the system disk can be specified by the user, and the preset default value can be used if the user does not specify it.
  • the virtual machine name can be in the form of preset characters plus numbers.
  • the number Plus 1 the default value of the configured number of virtual CPUs may be 1.
  • Step S102 Create a virtual machine according to the configuration instruction, make the virtual machine include the configured number of virtual CPUs, and allocate a corresponding physical CPU to each virtual CPU, and the physical CPU includes idle logic nuclear.
  • a virtual disk is created according to the virtual machine name and the size of the system disk, and the operating system of the operating system type is installed, and then Editing a configuration file, such as an XML file, according to the configuration instruction, the configuration file including the virtual CPU and the memory configured with the configuration number of the virtual CPU for the virtual machine name of the configuration instruction
  • the physical CPU including the idle logical core is acquired, and when the virtual machine is configured, the corresponding physical CPU is allocated to each virtual CPU, so that all the virtual CPUs are allocated
  • the physical CPU has idle resources for the virtual CPU.
  • a query can be made based on the virtual machine name, and the physical CPU resource information currently allocated by the virtual machine can be obtained.
  • the information includes the serial number of the idle logical core.
  • Step S103 Allocate at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU.
  • the allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU may randomly select the serial number according to the physical CPU resource information.
  • the idle logical core is allocated to the corresponding virtual CPU.
  • the virtual CPU includes a first virtual CPU and a second virtual CPU
  • the physical CPU includes a first physical CPU and a second physical CPU
  • the first virtual CPU corresponds to the The first physical CPU, the second physical CPU corresponding to the second virtual CPU
  • the allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU may also be performed if the first If the sequence number of at least one of the idle logical cores in the physical CPU is the same as the sequence number of at least one of the idle logical cores in the second physical CPU, the virtual machine name is the first virtual
  • the CPU and the second virtual CPU are respectively allocated the idle logical cores of the sequence numbers in the first physical CPU and the second physical CPU.
  • the user issues a configuration instruction for creating a virtual machine through the client.
  • the configuration instruction includes: the virtual machine name is wp, the system disk size is 50G, the operating system type is the default operating system, and the memory size is 2G, the number of virtual CPU configurations is 2.
  • the server After receiving the configuration instruction, the server creates one based on the name of the virtual machine as wp, the size of the system disk as 50G, and the operating system type as the default operating system.
  • the virtual disk is installed with the default operating system.
  • a configuration file is generated based on the memory size of 2G and the number of virtual CPU configurations being 2, and the current server that can be allocated to the virtual machine includes the
  • the two physical CPUs of the idle logical core are then configured for the virtual machine according to the configuration file, and the two physical CPUs are allocated to the two virtual CPUs.
  • the serial number of the idle logical core of the physical CPU currently allocated by the virtual machine can be obtained.
  • the virtual CPU1 corresponds to the physical CPU1
  • the physical CPU1 includes 20 idle logical cores.
  • the idle logical core sequence number is 1-20
  • the virtual CPU2 corresponds to the physical CPU2
  • the physical CPU2 includes 15 idle logical cores.
  • the idle logical core sequence number is 1-15.
  • the The empty logical core with the serial number 3 in the physical CPU 1 is allocated to the virtual CPU 1
  • the empty logical core with the serial number 10 in the physical CPU 2 is allocated to the virtual CPU 2.
  • the virtual machine with the name of the virtual machine may also be directly assigned the idle logical cores with serial numbers 5-9. At this time, the empty logical cores with serial numbers 5-9 in the physical CPU 1
  • the logical cores are allocated to the virtual CPU1, and the empty logical cores with serial numbers 5-9 in the physical CPU2 are allocated to the virtual CPU2.
  • the virtual machine creation and CPU resource allocation method further includes querying the virtual CPU allocation result according to the virtual machine name, and the allocation result includes the physical CPU allocated by the virtual CPU And its corresponding idle logic core; compare whether the sequence number of the idle logic core after the allocation is consistent with the sequence number of the allocated idle logic core, if they are the same, the allocation result is correct, and then it is completed The virtual CPU allocation.
  • the virtual machine creation and CPU resource allocation method proposed in this application can automatically complete the resource binding of the virtual CPU during the creation process by creating a virtual machine and allocating at least one of the idle logical cores of a physical CPU to a corresponding virtual CPU. After the allocation is completed, there is no competition for the virtual CPU, and it can run stably, which improves the performance and stability of the virtual machine, thereby enhancing the customer experience.
  • the allocation of virtual CPU resources is completed through the serial number and the name of the virtual machine, which avoids manual calculations, does not need to manually bind, and improves the accuracy of resource allocation.
  • the correctness of the allocation result is checked by querying the configuration, which further guarantees the accuracy of resource allocation.
  • FIG. 2 is a schematic structural diagram of a virtual machine creation and CPU resource allocation apparatus 1 according to an embodiment of the present application.
  • the virtual machine creation and CPU resource allocation device 1 includes an acquisition module 11, a creation module 12 and an allocation module 13.
  • the obtaining module 11 is configured to obtain a configuration instruction for a user to create a virtual machine, where the configuration instruction includes the configuration number of virtual CPUs.
  • the obtaining module 11 is further configured to obtain the physical CPU resource information, and the resource information includes the serial number of the idle logical core.
  • the configuration instruction further includes a virtual machine name
  • the obtaining module 11 is further configured to obtain the physical CPU resource information according to the virtual machine name.
  • the creation module 12 is configured to create a virtual machine according to the configuration instruction, so that the virtual machine includes the configured number of virtual CPUs, and allocates a corresponding physical CPU to each virtual CPU, the physical CPU Including idle logic cores.
  • the configuration instruction further includes the type of operating system and the size of the system disk
  • the creation module 12 is further configured to create a virtual disk according to the name of the virtual machine and the size of the system disk, and install the operation The operating system of the system type.
  • the allocation module 13 is configured to allocate at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU.
  • the allocation module 13 is further configured to randomly select the idle logical core from the sequence number and allocate it to the corresponding virtual CPU according to the physical CPU resource information.
  • the virtual CPU includes a first virtual CPU and a second virtual CPU
  • the physical CPU includes a first physical CPU and a second physical CPU
  • the first virtual CPU corresponds to the first virtual CPU.
  • a physical CPU, the second physical CPU corresponding to the second virtual CPU, and the allocation module 13 is also configured to, if the serial number of at least one idle logical core in the first physical CPU is the same as the second physical CPU If at least one of the idle logical cores in the physical CPU has the same serial number, the first virtual CPU and the second virtual CPU are allocated to the first physical CPU and the second virtual CPU according to the virtual machine name. 2.
  • the allocation module 13 is further configured to query the virtual CPU allocation result according to the virtual machine name, and the allocation result includes the physical CPU allocated by the virtual CPU and its corresponding Idle logical core; compare whether the sequence number of the allocated idle logical core is consistent with the allocated sequence number of the idle logical core, if they are consistent, the allocation result is correct, and the virtual CPU allocation is completed.
  • FIG. 3 is a schematic structural diagram of a virtual machine creation and CPU resource allocation device 30 according to an embodiment of the present application.
  • the virtual machine creation and CPU resource allocation device 30 includes a processor 32 and a memory 31 coupled to the processor 32, wherein the memory 31 stores computer readable instructions, and When the computer-readable instructions are executed by the processor 32, the following steps are implemented: obtaining a configuration instruction for a user to create a virtual machine, where the configuration instruction includes the configuration number of virtual CPUs; creating a virtual machine according to the configuration instruction, and making the virtual machine
  • the computer includes the configured number of virtual CPUs, and allocates a corresponding physical CPU to each virtual CPU, the physical CPU includes an idle logical core; and at least one idle logical core of the physical CPU Allocate to the corresponding virtual CPU.
  • the virtual machine creation and CPU resource allocation method further includes: acquiring the physical CPU resource information, where the resource information includes the serial number of the idle logical core.
  • the allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU includes: randomly selecting from the sequence numbers according to the physical CPU resource information
  • the idle logical core is allocated to the corresponding virtual CPU.
  • the configuration instruction further includes a virtual machine name
  • the acquiring the physical CPU resource information includes: acquiring the physical CPU resource information according to the virtual machine name.
  • the virtual CPU includes a first virtual CPU and a second virtual CPU
  • the physical CPU includes a first physical CPU and a second physical CPU
  • the first virtual CPU corresponds to the first virtual CPU.
  • a physical CPU, the second physical CPU corresponding to the second virtual CPU, and the allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU includes: if the first If the sequence number of at least one of the idle logical cores in the physical CPU is the same as the sequence number of at least one of the idle logical cores in the second physical CPU, the virtual machine name is the first virtual
  • the CPU and the second virtual CPU are respectively allocated the idle logical cores of the sequence numbers in the first physical CPU and the second physical CPU.
  • the configuration instruction further includes the type of operating system and the size of the system disk
  • the creation of the virtual machine according to the configuration instruction includes: according to the name of the virtual machine and the size of the system disk Create a virtual disk, and install the operating system of the operating system type.
  • the virtual machine creation and CPU resource allocation method further includes: querying the virtual CPU allocation result according to the virtual machine name, and the allocation result includes the physical allocation of the virtual CPU CPU and its corresponding idle logic core; compare whether the sequence number of the idle logic core after the allocation is consistent with the sequence number of the allocated idle logic core, if they are the same, the allocation result is correct, then Complete the virtual CPU allocation.
  • FIG. 4 is a schematic structural diagram of a storage medium according to an embodiment of the present application.
  • a storage medium storing computer-readable instructions 41.
  • the one or more processors perform the following steps: Obtain the configuration of the virtual machine created by the user Instruction, the configuration instruction includes the configured number of virtual CPUs; a virtual machine is created according to the configuration instruction so that the virtual machine includes the configured number of virtual CPUs, and each virtual CPU is assigned a corresponding
  • the physical CPU includes an idle logical core; and at least one idle logical core of the physical CPU is allocated to the corresponding virtual CPU.
  • the virtual machine creation and CPU resource allocation method further includes: acquiring the physical CPU resource information, where the resource information includes the serial number of the idle logical core.
  • the allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU includes: randomly selecting from the sequence numbers according to the physical CPU resource information
  • the idle logical core is allocated to the corresponding virtual CPU.
  • the configuration instruction further includes a virtual machine name
  • the acquiring the physical CPU resource information includes: acquiring the physical CPU resource information according to the virtual machine name.
  • the virtual CPU includes a first virtual CPU and a second virtual CPU
  • the physical CPU includes a first physical CPU and a second physical CPU
  • the first virtual CPU corresponds to the first virtual CPU.
  • a physical CPU, the second physical CPU corresponding to the second virtual CPU, and the allocating at least one of the idle logical cores of the physical CPU to the corresponding virtual CPU includes: if the first If the sequence number of at least one of the idle logical cores in the physical CPU is the same as the sequence number of at least one of the idle logical cores in the second physical CPU, the virtual machine name is the first virtual
  • the CPU and the second virtual CPU are respectively allocated the idle logical cores of the sequence numbers in the first physical CPU and the second physical CPU.
  • the configuration instruction further includes the type of operating system and the size of the system disk
  • the creation of the virtual machine according to the configuration instruction includes: according to the name of the virtual machine and the size of the system disk Create a virtual disk, and install the operating system of the operating system type.
  • the virtual machine creation and CPU resource allocation method further includes: querying the virtual CPU allocation result according to the virtual machine name, and the allocation result includes the physical allocation of the virtual CPU CPU and its corresponding idle logic core; compare whether the sequence number of the allocated idle logic core is consistent with the sequence number of the allocated idle logic core, if they are the same, the allocation result is correct, then Complete the virtual CPU allocation.
  • the computer program can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments.
  • the aforementioned storage medium may be non-volatile or volatile, and the storage medium may be a magnetic disk, an optical disk, or a read-only memory (Read-Only Memory, ROM) and other non-volatile storage media, or random storage memory (Random Access Memory, RAM) etc.

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

一种虚拟机创建及CPU资源分配方法、装置、设备及存储装置,虚拟机创建及CPU资源分配方法包括:获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数(S101);依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核(S102);以及将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU(S103)。所述方法能够达到避免虚拟CPU资源争抢,提高虚拟CPU计算性能,满足客户应用的目的。

Description

虚拟机创建及CPU资源分配方法、装置、设备
本申请要求于2020年7月20日提交中国专利局、申请号为202010697534.X,发明名称为“虚拟机创建及CPU资源分配方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及虚拟计算技术领域,尤其涉及一种虚拟机创建及CPU资源分配方法、装置、设备及存储介质。
背景技术
随着计算机技术以及互联网的决速发展,操作系统虚拟化技术日益成熟。虚拟化系统允许多个操作系统并发运行在同一台物理服务器上,使用相同的硬件,且相互不影响。
随着云化进程的加快,虚拟机也迁移到了云上,且越来越多的关键应用已经迁移到了云虚拟机即云主机上,这就需要高计算性能的虚拟机来满足用户业务需求。虚拟CPU是虚拟机不可或缺的部分,虚拟CPU的计算能力决定了虚拟机的性能,发明人发现,传统的虚拟机的虚拟CPU采用随机分配方式,虚拟机无法独占计算资源,可能造成虚拟CPU争抢物理核心,并且在关键应用程序运行时,虚拟CPU争抢会导致等待时间过长,应用运行缓慢。
因此,如何提升虚拟机的虚拟CPU计算能力,进而提升虚拟机的性能满足关键应用的需求是用户的迫切需求。
技术问题
本申请提供一种虚拟机创建及CPU资源分配方法、装置、设备及存储装置,能够达到避免虚拟CPU资源争抢,提高虚拟CPU计算性能,满足客户应用的目的。
技术解决方案
为解决上述技术问题,本申请采用的一个技术方案是:提供一种虚拟机创建及CPU资源分配方法,包括以下步骤:
获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及
将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
此外,为解决上述技术问题,本申请还采用的一个技术方案是:提供一种虚拟机创建及CPU资源分配装置,该装置包括:
获取模块,用于获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
创建模块,用于依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;
分配模块,用于将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
此外,为解决上述技术问题,本申请还采用的一个技术方案是:提供一种虚拟机创建及CPU资源分配设备,该虚拟机创建及CPU资源分配设备包括处理器、与所述处理器耦接的存储器,其中,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及
将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
此外,为解决上述技术问题,本申请还采用的一个技术方案是:提供一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及
将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
有益效果
本申请提出的虚拟机创建及CPU资源分配方法、装置、设备及存储装置,通过创建虚拟机及将物理CPU的至少一个所述空闲逻辑核分配给对应的虚拟CPU,可以在创建过程中自动完成虚拟CPU的资源绑定,分配完成后虚拟CPU无争抢,且能稳定运行,提高了虚拟机性能及稳定性,从而提升客户体验。进一步地,通过序号及虚拟机名称完成虚拟CPU资源的分配,避免人为计算,不需手动绑定,提高资源分配的准确率。进一步地,分配完成后通过查询配置检查分配结果的正确性,进一步保障了资源分配的准确率。
附图说明
图1是本申请一种实施例的虚拟机创建及CPU资源分配方法的流程示意图;
图2是本申请一种实施例的虚拟机创建及CPU资源分配装置的结构示意图;
图3是本申请一种实施例的虚拟机创建及CPU资源分配设备的结构示意图;
图4是本申请一种实施例的存储介质的结构示意图。
本发明的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
图1是本申请一种实施例的虚拟机创建及CPU资源分配方法的流程示意图。所述虚拟机创建及CPU资源分配方法可以运行于本地服务器、远程服务器或远程云平台上,所述本地服务器、所述远程服务器或所述远程云平台通过WIFI等无线网络或者以太网等有线网络可以与用户端通信,所述用户端可以是能够提供被用户操作的任意终端,例如为手机、平板电脑、笔记本等。需注意的是,若有实质上相同的结果,本申请的方法并不以图1所示的流程顺序为限。如图1所示,该方法包括步骤:
步骤S101:获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数。
用户可以在用户端通过鼠标、键盘等输入设备,使用脚本命令、图形界面等方式向所述服务器发送创建虚拟机的配置指令,根据本申请的一种实施例,所述配置指令可以包括虚拟机名称、虚拟CPU的配置个数、操作系统类型、系统盘大小、内存大小,可以理解,所述配置指令中的所述虚拟机名称、所述虚拟CPU的配置个数、所述操作系统类型及系统盘大小均可以用户指定,在用户未指定的情况下可以采用预设的默认值,如所述虚拟机名称可以采用预设字符加数字的形式,每创建一个所述虚拟机,所述数字加1,所述虚拟CPU的配置个数默认值可以是1。
步骤S102:依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核。
所述本地服务器、所述远程服务器或所述远程云平台获取到所述配置指令后依据所述虚拟机名称、所述系统盘大小创建虚拟磁盘,并安装所述操作系统类型的操作系统,然后,依据所述配置指令编辑一个配置文件,如XML文件,所述配置文件中包括对所述配置指令的所述虚拟机名称配置所述虚拟CPU的配置个数的所述虚拟CPU、所述内存大小等配置,同时,获取包括所述空闲逻辑核的所述物理CPU,在对所述虚拟机进行配置时,为每个所述虚拟CPU分配对应的物理CPU,使每个虚拟CPU分配的所述物理CPU均有空闲资源给所述虚拟CPU使用。
根据本申请的一种实施例,完成所述虚拟机的初步配置后,还可以依据所述虚拟机名称进行查询,可以获取到当前所述虚拟机分配的所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
步骤S103:将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
根据本申请的一种实施例,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU可以依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。
根据本申请的另一种实施例,所述虚拟CPU包括第一虚拟CPU、第二虚拟CPU,所述物理CPU包括第一物理CPU、第二物理CPU,所述第一虚拟CPU对应的所述第一物理CPU,所述第二虚拟CPU对应的所述第二物理CPU,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU还可以若所述第一物理CPU中至少有一个所述空闲逻辑核的所述序号与所述第二物理CPU中至少有一个所述空闲逻辑核的所述序号相同,则依据所述虚拟机名称为所述第一虚拟CPU、所述第二虚拟CPU分别分配所述第一物理CPU、所述第二物理CPU中的所述序号的所述空闲逻辑核。
下面通过具体的举例对上述过程进行说明。
用户通过用户端下发创建虚拟机的配置指令,所述配置指令包括:所述虚拟机名称为wp,所述系统盘大小为50G,所述操作系统类型为默认操作系统,所述内存大小为2G,所述虚拟CPU配置个数为2个,服务器接收到所述配置指令后,依据所述虚拟机名称为wp,所述系统盘大小为50G,所述操作系统类型为默认操作系统创建一个虚拟磁盘并安装默认操作系统,同时依据所述内存大小为2G,所述虚拟CPU配置个数为2个生成一个配置文件,并获取到当前服务器上能分配给所述虚拟机使用的包括所述空闲逻辑核的2个所述物理CPU,然后依据所述配置文件对所述虚拟机进行配置,并将2个所述物理CPU分配给2个所述虚拟CPU。
依据所述虚拟机名称wp进行查询,可以获取到当前所述虚拟机分配的所述物理CPU的所述空闲逻辑核的序号,如虚拟CPU1对应物理CPU1,物理CPU1中包括20个空闲逻辑核,所述空闲逻辑核序号为1-20,虚拟CPU2对应物理CPU2,物理CPU2中包括15个空闲逻辑核,所述空闲逻辑核序号为1-15,在一种实施例中,可以随机选择所述物理CPU1中的序号为3的所述空虚逻辑核分配给虚拟CPU1,所述物理CPU2中的序号为10的所述空虚逻辑核分配给虚拟CPU2。在另一实施例中,还可以直接为所述虚拟机名称的虚拟机分配序号为5-9的所述空闲逻辑核,此时,所述物理CPU1中的序号为5-9的所述空虚逻辑核分配给虚拟CPU1,所述物理CPU2中的序号为5-9的所述空虚逻辑核分配给虚拟CPU2。
根据本申请的一种实施例,所述虚拟机创建及CPU资源分配方法还包括依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
本申请提出的虚拟机创建及CPU资源分配方法,通过创建虚拟机及将物理CPU的至少一个所述空闲逻辑核分配给对应的虚拟CPU,可以在创建过程中自动完成虚拟CPU的资源绑定,分配完成后虚拟CPU无争抢,且能稳定运行,提高了虚拟机性能及稳定性,从而提升客户体验。
进一步地,通过序号及虚拟机名称完成虚拟CPU资源的分配,避免人为计算,不需手动绑定,提高资源分配的准确率。
进一步地,分配完成后通过查询配置检查分配结果的正确性,进一步保障了资源分配的准确率。
图2是本申请一种实施例的虚拟机创建及CPU资源分配装置1的结构示意图。如图3所示,所述虚拟机创建及CPU资源分配装置1包括获取模块11,创建模块12及分配模块13。
获取模块11,用于获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数。
根据本申请的一种实施例,获取模块11还用于获取所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
根据本申请的一种实施例,所述配置指令还包括虚拟机名称,获取模块11还用于依据所述虚拟机名称获取所述物理CPU资源信息。
创建模块12,用于依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核。
根据本申请的一种实施例,所述配置指令还包括操作系统类型、系统盘大小,创建模块12还用于依据所述虚拟机名称、所述系统盘大小创建虚拟磁盘,并安装所述操作系统类型的操作系统。
分配模块13,用于将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
根据本申请的一种实施例,分配模块13还用于依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。
根据本申请的一种实施例,所述虚拟CPU包括第一虚拟CPU、第二虚拟CPU,所述物理CPU包括第一物理CPU、第二物理CPU,所述第一虚拟CPU对应的所述第一物理CPU,所述第二虚拟CPU对应的所述第二物理CPU,分配模块13还用于若所述第一物理CPU中至少有一个所述空闲逻辑核的所述序号与所述第二物理CPU中至少有一个所述空闲逻辑核的所述序号相同,则依据所述虚拟机名称为所述第一虚拟CPU、所述第二虚拟CPU分别分配所述第一物理CPU、所述第二物理CPU中的所述序号的所述空闲逻辑核。
根据本申请的一种实施例,分配模块13还用于依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
可以理解的是,上述装置的各模块实现各功能的具体方式可参阅上述实施例对应的具体步骤,故在此不作赘述。
请参阅图3,图3是本申请一种实施例的虚拟机创建及CPU资源分配设备30的结构示意图。如图3所示,所述虚拟机创建及CPU资源分配设备30包括处理器32、与所述处理器32耦接的存储器31,其中,所述存储器31中存储有计算机可读指令,所述计算机可读指令被所述处理器32执行时实现以下步骤:获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
根据本申请的一种实施例,所述虚拟机创建及CPU资源分配方法还包括:获取所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
根据本申请的一种实施例,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。根据本申请的一种实施例,所述配置指令还包括虚拟机名称,所述获取所述物理CPU资源信息,包括:依据所述虚拟机名称获取所述物理CPU资源信息。
根据本申请的一种实施例,所述虚拟CPU包括第一虚拟CPU、第二虚拟CPU,所述物理CPU包括第一物理CPU、第二物理CPU,所述第一虚拟CPU对应的所述第一物理CPU,所述第二虚拟CPU对应的所述第二物理CPU,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:若所述第一物理CPU中至少有一个所述空闲逻辑核的所述序号与所述第二物理CPU中至少有一个所述空闲逻辑核的所述序号相同,则依据所述虚拟机名称为所述第一虚拟CPU、所述第二虚拟CPU分别分配所述第一物理CPU、所述第二物理CPU中的所述序号的所述空闲逻辑核。
根据本申请的一种实施例,所述配置指令还包括操作系统类型、系统盘大小,所述依据所述配置指令创建所述虚拟机,包括:依据所述虚拟机名称、所述系统盘大小创建虚拟磁盘,并安装所述操作系统类型的操作系统。
根据本申请的一种实施例,所述虚拟机创建及CPU资源分配方法还包括:依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
请参阅图4,图4是本申请一种实施例的存储介质的结构示意图。如图4所示存储有计算机可读指令41的存储介质,该计算机可读指令41被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
根据本申请的一种实施例,所述虚拟机创建及CPU资源分配方法还包括:获取所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
根据本申请的一种实施例,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。根据本申请的一种实施例,所述配置指令还包括虚拟机名称,所述获取所述物理CPU资源信息,包括:依据所述虚拟机名称获取所述物理CPU资源信息。
根据本申请的一种实施例,所述虚拟CPU包括第一虚拟CPU、第二虚拟CPU,所述物理CPU包括第一物理CPU、第二物理CPU,所述第一虚拟CPU对应的所述第一物理CPU,所述第二虚拟CPU对应的所述第二物理CPU,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:若所述第一物理CPU中至少有一个所述空闲逻辑核的所述序号与所述第二物理CPU中至少有一个所述空闲逻辑核的所述序号相同,则依据所述虚拟机名称为所述第一虚拟CPU、所述第二虚拟CPU分别分配所述第一物理CPU、所述第二物理CPU中的所述序号的所述空闲逻辑核。
根据本申请的一种实施例,所述配置指令还包括操作系统类型、系统盘大小,所述依据所述配置指令创建所述虚拟机,包括:依据所述虚拟机名称、所述系统盘大小创建虚拟磁盘,并安装所述操作系统类型的操作系统。
根据本申请的一种实施例,所述虚拟机创建及CPU资源分配方法还包括:依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可以是非易失性,也可以是易失性,存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

1、一种虚拟机创建及CPU资源分配方法,其中,所述虚拟机创建及CPU资源分配方法包括:
获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及
将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
2、根据权利要求1所述虚拟机创建及CPU资源分配方法,其中,所述虚拟机创建及CPU资源分配方法还包括:
获取所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
3、根据权利要求2所述虚拟机创建及CPU资源分配方法,其中,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:
依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。
4、根据权利要求2所述虚拟机创建及CPU资源分配方法,其中,所述配置指令还包括虚拟机名称,所述获取所述物理CPU资源信息,包括:
依据所述虚拟机名称获取所述物理CPU资源信息。
5、根据权利要求4所述虚拟机创建及CPU资源分配方法,其中,所述虚拟CPU包括第一虚拟CPU、第二虚拟CPU,所述物理CPU包括第一物理CPU、第二物理CPU,所述第一虚拟CPU对应的所述第一物理CPU,所述第二虚拟CPU对应的所述第二物理CPU,
所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:
若所述第一物理CPU中至少有一个所述空闲逻辑核的所述序号与所述第二物理CPU中至少有一个所述空闲逻辑核的所述序号相同,则依据所述虚拟机名称为所述第一虚拟CPU、所述第二虚拟CPU分别分配所述第一物理CPU、所述第二物理CPU中的所述序号的所述空闲逻辑核。
6、根据权利要求4所述虚拟机创建及CPU资源分配方法,其中,所述配置指令还包括操作系统类型、系统盘大小,所述依据所述配置指令创建所述虚拟机,包括:
依据所述虚拟机名称、所述系统盘大小创建虚拟磁盘,并安装所述操作系统类型的操作系统。
7、根据权利要求2所述虚拟机创建及CPU资源分配方法,其中,所述虚拟机创建及CPU资源分配方法还包括:
依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;
对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,
若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
8、一种虚拟机创建及CPU资源分配装置,其中,包括:
获取模块,用于获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
创建模块,用于依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;
分配模块,用于将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
9、一种虚拟机创建及CPU资源分配设备,其中,所述虚拟机创建及CPU资源分配设备包括处理器、与所述处理器耦接的存储器,其中,
所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及
将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
10、根据权利要求9所述虚拟机创建及CPU资源分配设备,其中,所述步骤还包括:
获取所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
11、根据权利要求10所述虚拟机创建及CPU资源分配设备,其中,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:
依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。
12、根据权利要求10所述虚拟机创建及CPU资源分配设备,其中,所述配置指令还包括虚拟机名称,所述获取所述物理CPU资源信息,包括:
依据所述虚拟机名称获取所述物理CPU资源信息。
13、根据权利要求12所述虚拟机创建及CPU资源分配设备,其中,所述虚拟CPU包括第一虚拟CPU、第二虚拟CPU,所述物理CPU包括第一物理CPU、第二物理CPU,所述第一虚拟CPU对应的所述第一物理CPU,所述第二虚拟CPU对应的所述第二物理CPU,
所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:
若所述第一物理CPU中至少有一个所述空闲逻辑核的所述序号与所述第二物理CPU中至少有一个所述空闲逻辑核的所述序号相同,则依据所述虚拟机名称为所述第一虚拟CPU、所述第二虚拟CPU分别分配所述第一物理CPU、所述第二物理CPU中的所述序号的所述空闲逻辑核。
14、根据权利要求12所述虚拟机创建及CPU资源分配设备,其中,所述配置指令还包括操作系统类型、系统盘大小,所述依据所述配置指令创建所述虚拟机,包括:
依据所述虚拟机名称、所述系统盘大小创建虚拟磁盘,并安装所述操作系统类型的操作系统。
15、根据权利要求10所述虚拟机创建及CPU资源分配设备,其中,所述步骤还包括:
依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;
对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,
若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
16、一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
获取用户创建虚拟机的配置指令,所述配置指令包括虚拟CPU的配置个数;
依据所述配置指令创建虚拟机,使所述虚拟机包括所述配置个数的所述虚拟CPU,并为每个所述虚拟CPU分配对应的物理CPU,所述物理CPU包括空闲逻辑核;以及
将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU。
17、根据权利要求16所述存储介质,其中,所述步骤还包括:
获取所述物理CPU资源信息,所述资源信息包括所述空闲逻辑核的序号。
18、根据权利要求17所述存储介质,其中,所述将所述物理CPU的至少一个所述空闲逻辑核分配给对应的所述虚拟CPU,包括:
依据所述物理CPU资源信息,随机从所述序号中选择所述空闲逻辑核分配给对应的所述虚拟CPU。
19、根据权利要求17所述存储介质,其中,所述配置指令还包括虚拟机名称,所述获取所述物理CPU资源信息,包括:
依据所述虚拟机名称获取所述物理CPU资源信息。
20、根据权利要求17所述存储介质,其中,所述步骤还包括:
依据所述虚拟机名称查询所述虚拟CPU分配结果,所述分配结果包括所述虚拟CPU分配的所述物理CPU及其对应的所述空闲逻辑核;
对比分配后的所述空闲逻辑核的所述序号与分配的所述空闲逻辑核的所述序号是否一致,
若一致,则所述分配结果正确,则完成所述虚拟CPU分配。
PCT/CN2020/123210 2020-07-20 2020-10-23 虚拟机创建及cpu资源分配方法、装置、设备 WO2021120841A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010697534.X 2020-07-20
CN202010697534.XA CN111831398A (zh) 2020-07-20 2020-07-20 虚拟机创建及cpu资源分配方法、装置、设备

Publications (1)

Publication Number Publication Date
WO2021120841A1 true WO2021120841A1 (zh) 2021-06-24

Family

ID=72922980

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/123210 WO2021120841A1 (zh) 2020-07-20 2020-10-23 虚拟机创建及cpu资源分配方法、装置、设备

Country Status (2)

Country Link
CN (1) CN111831398A (zh)
WO (1) WO2021120841A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102317917A (zh) * 2011-06-30 2012-01-11 华为技术有限公司 热点域虚拟机cpu调度方法及虚拟机系统
US9703589B2 (en) * 2013-08-26 2017-07-11 Vmware, Inc. Networking stack of virtualization software configured to support latency sensitive virtual machines
CN108255598A (zh) * 2016-12-28 2018-07-06 华耀(中国)科技有限公司 性能保证的虚拟化管理平台资源分配系统及方法
CN110990114A (zh) * 2019-11-08 2020-04-10 浪潮电子信息产业股份有限公司 一种虚拟机资源分配方法、装置、设备及可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270159B (zh) * 2011-08-11 2013-02-27 浙江大学 一种虚拟化环境中的准入控制与负载均衡方法
JP6511025B2 (ja) * 2016-09-02 2019-05-08 日本電信電話株式会社 リソース割当装置、リソース割当方法およびリソース割当プログラム
JP6958414B2 (ja) * 2018-02-19 2021-11-02 日本電信電話株式会社 仮想リソース管理装置、仮想リソース割り当て方法、仮想リソース割り当てプログラム、および、仮想リソース管理システム
CN111104219A (zh) * 2019-11-30 2020-05-05 北京浪潮数据技术有限公司 虚拟核心与物理核心的绑定方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102317917A (zh) * 2011-06-30 2012-01-11 华为技术有限公司 热点域虚拟机cpu调度方法及虚拟机系统
US9703589B2 (en) * 2013-08-26 2017-07-11 Vmware, Inc. Networking stack of virtualization software configured to support latency sensitive virtual machines
CN108255598A (zh) * 2016-12-28 2018-07-06 华耀(中国)科技有限公司 性能保证的虚拟化管理平台资源分配系统及方法
CN110990114A (zh) * 2019-11-08 2020-04-10 浪潮电子信息产业股份有限公司 一种虚拟机资源分配方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN111831398A (zh) 2020-10-27

Similar Documents

Publication Publication Date Title
US11340803B2 (en) Method for configuring resources, electronic device and computer program product
EP3425502B1 (en) Task scheduling method and device
US9110697B2 (en) Sending tasks between virtual machines based on expiration times
US8904386B2 (en) Running a plurality of instances of an application
CN103970520A (zh) MapReduce架构中的资源管理方法、装置和架构系统
WO2019227715A1 (zh) 数据处理方法、装置及计算机可读存储介质
US10810220B2 (en) Platform and software framework for data intensive applications in the cloud
CN110971700B (zh) 分布式锁的实现方法及装置
WO2020125396A1 (zh) 一种共享数据的处理方法、装置及服务器
US10437645B2 (en) Scheduling of micro-service instances
WO2023000673A1 (zh) 硬件加速器设备管理方法、装置及电子设备和存储介质
WO2018107945A1 (zh) 一种实现硬件资源分配的方法、装置及存储介质
US20240061712A1 (en) Method, apparatus, and system for creating training task on ai training platform, and medium
CN115280283A (zh) 在kubernets中运行pbs作业
CN112131208A (zh) 全量数据迁移方法、装置、设备及计算机可读存储介质
CN112650541B (zh) 一种应用程序启动加速方法、系统、设备及存储介质
US20200371827A1 (en) Method, Apparatus, Device and Medium for Processing Data
CN105677481B (zh) 一种数据处理方法、系统及电子设备
WO2022105295A1 (zh) 基于nGraph的GPU后端分布式训练方法和系统
CN110580195A (zh) 一种基于内存热插拔的内存分配方法和装置
WO2021120843A1 (zh) 云主机内存分配方法及云主机、设备及存储介质
CN117076096A (zh) 任务流程的执行方法、装置、计算机可读介质及电子设备
US20230171179A1 (en) Method for testing pressure, electronic device and storage medium
WO2021120841A1 (zh) 虚拟机创建及cpu资源分配方法、装置、设备
CN112506655B (zh) 一种绘图方法、存储介质及应用服务器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20901422

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20901422

Country of ref document: EP

Kind code of ref document: A1