CN111240803B - Method and system for configuring network for multiple Linux system virtual machines - Google Patents

Method and system for configuring network for multiple Linux system virtual machines Download PDF

Info

Publication number
CN111240803B
CN111240803B CN202010026808.2A CN202010026808A CN111240803B CN 111240803 B CN111240803 B CN 111240803B CN 202010026808 A CN202010026808 A CN 202010026808A CN 111240803 B CN111240803 B CN 111240803B
Authority
CN
China
Prior art keywords
configuration
linux
virtual machine
operating system
network
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
CN202010026808.2A
Other languages
Chinese (zh)
Other versions
CN111240803A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010026808.2A priority Critical patent/CN111240803B/en
Publication of CN111240803A publication Critical patent/CN111240803A/en
Application granted granted Critical
Publication of CN111240803B publication Critical patent/CN111240803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a system for configuring a network for various Linux system virtual machines, wherein an IP program is run in the Linux virtual machine, the program is used for detecting whether the Linux virtual machine operating system is in a compatible Linux operating system list, and the IP is configured by using a network configuration service in the virtual machine. The method is simple and easy to implement, can effectively improve the IP configuration efficiency of the network card, and saves time.

Description

Method and system for configuring network for multiple Linux system virtual machines
Technical Field
The invention relates to the technical field of network configuration, in particular to a method and a system for configuring a network for a plurality of Linux system virtual machines.
Background
When a virtual machine of a virtualization platform is used to run a service, a virtual machine is usually created first, a Linux operating system is installed for the virtual machine, then the service to be run is deployed in the virtual machine, finally the virtual machine is converted into a virtual machine template, and when the same service needs to be deployed subsequently, the virtual machine is directly deployed through the virtualization template. When the Linux virtual machine is deployed through the virtual machine template, the effective IP address is directly configured for the new virtual machine after the deployment of the virtual machine is finished. When a plurality of virtual machines are deployed through the template, the available IP functions are configured for the virtual machines when new virtual machines are deployed, and the method is very practical.
Under the condition that the virtual machine is not accessed, the virtual machine is operated on the virtual machine in the virtual machine management platform, for example, the function of safely closing the virtual machine of the virtual machine management platform is that the closing operation is installed below the virtual machine management platform, and the actual shutdown program is in the virtual machine, so that the same effect of closing the virtual machine and accessing the virtual machine operating system for shutdown can be realized. Therefore, the virtualization management platform configures the IP for the virtual machine, and the program for configuring the IP can also run in the virtual machine. However, the Linux virtual machine operating systems managed by the virtualization platform are of too many types, such as reddat, CentOS, Ubuntu, or SuSe, and the IP configuration modes of different Linux virtual machine systems or programs for managing the network card IP configuration are different, and if the virtualization platform is to implement the configuration of IP addresses for virtual machines when deploying the Linux virtual machines, it is necessary to be compatible with multiple types of Linux virtual machine network card IP configurations.
Disclosure of Invention
The invention aims to provide a method and a system for configuring a network for a plurality of Linux system virtual machines, which aim to solve the problem that the prior art can not be compatible with IP (Internet protocol) configuration of a plurality of Linux virtual machine network cards, realize network configuration of the plurality of virtual machine Linux system virtual machines of a virtualization platform and improve the IP configuration efficiency.
In order to achieve the technical purpose, the invention provides a method for configuring a network for a plurality of Linux system virtual machines, which comprises the following steps:
s1, forming a compatible Linux operating system list according to the Linux operating system type subjected to the IP configuration program compatibility adaptation;
s2, an IP configuration program built in the virtual machine receives configuration IP operation and IP address information issued by the virtualization platform, and obtains the system type and version of the Linux virtual machine;
s3, checking whether the virtual machine operating system type exists in a compatible Linux operating system list, and when the virtual machine operating system type exists, performing IP configuration through an internal network configuration service; and when the IP configuration program does not exist, performing IP configuration through a network configuration service supported by the IP configuration program.
Preferably, when the virtual machine operating system type exists in the Linux compatible operating system list, such as when the internal network configuration service part is abnormal, the IP configuration is performed by using an IP command common to Linux.
Preferably, when the type of the virtual machine operating system does not exist in the list of the compatible Linux operating systems, such as the network configuration service supported by the IP configuration program does not exist or is abnormal, the IP configuration is performed through a Linux general IP command.
The invention also provides a system for configuring a network for a plurality of Linux system virtual machines, which comprises:
the compatible operating system list maintenance module is used for forming a compatible Linux operating system list according to the type of the Linux operating system subjected to the IP configuration program compatibility adaptation;
the virtual machine operating system type acquisition module is used for receiving configuration IP operation and IP address information issued by a virtualization platform by an IP configuration program built in the virtual machine and acquiring the system type and version of the Linux virtual machine;
the IP configuration module is used for checking whether the type of the virtual machine operating system exists in a compatible Linux operating system list or not, and when the type of the virtual machine operating system exists, IP configuration is carried out through internal network configuration service; and when the IP configuration program does not exist, performing IP configuration through a network configuration service supported by the IP configuration program.
Preferably, when the virtual machine operating system type exists in the Linux compatible operating system list, such as when the internal network configuration service part is abnormal, the IP configuration is performed by using an IP command common to Linux.
Preferably, when the type of the virtual machine operating system does not exist in the compatible Linux operating system list, such as the network configuration service supported by the IP configuration program does not exist or is abnormal, the IP configuration is performed through the Linux general IP command.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
compared with the prior art, the method and the device have the advantages that the IP configuration program is operated in the Linux virtual machine, whether the Linux virtual machine operating system is in the compatible Linux operating system list or not is detected by using the IP configuration program, the IP is configured by using the network configuration service in the virtual machine, when the Linux virtual machine system cannot be compatible, the IP configuration is carried out on the Linux virtual machine network card by adopting the universal IP command, and the network configuration is carried out on the virtual machines of the virtual machine Linux systems of the virtualization platforms. The method is simple and easy to implement, can effectively improve the IP configuration efficiency of the network card and saves time.
Drawings
FIG. 1 is a logic flow diagram of a method for configuring a network for multiple Linux system virtual machines provided in an embodiment of the present invention;
fig. 2 is a system block diagram of configuring a network for multiple Linux system virtual machines according to an embodiment of the present invention.
Detailed Description
In order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
The following describes a method and a system for configuring a network for multiple Linux system virtual machines in detail, which are provided by the embodiments of the present invention, with reference to the accompanying drawings.
As shown in fig. 1, the present invention discloses a method for configuring a network for multiple Linux system virtual machines, which comprises the following steps:
s1, forming a compatible Linux operating system list according to the Linux operating system type subjected to the IP configuration program compatibility adaptation;
s2, an IP configuration program built in the virtual machine receives configuration IP operation and IP address information issued by the virtualization platform, and obtains the system type and version of the Linux virtual machine;
s3, checking whether the virtual machine operating system type exists in a compatible Linux operating system list, and when the virtual machine operating system type exists, performing IP configuration through an internal network configuration service; and when the IP configuration program does not exist, performing IP configuration through a network configuration service supported by the IP configuration program.
The embodiment of the invention does not relate to a virtualization management platform, issues the operation of configuring the IP to the inside of the virtual machine, only cares about how the program for configuring the IP running in the inside of the virtual machine can be compatible with various Linux operating systems, and reliably configures the IP address into the virtual machine.
The network card IP configuration program is operated in the virtual machine, a compatible Linux operating system list is maintained, the Linux operating system list basically comprises all Linux operating system types, and the IP configuration programs of the Linux systems in the Linux operating system list are subjected to compatibility adaptation, so that the IP configuration can be more reliably carried out on the virtual machine.
If the Linux virtual machine system type is in the compatible Linux operating system list, the corresponding IP configuration program can be directly run for configuration, and when the IP configuration is performed, network configuration services in the Linux system are used for configuration, for example, a Suse12 version operating system maintains network configuration through a wicked network, most Linux systems maintain network configuration by using a NetworkManager, and the network configuration services all have related network configuration commands to perform IP address configuration on the network cards. The IP address can be better configured by using the network maintenance software in the Linux virtual machine system to configure the IP address.
If the system type of the Linux virtual machine is not in the compatible Linux operating system list, checking whether a network configuration service supported by an IP address configuration program is contained in the Linux system, and if the network configuration service exists and can be used by the service configuration program, using the network service to perform IP address configuration. If the supported network configuration service cannot be detected, a Linux system universal IP configuration mode is used, for example, the network card can be configured by IP commands supported by the Linux system, but the configuration mode can ensure normal configuration of the IP, but the IP address cannot be persisted to a configuration file because the network card configuration rule of the Linux system is unclear, and the IP address may be lost after the system is restarted, so that the network card needs to be configured by the universal IP command again when the IP address is lost after the system is restarted.
And the IP configuration program in the Linux virtual machine receives the configuration IP operation and the IP address information sent by the virtualization platform, acquires the system type and the version of the Linux virtual machine, and checks whether the system type and the version of the Linux virtual machine are in a compatible Linux operating system list.
If the Linux virtual machine system type is the supported system type, executing the following steps:
checking network configuration service in the Linux system, and if the network configuration service is available, carrying out IP configuration through a related configuration command of the network service; and if the network configuration service is abnormal, performing IP configuration through a Linux general IP command.
If the Linux virtual machine system type is not the supported system type, executing the following steps:
checking whether a network configuration service supported by an IP configuration program exists in the Linux system, and if the supported network configuration service is available, carrying out IP configuration through a related configuration command of the network service; and if the network service does not exist or is abnormal, carrying out IP configuration through a Linux general IP command.
The embodiment of the invention realizes the network configuration of various virtual machine Linux system virtual machines of a virtualization platform by running the program for configuring the IP inside the Linux virtual machine, detecting whether the Linux virtual machine operating system is in the compatible Linux operating system list by using the program, configuring the IP by using the network configuration service inside the virtual machine, and carrying out the IP configuration on the Linux virtual machine network card by adopting a general IP command when the Linux virtual machine system can not be compatible. The method is simple and easy to implement, can effectively improve the IP configuration efficiency of the network card and saves time.
As shown in fig. 2, an embodiment of the present invention further discloses a system for configuring a network for multiple Linux system virtual machines, where the system includes:
the compatible operating system list maintenance module is used for forming a compatible Linux operating system list according to the type of the Linux operating system subjected to the IP configuration program compatibility adaptation;
the virtual machine operating system type acquisition module is used for receiving configuration IP operation and IP address information issued by a virtualization platform by an IP configuration program built in the virtual machine and acquiring the system type and version of the Linux virtual machine;
the IP configuration module is used for checking whether the type of the virtual machine operating system exists in a compatible Linux operating system list or not, and when the type of the virtual machine operating system exists, IP configuration is carried out through internal network configuration service; and when the IP configuration program does not exist, performing IP configuration through a network configuration service supported by the IP configuration program.
The network card IP configuration program is operated in the virtual machine, a compatible Linux operating system list is maintained, the Linux operating system list basically comprises all Linux operating system types, and the IP configuration programs of the Linux systems in the Linux operating system list are subjected to compatibility adaptation, so that the IP configuration can be more reliably carried out on the virtual machine.
And the IP configuration program in the Linux virtual machine receives the configuration IP operation and the IP address information sent by the virtualization platform, acquires the system type and the version of the Linux virtual machine, and checks whether the system type and the version of the Linux virtual machine are in a compatible Linux operating system list.
If the Linux virtual machine system type is the supported system type, executing the following steps:
checking network configuration service in the Linux system, and if the network configuration service is available, carrying out IP configuration through a related configuration command of the network service; and if the network configuration service is abnormal, performing IP configuration through a Linux general IP command.
If the Linux virtual machine system type is not the supported system type, executing the following steps:
checking whether a network configuration service supported by an IP configuration program exists in the Linux system, and if the supported network configuration service is available, carrying out IP configuration through a related configuration command of the network service; and if the network service does not exist or is abnormal, carrying out IP configuration through a Linux general IP command.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (2)

