CN103856343B - Configure the method and system of virtual machine network information - Google Patents

Configure the method and system of virtual machine network information Download PDF

Info

Publication number
CN103856343B
CN103856343B CN201210517953.6A CN201210517953A CN103856343B CN 103856343 B CN103856343 B CN 103856343B CN 201210517953 A CN201210517953 A CN 201210517953A CN 103856343 B CN103856343 B CN 103856343B
Authority
CN
China
Prior art keywords
virtual machine
configuration
network
operating system
nbd equipment
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
CN201210517953.6A
Other languages
Chinese (zh)
Other versions
CN103856343A (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.)
Beijing Teamsun Technology Co Ltd
Original Assignee
Beijing Teamsun 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 Teamsun Technology Co Ltd filed Critical Beijing Teamsun Technology Co Ltd
Priority to CN201210517953.6A priority Critical patent/CN103856343B/en
Publication of CN103856343A publication Critical patent/CN103856343A/en
Application granted granted Critical
Publication of CN103856343B publication Critical patent/CN103856343B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of method and system for configuring virtual machine network information, wherein method includes:Acquisition needs the virtual machine attribute information of Configuration network information, according to the virtual machine attribute information, determines the corresponding virtual machine image file of the virtual machine, and target physical main frame is determined according to specific service needed;It is mounted to virtual machine image file as block device under the temp directory of the operating system of target physical main frame, the Network Search configuration file under temp directory, changes network profile and preserve.The method and system of the configuration virtual machine network information that the present invention is provided, can, more stably Configuration network information more efficient for virtual machine, while remotely modifying network profile can be realized, it is to avoid cumbersome manual configuration.

Description

