CN111831393A - Method for managing virtual machine, server and storage medium - Google Patents

Method for managing virtual machine, server and storage medium Download PDF

Info

Publication number
CN111831393A
CN111831393A CN202010614782.3A CN202010614782A CN111831393A CN 111831393 A CN111831393 A CN 111831393A CN 202010614782 A CN202010614782 A CN 202010614782A CN 111831393 A CN111831393 A CN 111831393A
Authority
CN
China
Prior art keywords
virtual machine
physical disk
attribute information
server
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010614782.3A
Other languages
Chinese (zh)
Inventor
夏俊明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202010614782.3A priority Critical patent/CN111831393A/en
Publication of CN111831393A publication Critical patent/CN111831393A/en
Pending legal-status Critical Current

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present specification provides a method of managing virtual machines, a server and a storage medium, the method comprising: acquiring attribute information of a physical disk of a server, and creating a first virtual machine according to the attribute information so that the first virtual machine enables the physical disk in the server according to the attribute information. By the method, the physical disks on the server host can be uniformly managed, scheduled, allocated and mounted to the virtual machine for use by the cloud platform.

Description

Method for managing virtual machine, server and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method for managing a virtual machine, a server, and a storage medium.
Background
The open source OpenStack cloud management platform is widely applied to various major cloud platform manufacturers, Tencent cloud, Huazhiyun, purple light public cloud and the like, the virtual machine meets most requirements of users, and the data storage of the current virtual machine mainly comprises the following steps: the local virtual disk and the cloud hard disk provided by the virtualization layer Hypervisor are shared storage volumes, but for some clients, physical disks on a server host need to be uniformly managed, scheduled, allocated and mounted to a virtual machine by a cloud platform for use, and no corresponding solution is provided at present.
Disclosure of Invention
In order to realize that a physical disk on a server host is uniformly managed, scheduled, allocated and mounted to a virtual machine by a cloud platform for use, the specification provides a method for managing the virtual machine, a server and a storage medium.
In a first aspect, the present specification provides a method of managing virtual machines, the method comprising:
acquiring attribute information of a physical disk of a server;
and creating a first virtual machine according to the attribute information so that the first virtual machine enables the physical disk in the server according to the attribute information.
According to the embodiment, the attribute information of the physical disk of the server is obtained, and the first virtual machine is created according to the attribute information, so that the first virtual machine can enable the physical disk in the server according to the attribute information, and the physical disk in the server is managed, scheduled, allocated and mounted to the virtual machine for use through the cloud platform.
Optionally, the attribute information of the physical disk includes: the type, storage space size and quantity information of the physical disk.
Optionally, the creating a first virtual machine according to the attribute information includes:
and creating the first virtual machine, and loading the acquired attribute information into the first virtual machine in a parameter form.
Optionally, enabling, by the first virtual machine, the physical disk in the server according to the attribute information specifically includes:
and establishing physical disk read-write path information according to the attribute information so that the first virtual machine enables the physical disk in the server according to the physical disk read-write path information.
Optionally, receiving a notice of destroying the virtual machine;
determining a virtual machine to be destroyed according to the virtual machine destruction notification, acquiring physical disk read-write path information in the virtual machine to be destroyed, determining a physical disk enabled by the first virtual machine according to the physical disk read-write path information, and recovering the physical disk.
It can be seen from the foregoing embodiments that, by the method provided in this specification, when a virtual machine is destroyed, a physical disk allocated to the destroyed virtual machine can be recovered, and further, by the method provided in this specification, a physical disk in a server can be managed, scheduled, allocated, and mounted to the virtual machine for use by a cloud platform, and a physical disk allocated and mounted to the virtual machine can be recovered.
In a second aspect, the present specification further provides a server running a cloud computing management platform with an OpenStack open source, where the OpenStack includes: the Hypervisor virtual machine monitoring manager and the Nova operation component, wherein the method comprises the following steps:
the OpenStack enabled virtual machine creates an instruction;
the Hypervisor acquires the attribute information of the disk of the server;
and the Nova loads the attribute information into the first virtual machine in a parameter mode according to the attribute information acquired by the Hypervisor so that the first virtual machine enables the physical disk in the server.
It can be seen from the above embodiments that, a server running the method provided in this specification can manage, schedule, allocate, and mount a physical disk in the server to a virtual machine for use through a cloud platform.
Optionally, the loading, by the Nova, the attribute information into the first virtual machine in a form of a parameter according to the attribute information acquired by the Hypervisor, specifically including:
the Nova acquires the attribute information of the disk of the server acquired by the Hypervisor by using the interaction information of the Restapi interface and the Hypervisor;
and establishing physical disk read-write path information according to the attribute information so that the first virtual machine enables the physical disk in the server according to the physical disk read-write path information.
Optionally, the OpenStack receives a virtual machine destruction notification;
the Nova determines the virtual machine to be destroyed according to the virtual machine destruction notification, acquires the physical disk read-write path information in the virtual machine to be destroyed, and notifies the Hypervisor to recover the physical disk corresponding to the physical disk read-write path information according to the physical disk read-write path information.
In a third aspect, the present specification also provides a server, comprising: a processor and a machine-readable storage medium; the machine-readable storage medium stores machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: implementing the method of any of the above embodiments.
In a fourth aspect, the present specification also provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing the method of any of the above embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a schematic flowchart of a method for managing a virtual machine according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the OpenStack environment, Neutron (OpenStack network service) is used to manage all VNIs (virtual network architecture), which are responsible for providing virtual network services to devices managed by OpenStack computing services.
Nova is a computing controller of OpenStack, which is used to manage the whole life cycle of a virtual machine instance and provide virtual services according to user requirements. The method is responsible for operations such as creation, startup, shutdown and migration of the virtual machine, and configures information such as a CPU (central processing unit), a memory and the like of the virtual machine.
Hypervisor provides software to manage access of virtual machines to underlying hardware, also known as virtual machine monitors, which are software, firmware, or hardware used to build and execute virtual machines. Nova itself supports multiple hypervisors.
Currently, an OpenStack cloud management platform currently provides an implementation scheme for the following virtual machine storage disks:
a. and dividing the local storage of the host into volumes by using a disk virtualization technology provided by a Hypervisor layer, and then mounting the volumes to a virtual machine for use.
b. Persistent storage is added to the virtual machine through an OpenStack block storage service (shader), the shader component provides special volume management of shared storage for the infrastructure, and functions of mounting and dismounting disks are provided for the virtual machine through interaction with Nova.
In the overall framework of the OpenStack cloud management platform, the creation and management of the VM are completed by interaction of Nova and a render component.
However, the management scheme of local volumes and cloud hard disks provided by circle and Nova can cover the storage disk requirements of virtual machines of most customers. However, for some clients who need a virtual machine to monopolize a certain bare disk device of a physical server, such as a big data server, the coordination of the existing circle and Nova services cannot be supported, and the unified management and scheduling cannot be performed through a cloud platform.
To solve the above technical problem, as shown in fig. 1, the present specification provides a method for managing a virtual machine, the method comprising:
s101, acquiring attribute information of a physical disk of a server.
S102, a first virtual machine is created according to the attribute information, so that the first virtual machine enables a physical disk in the server according to the attribute information.
In the present embodiment, the main body performing the method may be a server (hereinafter referred to as a first server for convenience of distinction), or a device unit having a processor and a storage medium (including a distributed processor and/or storage medium).
In step S101, a first server (device unit) may obtain, through Hypervisor, attribute information of a physical disk in the server (in other embodiments, may obtain other servers connected to the server), where the physical disk may be a bare disk.
The acquired attribute information of the physical disk may include: type of physical disk, size of storage space, and quantity information.
In step 102, when a first virtual machine needs to be created in the first server, the attribute information of the physical disk acquired in step S101 may be acquired to create the first virtual machine. In an embodiment, the Nova module in the OpenStack platform may be used to perform information interaction with the Hypervisor, so that the attribute information of the physical disk acquired by the Hypervisor may be obtained. For example, the format of one acquired attribute information may be as follows:
{'type':'A','size':500,'num':10}
where type represents type, size table size, and num represents number.
In this embodiment, Nova may acquire the attribute information of the plurality of physical disks in the server and store the attribute information in the computer nodes, so that Nova may call the attribute information stored in the computer nodes. It should be noted that, in this embodiment, the storage carrier of the attribute information of the physical disk acquired may be a database.
Since Nova is a computing component in OpenStack and has the capability of scheduling and managing computing resources such as virtual machines, when a first virtual machine is created through OpenStack, attribute information of a physical disk can be acquired from Hypervisor by Nova and loaded into the first virtual machine.
One way to issue the physical disk attribute information is as follows:
openstack flavor set 1*2*40--property bare_disk_type=A\
--property bare_disk_size=500--property bare_disk_num=1
the obtained attribute information can be issued to the first virtual machine in the above manner, so that the first virtual machine enables the physical disk in the server according to the attribute information.
In this embodiment, when Nova issues the attribute information to the first virtual machine, it needs to update the resources of the physical disk stored in the database, and if the virtual machine fails to be created or the attribute information fails to be issued to the first virtual machine, it needs to rollback the resources of the physical disk.
In this embodiment, a new filter may be added to perform screening according to the attribute information of each computer node, and the screening logic may be as follows:
and the types and the sizes of the physical disks are consistent, the scheduling is passed when the number of the available disks is equal to the number to be distributed to the virtual machines, and otherwise, the scheduling is failed. So as to avoid the situation of allocation error caused by insufficient physical disk resources.
In this embodiment, after the Nova issues the attribute information of the physical disk to be allocated to the virtual machine to the first virtual machine, the first virtual machine may generate the physical disk read-write path information according to the attribute information, so as to use the corresponding physical disk by using the physical disk read-write path information.
In this embodiment, when the first virtual machine needs to be destroyed, the resource of the physical disk that has been allocated to the first virtual machine needs to be recovered at the same time, specifically, when an instruction to destroy the first virtual machine is received, the read-write path information of the physical disk generated in the first virtual machine may be obtained, the physical disk that needs to be recovered is locked by the read-write path information of the physical disk, the recovery operation is implemented by formatting the locked physical disk, and the resource of the physical disk that needs to be stored in the database needs to be updated for the next use.
The present specification also provides a server running a cloud computing management platform with an OpenStack open source, where the OpenStack includes: the Hypervisor virtual machine monitoring manager and the Nova operation component, wherein the method comprises the following steps:
the OpenStack enabled virtual machine creates an instruction;
the Hypervisor acquires the attribute information of the disk of the server;
and the Nova loads the attribute information into the first virtual machine in a parameter mode according to the attribute information acquired by the Hypervisor so that the first virtual machine enables the physical disk in the server.
In this embodiment, an administrator sends an instruction to create the first virtual machine through the OpenStack platform, Nova may interact with the Hypervisor through the RestApi interface, and obtain attribute information of the physical disk in the server through the Hypervisor (as described in the foregoing embodiment, the obtained attribute information of the physical disk may be stored in the database, and the attribute information may be obtained in a data retrieving manner).
And the Nova issues the acquired attribute information to the first virtual machine, the first virtual machine establishes a physical disk according to the attribute information to obtain writing path information, and enables the corresponding physical disk according to the path information.
When OpenStack receives a virtual machine destruction notification sent by an administrator, Nova determines a virtual machine to be destroyed according to the virtual machine destruction notification, acquires physical disk read-write path information in the virtual machine to be destroyed, and notifies the Hypervisor to recover a physical disk corresponding to the physical disk read-write path information according to the physical disk read-write path information.
According to the embodiment, the attribute information of the physical disk of the server is obtained, and the first virtual machine is created according to the attribute information, so that the first virtual machine can enable the physical disk in the server according to the attribute information, the physical disk in the server is managed, scheduled, allocated and mounted to the virtual machine for use through the cloud platform, and the physical disk allocated and mounted to the virtual machine is recovered.
The present specification also provides a server comprising: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: method steps of any embodiment of the present description are implemented.
The present specification also provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: method steps of any embodiment of the present description are implemented.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (10)

