Computing resource scheduling method and device, equipment and storage medium

By building custom-type resources and controllers, and combining KVM and Kubernetes, we have achieved hybrid scheduling of virtual machines and containers on a single physical computer, solving the problems of high hardware overhead and slow expansion in existing technologies, and improving scheduling efficiency and security.

CN116627644BActive Publication Date: 2026-03-27OPENBAYES (TIANJIN) IT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies struggle to support the simultaneous scheduling of virtual machines and containers on a single physical computer. Virtualization technology results in high hardware overhead and slow expansion speed, while container technology falls short in terms of security and support for heterogeneous operating systems.

Method used

Build custom-type resources, and when the controller category is virtual machine, build containers containing virtual machines. Create virtual machines inside the containers using KVM instructions, and leverage Kubernetes' scalability to implement resource configuration and scheduling.

Benefits of technology

It enables the simultaneous support of hybrid scheduling of virtual machines and containers on a single physical computer, reducing hardware overhead, improving expansion speed, and supporting the operation of heterogeneous operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116627644B_ABST
    Figure CN116627644B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cloud computing, in particular to a computing resource scheduling method and device, equipment and a storage medium, the method comprises the following steps: constructing a self-defined type of resource, and constructing a corresponding controller according to the self-defined type of resource; when the category of the controller is a virtual machine, a container containing the virtual machine is constructed; according to the type corresponding to the self-defined type of resource, corresponding resource configuration is extracted, and the creation instruction of the container containing the virtual machine is rewritten, the virtual machine is scheduled, and thus a single physical computer can support mixed scheduling of virtual machines and containers simultaneously.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud computing, and particularly relates to a computing resource scheduling method and device, equipment and a storage medium. BACKGROUND

[0002] Virtualization technology is adopted to virtually divide a physical computer into virtual computers of different granularities, each virtual computer occupies a specific amount of physical resources, and the virtual computers are isolated from each other; compared with the virtualization technology, the container technology is a lighter computing resource division scheme, and in this way, the hardware performance overhead brought by the virtualization technology is effectively reduced, therefore, how to realize the mixed scheduling of virtual machines and containers on a single physical computer becomes a technical problem to be solved at present.

[0003] At present, the traditional method mainly adopts one of the virtualization technology and the container technology, the virtualization technology will generate additional hardware overhead and will be slower when fast expansion is needed; compared with the virtualization scheme, the security and independence of resources of the container technology are not as good as those of the virtualization scheme, and the container technology cannot support heterogeneous operating systems to run on the same physical machine.

[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0005] The main purpose of the present application is to provide a computing resource scheduling method, device, equipment and storage medium, which aims to solve the technical problem of realizing the mixed scheduling of virtual machines and containers on a single physical computer in the prior art.

[0006] To achieve the above purpose, the present application provides a computing resource scheduling method, which comprises the following steps:

[0007] Constructing a custom type of resource, and constructing a corresponding controller according to the custom type of resource;

[0008] When the category of the controller is a virtual machine, a container containing the virtual machine is constructed;

[0009] According to the type corresponding to the custom type of resource, the corresponding resource configuration is extracted, and the creation instruction of the container containing the virtual machine is rewritten to realize the scheduling of the virtual machine.

[0010] Optionally, the constructing a custom type of resource, and constructing a corresponding controller according to the custom type of resource comprises:

[0011] Kubernetes is taken as a container scheduling platform, and a custom type of resource is constructed through the extensibility of the container scheduling platform;

[0012] According to the custom type resource, a corresponding controller is constructed.

[0013] Optionally, when the category of the controller is a virtual machine, a container containing a virtual machine is constructed, comprising:

[0014] When the category of the controller is a virtual machine, the container is given an administrator permission to allow internal construction of a virtual machine;

[0015] According to the resources contained in the current container, a virtual machine is constructed inside the container through a kvm instruction.

[0016] Optionally, after the virtual machine is constructed inside the container through the kvm instruction according to the resources contained in the current container, the method further comprises:

[0017] A change in a BayesJob type resource is listened to;