Configure the method and system of virtual machine network information
Technical field
The present invention relates to computer information technology field, more particularly to a kind of method for configuring virtual machine network information and System.
Background technology
Generally there are several ways in Intel Virtualization Technology, most common method is pacified by ISO files when virtual machine is created Dress, is cloned, virtual machine creating masterplate by existing virtual machine, then creates virtual machine etc. by masterplate.
At present, the initial configuration of virtual machine physically is generally divided into two parts, and a part is by operating system Come what is completed, a part is manually completed by user.But in cloud computing environment, there is substantial amounts of virtual machine to run.Virtually Machine may be frequently necessary to change network profile, perform the operation of Configuration network information, and due to the particularity of cloud computing, It is many to complete the virtual machine quantity of configuration operation manually by user, tens, up to a hundred virtual machines may can be once created, such as Fruit is all configured manually by user, then suitable big of workload.
In addition, after virtual machine creating success, how to want to be conducted interviews by network, then be necessary for virtual machine configuration phase The network answered, manually can change relevant configuration to realize, such as WINDOWS can be by configuring locality connection come real Existing, LINUX needs to configure associated documents.When virtual machine is created by masterplate, may relate to change virtual machine network, otherwise The situation of network conflict can be produced.When batch create virtual machine when, it is necessary to substantial amounts of virtual machine network set operation, it is aobvious very Expend energy.
Network control techology (Network Block Device, NBD) makes user that one disk of distance host is empty Between, used as a block device, just as one piece of hard disk.Can very easily by another server using its user Hard drive space, increase on home server.
Therefore for prior art, how the operating efficiency of the virtual machine configuration network information is individual in group system is improved Problem demanding prompt solution.
The content of the invention
The invention provides a kind of method and system for configuring virtual machine network information, it is used to improve virtual in group system The operating efficiency of machine Configuration network information.
A kind of system of the configuration virtual machine network information provided based on above mentioned problem, the present invention, including multiple physics masters Machine, is provided with one or more virtual machines on each physical host, being each equipped with NBD in the operating system of each physical host sets It is standby, the shared of storage is completed by NFS protocol between multiple physical hosts;
The NBD equipment is used to carry out the virtual machine on physical host in group system the configuration of the network information;
Physical host includes acquisition module, wherein:
The acquisition module, the virtual machine attribute information of Configuration network information is needed for obtaining, according to the virtual machine Attribute information, determines the corresponding virtual machine image file of the virtual machine, and target physical main frame is determined according to specific service needed;
The NBD equipment includes carry configuration module, wherein:
The carry configuration module, the behaviour for virtual machine image file to be mounted to target physical main frame as block device Make under the temp directory of system, the Network Search configuration file under temp directory, change network profile and preserve.
It is preferred that used as a kind of embodiment, the carry configuration module includes carry submodule, wherein:
The carry submodule, the NBD equipment for virtual machine image file to be connected to target physical main frame judges The OS Type of the virtual machine of Configuration network information is needed, if the operating system of the virtual machine is WINDOWS operates system System, then generate NBD equipment, and the NBD equipment of generation directly is mounted into the temp directory of target physical host operating system Under;
If the operating system of the virtual machine be LINUX operating systems, judge the virtual machine LINUX system whether There is LVM subregions, if there is LVM subregions, generate NBD equipment and multiple subregions, and in multiple subregions of generation, search The corresponding NBD equipment of LVM subregions, activates subregion corresponding with NBD equipment, and corresponding subregion can produce many height after activation Subregion, investigates one by one to each child partition, if in child partition modification in need network profile, child partition is mounted to Under the temp directory of target physical host operating system;If in the absence of the network profile for needing modification in child partition, will Child partition cancels state of activation;If not existing LVM subregions, NBD equipment is generated, the NBD equipment carries that will directly generate To under the temp directory of target physical host operating system.
It is preferred that used as a kind of embodiment, the carry configuration module also includes default submodule, wherein:
The default submodule, for generate each NBD equipment before, after having preset NBD equipment carries Temp directory position.
It is preferred that used as a kind of embodiment, the carry configuration module also includes modification submodule, wherein:
The modification submodule, in target physical host operating system NBD equipment it is corresponding set in advance Under temp directory, the network profile for needing modification is searched, change the network profile and preserve.
It is preferred that used as a kind of embodiment, the virtual machine attribute information includes the file of virtual machine image file Name and VME operating system type;
The network profile includes the network configuration information of virtual machine, and the network configuration information of the virtual machine includes IP, MAC Address, gateway, subnet close mask, DNS, virtual machine Adapter Name, physical host name.
Correspondingly, present invention also offers a kind of method for configuring virtual machine network information, comprise the following steps:
Acquisition needs the virtual machine attribute information of Configuration network information, according to the virtual machine attribute information, it is determined that described The corresponding virtual machine image file of virtual machine, target physical main frame is determined according to specific service needed;
It is mounted to virtual machine image file as block device under the temp directory of the operating system of target physical main frame, Network Search configuration file under temp directory, changes network profile and preserves.
It is preferred that as a kind of embodiment, it is described to be mounted to object using virtual machine image file as block device Manage under the temp directory of host operating system, comprise the following steps:
Virtual machine image file is connected in the NBD equipment of target physical main frame, judgement needs Configuration network information The OS Type of virtual machine, if the operating system of the virtual machine is WINDOWS operating systems, generates NBD equipment, Directly the NBD equipment of generation is mounted under the temp directory of target physical host operating system;
If the operating system of the virtual machine be LINUX operating systems, judge the virtual machine LINUX system whether There is LVM subregions, if there is LVM subregions, generate NBD equipment and multiple subregions, and in multiple subregions of generation, search The corresponding NBD equipment of LVM subregions, activates subregion corresponding with NBD equipment, and corresponding subregion can produce many height after activation Subregion, investigates one by one to each child partition, if in child partition modification in need network profile, child partition is mounted to Under the temp directory of target physical host operating system;If in the absence of the network profile for needing modification in child partition, will Child partition cancels state of activation;If not existing LVM subregions, NBD equipment is generated, the NBD equipment carries that will directly generate To under the temp directory of target physical host operating system.
It is preferred that as a kind of embodiment, also comprising the following steps when carry is performed:
Before each NBD equipment is generated, the temp directory position after NBD equipment carries has been preset.
It is preferred that used as a kind of embodiment, after the execution carry, Network Search is matched somebody with somebody under being additionally included in temp directory File is put, the step of changing and preserve:
Under the corresponding temp directory set in advance of NBD equipment in target physical host operating system, searching needs The network profile of modification, changes the network profile and preserves;
It is preferred that used as a kind of embodiment, the collocation method also comprises the following steps:
After virtual machine startup, dummy machine system loads amended network profile, and carries out Configuration network information Operation.
Beneficial effects of the present invention include:
The invention provides a kind of method and system for configuring virtual machine network information, wherein method includes:Obtaining needs The virtual machine attribute information of Configuration network information, according to the virtual machine attribute information, determines that the virtual machine is corresponding virtual Machine image file, target physical main frame is determined according to specific service needed;It is mounted to virtual machine image file as block device Under the temp directory of the operating system of target physical main frame, the Network Search configuration file under temp directory changes network configuration File is simultaneously preserved.The method and system of the configuration virtual machine network information that the present invention is provided, are that virtual machine sets network letter automatically Breath, reduces manual intervention and workload, so as to improve the efficiency of the virtual machine configuration network information, while remotely modifying can be realized Network profile, this will further improve allocative efficiency.
Brief description of the drawings
Fig. 1 is the system structure diagram of one embodiment of the system of present invention configuration virtual machine network information;
Fig. 2 is the structural representation of the NBD equipment in the system embodiment of present invention configuration virtual machine network information in Fig. 1 Figure;
Fig. 3 is the system structure diagram of another embodiment of the system of present invention configuration virtual machine network information;
Fig. 4 is the schematic flow sheet of one embodiment of the method for present invention configuration virtual machine network information;
Fig. 5 is the method for present invention configuration virtual machine network information in specific one embodiment for performing carry configuration operation Schematic flow sheet.
Specific embodiment
With reference to Figure of description, to the method and system for configuring virtual machine network information in the embodiment of the present invention Specific embodiment is illustrated.
The system 1 of configuration virtual machine network information is the embodiment of the invention provides, as shown in figure 1, the configuration system 1 is wrapped Multiple physical hosts 2 are included, one or more virtual machines 20, the operation system of each physical host 2 are provided with each physical host 2 NBD equipment 211 is each equipped with system 21, the shared of storage is completed by NFS protocol between multiple physical hosts, the NBD sets Standby 211 configurations for being used to realize the virtual machine on physical host in group system the network information, in systems, install NBD and set Each physical host after standby can mutually realize the carry of virtual machine image file as NBD servers or client With the operation of modification network profile, the NBD equipment 211 includes carry configuration module 2111, as shown in Fig. 2 wherein:
Physical host 2 includes acquisition module 22, wherein:
The acquisition module 22, the virtual machine attribute information of Configuration network information is needed for obtaining, according to described virtual Machine attribute information, determines the corresponding virtual machine image file of the virtual machine, and target physical master is determined according to specific service needed Machine;
The NBD equipment 211 includes carry configuration module 2111, wherein:
The carry configuration module 2111, for being mounted to target physical main frame using virtual machine image file as block device Operating system temp directory under, the Network Search configuration file under temp directory, modification network profile simultaneously preserve.
It should be noted that being mounted on network control techology in the operating system of each physical host(NBD), after installation Each physical host can be by regarding NBD server and client sides, it is possible to mutually realize virtual machine image text as needed The carry of part processes and changes the operation of network profile therein.
Target physical main frame is determined according to specific service needed, when being installed in the operating system of target physical main frame, tool Body comprises the following steps:
User needs to install NBD equipment and related tool on server end and client(For example:Nbd-server and Nbd-client instruments).NBD.KO is put into the operation system of target physical main frame as a kind of system kernel module, user for NBD In system kernel, and load.
The order provided by NBD equipment, is mounted to system temp directory by virtual machine image file first, and order is such as Under:qemu-nbd–c nbd—name(Nbd titles, can generate the NBD equipment of fixed qty by specifying)image-name (Virtual machine image file title is virtual machine attribute information), after having performed order above, NBD equipment can generate corresponding NBD Sub- equipment;After installation is complete, then need to be mounted to virtual machine image file as block device the operation of target physical main frame Under the temp directory of system.
It is preferred that used as a kind of embodiment, the carry configuration module 2111 includes carry submodule, wherein:
The carry submodule, the NBD equipment for virtual machine image file to be connected to target physical main frame judges The OS Type of the virtual machine of Configuration network information is needed, if the operating system of the virtual machine is WINDOWS operates system System, then generate NBD equipment, and the NBD equipment of generation directly is mounted into the temp directory of target physical host operating system Under;
If the operating system of the virtual machine be LINUX operating systems, judge the virtual machine LINUX system whether There is LVM subregions, if there is LVM subregions, generate NBD equipment and multiple subregions, and in multiple subregions of generation, search The corresponding NBD equipment of LVM subregions, activates subregion corresponding with NBD equipment, and corresponding subregion can produce many height after activation Subregion, investigates one by one to each child partition, if in child partition modification in need network profile, child partition is mounted to Under the temp directory of target physical host operating system;If in the absence of the network profile for needing modification in child partition, will Child partition cancels state of activation;If not existing LVM subregions, NBD equipment is generated, the NBD equipment carries that will directly generate To under the temp directory of target physical host operating system.
It is preferred that used as a kind of embodiment, the carry configuration module 2111 also includes default submodule, wherein:
The default submodule, for before each NBD equipment is generated, having preset NBD equipment carries Temp directory position afterwards.
It is preferred that used as a kind of embodiment, the carry configuration module 2111 also includes modification submodule, wherein:
The modification submodule, the modification submodule, for the NBD equipment pair in target physical host operating system Under the temp directory set in advance answered, the network profile for needing modification is searched, change the network profile and protect Deposit.
Changing the network profile includes write-in network configuration script and registry information.
It is preferred that including the filename of virtual machine image file as virtual machine attribute information described in a kind of embodiment With VME operating system type;
The network profile includes the network configuration information of virtual machine, and the network configuration information of the virtual machine includes IP, MAC Address, gateway, subnet close mask, DNS, virtual machine Adapter Name, physical host name.
For example, in embodiments of the present invention, the system that Fig. 3 illustrates present invention configuration virtual machine network information is implemented In configuration process.
In figure 3, with two physical hosts in group system(Physical host A and physical host B)As a example by, physical host There is individual virtual machine on B or A(Virtual Machine, VM), virtual machine is VM1, and the corresponding image files of VM1 are img1(img Formatted file is a kind of virtual machine image file), it is assumed that the corresponding image files of VM1 are on physical host B.Physical host A and physical host B passes through NFS protocol(Network File System)Share directory and file.By using NFS, physics master Machine A routine accesses distal end(Physical host B)Image file in system.
Simultaneously, it is assumed that in physical host A according to service needed as target physical main frame, then need to be in the behaviour of physical host A Installation NBD kernel modules are embedded in as system.Carry configuration module performs carry operation, by the mirror image text on physical host B Part is mounted under physical host A temp directorys, then the Network Search configuration file under temp directory, and modification network configuration information is simultaneously Preserve network profile.
It will be understood by those skilled in the art that the essence of the embodiment of the present invention is by NBD equipment, by virtual machine mirror As file is mounted under the temp directory of target physical host computer system as block device, on physical host can remotely or this Ground modification network profile, after virtual machine startup, can direct Configuration network information when reading virtual machine image file.
Based on same inventive concept, the embodiment of the present invention additionally provides a kind of method for configuring virtual machine network information, by In the method solve problem principle by it is foregoing it is a kind of configure virtual machine network information system realize, therefore the method reality The implementation that may refer to aforementioned system function is applied, part is repeated and is repeated no more.
A kind of method for configuring virtual machine network information provided in an embodiment of the present invention, Fig. 4 is matching somebody with somebody for the embodiment of the present invention Put the method flow diagram of virtual machine network information.As shown in figure 4, the method that the present embodiment is used includes following several steps:
Step S100, acquisition need the virtual machine attribute information of Configuration network information, according to the virtual machine attribute information, Determine the corresponding virtual machine image file of the virtual machine, target physical main frame is determined according to specific service needed;
Step S200, using virtual machine image file as block device be mounted to target physical main frame operating system it is interim Under catalogue, the Network Search configuration file under temp directory is changed network profile and is preserved.
It is preferred that as a kind of embodiment, it is in step s 200, described using virtual machine image file as block device It is mounted under the temp directory of target physical host operating system, comprises the following steps:
Virtual machine image file is connected in the NBD equipment of target physical main frame, judgement needs Configuration network information The OS Type of virtual machine, if the operating system of the virtual machine is WINDOWS operating systems, generates NBD equipment, Directly the NBD equipment of generation is mounted under the temp directory of target physical host operating system;
If the operating system of the virtual machine be LINUX operating systems, judge the virtual machine LINUX system whether There is LVM subregions, if there is LVM subregions, generate NBD equipment and multiple subregions, and in multiple subregions of generation, search The corresponding NBD equipment of LVM subregions, activates subregion corresponding with NBD equipment, and corresponding subregion can produce many height after activation Subregion, investigates one by one to each child partition, if in child partition modification in need network profile, child partition is mounted to Under the temp directory of target physical host operating system;If in the absence of the network profile for needing modification in child partition, will Child partition cancels state of activation;If not existing LVM subregions, NBD equipment is generated, the NBD equipment carries that will directly generate To under the temp directory of target physical host operating system.
It is preferred that as a kind of embodiment, in step s 200, also comprising the following steps when carry is performed:
Before each NBD equipment is generated, the temp directory position after NBD equipment carries has been preset.
It is preferred that as a kind of embodiment, in step s 200, after the execution carry, being additionally included in interim mesh The lower Network Search configuration file of record, the step of changing and preserve:
Into target physical host operating system, NBD equipment is corresponding in advance in target physical host operating system Under the temp directory of setting, the network profile for needing modification is searched, change the network profile and preserve;
It is preferred that used as a kind of embodiment, the collocation method also comprises the following steps in S300,:
Step S300, after virtual machine startup, dummy machine system loads amended network profile, and realizes automatic The operation of Configuration network information.
In step s 200, the order for being provided by NBD equipment, is mounted to system interim by virtual machine image file first Catalogue, orders as follows:
qemu-nbd-c nbd—name(Nbd titles, can generate the NBD equipment of fixed qty by specifying) image-name(Virtual machine image file title), after having performed order above, NBD equipment can generate corresponding NBD equipment; If virtual machine LINUX operating systems have LVM subregions, can also generate corresponding according to the LVM subregions of loaded image file Multiple subregions.
NBD equipment can be different according to the OS Type of virtual machine, realize that the mode of carry is also different.For example, OS Type according to virtual machine is different, such as WINDOWS or LINUX system.
Situation one, for WINDOWS system virtual machines;NBD equipment generates NBD equipment, directly sets NBD of generation It is standby to be mounted under the default temp directory of target physical host operating system.
Situation two, for LINUX system virtual machine;Then judge the LINUX system of the virtual machine with the presence or absence of LVM points Area, if there is LVM subregions, generates NBD equipment and multiple subregions, then the subregion execution carry operation to needing, following example Son describes above-mentioned specific implementation step in detail.
For example, NBD equipment generates multiple NBD equipment, including entitled NBD0, NBD1, NBD2 ... NBD16 NBD equipment, because the LINUX system of the virtual machine has LVM subregions, then generate sub- equipment simultaneously, also generate each Corresponding multiple subregions of sub- equipment, and in multiple subregions of generation, search the corresponding NBD equipment of LVM subregions, activation with The corresponding subregion of NBD equipment, corresponding subregion can produce multiple child partitions after activation, for example:The sub- equipment of NBD0 is corresponding more Individual subregion be NBD0sp1, NBD0sp2, NBD0sp3 ... NBD0spN.(N is constant).For example drawn by test NBD0sp1 is system partitioning, then to enter line activating to NBD0sp1, and the corresponding subregion after activation can be produced to individual child partition, right Each child partition therein is investigated one by one, if in child partition modification in need network profile, child partition is mounted to Under the temp directory of target physical host operating system;Wherein, for not having to need the network profile changed then in subregion Cancel carry, if the NBD equipment at place is not system partitioning(In the absence of the network profile to be changed), then NBD is unloaded Sub- equipment, to prepare for the next use.
For the virtual machine of LINUX operating systems, the mode of subregion is different, be there is also by way of NBD carries are processed Difference, as shown in figure 5, wherein, Ubuntu is identical with the processing mode of Debian, Centos is identical with Redhat modes.First By NBD carry image files, indistinction herein, but there is the image file with non-LVM subregions of LVM subregions, complete the After one step, the added nbd equipment come that sets out is different, checks to be also to have any different by disk management instrument in systems , specific difference is that the file that there is LVM subregions can generate LVM points be associated with NBD equipment in disk management Area, rather than the file of LVM subregions is will not to load out this partial-partition content.
If to carry out carry to file in LVM, it is necessary to once be processed, found out by LVM system commands first That subregion device-dependent with NBD(Other LVM subregions are there may exist in system), after finding, activated by LVM Command enters line activating, and after activation, LVM states can be shown as state of activation, now can be just mounted to interim mesh , may there are multiple small subregions after LVM activation under it in record(Child partition), because the file to be changed does not know That child partition inside is investigated, it is necessary to carry out carry one by one, until finding the child partition of file including changing and by child partition It is mounted under the temp directory of target physical host operating system.After using terminating, in addition it is also necessary to by LVM de-activated, it is ensured that The use of next time is normal.
There is no the file of LVM subregions, then the NBD equipment for directly generating is mounted to temp directory, grasped without more than Make.
In embodiments of the present invention, the method that the embodiment of the present invention provides configuration virtual machine network information, can be than existing More stable, more efficient configuration operation is realized in the manual setting having, while realizing remotely modifying network profile.So, only hang The file that configuration is needed in image file is carried, it also avoid using a large amount of cumbersome configurators.
A kind of method and system for configuring virtual machine network information are the embodiment of the invention provides, wherein method includes:Obtain The virtual machine attribute information for needing Configuration network information is taken, according to the virtual machine attribute information, the virtual machine correspondence is determined Virtual machine image file, target physical main frame is determined according to specific service needed;Using virtual machine image file as block device It is mounted under the temp directory of the operating system of target physical main frame, the Network Search configuration file under temp directory, changes net Network configuration file is simultaneously preserved.The method and system of configuration virtual machine network information provided in an embodiment of the present invention are virtual machine from It is dynamic that the network information is set, manual intervention and workload are reduced, so as to improve the efficiency of the virtual machine configuration network information, while can Remotely modifying network profile is realized, this will further improve allocative efficiency.
Embodiment described above only expresses several embodiments of the invention, and its description is more specific and detailed, but simultaneously Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention Shield scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

