Search This Blog

Friday, September 12, 2014

Root File System Extension in HP-Unix

This article explains how to extend the root (/) file system using LVM Mirror/UX. OnlineJFS is required to extend the file system without going in LVM maintenance mode. This method allows to extend root (/) file system without re-igniting the server.

It uses a special "reserve" logical volume as stepping stone to free the required PEs between current lvol3 and lvol4 to comply with lvol3 contiguous policy. This method can be used on HP-UX 11.11 / 11.23 with Legacy Addressing (/dev/dsk/c#t#d#) or with the new HP-UX 11.31 Agile Addressing (/dev/disk/disk#) device special files. In this example, we use the new HP-UX 11.31 Agile Addressing.

1.   Create full backup of /dev/vg00 volume group using Ignite, if available.

# make_tape_recovery -v -I -x inc_entire=vg00 -a /dev/rmt/#mn

2.   Check the current status of your volume groups and logical volumes.
boxnet:/root#bdf      
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    2097152  290496 1792600   14% /
/dev/vg00/lvol1    2097152  199152 1883256   10% /stand
/dev/vg00/lvol10   8388608 2372536 5974544   28% /var
/dev/vg00/lvol12   4194304   20848 4140864    1% /var/adm/crash
/dev/vg00/lvol11   2097152   20776 2060168    1% /var/SAN
/dev/vg00/lvol9    8388608 3253432 5095160   39% /usr
/dev/vg00/lvol8    1048576   22904 1017744    2% /tmp
/dev/vg00/lvol5    9355264 5333416 3990488   57% /opt
/dev/vg00/lvol7    2097152   20776 2060168    1% /opt/networker
/dev/vg00/lvol6    2097152   20776 2060168    1% /opt/SAN
/dev/vg00/lvol4    1048576   21216 1019456    2% /home


boxnet:/root#vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      12    
Open LV                     12    
Max PV                      16    
Cur PV                      2     
Act PV                      2     
Max PE per PV               4329        
VGDA                        4  
PE Size (Mbytes)            16             
Total PE                    8638   
Alloc PE                    6262   
Free PE                     2376   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    
VG Version                  1.0      
VG Max Size                 1108224m  
VG Max Extents              69264        

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                256        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd          
   LV Size (Mbytes)            8192           
   Current LE                  512      
   Allocated PE                1024       
   Used PV                     2      

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048            
   Current LE                  128      
   Allocated PE                256        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd          
   LV Size (Mbytes)            1024           
   Current LE                  64       
   Allocated PE                128        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd           
   LV Size (Mbytes)            9136           
   Current LE                  571      
   Allocated PE                1142       
   Used PV                     2      

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                256        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                256        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd          
   LV Size (Mbytes)            1024           
   Current LE                  64       
   Allocated PE                128        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol9
   LV Status                   available/syncd          
   LV Size (Mbytes)            8192           
   Current LE                  512      
   Allocated PE                1024       
   Used PV                     2      

   LV Name                     /dev/vg00/lvol10
   LV Status                   available/syncd          
   LV Size (Mbytes)            8192           
   Current LE                  512      
   Allocated PE                1024       
   Used PV                     2      

   LV Name                     /dev/vg00/lvol11
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048            
   Current LE                  128      
   Allocated PE                256        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol12
   LV Status                   available/syncd          
   LV Size (Mbytes)            4096           
   Current LE                  256      
   Allocated PE                512        
   Used PV                     2      


   --- Physical volumes ---
   PV Name                     /dev/disk/disk2_p2
   PV Status                   available               
   Total PE                    4319   
   Free PE                     1188   
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/disk/disk3_p2
   PV Status                   available               
   Total PE                    4319   
   Free PE                     1188   
   Autoswitch                  On       
   Proactive Polling           On              



The primary disk is disk2_p2 and the alternate disk is disk3_p2. In this example, the current size of lvol3 is 256 PE or 2048 MB.

CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|   LVOL3   |      |   LVOL3   |
+-----------+      +-----------+
|   LVOL4   |      |   LVOL4   |
+-----------+      +-----------+
|   LVOL5   |      |   LVOL5   |
+-----------+      +-----------+
|   LVOL6   |      |   LVOL6   |
+-----------+      +-----------+
|   LVOL7   |      |   LVOL7   |
+-----------+      +-----------+
|   LVOL8   |      |   LVOL8   |
+-----------+      +-----------+
|   LVOL9   |      |   LVOL9   |
+-----------+      +-----------+
|   LVOL10  |      |   LVOL10  |
+-----------+      +-----------+
|   LVOL11  |      |   LVOL11  |
+-----------+      +-----------+
|   LVOL12  |      |   LVOL12  |
+-----------+      +-----------+

3.   Remove all mirrors from alternate disk down to lvol4.

# lvreduce -m 0 /dev/vg00/lvol12 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol11 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol10 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol9 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol8 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol7 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol6 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol5 /dev/disk/disk3_p2
# lvreduce -m 0 /dev/vg00/lvol4 /dev/disk/disk3_p2


boxnet:/root#vgdisplay -v vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      12    
Open LV                     12    
Max PV                      16    
Cur PV                      2     
Act PV                      2     
Max PE per PV               4329        
VGDA                        4  
PE Size (Mbytes)            16             
Total PE                    8638   
Alloc PE                    3899   
Free PE                     4739   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    
VG Version                  1.0      
VG Max Size                 1108224m  
VG Max Extents              69264        

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                256        
   Used PV                     2      

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd          
   LV Size (Mbytes)            8192           
   Current LE                  512      
   Allocated PE                1024       
   Used PV                     2      

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                256         
   Used PV                     2      

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd          
   LV Size (Mbytes)            1024           
   Current LE                  64       
   Allocated PE                64         
   Used PV                     1      

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd          
   LV Size (Mbytes)            9136           
   Current LE                  571      
   Allocated PE                571        
   Used PV                     1      

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                128        
   Used PV                     1      

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                128        
   Used PV                     1      

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd          
   LV Size (Mbytes)            1024           
   Current LE                  64       
   Allocated PE                64         
   Used PV                     1      

   LV Name                     /dev/vg00/lvol9
   LV Status                   available/syncd          
   LV Size (Mbytes)            8192           
   Current LE                  512      
   Allocated PE                512        
   Used PV                     1      

   LV Name                     /dev/vg00/lvol10
   LV Status                   available/syncd          
   LV Size (Mbytes)            8192           
   Current LE                  512      
   Allocated PE                512        
   Used PV                     1      

   LV Name                     /dev/vg00/lvol11
   LV Status                   available/syncd          
   LV Size (Mbytes)            2048           
   Current LE                  128      
   Allocated PE                128         
   Used PV                     1      

   LV Name                     /dev/vg00/lvol12
   LV Status                   available/syncd          
   LV Size (Mbytes)            4096           
   Current LE                  256      
   Allocated PE                256        
   Used PV                     1      


   --- Physical volumes ---
   PV Name                     /dev/disk/disk2_p2
   PV Status                   available               
   Total PE                    4319   
   Free PE                     1188   
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/disk/disk3_p2
   PV Status                   available               
   Total PE                    4319   
   Free PE                     3551   
   Autoswitch                  On       
   Proactive Polling           On

CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|   LVOL3   |      |   LVOL3   |
+-----------+      +-----------+
|   LVOL4   |     
+-----------+     
|   LVOL5   |     
+-----------+     
|   LVOL6   |     
+-----------+     
|   LVOL7   |     
+-----------+     
|   LVOL8   |     
+-----------+     
|   LVOL9   |     
+-----------+     
|   LVOL10  |     
+-----------+     
|   LVOL11  |     
+-----------+      
|   LVOL12  |     
+-----------+   

4.   At this point, the alternate disk is only mirroring lvol1, lvol2 and lvol3. You can confirm using pvdisplay -v /dev/disk/disk3_p2. Create a "step stone" logical volume in the alternate disk of the size you need to add to lvol3.

# lvcreate -n reserve /dev/vg00
# lvextend -l <PE_size> /dev/vg00/reserve /dev/disk/disk3_p2

boxnet:/root#pvdisplay -v /dev/disk/disk3_p2|more
--- Physical volumes ---
PV Name                     /dev/disk/disk3_p2
VG Name                     /dev/vg00
PV Status                   available               
Allocatable                 yes         
VGDA                        2  
Cur LV                      3     
PE Size (Mbytes)            16             
Total PE                    4319   
Free PE                     3551   
Allocated PE                768        
Stale PE                    0      
IO Timeout (Seconds)        default            
Autoswitch                  On       
Proactive Polling           On              

   --- Distribution of physical volume ---
   LV Name                 LE of LV  PE for LV
   /dev/vg00/lvol1         128       128      
   /dev/vg00/lvol2         512       512      
   /dev/vg00/lvol3         128       128  

boxnet:/root#lvcreate -n reserve /dev/vg00
Logical volume "/dev/vg00/reserve" has been successfully created with
character device "/dev/vg00/rreserve".
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

# lvextend -L 2048 /dev/vg00/reserve /dev/disk/disk3_p2

boxnet:/root#lvextend -L 2048 /dev/vg00/reserve /dev/disk/disk3_p2
Logical volume "/dev/vg00/reserve" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf


CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|   LVOL3   |      |   LVOL3   |
+-----------+      +-----------+
|   LVOL4   |      |   Reserve |
+-----------+      +-----------+
|   LVOL5   |    
+-----------+    
|   LVOL6   |    
+-----------+    
|   LVOL7   |    
+-----------+    
|   LVOL8   |    
+-----------+    
|   LVOL9   |    
+-----------+    
|   LVOL10  |    
+-----------+    
|   LVOL11  |    
+-----------+    
|   LVOL12  |    
+-----------+    

5.   Re-mirror the lvols to the alternate disk

# lvextend -m 1 /dev/vg00/lvol4 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol5 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol6 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol7 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol8 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol9 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol10 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol11 /dev/disk/disk3_p2
# lvextend -m 1 /dev/vg00/lvol12 /dev/disk/disk3_p2

CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|   LVOL3   |      |   LVOL3   |
+-----------+      +-----------+
|   LVOL4   |      |  reserve  |
+-----------+      +-----------+
|   LVOL5   |      |   LVOL4   |
+-----------+      +-----------+
|   LVOL6   |      |   LVOL5   |
+-----------+      +-----------+
|   LVOL7   |      |   LVOL6   |
+-----------+      +-----------+
|   LVOL8   |      |   LVOL7   |
+-----------+      +-----------+
|   LVOL9   |      |   LVOL8   |
+-----------+      +-----------+
|   LVOL10  |      |   LVOL9   |
+-----------+      +-----------+
|   LVOL11  |      |   LVOL10  |
+-----------+      +-----------+
|   LVOL12  |      |   LVOL11  |
+-----------+      +-----------+
                    |   LVOL12  |
                   +-----------+

6.   Reduce the mirrors from the primary disk down to lvol4 included.

# lvreduce -m 0 /dev/vg00/lvol12 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol11 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol10 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol9 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol8 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol7 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol6 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol5 /dev/disk/disk2_p2
# lvreduce -m 0 /dev/vg00/lvol4 /dev/disk/disk2_p2

CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|   LVOL3   |      |   LVOL3   |
+-----------+      +-----------+
                   |  RESERVE  |
                   |           |
                   +-----------+
                   |   LVOL4   |
                   +-----------+
                   |   LVOL5   |
                   +-----------+
                   |   LVOL6   |
                   +-----------+
                   |   LVOL7   |
                   +-----------+
                   |   LVOL8   |
                   +-----------+
                   |   LVOL9   |
                   +-----------+
                   |   LVOL10  |
                   +-----------+
                   |   LVOL11  |
                   +-----------+
                   |   LVOL12  |
                   +-----------+

7.   Remove the "step stone" lvol in the alternate disk to free its space.

# lvremove /dev/vg00/reserve

boxnet:/tmp#lvremove /dev/vg00/reserve
The logical volume "/dev/vg00/reserve" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vg00/reserve" has been successfully removed.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

   CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|   LVOL3   |      |   LVOL3   |
+-----------+      +-----------+
                   |  free...  |
                   |           |
                   +-----------+
                   |   LVOL4   |
                   +-----------+
                   |   LVOL5   |
                   +-----------+
                   |   LVOL6   |
                   +-----------+
                   |   LVOL7   |
                   +-----------+
                   |   LVOL8   |
                   +-----------+
                   |   LVOL9   |
                   +-----------+
                   |   LVOL10  |
                   +-----------+
                   |   LVOL11  |
                   +-----------+
                   |   LVOL12  |
                   +-----------+

8.   Now enough contiguous space is available in both drives to extend the /dev/vg00/lvol3 logical volume.
Extend the logical volume. This will increase lvol3 in both disks since the mirror hasn't been broken.

# lvextend -l <PE_size> /dev/vg00/lvol3

boxnet:/tmp#lvextend -L 4096 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|           |      |           |
|   LVOL3   |      |   LVOL3   |
|           |      |           |
|           |      |           |
+-----------+      +-----------+
                   |   LVOL4   |
                   +-----------+
                   |   LVOL5   |
                   +-----------+
                   |   LVOL6   |
                   +-----------+
                   |   LVOL7   |
                   +-----------+
                   |   LVOL8   |
                   +-----------+
                   |   LVOL9   |
                   +-----------+
                   |   LVOL10  |
                   +-----------+
                   |   LVOL11  |
                   +-----------+
                   |   LVOL12  |
                   +-----------+

9.   Re-mirror the lvols from the alternate disk to the primary disk.

# lvextend -m 1 /dev/vg00/lvol12 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol11 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol10 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol9 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol8 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol7 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol6 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol5 /dev/disk/disk2_p2
# lvextend -m 1 /dev/vg00/lvol4 /dev/disk/disk2_p2

  CURRENT DISK CONFIGURATION
PRIMARY DISK       ALTERNATE DISK
+-----------+      +-----------+
|   LVOL1   |      |   LVOL1   |
+-----------+      +-----------+
|   LVOL2   |      |   LVOL2   |
+-----------+      +-----------+
|           |      |           |
|   LVOL3   |      |   LVOL3   |
|           |      |           |
|           |      |           |
+-----------+      +-----------+
|   LVOL4   |      |   LVOL4   |
+-----------+      +-----------+
|   LVOL5   |      |   LVOL5   |
+-----------+      +-----------+
|   LVOL6   |      |   LVOL6   |
+-----------+      +-----------+
|   LVOL7   |      |   LVOL7   |
+-----------+      +-----------+
|   LVOL8   |      |   LVOL8   |
+-----------+      +-----------+
|   LVOL9   |      |   LVOL9   |
+-----------+      +-----------+
|   LVOL10  |      |   LVOL10  |
+-----------+      +-----------+
|   LVOL11  |      |   LVOL11  |
+-----------+      +-----------+
|   LVOL12  |      |   LVOL12  |
+-----------+      +-----------+

10.  Extend the filesystem of lvol3 using OnlineJFS fsadm command.

# fsadm -F vxfs -b <Current PEs * PE_size>M /

boxnet:/tmp#fsadm -F vxfs -b 4096m /
UX:vxfs fsadm: INFO: V-3-25942: /dev/vg00/rlvol3 size increased from 2097152 sectors to 4194304 sectors

11.  Final Size of root File System that is extended by 2 GB.

boxnet:/tmp#bdf /
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    4194304  289344 3874512    7% /

12.  Take a Reboot after completing this activity, to re-confirm everything is fine.




Saturday, August 30, 2014

vPars Monitor and partition database

vPars Monitor and partition database
With or without vPars, the firmware loads and launches ISL or EFI. In a server without vPars, from ISL or EFI, the loader hpux or hpux.efi loads the kernel /stand/vmunix:

PA-RISC
ISL> hpux /stand/vmunix
Integrity
HPUX> boot vmunix

However, in a server with vPars, from the loader (hpux or hpux.efi) loads the vPars Monitor (/stand/vpmon):
PA-RISC
ISL> hpux /stand/vpmon
Integrity
HPUX> boot vpmon

Single User Mode
On a vPars server, you can boot a virtual partition into single-user mode either at the monitor prompt or at the shell prompt of a running partition.

For example, if we wanted to boot node2 into single user mode:

From MON> From the monitor prompt, specify the -is option as an argument to vparload.

MON> vparload -p node2 -o "-is"

From the shell prompt of another virtual partition, specify the -o option with the vparboot command:

node1# vparboot -p node2 -o "-is"

NOTE: To boot a virtual partition, the partition must be in the down state. If the partition is in the hung state, perform the following before executing the vparboot:

Turn off autoboot for the target partition:

node1# vparmodify -p node2 -B manual

Attempt to reset the target partition with the -t option (soft reset):

node1# vparreset -p node2 -t


If it still appears to be hung, reset it with the -h option (hard reset):

node1# vparreset -p node2 -h

Continue verifying the state until vparstatus shows that node2 is in the down state:

node1# vparstatus -p node2 -v | grep -E "Name|State"
Name: node2
State: down

After you have entered into single-user mode and if you want to turn autoboot back on, the command is:

node1# vparmodify -p node2 -B auto

Maintenance Mode
When troubleshooting LVM, you may need to enter into maintenance mode using the -lm option. For more information on maintenance mode, see the book "Managing Systems and Workgroups."

On a vPars server, you specify the -lm option but as an argument to either the monitor vparload command or as a -o option to the shell vparboot command.

For example, if the partition node2 is down, to boot node2 into maintenance mode:

From MON> From the monitor prompt:

MON> vparload -p node2 -o "-lm"

From shell prompt From the running partition node1:

node1# vparboot -p node2 -o "-lm"

Overriding Quorum
In LVM, when the root disk is mirrored, the server can only activate the root volume group, which contains the OS instance, when the majority of the physical volumes in a root volume group are present at boot time. This is called establishing a quorum. Sometimes, you may want to boot an OS instance regardless of whether a quorum is established. You can override the quorum requirement by using the -lq option. For more information on quorums, see the book "Managing Systems and Workgroups."

On a vPars server, you can execute either of the following:
From MON> From the monitor prompt, to boot node2 overriding the quorum requirement:

MON> vparload -p node2 -o "-lq"

From shell prompt From the running virtual partition node1, to boot node2 overriding the quorum requirement:

node1# vparboot -p node2 -o "-lq"

From the running virtual partition node1, to modify node2 to override the quorum requirement when booting:

node1# vparmodify -p vpar1 -o "-lq" 

In a vpar server, the mkboot command is not useful as the quorum override is handled by the vPars Monitor database. The AUTO file is no read when a vpar is booting. The only time the AUTO file is read, is when the server or nPar is booting, just before loading the vPar Monitor.

NOTE: Specifying the boot options from the command line only affects the current boot. On a non-vPars server, to have a server permanently boot with the -lq option, you would put "hpux -lq" in the LIF AUTO file. On a vPars server, to have a partition boot with the -lq option, you would simulate the AUTO file usage by entering the -lq option into the partition database. See “Simulating the AUTO File on a Virtual Partition” in vPars Manual.


Thursday, August 28, 2014

Site Awareness

What are remote mirroring and site awareness? In a remote mirror configuration, SF hosts and the storage are distributed to two or more sites. These sites are typically connected via a redundant high-capacity network (Fiber Channel or Dense Wavelength Division Multiplexing) that provides access to storage. The disk groups include disks from all sites and volumes are created with a mirror at each site.

To verify that you have the Site Awareness feature enabled, use the following command:
root@desap2ia:/root# vxlicrep |grep -i site
   Site License                        = YES
   Site License                        = YES
   Site License                        = YES
   Site Awareness                      = Enabled
   Site License                        = YES
   Site License                        = YES

Configuring Site Awareness              
1)       Assign the physical resources (hosts and disks) to a site.
2)       Configure site-based allocation on a diskgroup
3)       Configure site consistency on the diskgroup and the volumes
4)       Set mirrored volumes read policy to site-based (if necessary)
5)       Use site-based storage allocation when creating new volumes.

