virtualization:vmware:67:vmk0_01
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| virtualization:vmware:67:vmk0_01 [2019/10/12 08:24] – rplecko | virtualization:vmware:67:vmk0_01 [2019/10/12 08:39] (current) – rplecko | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| === Remove and recreate Management Network VM Kernel interface [vmk0], using ESXi CLI === | === Remove and recreate Management Network VM Kernel interface [vmk0], using ESXi CLI === | ||
| + | [[https:// | ||
| As you may know, ESXi Management interface (aka vmk0) is created during installation. By default that interface will inherit MAC address of one of the physical NIC cards. Now, this is not a problem at all in most cases, but sometimes it can create problems. | As you may know, ESXi Management interface (aka vmk0) is created during installation. By default that interface will inherit MAC address of one of the physical NIC cards. Now, this is not a problem at all in most cases, but sometimes it can create problems. | ||
| Line 13: | Line 14: | ||
| If you are using Standard Switches, the procedure is pretty straight forward so i will not cover it. It becomes a bit complex in case your Management interface was migrated to Distributed Virtual Switch. And this is exactly the case I will cover here. | If you are using Standard Switches, the procedure is pretty straight forward so i will not cover it. It becomes a bit complex in case your Management interface was migrated to Distributed Virtual Switch. And this is exactly the case I will cover here. | ||
| - | All these steps will need to be performed using direct console, as we will be deleting the interface. It is also a good idea to put the host into Maintenance Mode. | + | All these steps will need to be performed using direct console, as we will be deleting the interface. It is also a good idea to put the host into Maintenance Mode.\\ |
| - | Collect configuration details | + | |
| - | First of all you need to capture current IP configuration | + | === Collect |
| - | Find Port ID | + | |
| - | Second, you will need to find a port number on dvswitch which is used by vmk0. To list Switch inso you can use esxcfg-vswitch -l and then look for vmk0. If you are in same situation as I am the output of that command can be very long, so you can use grep and awk to filter out only the value we need. | + | First of all you need to capture current IP configuration of your management interface. I mean IP, Netmask and Gateway. We will also need name of the dvswitch which has the vmk0 interface. All this info will be needed.\\ |
| - | esxcfg-vswitch -l |grep vmk0 |awk ' | + | === Find Port ID === |
| - | | + | Second, you will need to find a port number on dvswitch which is used by vmk0. To list Switch info you can use \\ |
| + | esxcfg-vswitch -l | ||
| + | |||
| + | and then look for **vmk0**. The output of that command can be very long, so you can use grep and awk to filter out only the value you need. | ||
| + | |||
| + | esxcfg-vswitch -l |grep vmk0 |awk ' | ||
| + | |||
| + | === | ||
| As third step, we need to remove current vmk0, thats easy, just run the command: | As third step, we need to remove current vmk0, thats easy, just run the command: | ||
| - | esxcli network ip interface remove --interface-name=vmk0 | + | |
| We can check if it was removed my running esxcfg-vmknic -l or we can check if the port was freed by running esxcfg-vswitch -l and looking for the port number we acquired in second step. | We can check if it was removed my running esxcfg-vmknic -l or we can check if the port was freed by running esxcfg-vswitch -l and looking for the port number we acquired in second step. | ||
| - | Re-Create vmk0 | + | === Re-Create vmk0 === |
| Now once we have old vmk0 removed, we can run following command to recreate it: | Now once we have old vmk0 removed, we can run following command to recreate it: | ||
| - | esxcli network ip interface add --interface-name=vmk0 --dvs-name=DVSWITCHNAME --dvport-id=PORT_ID_FROM_STEP_TWO | + | |
| - | Of course you will need to replace DVSWITCHNAME with your Distributed Switch name and PORT_ID_FROM_STEP_TWO with the Port ID we acquired in step 2. | + | Of course you will need to replace |
| - | Again, we can check if port was created using esxcfg-vmknic -l or esxcfg-vswitch -l. | + | Again, we can check if port was created using\\ |
| - | Configure IP settings | + | < |
| + | or | ||
| + | esxcfg-vswitch -l</ | ||
| + | === Configure IP settings | ||
| - | In step number 5 we need to assign IP configuration to the new vmk0 interface. Use the following command to do it. Replace IP and NETMASK with info captured in step 1. | ||
| - | esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=IP --netmask=NETMASK | + | In step number 5 we need to assign IP configuration to the new vmk0 interface. Use the following command to do it. Replace **IP** and **NETMASK** with info captured in step 1. |
| - | Set default Gateway | + | esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=IP --netmask=NETMASK --type=static |
| + | |||
| + | === Set default Gateway | ||
| We also need to set the default GW back to its place, as it was removed once we removed vmk0. | We also need to set the default GW back to its place, as it was removed once we removed vmk0. | ||
| - | esxcfg-route -a default IP_OF_GW | + | |
| + | |||
| + | === Mark vmk0 for Management traffic === | ||
| - | Mark vmk0 for Management traffic | ||
| It may happen that vmk0 will not be marked for Management traffic after recreation. You can use the following command to mark interface for management in CLI. | It may happen that vmk0 will not be marked for Management traffic after recreation. You can use the following command to mark interface for management in CLI. | ||
| - | esxcli network ip interface tag add -i vmk0 -t Management | + | |
virtualization/vmware/67/vmk0_01.1570868649.txt.gz · Last modified: 2019/10/12 08:24 by rplecko
