comment upgrader un serveur avec NIM alternate install

Creation: 11 fevrier 2015
Mise à jour:
Version: 1.0
Author: Jean-Louis Bicquelet-Salaün
Location: http://jlbicquelet.free.fr
Copyright: (c) 2015 Jean-Louis BICQUELET-SALAÜN

nimadm et alternate_disk

Avec NIM il est possible de migrer un serveur AIX en fonctionnement vers un niveau supérieur d'AIX et d'activer le nouveau système en un seul reboot.

On peut ainsi faire en une seule fois un upgrade de AIX 5.3 en AIX 6.1 ou d'AIX 6.1 en AIX 7.1.

Il faut disposer pour cela d'un disque supplémentaire de taille suffisante.

préparer l'alternate disk

  1. rechercher le serveur et vérifier sa configuration

      #lsnim -c machines |grep serveur
    serveur01           machines       standalone
    
     #lsnim -l serveur01
    serveur01:
       class          = machines
       type           = standalone
       connect        = nimsh
       comments       = site=vega_lune_noire
       current_master = serveur01
       sync_required  = yes
       platform       = chrp
       netboot_kernel = mp
       if1            = ent-NetworkAdminMon serveur01 0AA92CCC4402 ent0
       net_settings1  = 1000 full
       cable_type1    = N/A
       Cstate         = ready for a NIM operation
       prev_state     = not running
       Mstate         = currently running
       cpuid          = 00F8A8444C00
       Cstate_result  = reset
    

  2. rechercher le spot correspondant à la version que l'on veut installer. Dans les normes on a souvent des définitions de spot qui ressemble à ceci:

    • spot53TL12SP09
    • spot61TL9SP2
    • spot71TL3SP3

    On peut ainsi faire un grep sur la version d'AIX et trier

    #lsnim -t spot |grep 61 | sort
    spot61TL4SP7               resources       spot
    spot61TL5SP3               resources       spot
    spot61TL6SP5               resources       spot
    spot61TL5SP5               resources       spot
    spot61TL6SP6               resources       spot
    spot61TL7SP4               resources       spot
    spot61TL7SP5               resources       spot
    spot61TL7SP6               resources       spot
    spot61TL8SP2               resources       spot
    spot61TL9SP2               resources       spot
    

    On fait de même pour les lpp sources

    #lsnim -t lpp_source |grep 61 |sort
    gawk_61                 resources       lpp_source
    lpp_source61TL4SP7      resources       lpp_source
    lpp_source61TL5SP3      resources       lpp_source
    lpp_source61TL5SP5      resources       lpp_source
    lpp_source61TL6SP5      resources       lpp_source
    lpp_source61TL6SP6      resources       lpp_source
    lpp_source61TL7SP4      resources       lpp_source
    lpp_source61TL7SP5      resources       lpp_source
    lpp_source61TL7SP6      resources       lpp_source
    lpp_source61TL8SP2      resources       lpp_source
    lpp_source61TL9SP2      resources       lpp_source
    lppsource61_PI          resources       lpp_source
    

Nous disposons de toutes les informations necessaires. Nous pouvons lancer l'installation de l'alternate disk.