Assigning disk to a site:

To assign a disk to a site:

#vxdisk [-g diskgroup] settag site=sitename [disk|e:enclosure] [disk|e:enclosure]…

#vxdisk –g datadg settag site=siteA emc0_1 emc0_2
#vxdisk settag apevmx09_111d site=site09

Or

# vxdisk –g datadg settag site=siteA e:emc0


To list the site tags on a disk:

# vxdisk [-g diskgroup] listtag


root@desap2ia:/root# vxdisk -g sapz42_dg listtag
DEVICE          NAME                            VALUE                             
apevmx09_07fe   site                            site09
apevmx09_07ff   site                            site09
apevmx09_08f1   site                            site09
apevmx09_11a2   site                            site09
apevmx09_11a3   site                            site09
apevmx09_111d   site                            site09
apevmx09_111e   site                            site09
apevmx09_0262   site                            site09
apevmx09_0800   site                            site09
apevmx09_0802   site                            site09
apevmx10_01ca   site                            site10
apevmx10_07e3   site                            site10
apevmx10_07e4   site                            site10
apevmx10_10d4   site                            site10
apevmx10_0701   site                            site10
apevmx10_0702   site                            site10
apevmx10_1047   site                            site10
apevmx10_1048   site                            site10
apevmx10_1059   site                            site10
apevmx10_1070   site                            site10
apevmx10_1071   site                            site10