1. A method of managing virtual machines, the method comprising:
acquiring attribute information of a physical disk of a server;
and creating a first virtual machine according to the attribute information so that the first virtual machine enables the physical disk in the server according to the attribute information.
2. The method of claim 1, wherein the attribute information of the physical disk comprises: the type, storage space size and quantity information of the physical disk.
3. The method of claim 1, wherein creating the first virtual machine according to the attribute information comprises:
and creating the first virtual machine, and loading the acquired attribute information into the first virtual machine in a parameter form.
4. The method according to claim 1, wherein enabling, by the first virtual machine, the physical disk in the server according to the attribute information specifically includes:
and establishing physical disk read-write path information according to the attribute information so that the first virtual machine enables the physical disk in the server according to the physical disk read-write path information.
5. The method of claim 1, further comprising:
receiving a virtual machine destruction notification;
determining a virtual machine to be destroyed according to the virtual machine destruction notification, acquiring physical disk read-write path information in the virtual machine to be destroyed, determining a physical disk enabled by the first virtual machine according to the physical disk read-write path information, and recovering the physical disk.
6. A server running a cloud computing management platform with an OpenStack open source, the OpenStack comprising: the Hypervisor virtual machine monitoring manager and the Nova operation component, wherein the method comprises the following steps:
the OpenStack enabled virtual machine creates an instruction;
the Hypervisor acquires the attribute information of the disk of the server;
and the Nova loads the attribute information into the first virtual machine in a parameter mode according to the attribute information acquired by the Hypervisor so that the first virtual machine enables the physical disk in the server.
7. The server according to claim 6, wherein the loading, by the Nova, the attribute information into the first virtual machine in a form of a parameter according to the attribute information acquired by the Hypervisor specifically includes:
the Nova acquires the attribute information of the disk of the server acquired by the Hypervisor by using the interaction information of the Restapi interface and the Hypervisor;
and establishing physical disk read-write path information according to the attribute information so that the first virtual machine enables the physical disk in the server according to the physical disk read-write path information.
8. The server according to claim 6,
the OpenStack receives a virtual machine destruction notification;
the Nova determines the virtual machine to be destroyed according to the virtual machine destruction notification, acquires the physical disk read-write path information in the virtual machine to be destroyed, and notifies the Hypervisor to recover the physical disk corresponding to the physical disk read-write path information according to the physical disk read-write path information.
9. A server, comprising: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 8.
10. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 8.
CN202010614782.3A 2020-06-30 2020-06-30 Method for managing virtual machine, server and storage medium Pending CN111831393A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010614782.3A CN111831393A (en) 2020-06-30 2020-06-30 Method for managing virtual machine, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010614782.3A CN111831393A (en) 2020-06-30 2020-06-30 Method for managing virtual machine, server and storage medium

Publications (1)

Publication Number Publication Date
CN111831393A true CN111831393A (en) 2020-10-27

Family

ID=72899567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010614782.3A Pending CN111831393A (en) 2020-06-30 2020-06-30 Method for managing virtual machine, server and storage medium

Country Status (1)

Country Link
CN (1) CN111831393A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416517A (en) * 2020-11-20 2021-02-26 北京优炫软件股份有限公司 Virtual computing organization control management system and method
CN113992630A (en) * 2021-09-10 2022-01-28 新华三大数据技术有限公司 Network resource conflict processing method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416517A (en) * 2020-11-20 2021-02-26 北京优炫软件股份有限公司 Virtual computing organization control management system and method
CN113992630A (en) * 2021-09-10 2022-01-28 新华三大数据技术有限公司 Network resource conflict processing method, device, equipment and storage medium
CN113992630B (en) * 2021-09-10 2023-08-22 新华三大数据技术有限公司 Network resource conflict processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11405274B2 (en) Managing virtual network functions
CN111488241B (en) Method and system for realizing agent-free backup and recovery operation in container arrangement platform
US11321197B2 (en) File service auto-remediation in storage systems
US20210111957A1 (en) Methods, systems and apparatus to propagate node configuration changes to services in a distributed environment
US10255095B2 (en) Temporal dynamic virtual machine policies
US9582319B2 (en) Migrating virtual machines across network separated data centers
US8756599B2 (en) Task prioritization management in a virtualized environment
US11023267B2 (en) Composite virtual machine template for virtualized computing environment
US11119829B2 (en) On-demand provisioning of customized developer environments
US20170140315A1 (en) Managing incident tickets in a cloud managed service environment
US20090210873A1 (en) Re-tasking a managed virtual machine image in a virtualization data processing system
US20190332443A1 (en) Method and system for allocating and migrating workloads across an information technology environment based on persistent memory availability
US20150067761A1 (en) Managing security and compliance of volatile systems
US10754675B2 (en) Identifying entities in a virtualization environment
US9959157B1 (en) Computing instance migration
CN111831393A (en) Method for managing virtual machine, server and storage medium
EP3786797A1 (en) Cloud resource marketplace
US11263053B2 (en) Tag assisted cloud resource identification for onboarding and application blueprint construction
US20220413902A1 (en) Partition migration with critical task prioritization
US20230229478A1 (en) On-boarding virtual infrastructure management server appliances to be managed from the cloud
US20230229477A1 (en) Upgrade of cell sites with reduced downtime in telco node cluster running containerized applications
CN112889247B (en) VNF service instantiation method and device
US20240012631A1 (en) Remediation engine for updating desired state of inventory data to be replicated across multiple software-defined data centers
KR20230014985A (en) Management apparatus for virtual graphic resource, and control method thereof

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