1. a kind of system for configuring virtual machine network information, including multiple physical hosts, is provided with one on each physical host Or multiple virtual machines, it is characterised in that NBD equipment, multiple physical hosts are each equipped with the operating system of each physical host Between the shared of storage is completed by NFS protocol;
The NBD equipment is used to carry out the virtual machine on physical host in group system the configuration of the network information;
Physical host includes acquisition module, wherein:
The acquisition module, the virtual machine attribute information of Configuration network information is needed for obtaining, according to the virtual machine attribute Information, determines the corresponding virtual machine image file of the virtual machine, and target physical main frame is determined according to specific service needed;
The NBD equipment includes carry configuration module, wherein:
The carry configuration module, the operation system for virtual machine image file to be mounted to target physical main frame as block device Under the temp directory of system, the Network Search configuration file under temp directory is changed network profile and is preserved, and the carry is matched somebody with somebody Putting module includes carry submodule, wherein:
The carry submodule, the NBD equipment for virtual machine image file to be connected to target physical main frame judges to need The OS Type of the virtual machine of Configuration network information, if the operating system of the virtual machine is WINDOWS operating systems, , directly be mounted to the NBD equipment of generation under the temp directory of target physical host operating system by generation NBD equipment.
2. it is according to claim 1 configuration virtual machine network information system, it is characterised in that:
The carry submodule, if the operating system for being additionally operable to the virtual machine is LINUX operating systems, judges described virtual The LINUX system of machine whether there is LVM subregions, if there is LVM subregions, generate NBD equipment and multiple subregions, and in generation Multiple subregions in, search the corresponding NBD equipment of LVM subregions, activate subregion corresponding with NBD equipment, after activation correspondingly Subregion can produce multiple child partitions, each child partition is investigated one by one, if in child partition modification in need network configuration text , then be mounted to child partition under the temp directory of target physical host operating system by part;If not existing in child partition needs modification Network profile, then child partition is cancelled into state of activation;If not existing LVM subregions, NBD equipment is generated, directly will The NBD equipment of generation is mounted under the temp directory of target physical host operating system.
3. it is according to claim 2 configuration virtual machine network information system, it is characterised in that the carry configuration module Also include default submodule, wherein:
The default submodule, for before each NBD equipment is generated, having preset facing after NBD equipment carries When directory location.
4. it is according to claim 3 configuration virtual machine network information system, it is characterised in that the carry configuration module Also include modification submodule, wherein:
The modification submodule, in target physical host operating system NBD equipment it is corresponding set in advance interim Under catalogue, the network profile for needing modification is searched, change the network profile and preserve.
5. according to any one of claim 1-4 configuration virtual machine network information system, it is characterised in that the void Plan machine attribute information includes the filename and VME operating system type of virtual machine image file;
The network configuration information of the network profile including virtual machine, the network configuration information of the virtual machine include IP, MAC Address, gateway, subnet close mask, DNS, virtual machine Adapter Name, physical host name.
6. it is a kind of configure virtual machine network information method, it is characterised in that comprise the following steps:
Acquisition needs the virtual machine attribute information of Configuration network information, according to the virtual machine attribute information, determines described virtual The corresponding virtual machine image file of machine, target physical main frame is determined according to specific service needed;
It is mounted to virtual machine image file as block device under the temp directory of the operating system of target physical main frame, interim Network Search configuration file under catalogue, changes network profile and preserves, and
It is described to be mounted to virtual machine image file as block device under the temp directory of target physical host operating system, including Following steps:
Virtual machine image file is connected in the NBD equipment of target physical main frame, judgement needs the virtual of Configuration network information The OS Type of machine, if the operating system of the virtual machine is WINDOWS operating systems, generates NBD equipment, directly The NBD equipment of generation is mounted under the temp directory of target physical host operating system.
7. it is according to claim 6 configuration virtual machine network information method, it is characterised in that it is described by virtual machine image File is mounted under the temp directory of target physical host operating system as block device, is also comprised the following steps:
If the operating system of the virtual machine is LINUX operating systems, judge that the LINUX system of the virtual machine whether there is LVM subregions, if there is LVM subregions, generate NBD equipment and multiple subregions, and in multiple subregions of generation, search LVM The corresponding NBD equipment of subregion, activates subregion corresponding with NBD equipment, and corresponding subregion can produce many height point after activation Area, investigates one by one to each child partition, if in child partition modification in need network profile, child partition is mounted to mesh Mark under the temp directory of physical host operating system;If in the absence of the network profile for needing modification in child partition, by son Subregion cancels state of activation;If not existing LVM subregions, NBD equipment is generated, be directly mounted to the NBD equipment of generation Under the temp directory of target physical host operating system.
8. according to claim 6 or 7 configuration virtual machine network information method, it is characterised in that perform carry when Also comprise the following steps:
Before each NBD equipment is generated, the temp directory position after NBD equipment carries has been preset.
9. it is according to claim 8 configuration virtual machine network information method, it is characterised in that after the execution carry, Network Search configuration file under temp directory is additionally included in, the step of changing and preserve:
Under the corresponding temp directory set in advance of NBD equipment in target physical host operating system, lookup needs modification Network profile, change the network profile and simultaneously preserve.
10. it is according to claim 6 configuration virtual machine network information method, it is characterised in that the collocation method is also Comprise the following steps:
After virtual machine startup, dummy machine system loads amended network profile, and carries out the behaviour of Configuration network information Make.
CN201210517953.6A 2012-12-05 2012-12-05 Configure the method and system of virtual machine network information Active CN103856343B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210517953.6A CN103856343B (en) 2012-12-05 2012-12-05 Configure the method and system of virtual machine network information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210517953.6A CN103856343B (en) 2012-12-05 2012-12-05 Configure the method and system of virtual machine network information