To remove the site tag from a disk:

#vxdisk [-g diskgroup] rmtag site=sitename [disk|e:enclosure]


Assigning host to a site


To assign a host to a site
# vxdctl set site=sitename
# vxdctl set site=siteA


To observe the site assignment of a host:
# vxdctl list|grep siteid
Siteid: siteA


To more the site name from a host:
#vxdctl [-F] unset site

-F Use the force option if imported disk groups are registered to the site.

Configuring site-based allocation on a disk group

To add site definition to a disk group configuration:
#vxdg –g diskgroup addsite sitename

For Example:
#vxdg –g datadg addsite siteA
#vxdg –g datadg addsite siteB

·          A new volume is automatically mirrored across all sites
·          The volume’s read policy is automatically set to siteread
·          Use allsites=off with vxassist make for non-default configuraiton

To remove a site from the disk group configuration:
#vxdg –g diskgroup rmsite sitename

·          No change is made to the physical resources that are assigned to that site.
·          You must use the force option (-f) if the site is detached.


Enabling site consistency in a disk group Site consistency in a disk group means that the data at each site is guaranteed to be consistent. Therefore, any disk failure in a site-consistent disk group that causes one of the volumes to be left without a complete plex causes the site to be detached. To enable fast resynchronization of volumes when the site is reattached, the volumes are created with the FastResync feature enabled and an instant snap DCO volume by default.