[0018] Key information defined by the BayesJob is converted into a native component of Kubernetes, and a container created by a kvm command is called to start a virtual machine.

[0019] Optionally, after the key information defined by the BayesJob is converted into the native component of Kubernetes, and the container created by the kvm command is called to start the virtual machine, the method further comprises:

[0020] According to a preset period, a change in a BayesJob type custom resource in Kubernetes is obtained;

[0021] According to the change in the BayesJob type custom resource, lifecycle management of the BayesJob is completed.

[0022] Optionally, the method further comprises:

[0023] A virtual machine is created by calling an API of KVM;

[0024] Resource information of the virtual machine is registered in Kubernetes, and scheduling of the virtual machine is implemented by completing a scheduling process of Kubernetes.

[0025] Optionally, when the category of the controller is a virtual machine, the container containing the virtual machine is constructed, further comprising:

[0026] When the custom type of the controller is a normal container type, a normal container is constructed.

[0027] The resource information of the common container is submitted to the Kubernetes, and the common container scheduling is completed.

[0028] In addition, to achieve the above object, the application further provides a computing resource scheduling device, which comprises:

[0029] A construction module is configured to construct a resource of a custom type and construct a corresponding controller according to the resource of the custom type.

[0030] The construction module is further configured to construct a container containing a virtual machine when the category of the controller is the virtual machine.

[0031] A scheduling module is configured to extract a corresponding resource configuration according to the type corresponding to the resource of the custom type, rewrite a creation instruction of the container containing the virtual machine, and implement scheduling of the virtual machine.

[0032] In addition, to achieve the above object, the application further provides a computing resource scheduling device, which comprises a memory, a processor, and a computing resource scheduling program stored in the memory and running on the processor, and the computing resource scheduling program is configured to implement the computing resource scheduling method as described above.

[0033] In addition, to achieve the above object, the application further provides a storage medium, which stores a computing resource scheduling program, and the computing resource scheduling program is executed by a processor to implement the computing resource scheduling method as described above.

[0034] The application discloses a computing resource scheduling method, device, equipment and storage medium, and the method comprises the following steps: constructing a resource of a custom type, and constructing a corresponding controller according to the resource of the custom type; constructing a container containing a virtual machine when the category of the controller is the virtual machine; extracting a corresponding resource configuration according to the type corresponding to the resource of the custom type, rewriting a creation instruction of the container containing the virtual machine, and implementing scheduling of the virtual machine, so that the container scheduling and the virtual machine scheduling are realized at the same time, and a single physical computer can support mixed scheduling of the virtual machine and the container. BRIEF DESCRIPTION OF DRAWINGS

[0035] Figure 1 It is a hardware running environment of an embodiment scheme of the application.

[0036] Figure 2 It is a flowchart of a first embodiment of the computing resource scheduling method of the application.

[0037] Figure 3A module schematic diagram only supporting virtual machine scheduling of the computing resource scheduling method embodiment of the present application;

[0038] Figure 4 A module schematic diagram only supporting container scheduling of the computing resource scheduling method embodiment of the present application;

[0039] Figure 5 A module schematic diagram supporting hybrid scheduling of containers and virtual machines of the computing resource scheduling method embodiment of the present application;

[0040] Figure 6 A whole flow schematic diagram of the computing resource scheduling method embodiment of the present application;

[0041] Figure 7 A schematic diagram of starting a virtual machine in a created container of the computing resource scheduling method embodiment of the present application;

[0042] Figure 8 A flow schematic diagram of the second embodiment of the computing resource scheduling method of the present application;

[0043] Figure 9 A flow schematic diagram of the third embodiment of the computing resource scheduling method of the present application;

[0044] Figure 10 A functional module schematic diagram of the first embodiment of the computing resource scheduling device of the present application.

[0045] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0047] Referring to Figure 1 , Figure 1 A computing resource scheduling device structure schematic diagram of the hardware running environment related to the embodiment scheme of the present application.