lancement de l'alternate disk

  1. vérification de l'état du serveur à partir du serveur NIM

    #lsnim -l serveur01
    

  2. lancement de l'alternate disk.

    /usr/sbin/nimadm -H -c'serveur01' -l'lpp_source61TL9SP2' -s'spot61TL9SP2' -d'hdisk2' -Y -j nimadmvg
    

    L'option -Y correspond à l'acceptation des nouvelles licences.

    #lsnim -l serveur01
    serveur01:
       class          = machines
       type           = standalone
       locked         = 16253328
       connect        = nimsh
       comments       = site=vega_lune_noire
       current_master = sxpnim01
       sync_required  = yes
       platform       = chrp
       netboot_kernel = mp
       if1            = ent-NetworkAdminMon serveur01 0AA92CCC4402 ent0
       net_settings1  = 1000 full
       cable_type1    = N/A
       Cstate         = alt_disk_mig operation is being performed
       prev_state     = ready for a NIM operation
       Mstate         = currently running
       lpp_source     = lpp_source61TL9SP2
       spot           = spot61TL9SP2
       cpuid          = 00F844444C00
       control        = master
       Cstate_result  = reset
    

    Sur le serveur NIM on voit le processus d'installation de dique alterné

    
    Initializing the NIM master.
    Initializing NIM client serveur01.
    warning: warning: 0042-521 m_ckmac: The mgmt_profile attribute is not set for the serveur01 object.
    
    
    Verifying alt_disk_migration eligibility.
    Initializing log: /var/adm/ras/alt_mig/serveur01_alt_mig.log
    Starting Alternate Disk Migration.
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 1.
    +-----------------------------------------------------------------------------+
    Cloning altinst_rootvg on client, Phase 1.
    Client alt_disk_install command: alt_disk_copy -j -M 6.1 -P1 -d "hdisk2"
    Calling mkszfile to create new /image.data file.
    Checking disk sizes.
    Creating cloned rootvg volume group and associated logical volumes.
    Creating logical volume alt_hd5
    Creating logical volume alt_hd6
    Creating logical volume alt_hd8
    Creating logical volume alt_hd4
    Creating logical volume alt_hd2
    Creating logical volume alt_hd9var
    Creating logical volume alt_hd3
    Creating logical volume alt_hd
    
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 2.
    +-----------------------------------------------------------------------------+
    Creating nimadm cache file systems on volume group nimadmvg.
    Checking for initial required migration space.
    Creating cache file system /serveur01_alt/alt_inst
    Creating cache file system /serveur01_alt/alt_inst/admin
    Creating cache file system /serveur01_alt/alt_inst/home
    Creating cache file system /serveur01_alt/alt_inst/opt
    
    
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 3.
    +-----------------------------------------------------------------------------+
    Syncing client data to cache ...
    
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 7.
    +-----------------------------------------------------------------------------+
    nimadm: There is no user customization script specified for this phase.
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 8.
    +-----------------------------------------------------------------------------+
    Creating client boot image.
    bosboot: Boot image is 55296 512 byte blocks.
    Writing boot image to client's alternate boot disk hdisk2.
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 9.
    +-----------------------------------------------------------------------------+
    Adjusting client file system sizes ...
    Adjusting size for /
    Adjusting size for /admin
    Adjusting size for /home
    Adjusting size for /opt
    Adjusting size for /opt/CA
    Adjusting size for /opt/admin
    Adjusting size for /opt/appmanager
    Adjusting size for /opt/beta48
    Adjusting size for /opt/controlm/agctm
    Adjusting size for /opt/controlm/agctm/ctm/sysout
    Adjusting size for /opt/mon
    Adjusting size for /tmp
    Adjusting size for /usr
    Adjusting size for /var
    Adjusting size for /var/log/syslog
    Syncing cache data to client ...
    Expanding /alt_inst/tmp client filesystem.
    Filesystem size changed to 8388608
    Filesystem size changed to 1310720
    
    Removing cache file system /serveur01_alt/alt_inst/opt/mon
    Removing cache file system /serveur01_alt/alt_inst/tmp
    Removing cache file system /serveur01_alt/alt_inst/usr
    Removing cache file system /serveur01_alt/alt_inst/var
    Removing cache file system /serveur01_alt/alt_inst/var/log/syslog
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 11.
    +-----------------------------------------------------------------------------+
    Cloning altinst_rootvg on client, Phase 3.
    Client alt_disk_install command: alt_disk_copy -j -M 6.1 -P3 -d "hdisk2"
    ## Phase 3 ###################
    Verifying altinst_rootvg...
    Modifying ODM on cloned disk.
    forced unmount of /alt_inst/var/log/syslog
    forced unmount of /alt_inst/var
    forced unmount of /alt_inst/usr
    forced unmount of /alt_inst/tmp
    forced unmount of /alt_inst/opt/mon
    forced unmount of /alt_inst/opt/controlm/agctm/ctm/sysout
    forced unmount of /alt_inst/opt/controlm/agctm
    forced unmount of /alt_inst/opt/beta48
    forced unmount of /alt_inst/opt/appmanager
    forced unmount of /alt_inst/opt/admin
    forced unmount of /alt_inst/opt/CA
    forced unmount of /alt_inst/opt
    forced unmount of /alt_inst/home
    forced unmount of /alt_inst/admin
    forced unmount of /alt_inst
    Changing logical volume names in volume group descriptor area.
    Fixing LV control blocks...
    Fixing file system superblocks...
    Bootlist is set to the boot disk: hdisk2 blv=hd5
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 10.
    +-----------------------------------------------------------------------------+
    Unmounting client mounts on the NIM master.
    forced unmount of /serveur01_alt/alt_inst/var/log/syslog
    forced unmount of /serveur01_alt/alt_inst/var/log/syslog
    forced unmount of /serveur01_alt/alt_inst/va
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 11.
    +-----------------------------------------------------------------------------+
    Cloning altinst_rootvg on client, Phase 3.
    Client alt_disk_install command: alt_disk_copy -j -M 6.1 -P3 -d "hdisk2"
    ## Phase 3 ###################
    Verifying altinst_rootvg...
    Modifying ODM on cloned disk.
    forced unmount of /alt_inst/var/log/syslog
    
    +-----------------------------------------------------------------------------+
    Executing nimadm phase 12.
    +-----------------------------------------------------------------------------+
    Cleaning up alt_disk_migration on the NIM master.
    Cleaning up alt_disk_migration on client serveur01.
    You have mail in /usr/spool/mail/root
    

    C'est assez long. Il faut compter environ 2 à 3 heures d'installation.

    Dans une autre console on peut voir l'état du client:

     #lsnim -l serveur01
    serveur01:
       class          = machines
       type           = standalone
       locked         = 16253328
       connect        = nimsh
       comments       = site=vega;env=rec;dmz=true
       current_master = sxpnim01
       sync_required  = yes
       platform       = chrp
       netboot_kernel = mp
       if1            = ent-NetworkAdminMon serveur01 0AA92FFF4402 ent0
       net_settings1  = 1000 full
       cable_type1    = N/A
       Cstate         = @red(alt_disk_mig operation is being performed)
       prev_state     = ready for a NIM operation
       Mstate         = currently running
       lpp_source     = lpp_source61TL9SP2
       spot           = spot61TL9SP2
       cpuid          = 00F8A8544C00
       control        = master
       Cstate_result  = reset
    

    Cstate

    Sur le client on voit

     lspv
    hdisk0          00f8a854e10959eb                    rootvg          active
    hdisk1          00f8a854e15ead94                    appsvg          active
    hdisk2          00f8a8541648b07b                    altinst_rootvg  active
    

    La bootlist est mise automatiquement à jour. Il faut ensuite prévoir un reboot.

    bootlist -o -m normal
    hdisk2 blv=hd5 pathid=0
    hdisk2 blv=hd5 pathid=1
    

    shutdown -Fr now
    

    Après reboot on trouve

    lspv
    hdisk0          00f8a854e10959eb                    old_rootvg
    hdisk1          00f8a854e15ead94                    appsvg          active
    hdisk2          00f8a8541648b07b                    rootvg          active
    

    Si vous obtenez un message semblable à ceci:

    sudo ssh serveur01
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    cd:9c:54:8c:b5:b6:10:1d:f8:5a:bb:5b:ba:2b:db:bb.
    Please contact your system administrator.
    Add correct host key in /root/.ssh/known_hosts to get rid of this message.
    Offending RSA key in /root/.ssh/known_hosts:@red(764)
    Password authentication is disabled to avoid man-in-the-middle attacks.
    Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
    Last unsuccessful login: Tue Jul  9 14:57:22 DFT 2013 on ssh from 192.19.10.10
    Last login: Fri Jan 23 14:18:58 NFT 2015 on /dev/pts/1 from serveur01
    

    Supprimer dans le fichier known_hosts la ligne correspondante.