When you turn on site consistency in a disk group:
·          By Default, new volumes are created as site-consistent.
·          Existing volumes are not impacted.
·          Disk group configuration copy is placed across sites

To Set site consistency in a disk group:
#vxdg –g diskgroup set siteconsistent=on


To set site consistency on an existing volume:
#vxsnap –g diskgroup prepare volume
#vxvol –g diskgroup set siteconsistent=on volume

To turn off site consistency:
#vxvol –g diskgroup set siteconsistent=off volume
#vxdg –g diskgroup set siteconsistent=off

Read policy in a site-consistent setup
The siteread policy:
·          Is available with SF5.0 and later
·          Instructs each host to read data only from local plexes, provided that local plexes are available.
·          Is the default policy if site-based allocation is enabled.

To manually set the read policy to siteread, run the following command:
#vxvol –g diskgroup rdpol siteread volume



File System Size Before Extension:

root@desap2ia:/usr/sap/Z42/sapdata999# df -k .
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/vx/dsk/sapz42_dg/usrsapTMP    20971520  16315608   23%     5230     1% /usr/sap/Z42/sapdata999

We need to observe the following things:
1) The READPOL should be SITEREAD
2) Three Plex Should there
3) Check the length of Log Plex

root@desap2ia:/usr/sap/Z42/sapdata999# vxprint -htg sapz42_dg usrsapTMP
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

