News

Protecting your SAN LUNs during installation

When you're installing a new ESX host, it's important to take precautions to make sure that you're not overwriting a SAN LUN where your precious VMs reside. To keep those LUNs safe, you have a few options which I'm going to list from most cautious to least cautious.

  • Physically disconnect the fibre that runs into the server
  • Unpresent the LUNs from the ESX host through zoning on your SP/Switches
  • Remove the drivers from the installation media ( check out this script if you're interested )
  • Run a script in %pre of the kickstart which unloads all of the fibre kernel modules ( Emulex and Qlogic ) so that you can't inadvertently install onto a SAN LUN. The following script was originally posted on VMTN by user timmp. You need to inject this script into the %pre section of your kickstart.

    %pre
    #!/bin/sh

    # This will remove the loaded HBA modules from the kernel
    remove_qla(){
    for i in $(lsmod | grep qla | awk '{print $1'}); do
    echo Will remove: $i >> /dev/tty1
    rmmod $i
    sleep 1
    done
    }

    remove_lpfc(){
    for i in $(lsmod | grep lpfc | awk '{print $1'}); do
    echo Will remove: $i >> /dev/tty1
    rmmod $i
    sleep 1
    done
    }

    remove_qla
    sleep 2
    remove_qla
    remove_lpfc
  • Use the --ignoredisk options to mask your LUNs during installation

    ignoredisk –-drives=sda,sdb,sdc,sdd,sde,sdf,sdg,sdh,sdi,sdj,sdk,etc,etc

  • If you're using Compaq/HP gear, the scsi devices are named differently, and if you specify them explicitly you *should* be safe.

    # Bootloader options
    bootloader –location=mbr –driveorder=cciss/c0d0
    # Disk Partitioning
    clearpart --all --initlabel --drives=cciss/c0d0
    part /boot --fstype ext3 --size 250 --ondisk cciss/c0d0 --asprimary
    part / --fstype ext3 --size 5192 --ondisk cciss/c0d0 --asprimary
    part swap --fstype swap --size 1600 --ondisk cciss/c0d0 --asprimary
    part /var/log --fstype ext3 --size 4096 --ondisk cciss/c0d0
    part /tmp --fstype ext3 --size 4096 --ondisk cciss/c0d0
    part /home --fstype ext3 --size 2048 --ondisk cciss/c0d0
    part None --fstype vmfs3 --size 8192 --ondisk cciss/c0d0 --grow
    part None --fstype vmkcore --size 100 --ondisk cciss/c0d0




    You can use one or more of those options to keep your data safe while you install/upgrade your ESX hosts. If you inadvertenly destroy a VMFS volume, it's extremely hard to recover that data.
  • Labels:

    Posted by Dominic Rivera at Friday, June 19, 2009.


    Archives

    10/01/2006 - 11/01/2006 | 03/01/2007 - 04/01/2007 | 04/01/2007 - 05/01/2007 | 05/01/2007 - 06/01/2007 | 06/01/2007 - 07/01/2007 | 07/01/2007 - 08/01/2007 | 09/01/2007 - 10/01/2007 | 10/01/2007 - 11/01/2007 | 11/01/2007 - 12/01/2007 | 12/01/2007 - 01/01/2008 | 01/01/2008 - 02/01/2008 | 02/01/2008 - 03/01/2008 | 03/01/2008 - 04/01/2008 | 04/01/2008 - 05/01/2008 | 05/01/2008 - 06/01/2008 | 06/01/2008 - 07/01/2008 | 08/01/2008 - 09/01/2008 | 09/01/2008 - 10/01/2008 | 10/01/2008 - 11/01/2008 | 03/01/2009 - 04/01/2009 | 06/01/2009 - 07/01/2009 | 07/01/2009 - 08/01/2009 |