[0048] As Figure 1As shown in the figure, the computing resource scheduling device can include a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection communication between the components. The user interface 1003 can include a display screen (Display), and the optional user interface 1003 can further include a standard wired interface, a wireless interface. The wired interface of the user interface 1003 can be a USB interface in the present application. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 can be a high-speed Random Access Memory (RAM) memory, or a stable Non-volatile Memory (NVM), such as a disk memory. The memory 1005 can also be an independent storage device from the aforementioned processor 1001.

[0049] Those skilled in the art can understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computing resource scheduling device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.

[0050] As Figure 1 As shown in the figure, the memory 1005, which is a computer storage medium, can include an operating system, a network communication module, a user interface module, and a computing resource scheduling program.

[0051] In Figure 1 In the computing resource scheduling device shown in the figure, the network interface 1004 is mainly used to connect a background server and communicate data with the background server; the user interface 1003 is mainly used to connect a user device; the computing resource scheduling device calls the computing resource scheduling program stored in the memory 1005 through the processor 1001, and executes the computing resource scheduling method provided by the embodiment of the present application.

[0052] Based on the above hardware structure, an embodiment of the computing resource scheduling method of the present application is proposed.

[0053] Referring to Figure 2 , Figure 2 The flowchart of the first embodiment of the computing resource scheduling method of the present application is proposed.

[0054] In the first embodiment, the computing resource scheduling method includes the following steps:

[0055] Step S10: constructing a custom type of resource, and constructing a corresponding controller according to the custom type resource.

[0056] It should be understood that the execution subject of the embodiment is a computing resource scheduling device having functions of data processing, data communication, program running, etc.

[0057] In a specific implementation, in the field of cloud computing, there are mainly two ways to sell computing resources: as shown in Figure 3 , a virtualization technology is used to virtually divide a physical computer into virtual computers of different granularities, each virtual computer occupies a specific amount of physical resources, and the virtual computers are isolated from each other. Such a way can maximize the guarantee that the virtual computers do not interfere with each other, ensuring the security and independence of the computing resources, and supporting different operating systems for each virtual computer, but the virtualization technology will generate additional hardware overhead and slower response when rapid expansion is needed. As shown in Figure 4 , a container technology is used, which is a lighter computing resource division scheme compared with the virtualization technology. On the one hand, this scheme effectively reduces the hardware performance overhead caused by the virtualization technology, and on the other hand, it is more flexible in scheduling, and can respond faster when expansion is needed, realizing second-level resource expansion. However, compared with the virtualization scheme, the resource security and independence of the container technology are not as good as those of the virtualization scheme, and it is not possible to support heterogeneous operating systems running on the same physical machine. Both schemes have their own advantages and disadvantages, have their own application scenarios, and some cloud computing platforms also provide both deployment schemes, but the "simultaneously" means that different physical computers of a cloud platform are divided, some support the container scheme, some support the virtual machine scheme, and the two scheduling schemes are not allowed to be used simultaneously on the same machine.

[0058] It should be noted that, as shown in Figure 5 , the present application supports the scheduling of virtual machines on the basis of the existing container scheduling scheme, and realizes the mixed use of the virtualization technology and the container technology for the same physical device.

[0059] Step S20: when the category of the controller is a virtual machine, a container containing the virtual machine is constructed.

[0060] It should be understood that, as shown in Figure 6 , when the custom type of the controller is a normal container type, a normal container is constructed; the resource information of the normal container is submitted to the Kubnerte, and the normal container scheduling is completed; when the category of the controller is a virtual machine, a container containing the virtual machine is constructed; according to the type corresponding to the custom type of resource, the corresponding resource configuration is extracted, and the creation instruction of the container containing the virtual machine is rewritten, so as to realize the scheduling of the virtual machine.

[0061] In a specific implementation, after the virtual machine is constructed inside the container by the kvm instruction according to the resources contained in the current container, further comprising: listening to the change of the BayesJob type resource; converting the key information defined by the BayesJob into the native component of Kubernetes, and calling the kvm command to start the virtual machine in the container created. After the conversion of the key information defined by the BayesJob into the native component of Kubernetes, and calling the kvm command to start the virtual machine in the container created, further comprising: obtaining the change of the BayesJob type custom resource in the kubernetes according to a preset period; completing the life cycle management of the BayesJob according to the change of the BayesJob type custom resource, supporting the container scheduling while realizing the virtual machine scheduling.