1. A method for configuring a network for a plurality of Linux system virtual machines, the method comprising the steps of:
s1, forming a compatible Linux operating system list according to the Linux operating system type subjected to the IP configuration program compatibility adaptation;
s2, an IP configuration program built in the virtual machine receives configuration IP operation and IP address information issued by the virtualization platform, and obtains the system type and version of the Linux virtual machine;
s3, checking whether the virtual machine operating system type exists in the compatible Linux operating system list, and when the virtual machine operating system type exists in the compatible Linux operating system list:
checking network configuration service in the Linux system, and if the network configuration service is available, carrying out IP configuration through a related configuration command of the network service; if the network configuration service is abnormal, performing IP configuration through a Linux general IP command;
when the virtual machine operating system type does not exist in the compatible Linux operating system list:
checking whether a network configuration service supported by an IP configuration program exists in the Linux system or not, and if the supported network configuration service is available, carrying out IP configuration through a related configuration command of the network service; and if the network service does not exist or is abnormal, carrying out IP configuration through a Linux general IP command.
2. A system for configuring a network for a plurality of Linux system virtual machines, the system comprising:
the compatible operating system list maintenance module is used for forming a compatible Linux operating system list according to the Linux operating system type subjected to the compatibility adaptation of the IP configuration program;
the virtual machine operating system type acquisition module is used for receiving configuration IP operation and IP address information issued by a virtualization platform by an IP configuration program built in the virtual machine and acquiring the system type and version of the Linux virtual machine;
the IP configuration module is used for checking whether the type of the virtual machine operating system exists in a compatible Linux operating system list, and when the type of the virtual machine operating system exists in the compatible Linux operating system list:
checking network configuration service in the Linux system, and if the network configuration service is available, carrying out IP configuration through a related configuration command of the network service; if the network configuration service is abnormal, performing IP configuration through a Linux general IP command;
when the virtual machine operating system type does not exist in the compatible Linux operating system list:
checking whether a network configuration service supported by an IP configuration program exists in the Linux system, and if the supported network configuration service is available, carrying out IP configuration through a related configuration command of the network service; and if the network service does not exist or is abnormal, carrying out IP configuration through a Linux general IP command.
CN202010026808.2A 2020-01-10 2020-01-10 Method and system for configuring network for multiple Linux system virtual machines Active CN111240803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010026808.2A CN111240803B (en) 2020-01-10 2020-01-10 Method and system for configuring network for multiple Linux system virtual machines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010026808.2A CN111240803B (en) 2020-01-10 2020-01-10 Method and system for configuring network for multiple Linux system virtual machines