Publications (2)

Publication Number Publication Date
CN103856343A CN103856343A (en) 2014-06-11
CN103856343B true CN103856343B (en) 2017-07-07

Family

ID=50863588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210517953.6A Active CN103856343B (en) 2012-12-05 2012-12-05 Configure the method and system of virtual machine network information

Country Status (1)

Country Link
CN (1) CN103856343B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155759B (en) * 2015-03-26 2019-05-28 华为软件技术有限公司 Virtual machine batch creation method and device
CN105306622B (en) * 2015-11-30 2018-08-10 南京优速网络科技有限公司 A kind of cloud net fusion domain name analysis system and its DNS service method
CN105573819A (en) * 2015-12-11 2016-05-11 国云科技股份有限公司 Method for obtaining disk capacity information of virtual machine directly through host machine
CN105573820A (en) * 2015-12-15 2016-05-11 国云科技股份有限公司 Hot plug method for Xen virtual machine compact disc
CN107493204B (en) * 2016-06-13 2021-03-02 阿里巴巴集团控股有限公司 Mirror image detection method and device
CN107608753A (en) * 2016-07-12 2018-01-19 阿里巴巴集团控股有限公司 A kind of virtual machine creation method and device
CN106383796B (en) * 2016-10-18 2019-06-14 广州视睿电子科技有限公司 A kind of recognition methods and system of host operating system type
CN106656621A (en) * 2016-12-31 2017-05-10 云宏信息科技股份有限公司 Method and system for configuring virtual machine DNS based on XEN
CN107463427A (en) * 2017-06-29 2017-12-12 北京北信源软件股份有限公司 The acquisition methods and device of a kind of VME operating system type and version
CN107463404A (en) * 2017-08-03 2017-12-12 浪潮(北京)电子信息产业有限公司 Increase the method and system of configuration file in a kind of system to virtual machine file
CN107861761B (en) * 2017-10-31 2021-03-16 北京青云科技股份有限公司 Starting method and system of physical host
CN108170508A (en) * 2017-12-12 2018-06-15 顺丰科技有限公司 Batch creates method, apparatus, equipment and its storage medium of virtual machine
CN110618896A (en) * 2018-06-19 2019-12-27 深信服科技股份有限公司 Data processing method and device, equipment and computer storage medium
CN110333931A (en) * 2019-05-27 2019-10-15 北京迈格威科技有限公司 The system of shared storage for training pattern
CN112653739A (en) * 2020-12-14 2021-04-13 南京壹进制信息科技有限公司 Agent emergency disaster recovery method and system for externally-assigned virtual machine network
CN114675926A (en) * 2020-12-24 2022-06-28 中兴通讯股份有限公司 Virtual machine attribute changing method and device, storage medium and electronic device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088367A (en) * 2010-12-10 2011-06-08 北京世纪互联工程技术服务有限公司 Method for quickly deploying in virtualization environment
CN102455929A (en) * 2011-08-19 2012-05-16 中标软件有限公司 Method for conveniently generating original equipment manufacturer (OEM) Linux installation mirror image
CN102662727A (en) * 2012-04-05 2012-09-12 北京天地云箱科技有限公司 Virtual machine creating method and virtual machine creating device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8954645B2 (en) * 2011-01-25 2015-02-10 International Business Machines Corporation Storage writes in a mirrored virtual machine system
CN102567075B (en) * 2011-12-05 2015-01-21 中标软件有限公司 Virtual machine context setting method in cloud computing environment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088367A (en) * 2010-12-10 2011-06-08 北京世纪互联工程技术服务有限公司 Method for quickly deploying in virtualization environment
CN102455929A (en) * 2011-08-19 2012-05-16 中标软件有限公司 Method for conveniently generating original equipment manufacturer (OEM) Linux installation mirror image
CN102662727A (en) * 2012-04-05 2012-09-12 北京天地云箱科技有限公司 Virtual machine creating method and virtual machine creating device

