12/09/2009

Kickstart and FT logging

One of the great features of vSphere is the option to make your vm's fault tolerant.
For those who are not yet aware of what this function does, just a short description.

Under normal conditions, your vm will run on 1 physical esx host. You can move it to another physical host by using vmotion if you use shared storage.

With Fault Tolerance, your vm will run simultaneously on 2 physical hosts, again using shared storage.
Your primary vm will be the one that's accessed all the time, the secondary vm will take over in case of physical problems with the esx host where the primary vm is situated.
As the secondary vm is synched (vlockstep) all the time, your vm is not protected against guest crashes. If your guest OS fails on the primary host, your secondary vm will fail too! As said before, you require shared storage, your secondary vm will use the same vmdk files!
And the saga continues, once your secondary vm becomes primary, a new secondary will be created on another esx in the same cluster (if a host is available).
For more details, just read the following pdf of vmware, as you have some requirements.

As certain commands where removed or not yet known to script the installation using kickstart, it was hard to find out how to enable the FT logging. Using the VI client you can enable FT logging on your vmkernel port, but scripting this was harder.

So here it is, just add following lines in your kickstart script.
To create your FT port on vSwitch0
esxcfg-vswitch -A "Fault Tolerance" vSwitch0
To add an ip address to your FT port
esxcfg-vmknic -a -i [FT IP ADDRESS] -n 255.255.255.0 "Fault Tolerance"
If you use vlan's, set the vlan of the FT port
esxcfg-vswitch -v [VLAN of FT IP] -p "Fault Tolerance" vSwitch0

Enabling vmotion will require following code :
vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0
I created 2 vmkernel ports, 1 for vmotion (vmk0) and 1 for FT (vmk1).

And here it is, to enable FT on your vmkernel port
vmware-vim-cmd hostsvc/advopt/update FT.Vmknic string vmk1

Checking afterwards in your VI client will show you that FT is enabled on your vmkernel port.

Gr,

David

3 comments:

  1. David this is great. Are you doing a restart of the management services afterwards, or a reboot of the ESX after the %post script. Incidentally, how are you calling the %post...?

    ReplyDelete
  2. Hi Mike,

    I'm not doing a restart of the mngmt services but finally I give it a reboot after installing the hp mngmt agents and networker client.

    But I tried it also when my esx was installed directly on the cos and no restart of mngmt is required. I don't even think that I did a refresh in the vi client, it was directly active and visible.

    I use UDA to deploy my hosts. I create in the %post a file that contains all my actions (like creating switches + pg, change cos memory, install agengts, set motd, ntp,...). After my reboot the script is executed. In 3.5 I've put my entire script in %post, but I noticed that certain commands were not recognized in the %post phase or did not respond correctly.
    An extra step, but in the past (2.5 and 3.0) we installed everything manually, so now the only I action I have to do is add to vcenter and enable my zoning for my hba's.

    Once I learned powershell I will probably move to PS, but during our migration now I'll leave everything as is.

    ReplyDelete
  3. Hi David,
    This is nice concept. Thanks for presenting the nice article.Please post further post based on your experience. That I want to know more about vmware

    Thanks & Regards,
    Praveen

    ReplyDelete