CN108206750A - The configuration method and device of virtual machine network interface card - Google Patents

The configuration method and device of virtual machine network interface card Download PDF

Info

Publication number
CN108206750A
CN108206750A CN201611175183.6A CN201611175183A CN108206750A CN 108206750 A CN108206750 A CN 108206750A CN 201611175183 A CN201611175183 A CN 201611175183A CN 108206750 A CN108206750 A CN 108206750A
Authority
CN
China
Prior art keywords
configuration
virtual machine
file
information
configuration file
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
CN201611175183.6A
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201611175183.6A priority Critical patent/CN108206750A/en
Publication of CN108206750A publication Critical patent/CN108206750A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • H04L41/0843Configuration by using pre-existing information, e.g. using templates or copying from other elements based on generic templates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Abstract

The invention discloses a kind of configuration methods and device of virtual machine network interface card.Wherein, this method includes:In the case where detecting that network interface card information need to be configured in virtual machine, the first configuration file is read from virtual image file, wherein, record has the configuration information of the network interface card of the virtual machine in first configuration file;First configuration file is converted to the second configuration file being adapted with the system of the virtual machine;The network interface card of the virtual machine is configured using second configuration file.The present invention solves the technical issues of needing Configuration network medium in the network card configuration for carrying out virtual machine, of high cost.

Description