[0062] Step S30: Extracting the corresponding resource configuration according to the type corresponding to the custom type resource, and rewriting the creation instruction of the container containing the virtual machine to realize the scheduling of the virtual machine.

[0063] In a specific implementation, as Figure 7As shown, the custom type resource configuration BayesJob that supports containers and virtual machines at the same time in Kubernetes is configured, and the BayesJob is a custom type that supports ordinary container scheduling and virtual machine scheduling at the same time, and the configuration adopts the custom type format of Kubernetes standard. It contains the following information: 1) resource name, version number; 2) resource scheduling type, including container, virtual machine; 3) resource details, including cpu number, memory size, hard disk size; 4) the image used, such as windows server 2023; 5) the owner of the resource; 6) the scheduling state of the resource; the corresponding BayesJob controller manages the BayesJob, and in the implementation of the method, the virtual machine controller is the core component for managing virtual machines under the container process. Currently, Kubernetes supports extending its components to implement customized scheduling rules. It contains the following important components: resource listener (Monitor), which listens to changes in BayesJob type resources, and any changes will be released to other components in the form of events. Builder, when receiving the event of creating a new BayesJob by the listener, the builder will convert the key information defined by the BayesJob into the native components of Kubernetes to complete the actual scheduling work. For virtual machine type scheduling, the builder also calls the kvm command according to the resource information defined by the BayesJob to start the virtual machine in the created container. The converter (State Switcher) is responsible for the state synchronization of the corresponding native components when the state of the BayesJob changes.

[0064] In the embodiment, a custom type resource is constructed, and a corresponding controller is constructed according to the custom type resource; when the category of the controller is a virtual machine, a container containing a virtual machine is constructed; according to the type corresponding to the custom type resource, the corresponding resource configuration is extracted, and the creation instruction of the container containing the virtual machine is rewritten, the virtual machine is scheduled, so that the container scheduling is supported at the same time, and the virtual machine scheduling is realized, and the single physical computer supports the mixed scheduling of virtual machines and containers at the same time.

[0065] Reference Figure 8 , Figure 8 The flowchart of the second embodiment of the computing resource scheduling method of the present application is shown, based on the first embodiment described above Figure 2 The second embodiment of the computing resource scheduling method of the present application is proposed based on the first embodiment shown in the above

[0066] In the second embodiment, the step S20 comprises:

[0067] Step S201: When the category of the controller is a virtual machine, the container is given administrator permission to allow it to build a virtual machine internally.

[0068] It should be noted that this scheme can create a virtual computer on a physical computer. Its essence is to divide specific hardware (cpu, memory, other hardware devices) on the host computer through an application program and realize the running of an independent operating system on these hardware resources. In the virtual machine type, the container is first given administrator permission to allow it to build a virtual machine internally, and then a virtual machine is built inside the container according to the resources (number of cpus, memory size, disk capacity, other hardware devices) contained in the current container using the kvm instruction. The current container scheduling process is extended to provide an additional virtual machine scheduling process on the basis of supporting the default container scheduling. Its scheduling process is consistent with the container scheduling as much as possible, and different application programs are used in the final scheduling. When the creation request is a virtual machine, a virtual machine is created by calling the API of KVM, and then the resource information (cpu, memory, other hardware devices) of the virtual machine is registered in Kubernetes, so that the scheduling of the virtual machine through the scheduling process of Kubernetes is completed. This process first generates a container, and no modification is required at the resource scheduling level. However, the application program started inside this container is a virtual machine management program, i.e., a virtual machine is nested inside the container. The virtual machine started in this way is essentially the same as the virtual machine started in other ways, and its resource allocation is consistent with that of the container.

[0069] Step S202: According to the resources contained in the current container, a virtual machine is built inside the container through the kvm instruction.