v  usrsapTMP    -            ENABLED  ACTIVE   41943040 SITEREAD  -        fsgen
pl usrsapTMP-01 usrsapTMP    ENABLED  ACTIVE   41943040 CONCAT    -        RW
sd sapz42_05-01 usrsapTMP-01 sapz42_05 0       41943040 0         apevmx09_08f1 ENA
pl usrsapTMP-02 usrsapTMP    ENABLED  ACTIVE   41943040 CONCAT    -        RW
sd sapz42_05m-01 usrsapTMP-02 sapz42_05m 0     41943040 0         apevmx10_1059 ENA
pl usrsapTMP-03 usrsapTMP    ENABLED  ACTIVE   LOGONLY  CONCAT    -        RW
sd sapz42_drl1-19 usrsapTMP-03 sapz42_drl1 26000 1040   LOG       apevmx10_10d4 ENA

Before Extending volume Remove Log Plex:

root@desap2ia:/usr/sap/Z42/sapdata999# vxassist -g sapz42_dg remove log usrsapTMP

root@desap2ia:/usr/sap/Z42/sapdata999# vxprint -htg sapz42_dg usrsapTMP         
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

v  usrsapTMP    -            ENABLED  ACTIVE   41943040 SITEREAD  -        fsgen
pl usrsapTMP-01 usrsapTMP    ENABLED  ACTIVE   41943040 CONCAT    -        RW
sd sapz42_05-01 usrsapTMP-01 sapz42_05 0       41943040 0         apevmx09_08f1 ENA
pl usrsapTMP-02 usrsapTMP    ENABLED  ACTIVE   41943040 CONCAT    -        RW
sd sapz42_05m-01 usrsapTMP-02 sapz42_05m 0     41943040 0         apevmx10_1059 ENA
          

