miércoles, 28 de abril de 2010

Misleading 10: Changing Service Console IP address

Recently I've been asked for changing an ESX 3.5 host from one of our production VLAN to another VLAN. This change involve a change of IP addresses for Service Console and vmKernel portgroup. Initially, this task could be viewed as a simple task, just login in ESX host physically and change the IP, but this change has more hidden implications that could move on serious problems like losing HA o vMotion capabilities for the affected host.

Changing Service Console IP is quite simple and the procedure looks something like (based on information found in this great post):

  1. List current Service Console port groups:
  2. esxcfg-vswitch -l this command will retrieve current vSwitches configuration, something like:
    Switch NameNum PortsUsed PortsConfigured PortsMTUUplinks
    vSwitch06413641500vmnic0,vmnic2

    PortGroup NameVLAN IDUsed PortsUplinks
    VM Network08vmnic0,vmnic2
    Service Console01vmnic0,vmnic2
    Switch NameNum PortsUsed PortsConfigured PortsMTUUplinks
    vSwitch06413641500vmnic1,vmnic3

    PortGroup NameVLAN IDUsed PortsUplinks
    VMkernel01vmnic1,vmnic3
    so you can look for your Service Console port group's name, in our example the bold one.
  3. We are looking for the virtual interface associated with that PortGroup, witch will be named something like vswif<n>, where n is the instance number of virtual interface, and will be retrieved by the esxcfg-vswif -l, aside all IP configuration associated with each virtual interface:
  4. NamePort GroupIP AddressNetmaskBroadcastEnabledDHCP
    vswif0Service Consolexxx.xxx.xxx.xxxnnn.nnn.nnn.nnnbbb.bbb.bbb.bbbtruefalse
  5. Once we've located our Service Console's associated virtual interface the only way for changing IP configuration is delete that virtual interface and create a new virtual interface with the new desired parameters. Steps to perform that procedure are:


    1. Delete virtual interface with esxcfg-vswif -d vswif0
    2. Create new virtual interface and associate it with our service console port group called Service Console:
      esxcfg-vswif -a -p "Service Console" -i <new IP Address> -n <netmask> vswif0
  6. We also should modify the default gateway associated with the virtual interface modifying /etc/sysconfig/network-scripts/ifcfg-vswif0 and adding GATEWAY=ggg.ggg.ggg.ggg in the file.
  7. This step it's quite important if you want to save a lot of headaches. Modify the corresponding in the /etc/hosts file
  8. At this point you have two options, reboot the ESX host or disable and enable the vswif interface. If your choice was disabling and enabling the vswif interface you should perform the following procedure:


    • To disable a vswif interface: esxcfg-vswif -s vswif0
    • To enable a vswif interface: esxcfg-vswif -e vswif0

Once you have done all these steps, just find your affected ESX in your VirtualCenter, Disconnect it and Reconnect. This process will uninstall the vpxa agent installed on the ESX host and will reinstall it during the reconecting process.

If after all you still have connections/vMotion/HA problems check ESX host's entry in the VirtualCenter database. Duncan has a great post at Yellow-Bricks that explains what registry should be checked and modified: http://www.yellow-bricks.com/2008/09/29/storage-vmotion-fails-after-service-console-ip-change/

Now it's time to change VMkernel IP address. This change can be done via vClient, or can be done directly from Service Console. Changing VMkernel IP address through vClient it's quite simple, so I'll focus on making this change manually.

As we saw with the method for change the Service Console IP, this procedure depends on deleting the affected vmknic and creating a new one.

  1. Again, the first recommended step it's to list all vmknics available on your ESX host. That could be done using the esxcfg-vmknic -l command that will produce an output like this:
  2. InterfacePort GroupIP AddressNetmaskBroadcastMAC AddressMTUTSO MSSEnabled
    vmk0VMkernelxxx.xxx.xxx.xxxnnn.nnn.nnn.nnnbbb.bbb.bbb.bbb00:50:56:aa:bb:cc150040960true
  3. Next, we are going to delete the affected vmknic (the bold one in our example). We'll also need the associated port group:
  4. esxcfg-vmknic -d -p VMkernel vmk0
  5. Finally, we create a new vmknic with the desired configuration and we associate it with the correct port group. Remember that this procedure will generate a new MAC Address:
  6. esxcfg-vmknic -a -p VMkernel -i yyy.yyy.yyy.yyy -n mmm.mmm.mmm.mmm vmk0

Keep in mind that these procedures are valid only for Standard vSwitches, and it's necesary slight modification to adapt it to Distributed vSwitches availables in ESX 4. But that's another history.

I based this post in my personal experience and the information recollected from:

I hope this post could help somebody

No hay comentarios:

Publicar un comentario