[0070] It should be noted that, in essence, the service created by using the container technology is itself a specific program running on a physical computer. This specific application program can be a business program that provides a specific service to users, or an application program that implements a virtualization scheme, which does not have an essential difference from the container technology itself. Therefore, a virtual machine can be created inside the container through the kvm instruction to take over the resources allocated by the container.

[0071] In a specific implementation, after the key information defined by the BayesJob is converted into a native component of Kubernetes, a container is created by invoking a kvm command to start a virtual machine inside the container, and further comprising: obtaining the change of the BayesJob type custom resource in the kubernetes according to a preset period; completing the life cycle management of the BayesJob according to the change of the BayesJob type custom resource. After the controller is deployed to the kubernetes cluster, the listener periodically obtains the change of the BayesJob type custom resource in the kubernetes, and the events listened to are sent to the converter or the builder to complete the life cycle management of the BayesJob.

[0072] In the embodiment, a custom type resource is constructed, and a corresponding controller is constructed according to the custom type resource; when the category of the controller is a virtual machine, an administrator permission is given to the container to allow the construction of a virtual machine inside the container; a virtual machine is constructed inside the container by a kvm instruction according to the resource contained in the current container; corresponding resource configurations are extracted according to the type corresponding to the custom type resource, and the creation instruction of the container containing the virtual machine is rewritten, the virtual machine is scheduled, so that the container scheduling and the virtual machine scheduling are supported at the same time, and a unified scheduling framework is supported, and therefore the flexible scheduling policy of the container can still be supported.

[0073] Referring to Figure 9 , Figure 9 The flowchart of the third embodiment of the computing resource scheduling method of the present application is based on the first embodiment shown in the above Figure 2 The third embodiment of the computing resource scheduling method of the present application is proposed based on the first embodiment shown in the above

[0074] In the third embodiment, the step S10 comprises:

[0075] Step S101: Kubernetes is used as a container scheduling platform, and a custom type resource is constructed by the extensibility of the container scheduling platform.

[0076] In a specific implementation, Kubernetes is used as a container scheduling platform, and a custom type resource is constructed by the extensibility of the container scheduling platform, and the finally scheduled resource is abstracted to support both ordinary containers and virtual machines nested in the containers.

[0077] Step S102: a corresponding controller is constructed according to the custom type resource.

[0078] It needs to be explained that, for the common container type, no modification is made, and direct scheduling is performed. The corresponding controller is constructed for the custom type resource, and the common container or the container containing the virtual machine is constructed for the category provided by the custom type. Kubernetes is a container cluster management platform currently used very much, has very strong customization capability, can construct the custom type resource meeting the business requirement according to the specification, and creates the corresponding controller to meet the complex resource scheduling and resource arrangement work.

[0079] In the embodiment, Kubernetes is taken as the container scheduling platform, and the custom type resource is constructed through the expansibility of the container scheduling platform; the corresponding controller is constructed according to the custom type resource. When the category of the controller is the virtual machine, the container containing the virtual machine is constructed; the corresponding resource configuration is extracted according to the type corresponding to the custom type resource, and the creation instruction of the container containing the virtual machine is rewritten, the virtual machine is scheduled, so that the container scheduling is supported, the virtual machine scheduling is realized, the single physical computer supports the hybrid scheduling of the virtual machine and the container, and the snapshot function of the virtual machine is still supported.

[0080] In addition, the embodiment of the application further provides a storage medium, and the storage medium stores a computing resource scheduling program. When the computing resource scheduling program is executed by a processor, the steps of the computing resource scheduling method described above are implemented.

[0081] Since the storage medium can adopt the technical solutions of all the above embodiments, it at least has the beneficial effects brought by the technical solutions of the above embodiments, which will not be repeated here.

[0082] Reference Figure 10 , Figure 10 The figure is a functional module schematic diagram of the first embodiment of the computing resource scheduling device of the application.

[0083] In the first embodiment of the computing resource scheduling device of the application, the computing resource scheduling device comprises:

[0084] The construction module 10 is configured to construct the custom type resource, and construct the corresponding controller according to the custom type resource.

[0085] The construction module 10 is further configured to construct the container containing the virtual machine when the category of the controller is the virtual machine.