Publications (2)

Publication Number Publication Date
CN111240803A CN111240803A (en) 2020-06-05
CN111240803B true CN111240803B (en) 2022-05-31

Family

ID=70872610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010026808.2A Active CN111240803B (en) 2020-01-10 2020-01-10 Method and system for configuring network for multiple Linux system virtual machines

Country Status (1)

Country Link
CN (1) CN111240803B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120054624A1 (en) * 2010-08-27 2012-03-01 Owens Jr Kenneth Robert Systems and methods for a multi-tenant system providing virtual data centers in a cloud configuration
CN108255500A (en) * 2017-12-14 2018-07-06 广东睿江云计算股份有限公司 A kind of automatic installing method of operating system of the compatibility virtualization architecture based on cobbler
CN108363608A (en) * 2018-02-06 2018-08-03 广东睿江云计算股份有限公司 A kind of virtual machine configuration method and its system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120054624A1 (en) * 2010-08-27 2012-03-01 Owens Jr Kenneth Robert Systems and methods for a multi-tenant system providing virtual data centers in a cloud configuration
CN108255500A (en) * 2017-12-14 2018-07-06 广东睿江云计算股份有限公司 A kind of automatic installing method of operating system of the compatibility virtualization architecture based on cobbler
CN108363608A (en) * 2018-02-06 2018-08-03 广东睿江云计算股份有限公司 A kind of virtual machine configuration method and its system