Storage Team has provided the below Disk


apevmx09_111d auto:none -          -          online invalid
apevmx09_111e auto:none -          -          online invalid
apevmx10_1070 auto:none -          -          online invalid
apevmx10_1071 auto:none -          -          online invalid  

# vxdisksetup -i apevmx09_111d
# vxdisksetup -i apevmx09_111e
# vxdisksetup -i apevmx10_1070
# vxdisksetup -i apevmx10_1071

Checking how the site read is configured

root@desap2ia:/tmp# vxdisk -g sapz42_dg listtag
DEVICE          NAME                            VALUE                             
apevmx09_07fe   site                            site09
apevmx09_07ff   site                            site09
apevmx09_08f1   site                            site09
apevmx09_0800   site                            site09
apevmx09_0802   site                            site09
apevmx10_07e3   site                            site10
apevmx10_07e4   site                            site10
apevmx10_10d4   site                            site10
apevmx10_0701   site                            site10
apevmx10_0702   site                            site10
apevmx10_1059   site                            site10

Disk from Enclousre apevmx09 is configured for site09
Disk from Enclousre apevmx10 is configured for site10

so we need to tag the disk as per site

cb20cpsdbpre# vxdisk settag apevmx09_111d site=site09
cb20cpsdbpre# vxdisk settag apevmx09_111e site=site09
cb20cpsdbpre# vxdisk settag apevmx10_1070 site=site10
cb20cpsdbpre# vxdisk settag apevmx10_1071 site=site10

