mercoledì 20 novembre 2013

Aix alt_disk_clone

Di seguito i passi eseguiti per clonare rootvg della lpar LPAR1 in occasione della migrazione da un P6-570 ad un P7-770.
Aggiungo un disco da 50GB (hdisk27) che ospiterà il rootvg della nuova partizione , sulla vecchia si chiamerà altinst_rootvg
al termine dell'operazione.

root@lpar1:/#lspv
hdisk0          00cff683554eac45                    rootvg          active
hdisk1          00cff683554eac7b                    rootvg          active
hdisk4          00cff683e9f9313f                    vgappl30           active
hdisk2          00cff68379f89cc7                    vgappl31           active
hdisk3          00cff68379f89dbe                    vgappl32           active
hdisk5          00cff68379f89e28                    vgappl33           active
hdisk6          00cff68379f89e74                    vgappl34           active
hdisk7          00cff68379f89eb4                    vgappl35           active
hdisk8          00cff68379f89ef9                    vgappl36           active
hdisk9          00cff68379f89f36                    vgappl30           active
hdisk10         00cff68379f89f7a                    vgappl31           active
hdisk11         00cff68379f89fbb                    vgappl32           active
hdisk12         00cff68379f89ffc                    vgappl33           active
hdisk13         00cff68379f8a046                    vgappl34           active
hdisk14         00cff68379f8a08b                    vgappl35           active
hdisk15         00cff68379f8a0d1                    vgappl36           active
hdisk16         00cff6837a2fb38a                    tempvg        active
hdisk17         00cff683ad734158                    tempvg        active
hdisk18         00cff6837b91c30d                    vgappl30           active
hdisk19         00cff683d38e1716                    swapvg          active
hdisk20         00cff6830a99978f                    vgappl30           active
hdisk21         00cff6830a999885                    vgappl31           active
hdisk22         00cff6830a9998f1                    vgappl32           active
hdisk23         00cff6830a999958                    vgappl33           active
hdisk24         00cff6830a9999c5                    vgappl34           active
hdisk25         00cff6830a999a4e                    vgappl35           active
hdisk26         00cff6830a999ace                    vgappl36           active
hdisk27         00cff6830915c025                    None            


Notare che se rootvg è mirrored l'operazione fallirà per mancanza di spazio; rimuovere mirror prima di procedere:

root@lpar1:/#unmirrorvg rootvg hdisk1
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run 'chpv -c '
        as root user to clear the boot record and avoid a potential boot
        off an old boot image that may reside on the disk from which this
        logical volume is moved/removed.
0516-1804 chvg: The quorum change takes effect immediately.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
        bosboot of system to reinitialize boot records.  Then, user must modify
        bootlist to just include:  hdisk0.


Verifichiamo lo stato del mirror :

root@lpar1:/#lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            981         588         08..00..188..196..196
hdisk1            active            981         981         197..196..196..196..196


OK , adesso rimuovo hdisk1 da rootvg :

root@lpar1:/#reducevg rootvg hdisk1
root@lpar1:/#lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            981         588         08..00..188..196..196


Un altro problema che potrebbe impedire l'operazione è la presenza di LV con nomi di lunghezza superiore a 12 caratteri
visto che la procedura aggiungerà un prefisso al nome originale dei logical volumes.

root@lpar1:/#smitty alt_clone

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* Target Disk(s) to install                          [hdisk27]                                                                                                          +
  Phase to execute                                    all                                                                                                               +
  image.data file                                    []                                                                                                                  /
  Exclude list                                       []                                                                                                                  /
  
  Bundle to install                                  []                                                                                                                 +
    -OR-
  Fileset(s) to install                              []
  
  Fix bundle to install                              []
    -OR-
  Fixes to install                                   []
  
  Directory or Device with images                    []
  (required if filesets, bundles or fixes used)
  
  installp Flags
  COMMIT software updates?                            yes                                                                                                               +
  SAVE replaced files?                                no                                                                                                                +
  AUTOMATICALLY install requisite software?           yes                                                                                                               +
  EXTEND file systems if space needed?                yes                                                                                                               +
  OVERWRITE same or newer versions?                   no                                                                                                                +
  VERIFY install and check file sizes?                no                                                                                                                +
  ACCEPT new license agreements?                      yes                                                                                                               +
  
  Customization script                               []                                                                                                                  /
  Set bootlist to boot from this disk
  on next reboot?                                     no                                                                                                                +
  Reboot when complete?                               no                                                                                                                +
  Verbose output?                                     yes                                                                                                               +
  Debug output?                                       no                                                                                                                +



Attenzione a non selezionare la modifica della bootlist e il reboot when complete .

Selezionando l'output verboso vedremo la lista dei files che vengono copiati nel nuovo disco , inutile.