[0086] The scheduling module 20 is configured to extract the corresponding resource configuration according to the type corresponding to the custom type resource, and rewrite the creation instruction of the container containing the virtual machine, so as to realize the scheduling of the virtual machine.

[0087] In the embodiment, a custom type of resource is constructed, and a corresponding controller is constructed according to the custom type of resource; when the category of the controller is a virtual machine, a container containing the virtual machine is constructed; a corresponding resource configuration is extracted according to the type corresponding to the custom type of resource, and a creation instruction of the container containing the virtual machine is rewritten, virtual machine scheduling is implemented, so that container scheduling and virtual machine scheduling are supported at the same time, and a single physical computer supports hybrid scheduling of virtual machines and containers.

[0088] In an embodiment, the constructing module 10 is further configured to construct a custom type of resource, and construct a corresponding controller according to the custom type of resource, including:

[0089] Kubernetes is taken as a container scheduling platform, and a custom type of resource is constructed through the extensibility of the container scheduling platform;

[0090] The corresponding controller is constructed according to the custom type of resource.

[0091] In an embodiment, the constructing module 10 is further configured to, when the category of the controller is a virtual machine, construct a container containing the virtual machine, including:

[0092] When the category of the controller is a virtual machine, an administrator is given a permission to the container to allow the administrator to construct a virtual machine inside the container;

[0093] A virtual machine is constructed inside the container through a kvm instruction according to resources contained in the current container.

[0094] In an embodiment, the constructing module 10 is further configured to, after constructing the virtual machine inside the container through the kvm instruction according to the resources contained in the current container, further include:

[0095] Changes of a BayesJob type of resource are listened to;

[0096] Key information defined by the BayesJob is converted into a native component of Kubernetes, and a virtual machine is started in a container created by a kvm command.

[0097] In an embodiment, the scheduling module 20 is further configured to, after converting the key information defined by the BayesJob into the native component of Kubernetes and starting the virtual machine in the container created by the kvm command, further include:

[0098] Changes of a BayesJob type of custom resource in kubernetes are obtained according to a preset period;

[0099] According to the change of the BayesJob type custom resource, the life cycle management of the BayesJob is completed.

[0100] In an embodiment, the scheduling module 20 is further configured to extract a corresponding resource configuration according to a type corresponding to the custom type of resource, and rewrite a creation instruction of the container containing the virtual machine, so as to implement scheduling of the virtual machine, including:

[0101] creating the virtual machine by calling an API of KVM;

[0102] registering resource information of the virtual machine in Kubernetes, and implementing scheduling of the virtual machine by completing a scheduling process of Kubernetes.

[0103] In an embodiment, the scheduling module 20 is further configured to, when the category of the controller is a virtual machine, construct a container containing the virtual machine, and further include:

[0104] when the custom type of the controller is a normal container type, constructing a normal container;

[0105] submitting resource information of the normal container to Kubernetes, and completing scheduling of the normal container.

[0106] Other embodiments or specific implementations of the computing resource scheduling apparatus can refer to the above-mentioned method embodiments, and thus at least have all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be described here again.

[0107] It should be noted that, in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or system. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or system including the element.

[0108] The above-mentioned embodiment numbers of the application are only for description, and do not represent the advantages and disadvantages of the embodiments. In the unit claims of several devices, several of these devices can be embodied by the same hardware item. The use of the words first, second and third does not represent any order, and these words can be interpreted as names.

[0109] Those skilled in the art can clearly understand the above-mentioned example method can be realized by means of software and the necessary general hardware platform, of course, also can be through hardware, but in many cases the former is a better implementation. Based on such understanding, the technical solutions of the present application essentially or say the part of the prior art contribution can be embodied in the form of software products, the computer software product is stored in a storage medium (such as read only memory image (Read Only Memory image, ROM) / random access memory (Random Access Memory, RAM), disk, optical disk), including a number of instructions to make a terminal device (may be a mobile phone, computer, server, or network equipment, etc.) executes the method described in various embodiments of the present application.