# vxdg -g usrsapTMP adddisk sapz42_06=apevmx09_111d
# vxdg -g usrsapTMP adddisk sapz42_07=apevmx09_111e
# vxdg -g usrsapTMP adddisk sapz42_06m=apevmx10_1070
# vxdg -g usrsapTMP adddisk sapz42_07m=apevmx10_1071


Calculating the space upto which we could extend the volume using the disk

# vxassist -g sapz42_dg maxgrow usrsapTMP layout=mirror-concat alloc=sapz42_06 sapz42_06m

Extending the Volume

root@desap2ia:/tmp# /etc/vx/bin/vxresize -g sapz42_dg -F vxfs usrsapTMP +40g alloc=sapz42_06 sapz42_06m
root@desap2ia:/tmp#  vxprint -htg sapz42_dg usrsapTMP
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

v  usrsapTMP    -            ENABLED  ACTIVE   125829120 SITEREAD -        fsgen
pl usrsapTMP-01 usrsapTMP    ENABLED  ACTIVE   125829120 CONCAT   -        RW
sd sapz42_05-01 usrsapTMP-01 sapz42_05 0       41943040 0         apevmx09_08f1 ENA
sd sapz42_06-01 usrsapTMP-01 sapz42_06 0       83886080 41943040  apevmx09_111d ENA
pl usrsapTMP-02 usrsapTMP    ENABLED  ACTIVE   125829120 CONCAT   -        RW
sd sapz42_05m-01 usrsapTMP-02 sapz42_05m 0     41943040 0         apevmx10_1059 ENA
sd sapz42_06m-01 usrsapTMP-02 sapz42_06m 0     83886080 41943040  apevmx10_1070 ENA
root@desap2ia:/tmp#