Alla fine avremo :

root@lpar1:/#lspv 
hdisk0          00cff683554eac45                    rootvg          active
hdisk1          00cff683554eac7b                    None            
hdisk4          00cff683e9f9313f                    vgappl30           active
hdisk2          00cff68379f89cc7                    vgappl31           active
hdisk3          00cff68379f89dbe                    vgappl32           active
hdisk5          00cff68379f89e28                    vgappl33           active
hdisk6          00cff68379f89e74                    vgappl34           active
hdisk7          00cff68379f89eb4                    vgappl35           active
hdisk8          00cff68379f89ef9                    vgappl36           active
hdisk9          00cff68379f89f36                    vgappl30           active
hdisk10         00cff68379f89f7a                    vgappl31           active
hdisk11         00cff68379f89fbb                    vgappl32           active
hdisk12         00cff68379f89ffc                    vgappl33           active
hdisk13         00cff68379f8a046                    vgappl34           active
hdisk14         00cff68379f8a08b                    vgappl35           active
hdisk15         00cff68379f8a0d1                    vgappl36           active
hdisk16         00cff6837a2fb38a                    tempvg        active
hdisk17         00cff683ad734158                    tempvg        active
hdisk18         00cff6837b91c30d                    vgappl30           active
hdisk19         00cff683d38e1716                    swapvg          active
hdisk20         00cff6830a99978f                    vgappl30           active
hdisk21         00cff6830a999885                    vgappl31           active
hdisk22         00cff6830a9998f1                    vgappl32           active
hdisk23         00cff6830a999958                    vgappl33           active
hdisk24         00cff6830a9999c5                    vgappl34           active
hdisk25         00cff6830a999a4e                    vgappl35           active
hdisk26         00cff6830a999ace                    vgappl36           active
hdisk27         00cff6830915c025                    altinst_rootvg  


A questo punto abbiamo il nuovo rootvg (altinst_rootvg) , per accedervi dobbiamo usare il comando alt_rootvg_op.
Ad esempio possiamo "svegliare" il vg :

root@lpar1:/#alt_rootvg_op -W -d hdisk27
Waking up altinst_rootvg volume group ...

root@lpar1:/#lsvg -l altinst_rootvg
altinst_rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
alt_hd5             boot       1       1       1    closed/syncd  N/A
alt_hd6             paging     16      16      1    closed/syncd  N/A
alt_hd8             jfs2log    1       1       1    open/syncd    N/A
alt_hd4             jfs2       8       8       1    open/syncd    /alt_inst
alt_hd2             jfs2       37      37      1    open/syncd    /alt_inst/usr
alt_hd9var          jfs2       16      16      1    open/syncd    /alt_inst/var
alt_hd3             jfs2       32      32      1    open/syncd    /alt_inst/tmp
alt_hd10opt         jfs2       64      64      1    open/syncd    /alt_inst/opt
alt_hd11admin       jfs2       2       2       1    open/syncd    /alt_inst/admin
alt_dumplv0         sysdump    64      64      1    closed/syncd  N/A
alt_livedump        jfs2       4       4       1    open/syncd    /alt_inst/var/adm/ras/livedump
alt_netbackup       jfs2       64      64      1    open/syncd    /alt_inst/opt/netbackup
alt_ocsinv          jfs2       2       2       1    open/syncd    /alt_inst/opt/ocsinventory
alt_nagios          jfs2       2       2       1    open/syncd    /alt_inst/opt/nagios
alt_logs            jfs2       80      80      1    open/syncd    /alt_inst/logs


e rimetterlo a dormire :

root@lpar1:/#alt_rootvg_op -S
Putting volume group altinst_rootvg to sleep ...
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt/ocsinventory
forced unmount of /alt_inst/opt/ocsinventory
forced unmount of /alt_inst/opt/netbackup
forced unmount of /alt_inst/opt/netbackup
forced unmount of /alt_inst/opt/nagios
forced unmount of /alt_inst/opt/nagios
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/logs
forced unmount of /alt_inst/logs
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Fixing LV control blocks...
Fixing file system superblocks...

root@lpar1:/#lsvg 
rootvg
altinst_rootvg
vgappl30
vgappl31
vgappl32
vgappl33
vgappl34
vgappl35
vgappl36
stagevg
swapvg

root@lpar1:/#lsvg -l altinst_rootvg
0516-010 : Volume group must be varied on; use varyonvg command.


Ora non rimane che eliminare ogni traccia del vg e del disco dalla lpar per spostarlo sulla nuova.

root@lpar1:/#exportvg altinst_rootvg

root@lpar1:/#rmdev -dl hdisk27
hdisk27 deleted

Nessun commento: