CN108228315A - virtual machine command line management method and device - Google Patents
virtual machine command line management method and device Download PDFInfo
- Publication number
- CN108228315A CN108228315A CN201711273672.XA CN201711273672A CN108228315A CN 108228315 A CN108228315 A CN 108228315A CN 201711273672 A CN201711273672 A CN 201711273672A CN 108228315 A CN108228315 A CN 108228315A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- order line
- machine
- virtual
- status 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
Abstract
A kind of virtual machine command line management method and tool, including:Receive the order line of input;Obtain the status information of virtual machine that the order line specifies and respective physical machine;Judge the virtual machine whether in the desired state of the order line according to the status information:It is that then calling system function library performs the virtual machine operation corresponding to the order line.Using this method system manager at any time using h can obtain every order in detail parsing, operating personnel can a key initialization physical machine, physical machine is added in into resource pool, simplifies operation, reduces operation maintenance personnel workload.
Description
Technical field
The present invention relates to computer software technical field, more particularly to a kind of order line management tool.
Background technology
Virtual machine technique is to build the support technology of cloud platform server, is built by installing virtual machine in physical machine
Cloud platform.But cloud platform and libvirt component, existing manager are relied on the life cycle management of virtual machine mostly at present
Method comes with some shortcomings, such as:Operation maintenance personnel is often unfamiliar with the Product Logic of developer institute development system, once cloud platform goes out
Virtual resource life cycle can not quickly be managed under recovery situation by breaking down in the existing short time, basic resource friendship
Paying timeliness reduces;Management separate unit physical machine is more likely to the libvirt components that resources of virtual machine is managed, is not entered uniformly
Virtual resource in all hardware equipment in the unified cluster of mouth management.
Invention content
In view of drawbacks described above of the prior art or deficiency, are intended to provide a kind of convenient, efficient, stable Virtual Machine Manager
Method.
In a first aspect, the embodiment of the present application provides a kind of virtual machine command line management method, including:Receive the life of input
Enable row;Obtain the status information of virtual machine that the order line specifies and respective physical machine;Institute is judged according to the status information
Virtual machine is stated whether in the desired state of the order line:It is that then calling system function library performs correspondence to the virtual machine
In the operation of the order line.
Second aspect, the embodiment of the present application provide a kind of virtual machine order line managing device, including:Order receives single
Member is configured to receive the order line of input;Information acquisition unit, be configured to obtain virtual machine that the order line specifies and
The status information of respective physical machine;State matching unit is configured to whether judge the virtual machine according to the status information
In the desired state of the order line;Command executing unit is configured to calling system function library and the virtual machine is performed
Corresponding to the operation of the order line.Virtual machine processing unit, be configured to order line call libvirt to virtual machine at
Reason.
Virtual machine command line management method and tool provided by the embodiments of the present application are by searching for database table and tcp agreements
It connects libvirt and obtains virtual machine state information, and further libvirt is called to be managed virtual machine by order line.It presses
According to the technical solution of the embodiment of the present application, system manager can not depend on large-scale cloud platform system, directly by linux orders
Row management tool can be managed virtual machine life cycle, meanwhile, it also solves large-scale cloud platform and manages object using agent
It is unstable caused by reason machine, be not suitable for small-sized cluster management the problem of and software operation readability problem, system manager
At any time use-h can obtain every order in detail parsing, operating personnel can a key initialization physical machine, by physical machine add in provide
Source pond simplifies operation, reduces operation maintenance personnel workload.
Description of the drawings
Fig. 1 obtains (vminfo) realization principle figure for virtual machine information;
Fig. 2 is virtual machine booting (start) realization principle figure;
Fig. 3 is virtual machine shutdown (stop) realization principle figure;
Fig. 4 obtains (vnc_address) realization principle figure for virtual machine vnc addresses;
Fig. 5 is virutal machine memory size modification (vmemchange) realization principle figure;
Fig. 6 changes (vcpuchange) realization principle figure for cpu number of virtual machine;
Fig. 7 is virtual hard disk size modification (vcpuchange) realization principle figure;
Fig. 8 deletes (vmdel) realization principle figure for virtual machine;
Fig. 9 is virtual machine (vm) migration (migrate) realization principle figure.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, illustrated only in attached drawing with inventing relevant part.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Really as stated in the Background Art, existing virtual machine management method relies on cloud platform mostly, and event once occurs in cloud platform
Barrier, operating personnel can not be managed virtual resource life cycle, and basic resource is delivered timeliness and reduced, serious or even cause
File is lost, and this management method operating procedure is numerous and diverse, time-consuming and laborious.
In view of the drawbacks described above of the prior art, the embodiment of the present application provides a kind of virtual machine order line Managed Solution.It is logical
It crosses searching data library table and libvirt acquisition virtual machine state informations is connected with tcp agreements, judge virtual machine state information and request
Whether corresponding preset state matches, and further libvirt is called to ask virtual machine according to user by order line if matching
It is managed, so as to be efficiently managed to virtual machine.The method that the embodiment of the present application is described below in conjunction with flow chart.
With reference to figure 1, it illustrates obtain realization principle figure according to the virtual machine information of the application one embodiment.
As shown in Figure 1, virtual machine information acquisition includes the following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine uuid, virtual machine state, resources of virtual machine information are obtained with list shape using tcp connections libvirt
Formula returns to user.
Fig. 2 shows virtual machine booting realization principle figures.As shown in Fig. 2, virtual machine booting includes the following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in off-mode, just allows order line tune
Virtual machine is opened with libvirt;
S4, virtual machine start-up operation result is returned into user with tabular form.
Fig. 3 shows virtual machine shutdown realization principle figure.As shown in figure 3, virtual machine shutdown includes the following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in open state, just allows order line tune
Virtual machine is closed with libvirt;
S4, virtual machine shutoff operation result is returned into user with tabular form.
Fig. 4 shows that virtual machine vnc addresses obtain realization principle figure.As shown in figure 4, virtual machine vnc address acquiring methods
Include the following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in open state, just allows order line tune
Virtual machine vnc ports are obtained with libvirt;
S4, virtual machine vnc addresses are added port return to user with tabular form.
Fig. 5 shows virutal machine memory size modification realization principle figure.As shown in figure 5, virutal machine memory modification include with
Lower step:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in off-mode, just allows order line tune
Virutal machine memory size is changed with libvirt;
S4, judge that user inputs whether memory is less than current memory, is not continue to execute, otherwise continues S5;
S5, memory size in libvirt modification virtual machine configurations is called, it is big updates the data virutal machine memory in library
It is small;
S6, user's operation result is returned.
Fig. 6 shows cpu number modification realization principle figure of virtual machine.As shown in fig. 6, cpu number modification of virtual machine includes
Following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in booting or off-mode, just to be allowed
Order line calls libvirt modification cpu number of virtual machine;
S4, judge that user inputs whether cpu number is equal to current cpu number, equal to not continuing to execute then, otherwise continues
S5;
S5, cpu number in libvirt modification virtual machine configurations is called, updates the data cpu number of virtual machine in library;
S6, user's operation result is returned.
Fig. 7 shows virtual hard disk size modification realization principle figure.As shown in fig. 7, virtual hard disk size modification packet
Include following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in open state, just allows order line tune
Magnetic disk of virtual machine size is changed with libvirt;
S4, judge that user inputs whether disk size is empty or less than existing size, be not continue to execute, otherwise after
Continuous S5;
S5, libvirt dilatations magnetic disk of virtual machine is called to update the data magnetic disk of virtual machine size in library to specified size;
S6, user's operation result is returned.
Fig. 8 shows that virtual machine deletes realization principle figure.As shown in figure 8, virtual machine deletion includes the following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, virtual machine state is obtained using tcp connections libvirt, virtual machine, which is in off-mode, just allows order line tune
Virtual machine is deleted with libvirt;
S4, judge whether virtual machine has snapshot, there is snapshot not allow to continue to S5;
S5, libvirt is called to delete each piece of hard disk of virtual machine, delete storage pool, undefined virtual machines, delete
Except virtual machine records in database;
S6, user's operation result is returned.
Fig. 9 shows virtual machine (vm) migration realization principle figure.As shown in figure 9, virtual machine (vm) migration includes the following steps:
S1, order line management tool can enter ginseng to user first and verify, for it is illegal enter ginseng provide friendly prompting;
S2, according to corresponding to virtual machine title, place physical machine ip in virtual machine ip searching datas library input by user;
S3, judge that user inputs purpose physical machine ip whether as physical machine ip where current virtual machine, be to reply
The friendly prompting of failure, otherwise to S4;
S4, judge that purpose physical machine whether there is using libvirt, be to continue to S5;
S5, judge whether virtual machine virtual machine has mirror image, otherwise libvirt is called to perform live migration of virtual machine, migrated
After in the physical machine of source undefined virtual machines;
S6, user's operation result is returned.
Claims (7)
1. a kind of virtual machine command line management method, which is characterized in that the method includes:
Receive the order line of input;
Obtain the status information of virtual machine that the order line specifies and respective physical machine;
Judge the virtual machine whether in the desired state of the order line according to the status information:
It is that then calling system function library performs the virtual machine operation corresponding to the order line.
2. virtual machine command line management method as described in claim 1, which is characterized in that described to virtual machine execution pair
The operation of order line described in Ying Yu includes:
Virtual machine (vm) migration judges whether target physical machine ip is consistent with physical machine ip where current virtual machine:
It is no, then judge that target physical machine whether there is by libvirt;
It is then to carry out judging whether virtual machine virtual machine has mirror image in next step:
It is no, then order line calling system function library is allowed to perform live migration of virtual machine, after the completion of migration in the physical machine of source
Undefined virtual machines.
3. virtual machine command line management method as described in claim 1, which is characterized in that described to virtual machine execution pair
The operation of order line described in Ying Yu includes:
Virtual machine is deleted, if the virtual machine state obtained is off-mode, judges whether virtual machine has snapshot:
No, then calling system function library deletes virtual machine.
4. virtual machine command line management method as described in claim 1, which is characterized in that the acquisition virtual machine and homologue
The status information of reason machine further includes:
Virtual machine title, place physical machine ip are corresponded to according in the virtual machine ip searching datas library of input;
Libvirt is connected by tcp agreements and obtains virtual machine state information.
5. virtual machine command line management method as described in claim 1, which is characterized in that described to virtual machine execution pair
The operation of order line described in Ying Yu further includes:
Order line calling system function library is allowed to obtain virtual machine vnc ports, modification virutal machine memory size, modification virtual machine
Cpu number, modification virtual hard disk size and virtual machine switching on and shutting down.
6. a kind of virtual machine order line managing device, it is characterised in that including:
Order receiving unit is configured to receive the order line of input;
Information acquisition unit is configured to obtain the status information of virtual machine that the order line specifies and respective physical machine;
Whether state matching unit is configured to judge the virtual machine in order line expectation according to the status information
State;
Command executing unit is configured to calling system function library and the behaviour for corresponding to the order line is performed to the virtual machine
Make.
7. a kind of equipment, including processor, memory and display;It is characterized in that,
The memory includes can be by instruction that the processor performs so that the processor performs:
Receive the order line of input;
Obtain the status information of virtual machine that the order line specifies and respective physical machine;
Judge the virtual machine whether in the desired state of the order line according to the status information:
It is that then calling system function library performs the virtual machine operation corresponding to the order line.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711273672.XA CN108228315A (en) | 2017-12-06 | 2017-12-06 | virtual machine command line management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711273672.XA CN108228315A (en) | 2017-12-06 | 2017-12-06 | virtual machine command line management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108228315A true CN108228315A (en) | 2018-06-29 |
Family
ID=62653859
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711273672.XA Pending CN108228315A (en) | 2017-12-06 | 2017-12-06 | virtual machine command line management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108228315A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105306225A (en) * | 2015-11-03 | 2016-02-03 | 国云科技股份有限公司 | Openstack-based physical machine remote shutdown method |
CN106126318A (en) * | 2016-07-05 | 2016-11-16 | 云南大学 | The dynamic migration method of virtual machine in a kind of Openstack cloud platform |
US20170031701A1 (en) * | 2015-07-28 | 2017-02-02 | International Business Machines Corporation | Tagging virtual machine instances based on commands |
CN106844012A (en) * | 2017-02-23 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of method and system of unshared storage dynamic migration virtual machine |
-
2017
- 2017-12-06 CN CN201711273672.XA patent/CN108228315A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170031701A1 (en) * | 2015-07-28 | 2017-02-02 | International Business Machines Corporation | Tagging virtual machine instances based on commands |
CN105306225A (en) * | 2015-11-03 | 2016-02-03 | 国云科技股份有限公司 | Openstack-based physical machine remote shutdown method |
CN106126318A (en) * | 2016-07-05 | 2016-11-16 | 云南大学 | The dynamic migration method of virtual machine in a kind of Openstack cloud platform |
CN106844012A (en) * | 2017-02-23 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of method and system of unshared storage dynamic migration virtual machine |
Non-Patent Citations (3)
Title |
---|
CHENYULANCN: ""基于libvirt的虚拟化迁移"", 《 HTTPS://BLOG.CSDN.NET/CHENYULANCN/ARTICLE/DETAILS/9012259》 * |
LIUJUNWEI1234: ""使用 libvirt创建和管理KVM虚拟机"", 《HTTP://BLOG.CHINAUNIX.NET/UID-20940095-ID-3238703.HTML》 * |
PANGBANGB: ""libvirt命令行文档"", 《HTTPS://WWW.CNBLOGS.COM/PANGBLOG/P/3285668.HTML》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210149769A1 (en) | Container-Based Application Data Protection Method and System | |
US10437617B2 (en) | Offline volume modifications | |
US20200081729A1 (en) | Virtual computing systems and methods | |
CN104541246B (en) | System and method for providing a service management engine for use in a cloud computing environment | |
US10114665B2 (en) | Communication node upgrade system and method for a communication network | |
CN107329799A (en) | A kind of fusion Docker containers and the system of KVM virtualization technology | |
WO2020019458A1 (en) | Page switching method of hybrid application, framework, computer device and storage medium | |
CN102520881A (en) | Virtual machine snapshot management method and system of cloud computing platform | |
CN104951694A (en) | Isolation method and apparatus for management virtual machine | |
CN111669284B (en) | OpenStack automatic deployment method, electronic device, storage medium and system | |
WO2018001091A1 (en) | Method and device for updating virtualized network function (vnf), and vnf packet | |
WO2024077885A1 (en) | Management method, apparatus and device for container cluster, and non-volatile readable storage medium | |
US9959157B1 (en) | Computing instance migration | |
WO2015014150A1 (en) | Method,apparatus,and application platform for updating application object attribute | |
WO2018201461A1 (en) | Method and device for migrating virtual machine and virtualization system | |
CN109740765A (en) | A kind of machine learning system building method based on Amazon server | |
CN107368353A (en) | A kind of method and apparatus for realizing virutal machine memory heat addition | |
CN112000439A (en) | Method for realizing cloud native application management virtual machine | |
WO2022199335A1 (en) | Method, apparatus and device for controlling firmware upgrade of server component, and storage medium | |
WO2016177261A1 (en) | Method and device for online upgrading module based on kernel virtual machine | |
Tang et al. | Application centric lifecycle framework in cloud | |
CN112948102B (en) | Virtual machine event processing method, device and system | |
CN114443239A (en) | Method and device for filling container | |
US10175976B1 (en) | Systems and methods for avoiding version conflict in a shared cloud management tool | |
CN108228315A (en) | virtual machine command line management method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180629 |
|
RJ01 | Rejection of invention patent application after publication |