วันเสาร์ที่ 10 กันยายน พ.ศ. 2554

The process of generating MAC addresses for virtual machines


Each virtual machine network adapter is assigned a unique MAC address. Sam's MAC address is a six byte (48 bit) number, which is as follows:
OO: UU: II: XX: YY: ZZ
Each manufacturer of network adapters has a unique Organizationally Unique Identifier (OUI) which of itself is three-byte (24 bit) prefix, used to generate unique MAC addresses. VMware-have given some Organizationally Unique Identifier (OUI)-s, and thus for VMware-th block of derivatives reserved identifiers such as MAC addresses.
In the arrangement of the following VMware OUI:
  • Auto-generated MAC addresses
  • MAC addresses statically prescription
  • For older virtual machines (not available in ESXi servers)
Now let us see how the generated MAC addresses for virtual network adapters, virtual machines.
Depending on whether the ESXi server is controlled by vCenter server or not, the MAC addresses for virtual network adapters, virtual machines will be generated in various ways when they are created:
  • If we create a virtual machine for ESXi host that is controlled by the server is assigned vCenter her MAC address will begin with the prefix 00:50:56
  • If we create a virtual machine for ESXi host that is not controlled vCenter server is assigned its MAC address will begin with the 00:0 C: 29
-
Case 1: ESXi host server is controlled by vCenter
In the case when vCenter manages virtual infrastructure, it will provide unique MAC addresses of virtual machines.
The generation of MAC addresses is as follows:
1. The first three bytes are Organizationally Unique Identifier (OUI) VMware-a: 00:50:56
2. Next (chetvyrty) bytes is - 0 × 80 + vCenter Server Usnique ID
vCenter Server Usnique ID can be found if you connect a customer to vSphere vCenter server and go toHome> Administration> Server Settings and go to the Runtime Settings, look at the value of vCenter Server Usnique ID.
Value which can be a vCenter Server Usnique ID ranges from 0 to 63, I-ex
image
If we consider the example when vCenter Server Usnique ID is equal to 48, making a basic calculation:
Take a 0x80, and remove the ox from transferring 80 HEX to DECIMAL, we get 128. To this add 128 to vCenter Server Usnique ID which in my case 48 and get 176. Converting 176 in HEX and get the fourth byte MAC address, which in my case goes b0.
3. The last two bytes are assigned in some way, so that each MAC address is assigned would be unique.
We got a MAC address of the form 00:50:56: b0: xx: xx to be used in a virtual infrastructure running this vCenter Server with the ID 48.
image
One can easily calculate that for every server vCenter get a maximum of 65,535 MAC addresses, because the server location vCenter ff: ff range.
As I wrote above vCenter Server Usnique ID can be set from 0 to 63 and this means that the fourth byte can range from 80 to bf in HEX.
If a lot of vCenter servers it is necessary to ensure that the value of their vCenter Server Usnique ID do not match, to avoid the appearance of identical / duplicate MAC addresses for virtual machines.
Before the virtual machine includes its MAC address is checked for uniqueness. If confirmed by the unique MAC address is a virtual machine is given a new unique MAC address.
Virtual machines are prescribed static MAC address in the range 00:50:56:00:00:00 - 00:50:56:3 f: ff: ff
image
-
Case 2: ESXi host server is not controlled by vCenter
In this case, VMware Universally Unique Identifier (UUID) generates MAC addresses that are checked for conflicts.
When generating the MAC address used by three parameters:
  • VMware OUI
  • SMBIOS UUID ESXi host
  • The hash is based on the object name to which to which this MAC address is generated
MAC address generation algorithm guarantees unique MAC addresses within the virtual machine host on which it was created.
Prefix Organizationally Unique Identifier (OUI) that is used to generate the MAC address in the case when the ESXi host is not controlled by vCenter server is: 00:0 C: 29.
All MAC addresses of network adapters are included or suspended virtual machines monitored ESXi server, which is not the MAC address of virtual machines that are turned off, so when you turn on the virtual machine checks its MAC address to its MAC does not match the MAC-ohm already included virtual machine. If the same as the virtual machine is included with his former MAC-om which it was, and if such a MAC already have another car then it is assigned a new unique MAC address. MAC address can change when we migrate a virtual machine to another location, such as for example if you change the path of (path) on the same server.
There are still pitfalls. Algorithm that generates the MAC address does not understand the other virtual machines that are on the other / another ESXi hosts but in the same subnet (subnet), and that the virtual machine to which the generation of MAC addresses, and so theoretically it could happen in a conflict will occur MAC address, and you will not be notified about it immediately.
Virtual machines are prescribed static MAC address in the range 00:0 C: 29:3 F: 00:00 - 00:0 C: 29:3 F: FF: FF.
-
And what happens if we have a ESXi host that is not controlled vCenter server and it created a virtual machine, and we decided to add the host to vCenter. Swap a MAC address already created VMs. Answer: No! All virtual machines will keep the MAC address (00:0 C: 29), just for the new virtual machine that will be created on a given host MAC address will be generated from a range of 00:50:56.
Links on this topic:
ADVERTISEMENT

ไม่มีความคิดเห็น:

แสดงความคิดเห็น