Connecting to the Ethernet
The management network refers to the PC running the vSphere Client. Actually, the vmnic for connecting to the management network is also used to connect to the service network.
In Figure 5-3, vmnic2, vmnic3, vmnic4, and vmnic5 are the ports on other NICs, and they can also be used to connect to the management network. In this example, only the ports vmnic0and vmnic1 on the MZ510 are used.
When NICs are replaced or added, the port numbers vmnic[num] displayed in ESXi are changed accordingly.
On the Configure Management Network screen, select IP Configuration. On the IP Configuration screen, set an IP address for the MZ510 port, as shown in Figure 5-4. The IP address is assigned to the vmnic connected to the management network. The IP address is assigned to the default port vmnic first, for example, vmnic0 in Figure 5-3. If the default port is disconnected, the IP address is assigned to the standby port, such as vmnic1. The IP address must be on the same network segment as the NIC on the PC. This ensures that the ESXi communicates with the vSphere Client. Press Enter to confirm the setting, and return to the Configure Management Network screen.
VLAN(Optional) on the Configure Management Network screen is an optional parameter. To configure a VLAN for the vmnic is to assign a PVID to the MZ510 port. You do not need to configure a VLAN for the vmnic that connects to the management network.
Run the vSphere Client, click the Configuration tab page, click Network, and then click Properties. The vSwitch0 Properties window is displayed. Click Add to create a virtual port group, select VM, and specify the group name in the Network Label text box, as shown in Figure 5-5.
Since you have selected vmnic0 and vmnic1 on Network Adapters in the ESXi, the VM Network2 virtual port group created in Figure 5-5 can be associated with the two ports. A virtual port group is used for the service network.
You can specify a VLAN ID for a virtual port group. The VLAN ID can be 0 (no VLAN), 4095 (all VLANs), or a value ranging from 1 to 4094. The value 0 indicates the EST mode, that is, the virtual port group is untagged, and the peer device (generally a switch) sets the VLAN ID. The value 4095 indicates the VGT mode, which enables the virtual port group to allow packets with any VLAN ID to pass through. This is similar to a switch trunk port. You must configure VLANs for the VM OS. The virtual port group does not process the VLAN tag of the packets and transparently transmits these packets. A value ranging from 1 to 4094 indicates the VST mode. The virtual port group is configured with a PVID, and the PVID is automatically added to untagged packets before the packets are forwarded to the external network. If the virtual port group receives packets with the VLAN tag that is the same as the PVID, it deletes the VLAN tag and then forwards the packets to the destination VM.
Create a VM on the vSphere Client, and add the VMs to a virtual port group. This is to allocate network ports to the VM. After the configuration is complete, you can view the VMs of each virtual port group in the network configuration window, as shown in Figure 5-6.
NIC ports vmnic0 and vmnic1 are shared in each virtual port group.
Install an OS on the VM, and set IP addresses for the NIC ports in the OS. Then the VM can communicate with the external network. The NIC ports detected by the VM OS are the NIC ports associated with the virtual port group of the VM. In this section, the NIC ports are vmnic0 and vmnic1. The following describes how to install SLES 11 SP2 on VM_2.
After installing SLES 11 SP2 on the VM_2, two NIC ports eth0 and eth1 are displayed, which correspond to vmnic0 and vmnic1 respectively, as shown in Figure 5-7. Set an IP address for eth1. Ensure that the IP address is on the same network segment as the management network. Then, the VM_2 can communicate with the ESXi management network port and the PC running the vSphere Client, as shown in Figure 5-8.
The MAC addresses of the NIC ports in the VM OS are generated by VMware, rather than the MAC addresses of vmnic0 and vmnic1.
Install SLES 11 SP2 on VM_1, and set IP addresses for the NIC ports. Then VM_1 can communicate with the ESXi management network port and the PC running the vSphere Client, and VM_1 and VM_2 in the same virtual port group VM Network can communicate with each other, as shown in Figure 5-9.
Select Edit Settings for the VM_1, select Network adapter 1 and Network adapter 2, and set Network Label to VM Network 2 to add the VM_1 to the virtual port group VM Network 2. See Figure 5-10. After the configuration, the VM_1 can still communicate with the management network and the VM_2, as shown in Figure 5-11.