The configuration method and device of virtual machine network interface card
Technical field
The present invention relates to computer realm, in particular to a kind of configuration method and device of virtual machine network interface card.
Background technology
SCVMM is a kind of deploying virtual machine and management tool, the work such as can be created, deleted, is configured to virtual machine, It is used by some companies as Virtual Machine Manager frame.On the basis of SCVMM, can by secondary development operational system, Automatically complete the establishment of virtual server.Need to be virtual server configuration of IP after virtual server establishment.At present, SCVMM Network card configuration is supported to the virtual machine for using windows systems, precondition is the virtual IP address that SCVMM possesses independent management and control Section distributes network interface card by the virtual IP address section to virtual windows systems.Through the above scheme, SCVMM is from the virtual of self-management IP sections of extraction IP, then by itself compatibility to windows systems, complete the configuration to windows system server network interface cards.But It is that SCVMM does not support linux system, so the network card configuration of the type system can not be completed.
A kind of DHCP technologies, i.e. dynamic host configuration protocol are additionally provided in the prior art.DHCP is a LAN Procotol is generally applied in large-scale LAN environment, and main function is the management concentrated, distribution IP address.But It needs to send dhcp broadcast packet to network in the program, it is possible to influence whether the network of other irrelevant servers.
SCVMM:System Center Virtual Machine are a kind of deploying virtual machine and management tool, use SCVMM, which creates application profiles, can help enterprise to realize deployment process automation, improve application program configuration consistency Property.
DHCP:Dynamic Host Configuration Protocol, dynamic host configuration protocol are a locals The procotol of net is worked using udp protocol, is generally applied in large-scale LAN environment, and main function is to concentrate Management, distribution IP address, make the host in network environment dynamically obtain IP address, gateway (Gateway) address, DNS service The information such as device address, and the utilization rate of address can be promoted.
As the above analysis, it using SCVMM frameworks and DHCP technologies, needs to carry out data interaction by network medium, Configuration network medium it is of high cost.
Configuration network medium is needed in the network card configuration for carrying out virtual machine for the problem that above-mentioned, it is of high cost, at present not yet It is proposed effective solution.
Invention content
An embodiment of the present invention provides a kind of configuration method and device of virtual machine network interface card, at least to solve carrying out virtually Need Configuration network medium during the network card configuration of machine, it is of high cost the technical issues of.
One side according to embodiments of the present invention provides a kind of configuration method of virtual machine network interface card, including:It is detecting In the case of going out virtual machine and network interface card information need to being configured, the first configuration file is read from virtual image file, wherein, described first Record has the configuration information of the network interface card of the virtual machine in configuration file;By first configuration file be converted to it is described virtual The second configuration file that the system of machine is adapted;The network interface card of the virtual machine is configured using second configuration file.
Further, before the first configuration file is read from virtual image file, the method further includes:Based on institute The configuration information for stating the network interface card of virtual machine generates first configuration file;First configuration file is packaged into described virtual Image file;By the virtual image file carry on the corresponding host equipment of the virtual machine.
Further, the configuration information of the network interface card based on the virtual machine generates first configuration file and includes:Generation Dictionary corresponding with the configuration information;By information write-in the first configuration text in the dictionary in the form of character string Part.
Further, first configuration file is converted to the second configuration text being adapted with the system of the virtual machine Part includes:The data of character string type in first configuration file are converted into dictionary;Read pre-defined configuration text Part template;By the information in the dictionary, according to the profile template, second configuration file is generated.
Further, before the first configuration file is read from virtual image file, the method further includes:Detection institute State in the network card configuration file of virtual machine whether configured IP information;The non-configuration of IP in the network card configuration file of the virtual machine In the case of information, detect that network interface card information need to be configured in the virtual machine;Detecting that network interface card information need to be configured in the virtual machine In the case of, detect whether that there are virtual image files;In the case of there are the virtual image file, read described virtual Image file.
Further, the configuration information of the network interface card of the virtual machine includes at least one following:Virtual machine title, IP Location, gateway and subnet mask.
Another aspect according to embodiments of the present invention additionally provides a kind of configuration device of virtual machine network interface card, including:It reads Unit, in the case where detecting that network interface card information need to be configured in virtual machine, reading the first configuration text from virtual image file Part, wherein, record has the configuration information of the network interface card of the virtual machine in first configuration file;Converting unit, for by institute It states the first configuration file and is converted to the second configuration file being adapted with the system of the virtual machine;Dispensing unit, for utilizing The network interface card of the virtual machine is configured in second configuration file.
Further, which is characterized in that before the reading unit, described device further includes:Generation unit, for base First configuration file is generated in the configuration information of the network interface card of the virtual machine;Packaged unit, for described first to be configured File is packaged into the virtual image file;Carry unit, for by the virtual image file carry in the virtual machine pair On the host equipment answered.
Further, the generation unit includes:First generation subelement, it is corresponding with the configuration information for generating Dictionary;Writing unit, for the information in the dictionary to be written first configuration file in the form of character string.
Further, the converting unit includes:Conversion subunit, for by the character string in first configuration file The data of type are converted to dictionary;First reading subunit, for reading pre-defined profile template;Second generation Unit, for by the information in the dictionary, according to the profile template, generating second configuration file.
Further, before the reading unit, described device further includes:First detection unit, it is described for detecting In the network card configuration file of virtual machine whether configured IP information;Second detection unit, for matching in the network interface card of the virtual machine It puts in file in the case of non-configuration of IP information, detects that network interface card information need to be configured in the virtual machine;Third detection unit, is used for In the case where detecting that network interface card information need to be configured in the virtual machine in the case of there are the virtual image file;Second Reading subunit in the case of there are the virtual image file, reads the virtual image file.
Further, the information that the reading unit is read includes at least one following:Virtual machine title, IP address, net Pass and subnet mask.
In embodiments of the present invention, in the case where detecting that network interface card information need to be configured in virtual machine, from the void being generated in advance Intend reading the first configuration file in image file.Wherein, the network card configuration information for having virtual machine is recorded in the first configuration file.Again The first configuration file read out is converted to the second configuration file, the second configuration file energy and virtual machine obtained after conversion System be adapted.According to the second obtained configuration file, the network interface card of virtual machine is configured.The program is detecting void In the case that network interface card information need to be configured in plan machine, there is the net of virtual machine by reading record in the virtual image file being generated in advance Card configuration information, and the file being adapted with the system of virtual machine is converted this information into, according to the transformed file to void The network interface card of plan machine is configured.Data exchange is carried out by non-network medium, simplifies the process of virtual machine network card configuration, reduces The cost of virtual machine network card configuration, so solve carry out virtual machine network card configuration when need Configuration network medium, it is of high cost The technical issues of.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and forms the part of the application, this hair Bright illustrative embodiments and their description do not constitute improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the configuration method of virtual machine network interface card according to embodiments of the present invention;
Fig. 2 is a kind of schematic diagram of the configuration device of virtual machine network interface card according to embodiments of the present invention;
Fig. 3 is a kind of schematic diagram of the configuration device of optional virtual machine network interface card according to embodiments of the present invention.
Specific embodiment
In order to which those skilled in the art is made to more fully understand the present invention program, below in conjunction in the embodiment of the present invention The technical solution in the embodiment of the present invention is clearly and completely described in attached drawing, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people Member's all other embodiments obtained without making creative work should all belong to the model that the present invention protects It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, " Two " etc. be the object for distinguishing similar, and specific sequence or precedence are described without being used for.It should be appreciated that it uses in this way Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment Those steps or unit clearly listed, but may include not listing clearly or for these processes, method, product Or the intrinsic other steps of equipment or unit.
According to embodiments of the present invention, a kind of configuration method embodiment of virtual machine network interface card is provided, it should be noted that The step of flow of attached drawing illustrates can perform in the computer system of such as a group of computer-executable instructions, also, It, in some cases, can be to be different from shown in sequence herein performs although showing logical order in flow charts The step of going out or describing.
Fig. 1 is a kind of flow chart of the configuration method of virtual machine network interface card according to embodiments of the present invention, as shown in Figure 1, should Method includes the following steps:
Step S102 in the case where detecting that network interface card information need to be configured in virtual machine, reads from virtual image file One configuration file, wherein, record has the configuration information of the network interface card of virtual machine in the first configuration file;
First configuration file is converted to the second configuration file being adapted with the system of virtual machine by step S104;
Step S106 is configured the network interface card of virtual machine using the second configuration file.
According to the above embodiment of the present invention, in the case where detecting that network interface card information need to be configured in virtual machine, from being generated in advance Virtual image file in read the first configuration file, then the first configuration file read out is converted to the system with virtual machine The second configuration file being adapted according to the second obtained configuration file, is configured the network interface card of virtual machine.In the embodiment In, data exchange is carried out by non-network medium, simplifies the process of virtual machine network card configuration, reduces virtual machine network card configuration Cost, and then solve the technical issues of Configuration network medium being needed in the network card configuration for carrying out virtual machine, of high cost.
Optionally, virtual machine be by software simulate have the function of complete hardware system, operate in one completely every From the complete computer in environment.Virtual machine has true behaviour by generating the new virtual mirror image of existing operating system Make the duplicate function of system, into after virtual system, all operations are all in this completely new independent virtual system Face carries out, and can be preserved data with independently installed runs software, possessed the independent table of oneself, and genuine system will not be generated and appointed What is influenced.The operating system of virtual machine includes Windows, Linux, Chrome OS, Mac OS, Android OS.
Optionally, virtual machine needs progress network card configuration that could realize mutual with extraneous information biography, in progress network card configuration During, it needs to obtain the network card configurations information such as the IP address of host and sub- mask, wherein, which records In the virtual image file of host network card configuration information, the net of host is obtained by being read out to virtual image file Card configuration information.
Optionally, virtual image file is a kind of file for simulating read-only CD (CD-ROM) working method, by the virtual text Part is mounted to as read-only CD on virtual machine, realizes the interaction of information between host and virtual machine by way of carry.
Optionally, different operating system can be configured in virtual machine, for different operating system, the text of network card configuration Part type is also different, and the first configuration file that will be used for transmission is needed to be converted into can be read by current virtual machine system second Configuration file.
Optionally, the second configuration file is can be included by the information of the reading of virtual machine current operation system, the information Network card configuration information, virtual machine can be configured according to the network card configuration information of reading.
According to the above embodiment of the present invention, before the first configuration file is read from virtual image file, method is also wrapped It includes:The configuration information of network interface card based on virtual machine generates the first configuration file;First configuration file is packaged into virtual image text Part;By virtual image file carry on the corresponding host equipment of virtual machine.
Optionally, before the first configuration file is read from virtual image file, the network card configuration letter based on virtual machine Breath the first configuration file of generation.First configuration file is packed again, is packaged into virtual image file.It is and then this is virtual Image file carry is on the host equipment corresponding to virtual machine.Wherein, carry be show disk partition distribute a drive or One equipment is articulated in an already present catalogue by person, and storage facilities is accessed by accessing this catalogue.The program, will The network card configuration information package of virtual machine is mounted into virtual image file, then by the virtual image file corresponding to the virtual machine Host on.By the way that virtual image file is mounted on the host of virtual machine, the host is by accessing the carry mesh Record may have access to the virtual image file.Data interaction can be carried out by non-network medium by above-described embodiment, avoided pair The network of other irrelevant servers impacts.
According to the above embodiment of the present invention, the configuration information of the network interface card based on virtual machine generates the first configuration file and includes: Generation dictionary corresponding with configuration information;The first configuration file is written into the information in dictionary in the form of character string.
Optionally, it according to the configuration information of the network interface card of virtual machine, generation and the corresponding dictionary of the configuration information, then uses Information in the dictionary is written in the first configuration file the form of character string.Configuration information is generated dictionary by the program, and Dictionary information is written in the first configuration file by the form of character string, i.e., configuration information is written by the form of character string In first configuration file, the content exact specification of write-in, and be written and identify convenient for computer.
According to the above embodiment of the present invention, the first configuration file is converted to second be adapted with the system of virtual machine and is matched File is put to include:The data of character string type in first configuration file are converted into dictionary;Read pre-defined configuration text Part template;By the information in dictionary, according to profile template, the second configuration file is generated.
Optionally, the first obtained configuration file will be read, is converted to can be adapted to the virtual machine system second and matches Put file.By the data of character string type in the first configuration file being converted to dictionary format, then read pre-defined match File template is put, the information in dictionary is inserted into pre-defined profile template to realize above-mentioned transfer process.It is optional Ground, pre-define profile template corresponding with virtual machine system to be configured, make pre-defined profile template and The virtual machine system is adapted.The data of character string type in first configuration file can be converted to dictionary by the program, then According to dictionary content, the second configuration file is generated according to pre-defined profile template.According to different virtual machine systems, By pre-defining profile template corresponding with virtual system, according still further to second configuration file of template generation, gained the Two configuration files can be adapted with the virtual machine system.Pass through the pre-defined configuration text being adapted with different virtual machine system Part template, you can the second configuration file of different virtual machine system is adapted to according to identical the first configuration file generation, without root According to different virtual machine system, different match informations is transmitted, simplifies the type of configuration information transmission.
According to the above embodiment of the present invention, before the first configuration file is read from virtual image file, the configuration side Method further includes:Detect virtual machine network card configuration file in whether configured IP information;In the network card configuration file of virtual machine In the case of non-configuration of IP information, detect that network interface card information need to be configured in virtual machine;Detecting that network interface card information need to be configured in virtual machine In the case of, detect whether that there are virtual image files;In the case of there are the virtual image file, virtual image is read File.
Optionally, before the first configuration file is read, whether to detect in the network card configuration file of virtual machine to be configured It is configured information.In the case where the network card configuration file of virtual machine has the circumstances of configuration information, network interface card need not be configured in virtual machine.In void Under the circumstances of the non-configuration of IP information of network card configuration file of plan machine, detect that network interface card information need to be configured in virtual machine.Detecting void In the case that network interface card information need to be configured in plan machine, detection the first configuration file virtual image file of storage whether there is, if not detecting To virtual image file, then continue to detect, until virtual image file is detected.If detecting virtual image file, Virtual image file is read, wherein, which includes the first configuration file that can be read.
According to the above embodiment of the present invention, the configuration information of the network interface card of virtual machine is including at least one following:Virtual machine name Title, IP address, gateway and subnet mask.Specifically, the configuration information of the network interface card of virtual machine includes, virtual machine title, IP address, At least one of gateway and subnet mask, this kind of configuration network interface card information needed information.
Fig. 2 is a kind of configuration device schematic diagram of virtual machine network interface card according to embodiments of the present invention, as shown in Fig. 2, the dress Put including:Reading unit 21, in the case where detecting that network interface card information need to be configured in virtual machine, being read from virtual image file The first configuration file is taken, wherein, record has the configuration information of the network interface card of virtual machine in the first configuration file;Converting unit 22 is used In the first configuration file to be converted to the second configuration file for being adapted with the system of virtual machine;Dispensing unit 23, for utilizing The network interface card of virtual machine is configured in second configuration file.
It is single by reading in the case where detecting that network interface card information need to be configured in virtual machine according to the above embodiment of the present invention Member reads the first configuration file from the virtual image file being generated in advance.Wherein, record has virtual machine in the first configuration file Network card configuration information.Again by converting unit, the first configuration file read out is converted to and the second configuration file, conversion The second configuration file obtained afterwards can be adapted with the system of virtual machine.And then by dispensing unit, match according to obtain second File is put, the network interface card of virtual machine is configured.The program in the case where detecting that network interface card information need to be configured in virtual machine, is led to Cross and record is read in the virtual image file being generated in advance have the network card configuration information of virtual machine, and convert this information into The file that the system of virtual machine is adapted is configured the network interface card of virtual machine according to the transformed file.So as to by non- Network medium carries out data exchange, simplifies the process of virtual machine network card configuration, reduces the cost of virtual machine network card configuration, and then Solve needs Configuration network medium in the network card configuration for carrying out virtual machine, it is of high cost the technical issues of.
According to the above embodiment of the present invention, which is characterized in that before reading unit, device further includes:Generation unit is used The first configuration file is generated in the configuration information of the network interface card based on virtual machine;Packaged unit, for the first configuration file to be packaged Into virtual image file;Carry unit, for by virtual image file carry in the corresponding host equipment of virtual machine.
Optionally, before the first configuration file is read from virtual image file, by generation unit, based on virtual machine Network card configuration information generate the first configuration file.Again by packaged unit, which is packed, is packaged into Virtual image file.And then by carry unit, by the virtual image file carry on the host equipment corresponding to virtual machine. Wherein, carry is to show disk partition to distribute a drive or an equipment is articulated in an already present catalogue, is led to It crosses and accesses this catalogue to access storage facilities.The program, by the network card configuration information package of virtual machine into virtual image file, The virtual image file is mounted on the host corresponding to the virtual machine again.By the way that virtual image file is mounted virtual machine Host on, the host by access the mount directory i.e. may have access to the virtual image file.It can by above-described embodiment To carry out data interaction by non-network medium, avoid impacting the network of other irrelevant servers.
According to the above embodiment of the present invention, generation unit includes:First generation subelement, for generating and configuration information pair The dictionary answered;Writing unit, for the information in dictionary to be written the first configuration file in the form of character string.
Optionally, according to the configuration information of the network interface card of virtual machine, by the first generation subelement, generation and the configuration information Corresponding dictionary, then by writing unit, using the form of character string, the first configuration file is written into the information in the dictionary In.Configuration information is generated dictionary by the program, and dictionary information is written in the first configuration file the form for passing through character string, Configuration information is written in the first configuration file by the form of character string, the content exact specification of write-in, and convenient for meter Calculation machine is written and identification.
According to the above embodiment of the present invention, converting unit includes:Conversion subunit, for by the word in the first configuration file The data of symbol string type are converted to dictionary;First reading subunit, for reading pre-defined profile template;Second life Into subelement, for by the information in dictionary, according to profile template, generating the second configuration file.
Optionally, the first obtained configuration file will be read, is converted to can be adapted to the virtual machine system second and matches Put file.The data of character string type in first configuration file are converted to by dictionary by conversion subunit, first reads son list Member reads pre-defined profile template, and the information in dictionary is inserted pre-defined match by the second generation subelement File template is put to realize above-mentioned transfer process.Optionally, configuration corresponding with virtual machine system to be configured is pre-defined File template makes pre-defined profile template be adapted with the virtual machine system.The program, can be by the first configuration text The data of character string type in part are converted to dictionary, further according to dictionary content, are given birth to according to pre-defined profile template Into the second configuration file.According to different virtual machine systems, by pre-defining profile template corresponding with virtual system, According still further to second configuration file of template generation, the second configuration file of gained can be adapted with the virtual machine system.By pre- The profile template that first definition is adapted with different virtual machine system, you can generated and adapted to according to the first identical configuration file Second configuration file of different virtual machine system, without according to different virtual machine system, transmitting different match informations, simplifying The type of configuration information transmission.
According to the above embodiment of the present invention, before reading unit, device further includes:First detection unit, for detecting In the network card configuration file of virtual machine whether configured IP information;Second detection unit, in the network card configuration of virtual machine text In part in the case of non-configuration of IP information, detect that network interface card information need to be configured in virtual machine;Third detection unit, for detecting In the case that network interface card information need to be configured in virtual machine, detect whether that there are virtual image files;Second reading subunit, there are institutes In the case of stating virtual image file, virtual image file is read.
Optionally, before the first configuration file is read, by first detection unit, the network interface card of virtual machine to be configured is detected Whether configuration of IP information in configuration file.Under the circumstances of the configured IP information of network card configuration file of virtual machine, virtually Network interface card need not be configured in machine.Under the circumstances of the non-configuration of IP information of network card configuration file of virtual machine, pass through second detection unit, inspection Network interface card information need to be configured by measuring virtual machine.In the case where detecting that network interface card information need to be configured in virtual machine, detected by third single Member, the virtual image file of detection the first configuration file of storage whether there is.If virtual image file is not detected, continue to examine It surveys, until virtual image file is detected.If detecting virtual image file, by the second reading subunit, read Virtual image file, wherein, which includes the first configuration file that can be read.
According to the above embodiment of the present invention, the information that reading unit is read is including at least one following:Virtual machine title, IP Address, gateway and subnet mask.Specifically, the read information of reading unit includes, virtual machine title, IP address, gateway and At least one of subnet mask, this kind of configuration network interface card information needed information.
Fig. 3 is a kind of configuration device schematic diagram of optional virtual machine network interface card according to embodiments of the present invention, such as Fig. 3 institutes Show, which includes:Detection module 31, delivery module 32 and configuration module 33.
SCVMM:It is a kind of deploying virtual machine and management tool, the works such as can be created, deleted, is configured to virtual machine Make, used by some companies as Virtual Machine Manager frame.
Linux:The multiple-user network operating system that one performance is stablized.
conf:It is writing a Chinese character in simplified form for config, that is, configuration file, is chiefly used in the configured letter of access hardware driver Breath.
iso:That is virtual image file, this document is generally using iso as extension name.
API:Application programming interface is some pre-defined functions, it is therefore an objective to provide application program and exploit person Member is able to access the ability of one group of routine based on certain software or hardware, and need not access source code or understand internal work machine The details of system.
string:Character string in programming language, the value of string objects is ordered into the content of set, and the value is not It can become.
CD-ROM:That is CD-ROM.
Carry:It is to show disk partition to distribute a drive or an equipment is articulated to an already present catalogue On, access storage facilities by accessing this catalogue.
Detection module is deployed in Linux virtual system modules, is virtually by all Linux created by SCVMM System all reads the template and carries out system installation, and then the module can be cloned in the Linux Virtual Service systems newly installed On.Virtual machine booting automatic running, detects network card configuration file in virtual system, if do not had in configuration file by the module Configuration of IP, then it is assumed that the system needs to do IP configurations;Whether constantly detection CD media are inserted into, if detecting inserting for CD media Enter, then starting configuration module.If not detecting the insertion of CD media, constantly detection is recycled.Match if the system has IP It puts, which can directly exit, and not do any operation.
Delivery module is deployed in O&M automated system, and operational system will be to virtual machine expected from a virtual machine Title, the data such as IP, gateway, subnet mask are passed to the module, and module receives these data, generates a dictionary, and use word Symbol string form is written in conf files, then conf files are packaged into the virtual image file that form is iso, transfers SCVMM API, virtual image file is mounted in the equipment of corresponding virtual machine title.
Configuration module, be detected module call get up after, to CDROM under take out conf files, by string classes in file The data of type go back to the form of dictionary, the Linux profile templates defined in a program in advance are then read, by keyword It is written, obtains the full content of configuration file, generated the available conf files of system again, override system network card configuration On file, service network restart.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
In the above embodiment of the present invention, all emphasize particularly on different fields to the description of each embodiment, do not have in some embodiment The part of detailed description may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei A kind of division of logic function, can there is an other dividing mode in actual implementation, for example, multiple units or component can combine or Person is desirably integrated into another system or some features can be ignored or does not perform.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module It connects, can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple On unit.Some or all of unit therein can be selected according to the actual needs to realize the purpose of this embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is independent product sale or uses When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products It embodies, which is stored in a storage medium, is used including some instructions so that a computer Equipment (can be personal computer, server or network equipment etc.) perform each embodiment the method for the present invention whole or Part steps.And aforementioned storage medium includes:USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various can to store program code Medium.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. a kind of configuration method of virtual machine network interface card, which is characterized in that including:
In the case where detecting that network interface card information need to be configured in virtual machine, the first configuration file is read from virtual image file, In, record has the configuration information of the network interface card of the virtual machine in first configuration file;
First configuration file is converted to the second configuration file being adapted with the system of the virtual machine;
The network interface card of the virtual machine is configured using second configuration file.
2. configuration method according to claim 1, which is characterized in that the first configuration text is being read from virtual image file Before part, the method further includes:
The configuration information of network interface card based on the virtual machine generates first configuration file;
First configuration file is packaged into the virtual image file;
By the virtual image file carry on the corresponding host equipment of the virtual machine.
3. configuration method according to claim 2, which is characterized in that the configuration information life of the network interface card based on the virtual machine Include into first configuration file:
Generation dictionary corresponding with the configuration information;
First configuration file is written into the information in the dictionary in the form of character string.
4. configuration method according to claim 1, which is characterized in that be converted to first configuration file and the void The second configuration file that the system of plan machine is adapted includes:
The data of character string type in first configuration file are converted into dictionary;
Read pre-defined profile template;
By the information in the dictionary, according to the profile template, second configuration file is generated.
5. configuration method according to claim 1, which is characterized in that the first configuration text is being read from virtual image file Before part, the method further includes:
Detect in the network card configuration file of the virtual machine whether configured IP information;
In the network card configuration file of the virtual machine in the case of non-configuration of IP information, detect that net need to be configured in the virtual machine Card information;
In the case where detecting that network interface card information need to be configured in the virtual machine, detect whether that there are virtual image files;
In the case of there are the virtual image file, the virtual image file is read.
6. configuration method according to claim 1, which is characterized in that under the configuration information of the network interface card of the virtual machine includes At least one state:Virtual machine title, IP address, gateway and subnet mask.
7. a kind of configuration device of virtual machine network interface card, which is characterized in that including:
Reading unit, in the case where detecting that network interface card information need to be configured in virtual machine, reading from virtual image file One configuration file, wherein, record has the configuration information of the network interface card of the virtual machine in first configuration file;
Converting unit, for first configuration file to be converted to the be adapted with the system of the virtual machine second configuration text Part;
Dispensing unit, for the network interface card of the virtual machine to be configured using second configuration file.
8. configuration device according to claim 7, which is characterized in that before the reading unit, described device is also wrapped It includes:
Generation unit generates first configuration file for the configuration information of the network interface card based on the virtual machine;
Packaged unit, for first configuration file to be packaged into the virtual image file;
Carry unit, for by the virtual image file carry in the corresponding host equipment of the virtual machine.
9. configuration device according to claim 8, which is characterized in that the generation unit includes:
First generation subelement, for generating dictionary corresponding with the configuration information;
Writing unit, for the information in the dictionary to be written first configuration file in the form of character string.
10. configuration device according to claim 7, which is characterized in that the converting unit includes:
Conversion subunit, for the data of the character string type in first configuration file to be converted to dictionary;
First reading subunit, for reading pre-defined profile template;
Second generation subelement, for by the information in the dictionary, according to the profile template, generation described second to be matched Put file.
CN201611175183.6A 2016-12-16 2016-12-16 The configuration method and device of virtual machine network interface card Pending CN108206750A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611175183.6A CN108206750A (en) 2016-12-16 2016-12-16 The configuration method and device of virtual machine network interface card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611175183.6A CN108206750A (en) 2016-12-16 2016-12-16 The configuration method and device of virtual machine network interface card

