Disclosure of Invention
The invention provides a method for generating state identification information, which comprises the following steps:
Receiving a configuration instruction with configuration information, wherein the configuration information comprises local configuration information for configuring local equipment and network configuration information for configuring network architecture of the local equipment;
The local equipment and the network architecture thereof are respectively configured according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration of the configuration information;
Generating state identification information according to the local configuration and the network architecture of the configuration equipment, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
Optionally, after the step of configuring the local device and the network architecture thereof according to the local configuration information and the network configuration information to obtain a configured device, the method further includes:
Receiving a subscription instruction conforming to a preset rule;
subscribing network architectures corresponding to other devices in the network according to the subscription instruction;
Acquiring target equipment in a network, wherein the target equipment is other equipment with the same network architecture as the configuration equipment;
The target device in the network is monitored.
Optionally, after the step of monitoring the target device in the network, the method further includes:
and recording the data information of the local configuration corresponding to the target equipment in the state identification information of the local equipment.
Optionally, the state identification information is a code stream table, where a stream table identification code, local configuration data information and network architecture data information corresponding to a local device, and local configuration data information corresponding to the target device are recorded in the code stream table.
Optionally, the local configuration information is configuration information for creating a virtual machine.
Optionally, the network configuration information is configuration information for creating a VPC network architecture and/or configuration information for creating a network security group.
The invention also provides another method for generating the state identification information, which comprises the following steps:
Creating a configuration instruction with configuration information according to a user request, wherein the configuration information comprises local configuration information for configuring local equipment and network configuration information for configuring network architecture of the local equipment;
The configuration instruction is sent to local equipment so that the local equipment receives the configuration instruction with configuration information, wherein the configuration information comprises local configuration information for configuring the local equipment and network configuration information for configuring the network architecture of the local equipment, the local equipment and the network architecture thereof are respectively configured according to the local configuration information and the network configuration information to obtain configuration equipment, the configuration equipment is the local equipment configured according to the configuration information, and state identification information is generated according to the local configuration and the network architecture of the configuration equipment, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
Optionally, after the step of configuring the local device and the network architecture thereof according to the local configuration information and the network configuration information to obtain a configured device, the method includes:
Creating a subscription instruction conforming to a preset rule according to a user request;
The method comprises the steps of sending a subscription instruction to local equipment, enabling the local equipment to receive the subscription instruction conforming to a preset rule, subscribing network architectures corresponding to other equipment in a network according to the subscription instruction, obtaining target equipment in the network, wherein the target equipment is other equipment with the same network architecture as the configuration equipment, and monitoring the target equipment in the network.
The application provides a state identification information generation system, which comprises a controller, an ETCD component and local equipment, wherein the controller is used for generating state identification information;
The controller is used for creating a configuration instruction with configuration information according to a user request and sending the configuration instruction to the local equipment, wherein the configuration information comprises local configuration information for configuring the local equipment and network configuration information for configuring the network architecture of the local equipment;
the ETCD component is used for acquiring the configuration instruction with configuration information sent by the controller from the local equipment, respectively configuring the local equipment and the network architecture thereof according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration information configuration, and generating state identification information according to the local configuration of the configuration equipment and the network architecture, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
Optionally, the system further comprises at least one other device;
the controller is also used for creating a subscription instruction according to a user request and sending the subscription instruction to the local equipment;
the ETCD component is further used for receiving a subscription instruction conforming to a preset rule, subscribing network architectures corresponding to other devices in a network according to the subscription instruction, acquiring target devices in the network, wherein the target devices are other devices with the same network architecture as the configuration device, and monitoring the target devices in the network.
Optionally, the data processing ETCD component is further configured to record data information corresponding to a local configuration of the target device in the state identification information of the local device.
The application provides a state identification information generating device, which comprises:
The device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a configuration instruction with configuration information, wherein the configuration information comprises local configuration information for configuring local equipment and network configuration information for configuring network architecture of the local equipment;
The configuration module is used for respectively configuring the local equipment and the network architecture thereof according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration of the configuration information;
The generating module is used for generating state identification information according to the local configuration and the network architecture of the configuration equipment, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
Optionally, the apparatus further comprises:
the receiving module is used for receiving a subscription instruction conforming to a preset rule;
the subscription module is used for subscribing network architectures corresponding to other devices in the network according to the subscription instruction;
the acquisition module is used for acquiring target equipment in a network, wherein the target equipment is other equipment with the same network architecture as the configuration equipment;
and the monitoring module is used for monitoring the target equipment in the network.
Optionally, the apparatus further comprises:
and the recording module is used for recording the data information corresponding to the local configuration of the target equipment in the state identification information of the local equipment.
Optionally, the application also provides another state identification information generating device, which comprises a processor and a memory;
The memory stores therein an application executable by the processor for causing the processor to execute the steps of the state identification information generation method.
Optionally, the program when executed by the processor implements the steps of the state identification information generation method.
As can be seen from the above, based on the above embodiments, the devices in the network can be mutually identified by recording the data information of the local configuration and the network architecture, so as to solve the technical problem that the data interaction errors are generated because the data interaction between the network devices cannot be identified.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below by referring to the accompanying drawings and examples.
Fig. 1 is a schematic diagram of an application scenario 100 according to an embodiment of the present application. As shown in fig. 1, in the present embodiment, the controller 110 (i.e., open vSwitch controller, where Open vSwitch is an Open virtual switching standard). The user or the controller 110 generates configuration information through setting, where the configuration information includes local configuration information and network configuration information, the local configuration information is data information for performing self data configuration on the local device 120, and the network configuration information is data information for performing network architecture configuration on the local device 120. The configuration information generating corresponding configuration instructions are sent to the local device 120 or other devices 130 in the network, and the ETCD component 140 in fig. 1 performs corresponding local configuration or network architecture configuration on the configuration information received by the local device 120 and/or other devices 130, where it should be noted that the ETCD component 140 may be set to operate separately in a separate device, or may be installed to operate in one of the local devices or other devices in the network.
The ETCD component 140 is a service discovery and data storage system in the container domain.
Fig. 2 is a schematic diagram of an application scenario 200 according to an embodiment of the present application. As shown in fig. 2, based on the embodiment in fig. 1, in this embodiment, the thread of the present application is schematically shown, where a Web Server (Web Server) receives configuration information, generates data of the configuration information in an openflow manner, and meanwhile, the ETCD component 140 acquires the data of the configuration information to monitor and status monitor the ETCD component 140 to achieve the purpose of discovering services. In the virtual machine scenario, a virtual machine management module may be provided, and the virtual machine management module may be implemented by adopting Libvirt to control and manage the state of the local device 120 in the state monitor.
An OpenFlow, an online communication protocol, belongs to a data link layer, and can control the forwarding plane (forwarding plane) of an online switch or router, thereby changing the online path taken by an online data packet.
Libvirt are APIs, daemons and management tools for managing the open source of the virtualized platform.
The API (Application Programming Interface ) is a number of predefined functions that are designed to provide the application and developer with the ability to access a set of routines based on certain software or hardware without having to access source code or understand the details of the internal operating mechanisms.
Fig. 3 is a schematic diagram of a flow 300 of a method for generating status identifying information according to an embodiment of the present application, as shown in fig. 3, in an embodiment, the present application provides a method for generating status identifying information, which includes:
s101, receiving a configuration instruction with configuration information, wherein the configuration information comprises local configuration information for configuring local equipment and network configuration information for configuring network architecture of the local equipment;
In this step, a configuration instruction with configuration information is required to be received, wherein the configuration information is a preset configuration requirement. The configuration requirements may be set by the user or may be generated by a program in the controller. The configuration information includes two parts, one part is a configuration performed locally (i.e., a local configuration), and the other part is a configuration performed on a network architecture (i.e., a network architecture), and it should be noted that the local configuration and the network architecture configuration are both specific to one device, i.e., the local device. The local device is an abstract concept, not necessarily a stand-alone device, but also a virtual data node arranged under the network architecture.
S102, configuring the local equipment and the network architecture thereof according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration of the configuration information;
The local device is configured in this step according to the local configuration information and the network configuration information. Correspondingly, the configuration of the local device refers to the configuration of the local device and the configuration of the network architecture thereof, and the local device becomes a configuration device conforming to the preset local configuration in the preset network architecture after the configuration is completed.
S103, generating state identification information according to the local configuration and the network architecture of the configuration equipment, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
In this step, status identification information is generated according to the local configuration of the configuration device and network architecture data, and the status identification information records data information which can be called in the network to read the corresponding local configuration and network architecture.
In this embodiment, the local device in the network may be configured according to the configuration instruction by receiving the configuration instruction with the configuration information. The configuration local equipment comprises two layers of local configuration and network architecture configuration, and configuration equipment conforming to configuration information is obtained after the local equipment is configured according to the configuration information. And recording the configuration state of the configuration equipment to generate state identification information, wherein the state identification information also comprises data information of two layers of local configuration and network architecture. According to the state identification information, the state of the local equipment and the state of the network architecture of the local equipment can be obtained, the local equipment can be identified in the subsequent data interaction by utilizing the data information, confusion of the data interaction in the network can not be generated according to the identification of the local equipment, and therefore errors in the process of data interaction are avoided.
Fig. 4 is a schematic diagram of a flow 400 of a method for generating status identifying information according to an embodiment of the present application, as shown in fig. 4, in an embodiment, the present application provides a method for generating status identifying information, after the steps of configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configuration device, the method includes:
s201, receiving a subscription instruction conforming to a preset rule;
in this step, in the network architecture established by the configuration device, a subscription instruction may be received. The subscription instruction herein is an instruction to monitor other devices in the network structure.
S202, subscribing network architectures corresponding to other devices in a network according to the subscription instruction;
In this step, network architectures corresponding to other devices are subscribed in the network. It should be noted that the other devices may be one or more of the networks, some or all of the other devices, and the above determination is performed separately according to a preset in the subscription instruction.
S203, acquiring target equipment in a network, wherein the target equipment is other equipment with the same network architecture as the configuration equipment;
in this step, the same network architecture may mean that other devices and the local device belong to the same security group or the same cloud. Similarly, the other devices herein may be one or more.
S204, monitoring the target equipment in the network.
In this step, when it is determined that the target device and the local device in the network belong to the same network architecture, that is, the target device should belong to the same security group or the same cloud, the target device may be monitored in real time through the network.
In this embodiment, the target device and the local device may belong to the same security group or the same cloud, and the target device having the same network architecture in the same network is acquired through the subscription instruction. Then, other devices in the network are monitored.
In an embodiment, after the step of monitoring the target device in the network, the method further comprises:
and recording the data information of the local configuration corresponding to the target equipment in the state identification information of the local equipment.
In this embodiment, in order to enable the local device to provide the local configuration of the target device, the local configuration data information of the target device under monitoring may be recorded in the identification information state of the local device, so that the local configuration of the target device may be obtained from the network through the local device, and then a control instruction is sent to the local device, and then the local device performs further network call or control on the target device.
In an embodiment, the state identification information is a code stream table, where the state identification information is a code stream table, and a stream table identification code, local configuration data information and network architecture data information corresponding to a local device, and local configuration data information corresponding to the target device are recorded in the code stream table.
The embodiment provides a specific implementation mode of the code stream table form state identification information.
In an embodiment, the local configuration information is configuration information for creating a virtual machine.
The embodiment provides a specific implementation mode of creating a virtual machine configuration by using a local configuration.
In an embodiment, the network configuration information is configuration information for creating a VPC network architecture and/or configuration information for creating a network security group.
The embodiment provides an implementation manner of specific configuration of a network architecture.
Fig. 5 is a schematic diagram of a flow 500 of a method for generating status identifying information according to an embodiment of the present application, and as shown in fig. 5, the present application further provides a method for generating status identifying information, which includes:
s301, creating a configuration instruction with configuration information according to a user request, wherein the configuration information comprises local configuration information for configuring local equipment and network configuration information for configuring a network architecture of the local equipment;
In this step, the user may directly set the configuration information, or may automatically generate the configuration instruction according to a predetermined setting.
S302, the configuration instruction is sent to local equipment so that the local equipment receives the configuration instruction with configuration information, wherein the configuration information comprises local configuration information for configuring the local equipment and network configuration information for configuring the network architecture of the local equipment, the local equipment and the network architecture thereof are configured according to the local configuration information and the network configuration information to obtain configuration equipment, the configuration equipment is the local equipment which accords with the configuration information, and state identification information is generated according to the local configuration and the network architecture of the configuration equipment, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
In this step, the configuration information and the configuration instruction are transmitted to the local device in this step, and the local device generates the state identification information according to the steps in the above-described embodiments.
The embodiment provides a specific implementation mode for generating the configuration instruction with the configuration information, and a user generates the configuration instruction with the configuration information according to the preset configuration instruction and sends the configuration instruction to the local equipment. The local equipment configures the local equipment and the network architecture thereof according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration information configuration, and generates state identification information according to the local configuration of the configuration equipment and the network architecture, and the state identification information is data information which records the local configuration and the network architecture corresponding to the configuration equipment.
Fig. 6 is a schematic diagram of a flow 600 of a method for generating status identifying information according to an embodiment of the present application, as shown in fig. 6, in an embodiment, after the steps of configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, the method includes:
S401, creating a subscription instruction conforming to a preset rule according to a user request;
In this step, a specific implementation manner of creating a subscription instruction is provided, where the subscription instruction may be a setting performed by a user, or may be a subscription instruction automatically generated according to a preset setting.
S402, sending the subscription instruction to the local equipment so that the local equipment receives the subscription instruction conforming to a preset rule, subscribing network architectures corresponding to other equipment in a network according to the subscription instruction, acquiring target equipment in the network, wherein the target equipment is other equipment with the same network architecture as the configuration equipment, and monitoring the target equipment in the network.
In this step, an embodiment is provided in which a subscription instruction is created and then sent to the local device to cause the local device to perform a subsequent step.
The embodiment provides a subscription instruction, wherein the subscription instruction is used for enabling a local device to receive a subscription instruction conforming to a preset rule, subscribing state identification information of other devices in a network according to the subscription instruction, acquiring target devices in the subscription instruction according to the state identification information of the other devices, wherein the target devices are other devices with the same network architecture data information as the local device, and monitoring specific implementation modes of the target devices in the network.
Working process and basic principle:
In order to better illustrate the technical solution of the present invention, the following description will take the creation of a virtual machine as an example, and it should be noted that the embodiment of creating a virtual machine is only for better illustrating the present invention, and is not a specific limitation of the present invention.
Fig. 7 is a schematic diagram of a flow 700 of a method for generating status identifying information according to an embodiment of the present application, as shown in fig. 7, in an embodiment, the method includes:
S501, receiving a configuration instruction with configuration information, wherein the configuration information comprises local configuration information for configuring local equipment and network configuration information for configuring network architecture of the local equipment;
The ETCD mechanism commonly applied in the container network field can be utilized for service discovery, and the virtual network adopts an ETCD component for service discovery. Specifically, the controller writes the local configuration information and the network configuration information to be created in the form of two-dimensional codes into the ETCD key. Wherein the local configuration information is one dimension in the data structure, the network configuration information is also recorded in the data structure of the other dimension, by adopting the method, the problem that the lightweight service discovery mechanism caused by ETCD cannot be realized due to the fact that the ETCD key is too simple to set and only a single key value is stored and one dimension of data is lacking can be avoided. The specific operation will be described in detail hereinafter, and will not be described in detail here.
The local configuration information may be understood as information for creating a virtual machine, including IP-address (IP address), mac (MEDIA ACCESS Control, medium access Control), host IP-address (IP address), virtual machine back-end device name, etc., where the configuration information corresponding to the network architecture of the created network vpc is written into a first dimension of the ETCD key, for example, the first dimension of/ovs/v 1/nodes/12.12.12.1/vms/1000/192.168.100.10,ETCD key includes the IP address of the host.
Vni, VXLAN Network Identifier, VXLAN network identifier.
Vpc, virtual Private Cloud, a private cloud, is a concept defined for the public cloud's underlying network (classical network).
The local network configuration information may be understood as configuration information for creating a vpc network architecture and/or configuration information for a network security group. The configuration information corresponding to the network vpc network architecture creation includes subnet, gateway, vni (VXLAN network identifier), etc., for example, vpc with vni being 1000 is to be created, and the configuration information is written into a first dimension of the ETCD key, for example,/ovs/v 1/nodes/12.12.12.1/vpcs/1000, where the first dimension of the ETCD key includes the IP address of the host.
S502, configuring the local equipment and the network architecture thereof according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration of the configuration information;
the local device is configured according to the ETCD key in the above step, that is, a network architecture of the virtual machine and the local device is created.
S503, receiving a subscription instruction conforming to a preset rule;
The controller creates a subscription instruction according to a preset rule, and sends the created subscription instruction to the local device. The local device receives a subscription instruction, the subscription instruction having the purpose of subscribing the local device to other devices in the network.
S504, subscribing the network architecture corresponding to other devices in the network according to the subscription instruction;
other devices also record corresponding network architecture data information.
S505, obtaining target equipment in a network, wherein the target equipment is other equipment with the same network architecture as the configuration equipment;
The network architecture data information in this step may be understood that the vpc network architecture or security Group SG (i.e. security Group) of the local device is the same as that of other devices, and other devices consistent with the above description are target devices, which may be one or more of the other devices.
S506, monitoring the target equipment in the network.
This step is to monitor the target device, and it should be noted that only other devices belonging to the same vpc network architecture or security group can be monitored.
Such as subscription key:/ETCDCTL WATCH-prefix/ovs/v 1/vpcs/1000, the local device is already monitoring the target device with vni 1000 vpc.
S507, recording the data information of the local configuration corresponding to the target device in the state identification information of the local device.
The state identification information records not only local configuration data information and network architecture data information of the local device. Data information of the local configuration of the target device may also be recorded.
For example, the controller writes the virtual machine configuration information and vpc configuration information of the local device stored on the ETCD key, that is, the data information of the local configuration and the network architecture, into the second dimension of the ETCD key.
If the local configuration data information of the local device is/ovs/v 1/vpcs/1000, the local configuration data information is/ovs/v 1/vpcs/1000, and can be stored as/ovs/v 1/vpcs/1000/vms/192.168.100.10 on the local device, and the local configuration data information corresponding to the target device can be automatically recorded in the state identification information of the local device. The target device may then create a virtual machine by the method described above, thereby generating corresponding state identification information.
Fig. 8 is a schematic diagram of an encoded data structure of a code stream table according to an embodiment of the present application, and as shown in fig. 8, a specific design scheme of status identification information in the form of a code stream table is provided below.
The cookie value is 64-bit width, which is expressed as 16-system number 0xFFFFFFFFFFFFFF, corresponding to cookie [0..63], and the following division design is carried out on cookies related to vpc networking:
The system stream table (namely stream table identification code) is characterized in that 60-63 bits are expressed as 0x0 of 16 system, 16-19 bits are expressed as tableid, and 0-15 bits are expressed as stream table serial numbers in the same table.
The vpc granularity flow table (i.e. network architecture data information) has 60-63 bits of 0x1, 36-59 bits of 16 scale of vni, 32-35 bits of 0 reserved bit and 0-31 bits of the rest low bits of 0.
In vm granularity flow table 1 (i.e. local configuration data information), 60-63 bits are 0x2 of 16 system, 36-59 bits are vni, 32-35 bits are 0 as reserved bits, and the remaining 0-31 bits are the virtual machine IP address on the host. (host herein can be understood as a local device)
And in the vm granularity flow table 2 (namely local configuration data information corresponding to the target device), 60-63 bits of the vm granularity flow table are expressed as 0x3 of 16 system, 36-59 bits of the vm granularity flow table are expressed as vni, 32-35 bits of the vm granularity flow table are expressed as reserved bits and are set as 0, and the remaining 0-31 bits of the lower bits of the vm granularity flow table are expressed as virtual machine IP addresses on other hosts belonging to the same vpc. (other hosts may be understood herein as other devices)
The security group related flow table (i.e. network architecture data information) has 60-63 bits of 0x4, 36-59 bits of vni, 24-35 bits of security group id, 8-23 bits of security group rule priority, and the rest 0-7 bits of security group rule id.
Following the cookie design above, an algorithm for generating a corresponding cookie is given below.
Cookie configuration of the system flow table;
table ID XX;
Stream table index XX
The digits occupied by the table ID;
the configuration of the cookie includes a table ID and a flow table index, as well as the associated configuration.
Thus, the following flow table can be formed for issuing
The cookie of the vpc granularity flow table,
The flow table starts to configure values;
vni configuration;
vpc starting configuration;
The cookie also requires configuration of vni configuration and flow table start configuration;
Thus, the following flow table can be formed for issuing
"The cookie itself is configured with,
The cookie of vm particle size stream table 1;
Initial configuration of a flow table;
vni configuration
Virtual machine IP configuration;
configuring IP data types of the virtual machine;
Generating a corresponding cookie
Thus, the following flow table can be formed for issuing
The target device granularity flows the cookies of table 2,
Initial configuration of a flow table;
vni configuration;
IP setting of the target equipment;
a corresponding cookie is generated.
Thus, the following flow table can be formed for issuing
Cookies configured as described above;
The cookie of the security group related flow table,
Configuring a safety group;
Thus, the following flow table can be formed for issuing
Configuring cookies of a security group;
Through the design of the cookies, each field forming the cookies can be reversely calculated by the operation of bit,
The batch operation can also be performed on the stream tables, for example, to delete the stream tables with a certain vpc granularity, and the stream tables can be deleted in batch by extracting the vni field from the cookie through bit operation.
Collision or coverage of the flow table can also be avoided according to the design of the cookie.
For example, when a security group rule is added, a scenario can occur that a user issues a rule to open 80 ports first, then adds a rule to open 50-100 ports (ranges), at this time, rule id is added with 1, 1 rule with different cookies is generated to open 80 ports, so that collision of a flow table is effectively avoided, coverage of an original flow table is also avoided, and the user deletes the rule of 180 ports, so that 80 ports cannot be accessed.
FIG. 9 is a schematic diagram of an ETCD key one-dimensional data structure according to an embodiment of the present application, and as shown in FIG. 9, the following provides a design of a first dimension of a specific data structure of the ETCD key:
ETCD key is designed into two dimensions, namely a node dimension and a vpc dimension, wherein the value of the two dimensions has a cross-correlation relationship.
The key of node dimension mainly refers to information on the local device, including vm information and vpc information, vm mainly refers to which vm is included on the local device, vpc information refers to which vpc is included on the host, and vpc is identified by vni, which is shown in the following figure.
According to the architecture of the above diagram, the following keys with cross-correlation can be designed:
identifying which virtual machines a node contains;
identifying which vpc a node contains
Which vpc of which node a certain virtual machine belongs to is identified.
FIG. 10 is a schematic diagram of another dimension data structure of an ETCD key according to an embodiment of the present application, as shown in FIG. 9, and the following provides a design of a second dimension of a specific data structure of the ETCD key:
The key of the vpc (identified by vni) dimension, comprising vm information and SG security group information, indicates which vm the vpc comprises, which security groups comprise, respectively, wherein the security groups comprise vm information and rule information,
According to the architecture of the above diagram, the following keys with cross-correlation can be designed:
identifying which virtual machines are under a vpc;
identifying which security groups a vpc contains;
identifying which vm is included under a security group
Identifying which security group of which vpc a vm belongs to
Identifying which rules a security group has
Identifying to which security group a rule belongs
By the design of the etcd two-dimensional key above, a search can be made,
Which vpcs are on a certain host;
which vm exists on a host;
Which vms a certain vpc contains;
which vpc of which host a certain vm belongs to;
some vpc contains which security groups;
Which vm a certain security group contains;
Which security group of which vpc a certain vm belongs to;
Which security group of which vpc a certain vm belongs to which host;
which rules a certain security group has;
a rule belongs to which safety group;
thus, in a virtual network, a similar rabbitMQ-based mechanism for service discovery can be implemented.
The above method may be applied to other operations such as deleting a virtual machine, adding a virtual machine to a security group, removing a virtual machine from the security group, adding a security group rule, deleting a security group rule, and the like.
In one embodiment, the application also provides a state identification information generation system, which comprises a controller, an ETCD component and a local device;
The controller is used for creating a configuration instruction with configuration information according to a user request and sending the configuration instruction to the local equipment, wherein the configuration information comprises local configuration information for configuring the local equipment and network configuration information for configuring the network architecture of the local equipment;
the ETCD component is used for acquiring the configuration instruction with configuration information sent by the controller from the local equipment, respectively configuring the local equipment and the network architecture thereof according to the local configuration information and the network configuration information to obtain configuration equipment, wherein the configuration equipment is the local equipment which accords with the configuration information configuration, and generating state identification information according to the local configuration of the configuration equipment and the network architecture, wherein the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration equipment.
In one embodiment, the system further comprises at least one other device;
the controller is also used for creating a subscription instruction according to a user request and sending the subscription instruction to the local equipment;
the ETCD component is further used for receiving a subscription instruction conforming to a preset rule, subscribing network architectures corresponding to other devices in a network according to the subscription instruction, acquiring target devices in the network, wherein the target devices are other devices with the same network architecture as the configuration device, and monitoring the target devices in the network.
In an embodiment, the data processing ETCD component is further configured to record data information corresponding to a local configuration of the target device in the state identification information of the local device.
Fig. 11 is a schematic diagram of an architecture 800 of a status identifying information generating device according to an embodiment of the present application, as shown in fig. 11, in an embodiment, the present application further provides a status identifying information generating device, which includes:
A receiving module 101, configured to receive a configuration instruction with configuration information, where the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
A configuration module 102, configured to configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configuration device, where the configuration device is a local device configured according to the configuration information;
and the generating module 103 is configured to generate state identification information according to the local configuration and the network architecture of the configuration device, where the state identification information is data information for recording the local configuration and the network architecture corresponding to the configuration device.
Fig. 12 is a schematic diagram of an architecture 900 of a status identifying information generating device according to an embodiment of the present application. As shown in fig. 12, in an embodiment, the apparatus further includes:
the receiving module 101 is configured to receive a subscription instruction conforming to a predetermined rule;
a subscription module 202, configured to subscribe to a network architecture corresponding to other devices in the network according to the subscription instruction;
An obtaining module 203, configured to obtain a target device in a network, where the target device is another device having the same network architecture as the configuration device;
A monitoring module 204, configured to monitor the target device in the network.
In one embodiment, the apparatus further comprises:
a recording module 301, configured to record data information corresponding to a local configuration of the target device in the state identification information of the local device.
In one embodiment, the application also provides a state identification information generating device, which comprises a processor and a memory;
The memory stores an application executable by the processor for causing the processor to perform the step of generating the state identification information.
In an embodiment, the present application further provides a computer-readable storage medium having stored thereon a computer program which when executed by a processor implements the state identification information generating step.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.