Also Published As

Publication number Publication date
CN103856343A (en) 2014-06-11

Similar Documents

Publication Publication Date Title
CN103856343B (en) Configure the method and system of virtual machine network information
CN103425511B (en) The system and method for application software installation and deployment in cloud computing environment
EP2765508B1 (en) Installation method and installation device for application software
CN110413288B (en) Application deployment method, device, server and storage medium
US8738883B2 (en) Snapshot creation from block lists
CN103514023B (en) The method and system that a kind of virtual machine off-line automatic software is installed
US8924954B2 (en) Application software installation method and application software installation apparatus
US11132450B2 (en) Accessing file systems in a virtual environment
US7761867B2 (en) Method and system for creation of operating system partition table
US20200341749A1 (en) Upgrading a storage controller operating system without rebooting a storage system
US20170308330A1 (en) Container migration utilizing state storage of partitioned storage volume
EP2944070B1 (en) Service migration across cluster boundaries
US8423734B2 (en) Making automated use of data volume copy service targets
CN102799464A (en) Virtual machine creation method, virtual machine creation system, virtual machine resetting method and virtual machine resetting system
CN109818934B (en) Method and device for automatically processing logs and computing equipment
US10084652B2 (en) Customizing network configuration of virtual machines using subnet mapping rules
CN106598692A (en) Method for creating mirror image file in logical volume and starting virtual machine, and server
CN104850442A (en) Operating system mounting method and device
US20180083887A1 (en) Automatic consolidation of network resources
JP5951002B2 (en) Selective policy enables component propagation between a host and multiple guests
JP2023518136A (en) FILE PROCESSING METHOD, APPARATUS, ELECTRONIC DEVICE, STORAGE MEDIUM, AND PROGRAM
EP4155994A1 (en) Automated generation of objects for kubernetes services
CN110413311A (en) ' In System Reconfiguration Method and server
CN106775451A (en) A kind of method and device for processing logical volume
US10002001B1 (en) Importing a virtual disk image into a compute service environment

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