Layer-2 networking information in a virtualized cloud environment
Techniques are described for communications in an L2 virtual network of a customer. In an example, the L2 virtual network includes a plurality of L2 compute instances hosted on a set of host machines and a plurality of L2 virtual network interfaces and L2 virtual switches hosted on a set of network virtualization devices. An L2 virtual network interface emulates an L2 port of the L2 virtual network. Information associated with the L2 virtual switches is collected and provided to the customer.
1 . A method comprising:
determining a first Layer 2 forwarding table associated with a first Layer 2 virtual switch of a Layer 2 virtual network, wherein:
the Layer 2 virtual network is hosted by a physical network,
the Layer 2 virtual network includes the first Layer 2 virtual switch, a first Layer 2 virtual network interface, a first compute instance, a second Layer 2 virtual network interface, and a second compute instance,
the first Layer 2 virtual network interface is associated with the first compute instance and is hosted by a first network virtualization device (NVD) of the physical network,
the first compute instance is hosted on a host machine of the physical network, and wherein the host machine and the first NVD are separate physical devices that are communicatively coupled, and
the first Layer 2 forwarding table includes first information about the second Layer 2 virtual network interface that is associated with the second compute instance; and
generating a second Layer 2 forwarding table based on the first Layer 2 forwarding table, wherein the second Layer 2 forwarding table includes second information about a first port based on a mapping between a customer port configuration and the Layer 2 virtual network, wherein the first port is associated with the second compute instance and corresponds to the second Layer 2 virtual network interface.
2 . The method of claim 1 , wherein the first information includes a media access control (MAC) address assigned to the second compute instance, wherein the first information further includes an association between the MAC address and the second Layer 2 virtual network interface.
3 . The method of claim 2 , further comprising:
determining a change to the first information; and
updating the second Layer 2 forwarding table based on the change.
4 . The method of claim 3 , wherein the change includes a re-mapping of the MAC address from being associated with the second Layer 2 virtual network interface to being associated with a third Layer 2 virtual network interface, and wherein the second Layer 2 forwarding table is updated by at least associating the MAC address with a second port that corresponds to the third Layer 2 virtual network interface.
5 . The method of claim 3 , wherein the change includes a re-mapping of the MAC address from being associated with a first internet protocol (IP) address of a second NVD hosting the second compute instance to being associated with a second IP address of a third NVD hosting a third Layer 2 virtual network interface for a third compute instance, and wherein the second Layer 2 forwarding table is updated by at least associating the MAC address with a second port that corresponds to the third Layer 2 virtual network interface.
6 . The method of claim 3 , wherein the change includes a media access control (MAC) address re-mapping in the first information, and wherein the second Layer 2 forwarding table is updated by at least associating the MAC address re-mapping with the first port.
7 . The method of claim 1 , wherein the first port is defined based on customer input, and wherein correspondence between the second Layer 2 virtual network interface and the first port is based on a mapping between ports and a distribution of resources of the Layer 2 virtual network.
8 . The method of claim 1 , wherein the first port is defined based on customer input, and wherein the second Layer 2 virtual network interface emulates the first port.
9 . The method of claim 1 , wherein the first Layer 2 virtual switch is also hosted by the first NVD.
10 . The method of claim 1 , further comprising:
receiving customer input indicating a customer configuration of the Layer 2 virtual network; and
determining a mapping between the customer configuration and a distribution of resources of the Layer 2 virtual network on the physical network, wherein the second Layer 2 forwarding table is generated further based on the mapping.
11 . The method of claim 1 , further comprising:
receiving customer input indicating the first port;
determining a first association between the first port and the second Layer 2 virtual network interface; and
determining a second association between the second Layer 2 virtual network interface and a second Layer 2 virtual switch, wherein the second Layer 2 forwarding table is generated further based on the first association and the second association.
12 . The method of claim 1 , further comprising:
determining a change to the first Layer 2 forwarding table, the change associated with the second Layer 2 virtual network interface;
determining that the second Layer 2 virtual network interface corresponds to the first port;
associating the change with the first port; and
including, in the second Layer 2 forwarding table, the change in association with the first port.
13 . The method of claim 12 , wherein the change includes a re-association of a first media access control (MAC) address from the second Layer 2 virtual network interface to a third Layer 2 virtual network interface.
14 . The method of claim 12 , wherein the change includes an association of a second MAC address with the second Layer 2 virtual network interface.
15 . The method of claim 1 , wherein the second Layer 2 forwarding table is generated by replacing Layer 2 virtual network interface information from the first Layer 2 forwarding table with port information in the second Layer 2 forwarding table.
16 . The method of claim 15 , wherein the second Layer 2 forwarding table is generated by re-mapping media access control (MAC) addresses from being associated with Layer 2 virtual network interface information to being associated with port information.
17 . A system comprising:
one or more processors; and
one or more computer-readable storage media storing instructions that, upon execution by the one or more processors, configure the system to:
determine a first Layer 2 forwarding table associated with a first Layer 2 virtual switch of a Layer 2 virtual network, wherein:
the Layer 2 virtual network is hosted by a physical network,
the Layer 2 virtual network includes the first Layer 2 virtual switch, a first Layer 2 virtual network interface, a first compute instance, a second Layer 2 virtual network interface, and a second compute instance,
the first Layer 2 virtual network interface is associated with the first compute instance and is hosted by a first network virtualization device (NVD) of the physical network,
the first compute instance is hosted on a host machine of the physical network, and wherein the host machine and the first NVD are separate physical devices that are communicatively coupled, and
the first Layer 2 forwarding table includes first information about the second Layer 2 virtual network interface that is associated with the second compute instance; and
generate a second Layer 2 forwarding table based on the first Layer 2 forwarding table, wherein the second Layer 2 forwarding table includes second information about a first port based on a mapping between a customer port configuration and the Layer 2 virtual network, wherein the first port is associated with the second compute instance and corresponds to the second Layer 2 virtual network interface.
18 . The system of claim 17 , wherein the execution of the instructions further configures the system to:
determine a change to the first information; and
update the second Layer 2 forwarding table based on the change by at least re-mapping a media access control (MAC) address from being mapped to the first port to being mapped to a second port.
19 . One or more non-transitory computer-readable storage media storing instructions that, upon execution on a system, cause the system to perform operations comprising:
determining a first Layer 2 forwarding table associated with a first Layer 2 virtual switch of a Layer 2 virtual network, wherein:
the Layer 2 virtual network is hosted by a physical network,
the Layer 2 virtual network includes the first Layer 2 virtual switch, a first Layer 2 virtual network interface, a first compute instance, a second Layer 2 virtual network interface, and a second compute instance,
the first Layer 2 virtual network interface is associated with the first compute instance and is hosted by a first network virtualization device (NVD) of the physical network,
the first compute instance is hosted on a host machine of the physical network, and wherein the host machine and the first NVD are separate physical devices that are communicatively coupled, and
the first Layer 2 forwarding table includes first information about the second Layer 2 virtual network interface that is associated with the second compute instance; and
generating a second Layer 2 forwarding table based on the first Layer 2 forwarding table, wherein the second Layer 2 forwarding table includes second information about a first port based on a mapping between a customer port configuration and the Layer 2 virtual network, wherein the first port is associated with the second compute instance and corresponds to the second Layer 2 virtual network interface.
20 . The one or more non-transitory computer-readable storage media of claim 19 , wherein the first port is defined based on customer input, and wherein correspondence between the second Layer 2 virtual network interface and the first port is based on a mapping between ports and a distribution of resources of the Layer 2 virtual network.