CN105162667B - Virtual machine configuration method and apparatus - Google Patents

Virtual machine configuration method and apparatus Download PDF

Info

Publication number
CN105162667B
CN105162667B CN201510574908.8A CN201510574908A CN105162667B CN 105162667 B CN105162667 B CN 105162667B CN 201510574908 A CN201510574908 A CN 201510574908A CN 105162667 B CN105162667 B CN 105162667B
Authority
CN
China
Prior art keywords
virtual machine
configuration
host
file
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.)
Active
Application number
CN201510574908.8A
Other languages
Chinese (zh)
Other versions
CN105162667A (en
Inventor
高君华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huawei Cloud Computing Technology Co ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510574908.8A priority Critical patent/CN105162667B/en
Publication of CN105162667A publication Critical patent/CN105162667A/en
Application granted granted Critical
Publication of CN105162667B publication Critical patent/CN105162667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

An embodiment of the present invention provides a kind of virtual machine configuration method and apparatus, are related to virtual machine technique field, the method includes:The configuration information that receiving host is sent by destinations traffic channel, the destinations traffic channel are all purpose communication channel between the virtual machine driving in the host and virtual machine;The configuration information is what virtual machine management system was sent to the host, the information forwarded from the host to virtual machine driving;The virtual machine driving configures virtual machine according to the configuration information.The problem of avoiding and the ad hoc virtual serial port equipment and serial ports for virtual machine configuration in virtual machine needed to monitor service in the prior art, and then wasting the serial port resource of virtual machine;Existing all purpose communication channel between host and virtual machine driving can be multiplexed by having reached, and into without doing special adaptations to virtual machine, save the effect of the serial port resource consumed needed for virtual machine.

Description

Virtual machine configuration method and apparatus
Technical field
The present invention relates to virtual machine technique field, more particularly to a kind of virtual machine configuration method and apparatus.
Background technology
Virtual machine is the complete computer system that simulation obtains in host (computer being physically present).Virtual machine Configuration information be typically by user during virtual machine is installed using compact disc image files (ISO) manual configuration, or It is specified when creating virtual machine template in virtual machine management system by user.Largely match again however, existing in practical application Set the demand of the configuration information of virtual machine.
A kind of existing virtual machine configuration method includes:Virtual machine management system is instructed ad hoc into virtual machine by serial ports Virtual serial port equipment send configuration information, service monitored by ad hoc serial ports listen to virtual serial port equipment in virtual machine and connect After the configuration information of receipts, virtual machine is configured according to configuration information.
Said program needs the ad hoc virtual serial port equipment and serial ports for virtual machine configuration in virtual machine to monitor service, Consume the serial port resource of virtual machine.
Invention content
An embodiment of the present invention provides a kind of virtual machine configuration method and apparatus, need to expend in the prior art for solving The problem of serial port resource of virtual machine.The technical solution is as follows:
In a first aspect, providing a kind of virtual machine configuration method, which is characterized in that the method includes:
The configuration information that receiving host is sent by destinations traffic channel, the destinations traffic channel are the host and void The all purpose communication channel between virtual machine driving in quasi- machine;The configuration information is that virtual machine management system is sent out to the host It send, the information forwarded from the host to virtual machine driving;
The virtual machine is configured according to the configuration information.
In the first possible realization method of first aspect, the receiving host is sent by destinations traffic channel Configuration information, including:
The interrupt signal that the host is sent is received, the interrupt signal is that the host is stored by the configuration information To the rear information sent to virtual machine driving in the destinations traffic channel, the interrupt signal is for indicating the mesh The signal of new information is stored in mark communication port;
Read the configuration information stored in the destinations traffic channel.
In second of possible realization method of first aspect, the configuration information includes the file of configuration script file Mark and configuration parameter;
It is described that the virtual machine is configured according to the configuration information, including:
Obtain the configuration script file corresponding to the file identification;
The virtual machine is configured according to the configuration script file and the configuration parameter.
Second of possible realization method with reference to first aspect, in the third possible realization method, the basis Before the configuration script file and the configuration parameter configure the virtual machine, the method further includes:
Generate the document of the configuration script file got;
Detect generate the document whether the text with the configuration script file carried in the configuration information Part abstract is consistent;
If consistent, execute it is described according to the configuration script file and the configuration parameter to virtual machine progress The operation of configuration.
Second of possible realization method with reference to first aspect, in the 4th kind of possible realization method, the acquisition Configuration script file corresponding to the file identification, including:
The configuration script file corresponding to the file identification is inquired under the predetermined directory of the virtual machine, it is described Predetermined directory is the storage catalogue for each file for allowing to be called by third party.
Second of possible realization method, the third possible realization method or the 4th kind of possibility with reference to first aspect Realization method, in the 5th kind of possible realization method, the method further includes:
Receive the more new command for updating the configuration script file;
The configuration script file is updated according to the more new command.
Second aspect provides a kind of virtual machine configuration device, which is characterized in that described device includes:
Information receiving module, for the configuration information that receiving host is sent by destinations traffic channel, the destinations traffic Channel is all purpose communication channel between the virtual machine driving in the host and virtual machine;The configuration information is virtual machine pipe Reason system is sent to the host, the information forwarded from the host to virtual machine driving;
Configuration module, the configuration information for being received according to described information receiving module carry out the virtual machine Configuration.
In the first possible realization method of second aspect, described information receiving module, including:
Signal receiving unit, the interrupt signal sent for receiving the host, the interrupt signal are that the host exists The configuration information is stored to the rear information sent to virtual machine driving in the destinations traffic channel, the interruption letter Number for signal for indicating to be stored with new information in the destinations traffic channel;
Information reading unit, for reading the configuration information stored in the destinations traffic channel.
In second of possible realization method of second aspect, the configuration information includes the file of configuration script file Mark and configuration parameter;
The configuration module, including:
Acquiring unit, for obtaining the configuration script file corresponding to the file identification;
Dispensing unit, the configuration script file for being got according to the acquiring unit and the configuration information The configuration parameter of middle carrying configures the virtual machine.
In conjunction with second of possible realization method of second aspect, in the third possible realization method, the configuration Module further includes:
Generation unit, the document for generating the configuration script file got;
Detection unit, for detecting whether the document that the generation unit generates is taken with the configuration information The document of the configuration script file of band is consistent;
The dispensing unit is additionally operable to, when the testing result of the detection unit is consistent, execute described in the basis The operation that configuration script file and the configuration parameter configure the virtual machine.
In conjunction with second of possible realization method of second aspect, in the 4th kind of possible realization method, the acquisition Unit is additionally operable to inquire the configuration script file corresponding to the file identification under the predetermined directory of the virtual machine, The predetermined directory is the storage catalogue for each file for allowing to be called by third party.
In conjunction with second of possible realization method of second aspect, the third possible realization method or the 4th kind of possibility Realization method, in the 5th kind of possible realization method, described device further includes:
Command reception module, for receiving the more new command for updating the configuration script file;
File update module updates the configuration for more new command described in being received according to described instruction receiving module Script file.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
By the existing all purpose communication channel being multiplexed between host and virtual machine driving, receiving host is general logical by this Believe the configuration information that channel is sent, and then virtual machine is configured according to the configuration information;It avoids and needs in the prior art Ad hoc virtual serial port equipment and serial ports for virtual machine configuration monitors service in virtual machine, and then wastes the serial ports of virtual machine The problem of resource;Existing all purpose communication channel between host and virtual machine driving can be multiplexed by having reached, into without to void Quasi- machine does special adaptations, saves the effect of the serial port resource consumed needed for virtual machine.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is the schematic diagram of the implementation environment involved by the virtual machine configuration method that each embodiment of the present invention provides.
Fig. 2 is the method flow diagram of virtual machine configuration method provided by one embodiment of the present invention.
Fig. 3 A are the method flow diagrams for the virtual machine configuration method that another embodiment of the present invention provides.
Fig. 3 B are the method flow diagrams for another virtual machine configuration method that another embodiment of the present invention provides.
Fig. 4 is the block diagram of virtual machine configuration device provided by one embodiment of the present invention.
Fig. 5 is the block diagram of virtual machine configuration device provided by one embodiment of the present invention.
Fig. 6 is the block diagram for the virtual machine configuration device that another embodiment of the present invention provides.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art The every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Referring to FIG. 1, the implementation ring involved by the virtual machine configuration method provided it illustrates each embodiment of the present invention The schematic diagram in border.As shown in Figure 1, the implementation environment includes virtual machine management system 110, host 120 and virtual machine driving 130.
Virtual machine management system 110 refers to the system for being managed to each virtual machine.The virtual machine management system 110 and each virtual machine may operate on same host 120.
Host 120 refers to the computer being physically present for carrying each virtual machine.
Virtual machine driving 130 is located in virtual machine, and the driver of virtualization is exclusively used in.Virtual machine driving 130 It is to install after virtual machine creating for improving the performances such as disk, the network I/O of virtual machine and providing virtual machine operating status prison Control the program of function.In the virtualized environments such as XEN, KVM, Vmware, virtual machine driving is installed in virtual machine, is virtual machine The prerequisite of Effec-tive Function is the essential option of installation.
In addition, in practical application, it can all be arranged that there are one all purpose communication channels between host 120 and virtual machine driving 130. For example, by taking XEN virtualized environments as an example, the communication port between host 120 and virtual machine driving 130 can be XenStore; And the communication port between KVM virtualization environment, host 120 and virtual machine driving 130 can be virtIo communication ports.This Embodiment will not enumerate the communication port under other virtualized environments.
Referring to FIG. 2, it illustrates the method flow diagrams of virtual machine configuration method provided by one embodiment of the present invention.Such as Shown in Fig. 2, which may include:
Step 201, the configuration information that receiving host is sent by destinations traffic channel, destinations traffic channel are host and void The all purpose communication channel between virtual machine driving in quasi- machine;Configuration information is what virtual machine management system was sent to host, by Information of the host to virtual machine driving forwarding.
Step 202, virtual machine is configured according to configuration information.
In conclusion virtual machine configuration method provided in this embodiment, by being multiplexed between host and virtual machine driving Existing all purpose communication channel, the configuration information that receiving host is sent by all purpose communication channel, and then confidence is matched according to this Breath configures virtual machine;It avoids and needs the ad hoc virtual serial port for virtual machine configuration in virtual machine in the prior art Equipment and serial ports monitor service, and then the problem of the serial port resource of waste virtual machine;Host and virtual machine can be multiplexed by having reached Existing all purpose communication channel between driving saves consumption needed for virtual machine into without doing special adaptations to virtual machine The effect of serial port resource.
A is please referred to Fig.3, it illustrates the method flow diagrams of virtual machine configuration method provided by one embodiment of the present invention. As shown in Figure 3A, which may include:
Step 301, the configuration information that receiving host is sent by destinations traffic channel, destinations traffic channel are host and void The all purpose communication channel between virtual machine driving in quasi- machine;Configuration information is what virtual machine management system was sent to host, by Information of the host to virtual machine driving forwarding.
When user needs to configure virtual machine, user can be arranged in virtual machine management system carries out virtual machine The configuration information of configuration, and the configuration information is sent to host by virtual machine management system.Correspondingly, host can receive void The configuration information that quasi- machine management system is sent.
After the configuration information that host receives virtual machine management system transmission, host can pass through destinations traffic channel Virtual machine driving into corresponding virtual machine forwards the configuration information.It is connect correspondingly, virtual machine can be driven by virtual machine Receive the configuration information that host is sent by destinations traffic channel.
Optionally, host can store configuration information into destinations traffic channel, and send interrupt signal to virtual machine Driving.Virtual machine driving receives after interrupt signal, you can knows in destinations traffic channel there is new information.At this point, virtual machine Driving can read the information stored in destinations traffic channel, and then get configuration information.
Destinations traffic channel in the present embodiment is all purpose communication channel between host and virtual machine driving.For example, with XEN virtualized environments come for example, the destinations traffic channel can be XenStore.
In addition, the configuration information in the present embodiment may include configuration script file file identification and to virtual machine into The configuration parameter of row configuration.Wherein, configuration script file refers to for realizing the file configured to virtual machine, configuration script The file identification of file can be the file name of configuration script file.
With the IP (English to virtual machine:Internet Protocol, referred to as:The agreement interconnected between network) address into Row configuration, namely the IP address that configuration parameter is virtual machine are come for example, the configuration information can be [set_ip.sh] [- ip 192.168.0.1]。
It should be added that the present embodiment be with configuration information include configuration script file file identification and Configuration parameter is come for example, can also include optionally, in configuration information other content, the present embodiment does not limit this It is fixed.
Step 302, the configuration script file corresponding to file identification is obtained.
After virtual machine receives configuration information by virtual machine driving, virtual machine can drive extraction to match by virtual machine The file identification of the configuration script file carried in confidence breath, then obtains corresponding configuration foot according to the file identification extracted This document.
Optionally, this step may include:The configuration foot corresponding to file identification is inquired under the predetermined directory of virtual machine This document, predetermined directory are the storage catalogue for each file for allowing to be called by third party.
When administrator creates virtual machine template in virtual machine management system, it can be stored under predetermined directory customized Configuration script file.After creating virtual machine by virtual machine template, it can be stored with this under the predetermined directory of virtual machine and match Set script file.Hereafter, after the file identification of configuration script file is extracted in virtual machine driving, virtual machine driving can be The corresponding configuration script file of this document mark is inquired under the predetermined directory of virtual machine.
By the way that called file will be allowed to be stored under specified predetermined directory, avoids third party's calling and be not allowed to After the file of calling, attack, ensure that the safety of virtual machine caused by virtual machine.
Step 303, the document of the configuration script file got is generated.
Optionally, virtual machine driving can pass through Message Digest Algorithm 5 (English:Message Digest Algorithm;Referred to as:MD5 the document of the configuration script file got) is generated.
Certainly, virtual machine driving can also generate this document abstract by other algorithms, and the present embodiment does not do this It limits.
Step 304, whether the document for detecting generation is plucked with the file of the configuration script file carried in configuration information It is consistent.
While administrator stores customized configuration script file under predetermined directory, it can also be given birth to by MD5 algorithms At the document of the configuration script file.Also, when hereafter virtual machine management system sends configuration information to host, virtually Machine management system can send the configuration information for the document for carrying generation.Correspondingly, virtual machine driving receives host After the configuration information that the virtual machine management system of forwarding is sent, virtual machine driving can extract the file carried in configuration information Abstract.Also, whether the document generated in detecting step 303 is consistent with the document extracted from configuration information.
The present embodiment is not limited generating algorithm used in document, only need to ensure to carry in configuration information The generating algorithm of document is consistent with the algorithm used in step 303.
Step 305, if unanimously, being configured to virtual machine according to configuration script file and configuration parameter.
If the testing result of virtual machine driving is consistent, illustrate that asking the third party configured to virtual machine to know matches The document for setting script file that is to say legal third party.At this point, virtual machine driving can according to configuration script file with And configuration parameter configures virtual machine.Specifically, virtual machine driving can trigger the execution of configuration script file, and foundation Configuration parameter configures virtual machine.Wherein, virtual machine driving is after successfully configuring virtual machine, virtual machine driving Configuration successful information can be forwarded to virtual machine management system by host with feedback configuration successful information to host.
And if the testing result of virtual machine driving is inconsistent, illustrates the third for asking to configure virtual machine at this time Side is not aware that the correct document of configuration script file namely third party may be the third party of disabled user's personation, At this point, in order to avoid carrying out error configurations to virtual machine, virtual machine driving can terminate flow.
It should be added that step 303 and step 304 are optional step, in actual implementation, executed in step 302 Step 305 can be directly executed after finishing, the present embodiment does not limit this.
In conclusion virtual machine configuration method provided in this embodiment, by being multiplexed between host and virtual machine driving Existing all purpose communication channel, the configuration information that receiving host is sent by all purpose communication channel, and then confidence is matched according to this Breath configures virtual machine;It avoids and needs the ad hoc virtual serial port for virtual machine configuration in virtual machine in the prior art Equipment and serial ports monitor service, and then the problem of the serial port resource of waste virtual machine;Host and virtual machine can be multiplexed by having reached Existing all purpose communication channel between driving saves consumption needed for virtual machine into without doing special adaptations to virtual machine The effect of serial port resource.
After virtual machine driving receives configuration information, virtual machine driving is under predetermined directory in query configuration information Configuration script file corresponding to file identification, wherein predetermined directory is the storage for each file for allowing to be called by third party Catalogue avoids third party after the executable file for calling other to be not allowed to, and attack, ensure that caused by virtual machine The safety of virtual machine.
Meanwhile the document by carrying configuration script file in configuration information, and then only in configuration information The document that generates of document and virtual machine driving it is consistent when, virtual machine driving can just configure virtual machine, keep away After having exempted from illegal third party to virtual machine progress malice configuration, attack, ensure that the peace of virtual machine caused by virtual machine Entirely.
In addition, since virtual machine driving process is the operation of high priority high reliability, so the present embodiment passes through void Quasi- machine driving configures virtual machine to realize, also improves the allocative efficiency configured to virtual machine.
It should be added that please referring to Fig.3 B, which can also include the following steps:
Step 306, the more new command of update configuration script file is received.
When user needs to update the configuration script file in virtual machine, user can apply update configuration in virtual machine The more new command of script file.Correspondingly, virtual machine can receive the more new command by operating system.Wherein, which refers to Order may include:It is new in existing configuration script file that user changes the modification instruction of existing configuration script file, user Increase the configuration script file corresponding to a certain function newly-increased instruction and user delete configuration script file in it is existing a certain At least one of deletion instruction of configuration script file corresponding to function.
Step 307, configuration script file is updated according to more new command.
After virtual machine receives more new command, the configuration script that virtual machine can be updated storage according to more new command is literary Part.
For example, being configuration script file of the user in configuration script file corresponding to newly-increased a certain function with more new command Newly-increased instruction come for example, the original file including corresponding to tri- functions of A, B and C in configuration script file, then when with When newly-increased D functions are thought at family, user can will be in the file copy corresponding to D functions to original configuration script file.Correspondingly, empty After quasi- machine receives the newly-increased instruction of copy of user, the file corresponding to D functions is added to original configuration script file.Again For example, when user wants to delete the C functions in tri- functions of A, B and C, user can apply deletion in virtual machine and match The deletion instruction of the file corresponding to the C functions in script file is set, virtual machine can receive the deletion and instruct accordingly, and After receiving deletion instruction, the file corresponding to C functions in configuration script file is deleted.
After the configuration script file that virtual machine updates storage, virtual machine can generate updated configuration script file Document.Hereafter, user can configure virtual machine according to newly-generated document.
For the present embodiment according to the update configuration script file received, having reached can be according to actual demand to configuration script File is updated, and then the effect of content can be configured with flexible customization.
Referring to FIG. 4, it illustrates the block diagrams of virtual machine configuration device provided by one embodiment of the present invention.Such as Fig. 4 institutes Show, which may include:Information receiving module 410 and configuration module 420.
Information receiving module 410, for the configuration information that receiving host is sent by destinations traffic channel, the target is logical Believe all purpose communication channel of the channel between the virtual machine driving in the host and virtual machine;The configuration information is virtual machine Management system is sent to the host, the information forwarded from the host to virtual machine driving;
Configuration module 420, the configuration information for being received according to described information receiving module 410 is to described virtual Machine is configured.
In conclusion virtual machine configuration device provided in this embodiment, by being multiplexed between host and virtual machine driving Existing all purpose communication channel, the configuration information that receiving host is sent by all purpose communication channel, and then confidence is matched according to this Breath configures virtual machine;It avoids and needs the ad hoc virtual serial port for virtual machine configuration in virtual machine in the prior art Equipment and serial ports monitor service, and then the problem of the serial port resource of waste virtual machine;Host and virtual machine can be multiplexed by having reached Existing all purpose communication channel between driving saves consumption needed for virtual machine into without doing special adaptations to virtual machine The effect of serial port resource.
Referring to FIG. 5, it illustrates the block diagrams of virtual machine configuration device provided by one embodiment of the present invention.Such as Fig. 5 institutes Show, which may include:Information receiving module 510 and configuration module 520.
Information receiving module 510, for the configuration information that receiving host is sent by destinations traffic channel, the target is logical Believe all purpose communication channel of the channel between the virtual machine driving in the host and virtual machine;The configuration information is virtual machine Management system is sent to the host, the information forwarded from the host to virtual machine driving;
Configuration module 520, the configuration information for being received according to described information receiving module 510 is to described virtual Machine is configured.
Optionally, described information receiving module 510, including:
Signal receiving unit 511, the interrupt signal sent for receiving the host, the interrupt signal are the host It is stored to the rear information sent to virtual machine driving in the destinations traffic channel, the interruption by the configuration information Signal is the signal for indicating to be stored with new information in the destinations traffic channel;
Information reading unit 512, for reading the configuration information stored in the destinations traffic channel.
Optionally, the configuration information includes the file identification and configuration parameter of configuration script file;The configuration module 520, including:
Acquiring unit 521, for obtaining the configuration script file corresponding to the file identification;
Dispensing unit 522, the configuration script file for being got according to the acquiring unit 521 and described matches The configuration parameter carried in confidence breath configures the virtual machine.
Optionally, the configuration module 520 further includes:
Generation unit 523, the document for generating the configuration script file got;
Detection unit 524, for detect the generation unit 523 generation the document whether with it is described match confidence The document of the configuration script file carried in breath is consistent;
The dispensing unit 522 is additionally operable to, when the testing result of the detection unit 524 is consistent, execute described The operation that the virtual machine is configured according to the configuration script file and the configuration parameter.
Optionally, the acquiring unit 521 is additionally operable to inquire the file identification under the predetermined directory of the virtual machine The corresponding configuration script file, the predetermined directory are the storage catalogue for each file for allowing to be called by third party.
Optionally, described device further includes:
Command reception module 530, for receiving the more new command for updating the configuration script file;
File update module 540 updates institute for more new command described in being received according to described instruction receiving module 530 State configuration script file.
In conclusion virtual machine configuration device provided in this embodiment, by being multiplexed between host and virtual machine driving Existing all purpose communication channel, the configuration information that receiving host is sent by all purpose communication channel, and then confidence is matched according to this Breath configures virtual machine;It avoids and needs the ad hoc virtual serial port for virtual machine configuration in virtual machine in the prior art Equipment and serial ports monitor service, and then the problem of the serial port resource of waste virtual machine;Host and virtual machine can be multiplexed by having reached Existing all purpose communication channel between driving saves consumption needed for virtual machine into without doing special adaptations to virtual machine The effect of serial port resource.
After virtual machine driving receives configuration information, virtual machine driving is under predetermined directory in query configuration information Configuration script file corresponding to file identification, wherein predetermined directory is the storage for each file for allowing to be called by third party Catalogue avoids third party after the executable file for calling other to be not allowed to, and attack, ensure that caused by virtual machine The safety of virtual machine.
Meanwhile the document by carrying configuration script file in configuration information, and then only in configuration information The document that generates of document and virtual machine driving it is consistent when, virtual machine driving can just configure virtual machine, keep away After having exempted from illegal third party to virtual machine progress malice configuration, attack, ensure that the peace of virtual machine caused by virtual machine Entirely.
In addition, since virtual machine driving process is the operation of high priority high reliability, so the present embodiment passes through void Quasi- machine driving configures virtual machine to realize, also improves the allocative efficiency configured to virtual machine.
For the present embodiment according to the update configuration script file received, having reached can be according to actual demand to configuration script File is updated, and then the effect of content can be configured with flexible customization.
Referring to FIG. 6, it illustrates the block diagrams of the virtual machine configuration device of node provided by one embodiment of the present invention.Such as Shown in Fig. 6, which includes:Bus 610, and the processor 620, the memory 630 that are communicated by bus 610 With transceiver 640.Wherein, memory 630 is configured to for storing one or more than one instruction, the instruction by handling Device 620 executes.Wherein:
Transceiver 640, for the configuration information that receiving host is sent by destinations traffic channel, destinations traffic channel For all purpose communication channel between the virtual machine driving in the host and virtual machine;The configuration information is Virtual Machine Manager system It unites and sends to the host, from the host to the information of virtual machine driving forwarding;
Processor 620, for being configured to the virtual machine according to the configuration information.
In conclusion virtual machine configuration device provided in this embodiment, by being multiplexed between host and virtual machine driving Existing all purpose communication channel, the configuration information that receiving host is sent by all purpose communication channel, and then confidence is matched according to this Breath configures virtual machine;It avoids and needs the ad hoc virtual serial port for virtual machine configuration in virtual machine in the prior art Equipment and serial ports monitor service, and then the problem of the serial port resource of waste virtual machine;Host and virtual machine can be multiplexed by having reached Existing all purpose communication channel between driving saves consumption needed for virtual machine into without doing special adaptations to virtual machine The effect of serial port resource.
In the first optional realization method of above-described embodiment,
The transceiver 640 is additionally operable to receive the interrupt signal that the host is sent, and the interrupt signal is the host It is stored to the rear information sent to virtual machine driving in the destinations traffic channel, the interruption by the configuration information Signal is the signal for indicating to be stored with new information in the destinations traffic channel;
The processor 620 is additionally operable to read the configuration information stored in the destinations traffic channel.
In second of optional realization method of above-described embodiment, the configuration information includes the text of configuration script file Part identifies and configuration parameter;
The processor 620 is additionally operable to obtain the configuration script file corresponding to the file identification;According to the configuration Script file and the configuration parameter configure the virtual machine.
In the third optional realization method of above-described embodiment,
The processor 620 is additionally operable to generate the document of the configuration script file got;What detection generated Whether the document is consistent with the document of configuration script file carried in the configuration information;If consistent, It then executes described according to the configuration script file and the operation that is configured to the virtual machine of configuration parameter.
In the 4th kind of optional realization method of above-described embodiment,
The processor 620 is additionally operable to inquire corresponding to the file identification under the predetermined directory of the virtual machine The configuration script file, the predetermined directory are the storage catalogue for each file for allowing to be called by third party.
In the 4th kind of optional realization method of above-described embodiment,
The transceiver 640 is additionally operable to receive the more new command for updating the configuration script file;
The processor 620 is additionally operable to the more new command according to and updates the configuration script file.
In conclusion virtual machine configuration device provided in this embodiment, by being multiplexed between host and virtual machine driving Existing all purpose communication channel, the configuration information that receiving host is sent by all purpose communication channel, and then confidence is matched according to this Breath configures virtual machine;It avoids and needs the ad hoc virtual serial port for virtual machine configuration in virtual machine in the prior art Equipment and serial ports monitor service, and then the problem of the serial port resource of waste virtual machine;Host and virtual machine can be multiplexed by having reached Existing all purpose communication channel between driving saves consumption needed for virtual machine into without doing special adaptations to virtual machine The effect of serial port resource.
After virtual machine driving receives configuration information, virtual machine driving is under predetermined directory in query configuration information Configuration script file corresponding to file identification, wherein predetermined directory is the storage for each file for allowing to be called by third party Catalogue avoids third party after the executable file for calling other to be not allowed to, and attack, ensure that caused by virtual machine The safety of virtual machine.
Meanwhile the document by carrying configuration script file in configuration information, and then only in configuration information The document that generates of document and virtual machine driving it is consistent when, virtual machine driving can just configure virtual machine, keep away After having exempted from illegal third party to virtual machine progress malice configuration, attack, ensure that the peace of virtual machine caused by virtual machine Entirely.
In addition, since virtual machine driving process is the operation of high priority high reliability, so the present embodiment passes through void Quasi- machine driving configures virtual machine to realize, also improves the allocative efficiency configured to virtual machine.
For the present embodiment according to the update configuration script file received, having reached can be according to actual demand to configuration script File is updated, and then the effect of content can be configured with flexible customization.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (8)

1. a kind of virtual machine configuration method, which is characterized in that the method includes:
The configuration information that receiving host is sent by destinations traffic channel, the destinations traffic channel are the host and virtual machine In virtual machine driving between all purpose communication channel;The configuration information is that virtual machine management system is sent to the host , the information forwarded from the host to virtual machine driving;
The virtual machine is configured according to the configuration information;
The configuration information includes the file identification and configuration parameter of configuration script file;
It is described that the virtual machine is configured according to the configuration information, including:
Obtain the configuration script file corresponding to the file identification;
The virtual machine is configured according to the configuration script file and the configuration parameter;
It is described the virtual machine is configured according to the configuration script file and the configuration parameter before, the method Further include:
Generate the document of the configuration script file got;
Detect whether the document generated is plucked with the file of the configuration script file carried in the configuration information It is consistent;
If consistent, execute and described the virtual machine is configured according to the configuration script file and the configuration parameter Operation.
2. according to the method described in claim 1, it is characterized in that, the receiving host is matched by what destinations traffic channel was sent Confidence ceases, including:
The interrupt signal that the host is sent is received, the interrupt signal is stored by the configuration information to institute for the host The rear information sent to virtual machine driving in destinations traffic channel is stated, the interrupt signal is for indicating that the target is logical The signal of new information is stored in letter channel;
Read the configuration information stored in the destinations traffic channel.
3. according to the method described in claim 1, it is characterized in that, the configuration script obtained corresponding to the file identification File, including:
The configuration script file corresponding to the file identification is inquired under the predetermined directory of the virtual machine, it is described default Catalogue is the storage catalogue for each file for allowing to be called by third party.
4. according to any method of claim 1 or 3, which is characterized in that the method further includes:
Receive the more new command for updating the configuration script file;
The configuration script file is updated according to the more new command.
5. a kind of virtual machine configuration device, which is characterized in that described device includes:
Information receiving module, for the configuration information that receiving host is sent by destinations traffic channel, destinations traffic channel For all purpose communication channel between the virtual machine driving in the host and virtual machine;The configuration information is Virtual Machine Manager system It unites and sends to the host, from the host to the information of virtual machine driving forwarding;
Configuration module, the configuration information for being received according to described information receiving module match the virtual machine It sets;
The configuration information includes the file identification and configuration parameter of configuration script file;
The configuration module, including:
Acquiring unit, for obtaining the configuration script file corresponding to the file identification;
Dispensing unit is taken in the configuration script file and the configuration information for being got according to the acquiring unit The configuration parameter of band configures the virtual machine;
The configuration module further includes:
Generation unit, the document for generating the configuration script file got;
Detection unit, for detect the document that the generation unit generates whether with carried in the configuration information The document of the configuration script file is consistent;
The dispensing unit is additionally operable to, when the testing result of the detection unit is consistent, execute described according to the configuration The operation that script file and the configuration parameter configure the virtual machine.
6. device according to claim 5, which is characterized in that described information receiving module, including:
Signal receiving unit, the interrupt signal sent for receiving the host, the interrupt signal are the host by institute It states configuration information to store to the rear information sent to virtual machine driving in the destinations traffic channel, the interrupt signal is Signal for indicating to be stored with new information in the destinations traffic channel;
Information reading unit, for reading the configuration information stored in the destinations traffic channel.
7. device according to claim 5, which is characterized in that
The acquiring unit, be additionally operable to inquire under the predetermined directory of the virtual machine corresponding to the file identification described in match Script file is set, the predetermined directory is the storage catalogue for each file for allowing to be called by third party.
8. according to any device of claim 5 or 7, which is characterized in that described device further includes:
Command reception module, for receiving the more new command for updating the configuration script file;
File update module updates the configuration script for more new command described in being received according to described instruction receiving module File.
CN201510574908.8A 2015-09-10 2015-09-10 Virtual machine configuration method and apparatus Active CN105162667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510574908.8A CN105162667B (en) 2015-09-10 2015-09-10 Virtual machine configuration method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510574908.8A CN105162667B (en) 2015-09-10 2015-09-10 Virtual machine configuration method and apparatus

Publications (2)

Publication Number Publication Date
CN105162667A CN105162667A (en) 2015-12-16
CN105162667B true CN105162667B (en) 2018-08-14

Family

ID=54803427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510574908.8A Active CN105162667B (en) 2015-09-10 2015-09-10 Virtual machine configuration method and apparatus

Country Status (1)

Country Link
CN (1) CN105162667B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122224A (en) * 2016-02-25 2017-09-01 中兴通讯股份有限公司 A kind of data transmission method, virtual machine and host
CN106487633B (en) * 2016-10-11 2019-12-06 中国银联股份有限公司 method and device for monitoring abnormity of virtual machine
TWI694699B (en) * 2019-01-07 2020-05-21 瑞昱半導體股份有限公司 Communication method for virtual machines, electronic device, and non-transitory computer readable storage medium
CN109933411B (en) * 2019-03-31 2021-03-30 山东超越数控电子股份有限公司 System and method for modifying internal configuration of virtual machine on line
CN111082964B (en) * 2019-10-18 2023-03-03 网宿科技股份有限公司 Distribution method and device of configuration information

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470621A (en) * 2007-12-28 2009-07-01 埃森哲环球服务有限公司 Virtual machine configuration system
CN102222014A (en) * 2011-06-16 2011-10-19 华中科技大学 Dynamic memory management system based on memory hot plug for virtual machine
CN103049219A (en) * 2012-12-12 2013-04-17 华中科技大学 Virtual disk write cache system applicable to virtualization platform and operation method of write cache system
CN104636159A (en) * 2013-11-15 2015-05-20 华为技术有限公司 Method and device for upgrading software in virtual machines

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470621A (en) * 2007-12-28 2009-07-01 埃森哲环球服务有限公司 Virtual machine configuration system
CN102222014A (en) * 2011-06-16 2011-10-19 华中科技大学 Dynamic memory management system based on memory hot plug for virtual machine
CN103049219A (en) * 2012-12-12 2013-04-17 华中科技大学 Virtual disk write cache system applicable to virtualization platform and operation method of write cache system
CN104636159A (en) * 2013-11-15 2015-05-20 华为技术有限公司 Method and device for upgrading software in virtual machines

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Xen XenStore学习;Acewind;《http://www.itfront.cn/showtopic-1892.aspx》;20100916;第1页 *
Xen-3.2.0平台上虚拟机迁移时restore_的过程;水岩;《http://blog.sina.com.cn/s/blog_617f58370100s7cl.html》;20110309;全文 *
Xenstore和Xenbus;chenyulancn;《http://blog.csdn.net/chenyulancn/article/details/8103228》;20121023;全文 *
基于virtio在虚拟机与主机之间传递消息;regjtc;《http://regjtc.iteye.com/blog/1828550》;20130313;全文 *

Also Published As

Publication number Publication date
CN105162667A (en) 2015-12-16

Similar Documents

Publication Publication Date Title
CN105162667B (en) Virtual machine configuration method and apparatus
US10461999B2 (en) Methods and systems for managing interconnection of virtual network functions
US8997090B2 (en) Installing an operating system in a host system
US10282211B2 (en) Operating system software install and boot up from a storage area network device
US8051158B2 (en) Program management apparatus and method
JP7069672B2 (en) Application update method and program
JP5569197B2 (en) Computer apparatus and reset control program
US8996667B2 (en) Deploying an operating system
US8418164B2 (en) Image install of a network appliance
WO2011116583A1 (en) Method and apparatus for implementing management of multi-protocol communication components
EP2974137A1 (en) Host device coupled to a mobile phone and method of operating the same
CN104636159B (en) The method and apparatus that software in virtual machine is upgraded
JP4961288B2 (en) Information processing apparatus, information processing program, recording medium, printing apparatus, and network system
US8661238B2 (en) Identifying an OS corresponding to an address included in a magic packet and determining whether activation of the OS is permitted
JP2008004010A (en) Communication equipment and control method therefor
JP2007323354A (en) Machine management system
US20080199012A1 (en) Method for identifying a server device in a network
JP2006133825A (en) Installation system, push installation device, installation execution device, installation method and installation program
JP2009037589A (en) Program determining apparatus, program determining method and program
WO2023198056A1 (en) Firmware update method for embedded device, and embedded device
US10545704B2 (en) Image forming apparatus and control method to update an application in an image forming apparatus
CN111459643A (en) Host migration method
JP2009020609A (en) Image forming apparatus, program control method, and program
JP5736346B2 (en) Virtualization device, virtualization control method, virtualization device control program
US20230032581A1 (en) Method and Apparatus for Processing Virtual Machine Component

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220221

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221206

Address after: 518129 Huawei Headquarters Office Building 101, Wankecheng Community, Bantian Street, Longgang District, Shenzhen, Guangdong

Patentee after: Shenzhen Huawei Cloud Computing Technology Co.,Ltd.

Address before: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee before: Huawei Cloud Computing Technologies Co.,Ltd.