Also Published As

Publication number Publication date
CN111240803A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
US12093682B2 (en) Roll back of data delta updates
CN110045991B (en) RAID configuration method and device of server, computer equipment and storage medium
CN105867975A (en) Method for refreshing BMC in batches based on LINUX platform
CN103067445B (en) Method and device of software upgrading of distributed system
CN111698343B (en) PXE equipment positioning method and device
CN106549789B (en) Method and system for realizing server installation
CN102446119A (en) Virtual machine dynamical migration method based on Passthrough I/O device
CN111538562B (en) Method and device for testing business continuity of Linux cloud host on cloud computing platform
CN109067599A (en) A kind of method and device for disposing cluster
CN103475526A (en) IP setting and detecting method supporting multi-VLAN virtual machine
CN103618634A (en) Method for automatically finding nodes in cluster
CN113849228A (en) Operating system batch deployment method, system, terminal and storage medium
CN113326104B (en) Method, system and device for modifying internal configuration of virtual machine
CN114024853A (en) Hardware information collection method and system for bare metal node and related components
CN111240803B (en) Method and system for configuring network for multiple Linux system virtual machines
KR20190039590A (en) Methods and devices for resource reconfiguration
CN113904926A (en) Pre-boot execution environment checking method, system, terminal and storage medium
CN104461757A (en) Method and device for restoring virtual machines
US20090199211A1 (en) Global, dynamic, remote and central system for database driver configuration
CN111984367A (en) Application deployment method and system based on container cloud platform
CN109039765B (en) Network configuration method and device
CN109995571B (en) Method and device for matching server configuration and VNF application
CN107908418B (en) Method for upgrading logic program of fiber channel node card and fiber channel bus equipment
US9244736B2 (en) Thinning operating systems
CN114168210A (en) Embedded equipment deployment method and system

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
GR01 Patent grant
GR01 Patent grant