[0110] The above is only the preferred embodiment of the present application, not therefore limit the patent scope of the present application, any equivalent structure or equivalent flow transformation using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for scheduling computing resources, characterized in that, The method includes the following steps: Construct a resource of a custom type, and construct a corresponding controller based on the custom type resource; When the controller is classified as a virtual machine, a container containing the virtual machine is constructed; Extract the corresponding resource configuration according to the type of the custom type of resource, and rewrite the creation instruction of the container containing the virtual machine to realize the scheduling of the virtual machine; When the controller is classified as a virtual machine, constructing a container containing the virtual machine includes: When the controller is classified as a virtual machine, the container is granted administrator privileges to allow the construction of virtual machines within it. Based on the resources contained in the current container, a virtual machine is built inside the container using KVM instructions; After building a virtual machine inside the container using KVM instructions based on the resources contained in the current container, the process also includes: Monitor changes to BayesJob type resources; The key information defined by BayesJob is converted into native Kubernetes components, and virtual machines are started in containers created by calling kvm commands. The process of converting the key information defined by BayesJob into native Kubernetes components and then starting a virtual machine within a container created by calling the kvm command also includes: Get the changes of custom resources of type BayesJob in Kubernetes according to a preset period; Complete the lifecycle management of BayesJob based on the changes in custom resources of the BayesJob type; The step of extracting the corresponding resource configuration based on the type of the custom resource and rewriting the creation instructions of the container containing the virtual machine to achieve virtual machine scheduling includes: Create virtual machines by calling KVM's API; The resource information of the virtual machine is registered in Kubernetes, and the virtual machine is scheduled by completing the Kubernetes scheduling process. When the controller is classified as a virtual machine, constructing a container containing the virtual machine further includes: When the custom type of the controller is a normal container type, construct a normal container; The resource information of the ordinary container is submitted to Kubernetes to complete the scheduling of the ordinary container.

2. The method as described in claim 1, characterized in that, The process of constructing custom-type resources and building corresponding controllers based on these custom-type resources includes: Use Kubernetes as a container scheduling platform, and leverage the extensibility of the container scheduling platform to build custom types of resources; Build the corresponding controller based on the custom type resource.

3. A computing resource scheduling device, characterized in that, The computing resource scheduling device includes: The building module is used to build custom-type resources and build corresponding controllers based on the custom-type resources; The building module is also configured to build a container containing virtual machines when the controller is classified as a virtual machine; The building module is also used to grant administrator privileges to containers to allow the building of virtual machines inside them when the controller is classified as a virtual machine; Based on the resources contained in the current container, a virtual machine is built inside the container using KVM instructions; The building module is also used to build a normal container when the custom type of the controller is a normal container type; The resource information of the ordinary container is submitted to Kubernetes to complete the scheduling of the ordinary container; The building module is also used to monitor changes in BayesJob type resources; The key information defined by BayesJob is converted into native Kubernetes components, and virtual machines are started in containers created by calling kvm commands. The building module is also used to obtain the changes of BayesJob type custom resources in Kubernetes according to a preset period; Complete the lifecycle management of BayesJob based on the changes in custom resources of the BayesJob type; The scheduling module is used to extract the corresponding resource configuration according to the type of the custom type of resource, and rewrite the creation instruction of the container containing the virtual machine to realize the scheduling of the virtual machine. The step of extracting the corresponding resource configuration based on the type of the custom resource and rewriting the creation instructions of the container containing the virtual machine to achieve virtual machine scheduling includes: Create virtual machines by calling KVM's API; The virtual machine's resource information is registered in Kubernetes, and the virtual machine is scheduled by completing the Kubernetes scheduling process.

4. A computing resource scheduling device, characterized in that, The computing resource scheduling device includes a memory, a processor, and a computing resource scheduling program stored in the memory and executable on the processor. When the computing resource scheduling program is executed by the processor, it implements the computing resource scheduling method as described in any one of claims 1 to 2.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computing resource scheduler, which, when executed by a processor, implements the computing resource scheduling method as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Method for realizing management of virtual machine by cloud native application

    CN112000439A