Adding Drl Logs Back:

To add DRL logs to an existing volume, use the following command:
# vxassist [-b] [-g diskgroup] addlog volume logtype=drl \   [nlog=n] [loglen=size]

# vxassist -b -g sapz42_dg addlog usrsapTMP logtype=drl nlog=1 loglen=1040 alloc=sapz42_drl1

root@desap2ia:/etc/vx/bin# vxassist -b -g sapz42_dg addlog usrsapTMP logtype=drl nlog=1 loglen=1040 alloc=sapz42_drl1
root@desap2ia:/etc/vx/bin# vxprint -htg sapz42_dg usrsapTMP
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

v  usrsapTMP    -            ENABLED  ACTIVE   125829120 SITEREAD -        fsgen
pl usrsapTMP-01 usrsapTMP    ENABLED  ACTIVE   125829120 CONCAT   -        RW
sd sapz42_05-01 usrsapTMP-01 sapz42_05 0       41943040 0         apevmx09_08f1 ENA
sd sapz42_06-01 usrsapTMP-01 sapz42_06 0       83886080 41943040  apevmx09_111d ENA
pl usrsapTMP-02 usrsapTMP    ENABLED  ACTIVE   125829120 CONCAT   -        RW
sd sapz42_05m-01 usrsapTMP-02 sapz42_05m 0     41943040 0         apevmx10_1059 ENA
sd sapz42_06m-01 usrsapTMP-02 sapz42_06m 0     83886080 41943040  apevmx10_1070 ENA
pl usrsapTMP-03 usrsapTMP    ENABLED  ACTIVE   LOGONLY  CONCAT    -        RW
sd sapz42_drl1-09 usrsapTMP-03 sapz42_drl1 9360 1040    LOG       apevmx10_10d4 ENA


FS Size before Extension
root@desap2ia:/usr/sap/Z42/sapdata999# df -k .
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/vx/dsk/sapz42_dg/usrsapTMP    20971520  16315608   23%     5230     1% /usr/sap/Z42/sapdata999

FS Size After Exetension
root@desap2ia:/tmp# df -k /usr/sap/Z42/sapdata999
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/vx/dsk/sapz42_dg/usrsapTMP    62914560  55627570   12%     5231     1% /usr/sap/Z42/sapdata999




What could be the issue, if we are not tagging the disk with respect to site:
Disk used without SITEREAD
root@desap2ia:/etc/vx/bin# vxassist -g sapz42_dg maxsize usrsapz42_ext_vol layout=mirror-concat alloc="sapz42_08 sapz42_08m"
VxVM vxassist INFO V-5-1-13775 Site consistent volumes use new dco log types (dcoversion=20). Creating it by default.
VxVM vxassist ERROR V-5-1-325 dm:usrsapz42_ext_vol: No disks match specification

Disk with tag SITEREAD
root@desap2ia:/etc/vx/bin# vxdg -g sapz42_dg adddisk sapz42_09m=apevmx10_1048
root@desap2ia:/etc/vx/bin# vxassist -g sapz42_dg maxgrow usrsapz42_ext_vol layout=mirror-concat alloc="sapz42_08 sapz42_08m"
Volume usrsapz42_ext_vol can be extended by 251582464 to: 725389312 (354194Mb)