Publications (1)

Publication Number Publication Date
CN108206750A true CN108206750A (en) 2018-06-26

Family

ID=62601940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611175183.6A Pending CN108206750A (en) 2016-12-16 2016-12-16 The configuration method and device of virtual machine network interface card

Country Status (1)

Country Link
CN (1) CN108206750A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086121A (en) * 2018-08-08 2018-12-25 郑州云海信息技术有限公司 A kind of virtual machine exterior arrangement method and virtual machine
CN110798346A (en) * 2019-10-25 2020-02-14 北京浪潮数据技术有限公司 Configuration method of newly added network card of Linux virtual machine and related components
CN111614790A (en) * 2019-02-26 2020-09-01 杭州海康威视系统技术有限公司 Virtual machine address configuration system, method and device
CN112241141A (en) * 2020-11-12 2021-01-19 上海电气风电集团股份有限公司 Hardware configuration method, system, device and medium of PLC control system
CN112350866A (en) * 2020-11-06 2021-02-09 北京首都在线科技股份有限公司 Method, device and storage medium for processing virtual machine network card configuration information
CN113419814A (en) * 2021-05-27 2021-09-21 济南浪潮数据技术有限公司 Virtual machine creating method, device, equipment and storage medium in cloud platform
CN117112071A (en) * 2023-10-25 2023-11-24 成都云祺科技有限公司 Cross-platform configuration information conversion method, system, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050138620A1 (en) * 2003-12-18 2005-06-23 Saul Lewites Virtual network interface
CN102033755A (en) * 2009-09-30 2011-04-27 国际商业机器公司 Method and system for running virtual machine mirror image
CN102521063A (en) * 2011-11-30 2012-06-27 广东电子工业研究院有限公司 Shared storage method suitable for migration and fault tolerance of virtual machine
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform
CN102752137A (en) * 2012-06-28 2012-10-24 用友软件股份有限公司 Device and method for actively setting network parameters of virtual machine
CN103530162A (en) * 2013-10-22 2014-01-22 中国科学院信息工程研究所 Automatic online virtual machine software installing method and system
CN103631639A (en) * 2013-11-04 2014-03-12 天津汉柏信息技术有限公司 Automatic detection method for user state virtual network interface card
CN103645945A (en) * 2013-11-04 2014-03-19 天津汉柏信息技术有限公司 Automatic probing and drive loading method of virtual network interface card
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method
CN103902347A (en) * 2012-12-24 2014-07-02 中国电信股份有限公司 Deploying method and system of virtual machine system
CN103970908A (en) * 2014-05-28 2014-08-06 浪潮电子信息产业股份有限公司 Virtual machine template IVF storage method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050138620A1 (en) * 2003-12-18 2005-06-23 Saul Lewites Virtual network interface
CN102033755A (en) * 2009-09-30 2011-04-27 国际商业机器公司 Method and system for running virtual machine mirror image
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform
CN102521063A (en) * 2011-11-30 2012-06-27 广东电子工业研究院有限公司 Shared storage method suitable for migration and fault tolerance of virtual machine
CN102752137A (en) * 2012-06-28 2012-10-24 用友软件股份有限公司 Device and method for actively setting network parameters of virtual machine
CN103902347A (en) * 2012-12-24 2014-07-02 中国电信股份有限公司 Deploying method and system of virtual machine system
CN103530162A (en) * 2013-10-22 2014-01-22 中国科学院信息工程研究所 Automatic online virtual machine software installing method and system
CN103631639A (en) * 2013-11-04 2014-03-12 天津汉柏信息技术有限公司 Automatic detection method for user state virtual network interface card
CN103645945A (en) * 2013-11-04 2014-03-19 天津汉柏信息技术有限公司 Automatic probing and drive loading method of virtual network interface card
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method
CN103970908A (en) * 2014-05-28 2014-08-06 浪潮电子信息产业股份有限公司 Virtual machine template IVF storage method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
默北: "nagios 使用模板生成配置文件", 《HTTP://WWW.TTLSA.COM/NAGIOS/USING-A-TEMPLATE-TO-GENERATE-NAGIOS-CONFIGURATION-FILE/》 *
默默,在路上: "使用T4模板生成不同部署环境下的配置文件", 《HTTPS://WWW.CNBLOGS.COM/SWORDDENG/ARCHIVE/2004/01/13/4309713.HTML》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086121A (en) * 2018-08-08 2018-12-25 郑州云海信息技术有限公司 A kind of virtual machine exterior arrangement method and virtual machine
CN111614790A (en) * 2019-02-26 2020-09-01 杭州海康威视系统技术有限公司 Virtual machine address configuration system, method and device
CN111614790B (en) * 2019-02-26 2022-08-05 杭州海康威视系统技术有限公司 Virtual machine address configuration system, method and device
CN110798346A (en) * 2019-10-25 2020-02-14 北京浪潮数据技术有限公司 Configuration method of newly added network card of Linux virtual machine and related components
CN112350866A (en) * 2020-11-06 2021-02-09 北京首都在线科技股份有限公司 Method, device and storage medium for processing virtual machine network card configuration information
CN112350866B (en) * 2020-11-06 2021-12-21 北京首都在线科技股份有限公司 Method, device and storage medium for processing virtual machine network card configuration information
CN112241141A (en) * 2020-11-12 2021-01-19 上海电气风电集团股份有限公司 Hardware configuration method, system, device and medium of PLC control system
CN113419814A (en) * 2021-05-27 2021-09-21 济南浪潮数据技术有限公司 Virtual machine creating method, device, equipment and storage medium in cloud platform
CN113419814B (en) * 2021-05-27 2022-03-08 济南浪潮数据技术有限公司 Virtual machine creating method, device, equipment and storage medium in cloud platform
CN117112071A (en) * 2023-10-25 2023-11-24 成都云祺科技有限公司 Cross-platform configuration information conversion method, system, equipment and storage medium
CN117112071B (en) * 2023-10-25 2024-01-02 成都云祺科技有限公司 Cross-platform configuration information conversion method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108206750A (en) The configuration method and device of virtual machine network interface card
CN109800056A (en) A kind of block chain dispositions method based on container
CN105939239B (en) Data transmission method and device of virtual network card
US7440415B2 (en) Virtual network addresses
CN106383852A (en) Docker container-based log acquisition method and apparatus
CN104518917A (en) Automatic server patrol inspection method
CN102413044B (en) Method, device, equipment and system for generating DHCP (Dynamic Host Configuration Protocol) Snooping binding table
CN108282527A (en) Generate the distributed system and method for Service Instance
CN105099786B (en) The method and apparatus of business configuration in a kind of network cutover
CN106789363A (en) A kind of method and device to virtual machine configuration network interface card
CN112291094B (en) Container network management method, device, equipment and storage medium
US6718319B1 (en) Method and apparatus for formatting smart cards and card readers
CN108572823A (en) Front and back end development management method and system based on interface engine
CN106406952B (en) Electric terminal and application program management apparatus and method
CN108600282A (en) Micro services dissemination method, device, storage medium and computer equipment
CN108205477A (en) Server stress test method
CN106656714A (en) Communication protocol method and system based on EtherCAT bus
CN106681799A (en) Disk inserting method, device and system
CN105049546B (en) A kind of Dynamic Host Configuration Protocol server is the method and device of client distribution IP address
CN106940771A (en) Leak detection method and device based on file
CN106534342A (en) Connection control method and system, and hosts
CN114650223A (en) Network configuration method and device of Kubernetes cluster and electronic equipment
CN111865905B (en) Ukey-based communication method, device and storage medium
CN109150969A (en) Data transmission method, sorter, terminating machine and data transmission system
CN103309722A (en) Cloud computation system and application access 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
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20180626

RJ01 Rejection of invention patent application after publication