HPVM - Integrity Virtual Machine Installation and Configuration Steps

INTEGRITY VIRTUAL MACHINE INSTALLATION AND CONFIGURATION

Advantages:
This is installed on servers which do not support vPar or nPar. Resources such as processors, memory disk devices can be assigned from the VM Host and can be modified later at any point of time. Modifying of resources such as cpu, memory as of now in version 3 is not dynamic and requires a reboot of the VM Guest. Dynamic assigning will be possible after release of version 3.5 in Dec’07.

Pre-Requisites to Installation:

Install the OS on the physical server where the virtual servers will be installed. The physical server on which the virtual servers will reside is called VM Host and virtual servers called as VM Guests.

Integrity Virtual Machine can be installed only from OS Media HPUX 11.23 May 2005 or later.
Install software Integrity Virtual Machine product # T2767AC
Install the two required patches PHKL_32158 & PHKL_33312 (please check at ITRC for the superseded patch)


Installation Procedure:

1. Create a virtual network switch
#hpvmnet –c –S vmsw1 –n 1

Where ‘c’ is for create, ‘S’ is for the virtual switch name and ‘n’ is the lan port so in this case it is lan1

Stop and start the vm by:
#cd /sbin/init.d
#./hpvm stop
#./hpvm start

Check the config for virtual switch

#hpvmnet

(Kindly remember to restart the hpvm services whenever a virtual switch is presented. If two virtual switch is required then assign both virtual switches and then once restart the hpvm services)

2. Create VM Guest with dedicated processor and memory

#hpvmcreate –P vm00 –c3 –r12G
                                Or
#hpvmcreate –P vm00 –e30 –r12G

Where “c” is the no of cpu , “e” is the percentage of cpu and “r” is the amount of memory in GB and ‘vm00’ is the VM Guest


3. Present an OS virtual disk to the VM Guest
#hpvmmodify –P vm00 -a disk:scsi::disk:/dev/rdsk/c2t0d0
(Use raw device in case of scsi device)

As per best practice in case of San LUN create a vg then an lv and map the lv to the VM Guest by following command
# hpvmmodify –P vm00 -a disk:scsi::lv:/dev/vg01/rlvol1
Raw devices from SAN also can be presented.

4. Present the DVD for installaion to the VM Guest
#hpvmmodify –P vm00 -a dvd:scsi::disk:/dev/rdsk/c0t0d0

5. For creating a global disk which will be shared among multiple guests
#hpvmdevmgmt -a gdev:/dev/rdsk/c8t0d3
#hpvmdevmgmt -m gdev:/dev/rdsk/c8t0d3:attr:SHARE=YES

6. Present the virtual switch to the VM Guest
#hpvmmodify –P vm00 -a network:lan::vswitch:vmsw1

7. Check the VM Guest resources
#hpvmstatus
(It would show all the VM Guests with disks, lans and dvd )

8. Boot the vm Guest and install OS:-
#hpvmconsole -P vm00 –Ffi –c ‘pc –on’
                                Or
#hpvmconsole –P vm00
Then go to CM and type command “PC”
(This will boot the VM Guest and start the installation, go to advanced installation and provide system details)

9. Installation reboots the VM Guest twice and then it comes to the login prompt.

10. After the installation is complete unpresent the DVD drive to take out the OS media :
#hpvmmodify –P vm00 -d dvd:scsi::disk:/dev/rdsk/c0t0d0

11. In order to access a VM Guest console from the VM Host: -

# hpvmconsole –P vm00

This will bring the vm00 (VM Guest) MP menu as follows:-

   MP MAIN MENU

         CO: Console
         CM: Command Menu
         CL: Console Log
         SL: Show Event Logs
         VM: Virtual Machine Menu
         HE: Main Help Menu
          X: Exit Connection

[vm00] vMP>

11. To switch between VM Host MP and VM Guest MP use cntl+x
12. Procedure to insert  and eject DVD from the VM Guest :
type “VM” from the MP of VM Guest
                Then type “in” to insert or “ej” to eject.




kernel downgrade in SLES : Quick view

Author : Dhanabal S

Kernel Downgrade procedure for SLES

1.Take all necessary root filesystem backup.


2.Check for installed kernel using the command "rpm –qa|grep –i kernel"

# rpm -qa|grep -i kernel
kernel-default-2.6.32.54-0.3.1
linux-kernel-headers-2.6.32-1.4.13
kernel-default-base-2.6.32.54-0.3.1
kernel-default-devel-2.6.32.54-0.3.1
kernel-source-2.6.32.54-0.3.1

3.Downgrade the all the kernel related rpm’s except nfs kernel
Command to downgrade is
rpm -Uhv --oldpackage --nodeps

eg:  rpm –Uhv kernel-source-2.6.32.23-0.3.1.x86_64.rpm --oldpackage
where is the kernel package you wish to install.

4.Reboot the sever and boot into your downgraded kernel.



RSYNC script - sync the data between two servers


Author : Dhanabal S

Sync the data between two linux servers

Solution:

Assumption:

a)      Source server ip address: 192.168.0.151
b)      Destination server ip address: 192.168.0.152

Source server - The server we are connecting from to upload the data
Destination server - The server we are connecting to receive the data


Setting the SSH key authentication:

1)      Make sure the Destination server have the ability to use key authentication enabled. In the sshd configuration file (usually ‘/etc/ssh/sshd_config’) enable the following options if they are not already set.
# vi /etc/ssh/sshd.conf
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

2)      In Source server create the public / private key pair to used for authentication with the following command
# ssh-keygen -t rsa

Note: Do not enter a passphrase for this, just hit enter when prompted.
3)      Now two files (public and private key) are created in the home directory of the user. If you are execute this as a root user means the files will be in,
# /root/.ssh/id_rsa.pub      (public key file)
#/root/.ssh/id_rsa               (private key file)

4)      Now upload the public key to the Destination Server
# scp /root/.ssh/id_rsa.pub 192.168.0.152:/root/.ssh

Note: Be sure to keep this private key safe. With it anyone will be able to connect to the Destination Server that contains the public key.

5)      In the Destination Server rename the public key file ( id_rsa.pub) to “authorized_keys”
# cd /root/.ssh
# mv id_rsa.pub authorized_keys

6)      Change the file permission of that public key as well as ssh folder permission also
# chmod 600 /root/.ssh/authorized_keys
# chmod 700 /root/.ssh

7)      Test the keys are working or not , by connecting the Destination Server from the Source Server
# ssh root@192.168.0.152

            If all is working it should not be prompted for a password but instead connected directly to a shell on the Destination Server.


Creating rsync script:

8)      Create one simple rsync script to sync both the servers and place it into the user’s home directory
# vi /root/rsync.sh
#!/bin/bash
SOURCEPATH=’/home’
DESTPATH=’/home’
DESTHOST=’192.168.0.152′
DESTUSER=’root’
LOGFILE=’rsync.log’
echo $’\n\n’ >> $LOGFILE
rsync -av –rsh=ssh $SOURCEPATH \  $DESTUSER@$DESTHOST:$DESTPATH 2>&1 >> $LOGFILE
echo “Completed at: `/bin/date`” >> $LOGFILE
Note: In this script 4 variables are used
SOURCEPATH - Source path to be synced
DESTPATH - Destination path to be synced
DESTHOST - Destination IP address or host name
DESTUSER - User on the destination server
The script will send all output to the ‘rsync.log’ file specified in the script

9)      Give the executable permission for this script
# chmod 700 /root/rsync.sh

10)    Now run the script and check, it is connect to the Destination Server, and transfer the files all without your interaction.

Setting up the cron job:

11)   Setup a cron job to run the script automatically at a predefined interval.
# crontab –e
   
0 * * * * /root/rsync.sh

            This will run the script once in every hour. Your 2 servers should now be syncing the chosen directory once every hour.


Author : Dhanabal S  

 

Linux Boot Paramters - Quick View


How to enter boot prompt parameter?

At Grub prompt press 'e' to edit command before booting.

1) Select second line
2) Again, press 'e' to edit selected command
3) Type any of below parameters.

Parameters:

1.Single  

   - To boot the server in single user mode. (Ex . for root passwd recovery )

2.init=/bin/bash or init=/bin/sh or S or 1

   - To boot the kernel in single user mode (Ex . for root passwd recovery )

3.root=/dev/device

   - Mention wich device/disk to be used as the root filesystem while booting

4.panic=SECOND

   - Specify kernel behavior on panic. Bedefault the kernel will not reboot after a panic.


5.maxcpus=number

   - Specify maximum number of processors for SMP kernel use.

6.debug

   - Enabe kernel Debugging.

7.fastboot

   - To skip the file system FSCK option at the time of Boot.

8.selinux [0 or 1]

  - Disable or enable SELinux at boot time (0 - Diasabe , 1- Enable)

9.raid=/dev/mdN

  - This is used to inform the kernel, howto assembly of RAID arrays at boot time.

10.mem=MEMORY_SIZE

  - This is for Specific amount of memory to be used when the kernel is not able to see the whole system memory. or for testing purpose.

11.hdX=noprobe

   - Disabe te hdX hard disk (ex. hdb=noprobe)

12.rw

   - mount root file system as read-only. This is used before run fsck option for File system after boot.

13. ro

   - mount root file system as read-write mode.

14.initrd /boot/initrd.img

    -     initrd is used to provide/load additional modules. The boot process will load the kernel and an initial ramdisk.   

15.raid=noautodetect

   - To suppress RAID array auto detection.




Skip FSCK while boot / fastboot in linux : Quick View

how to skip or bypass a fsck on reboot? How to stop a FSCK from prompting or running automatically while rebooting the server.

1. To change grub.conf

Reboot the server using below command

# shutdown -rf now

Above command will reboot the system and will not run auto fsck.

change Linux kernel option by editing grub.conf / menu.lst

Open grub.conf or menu.lst

# vi /boot/grub.conf

Find kernel line and put "fastboot" at the end of the kernel line. In the end it should look as follow:

kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 fastboot


This will be saved as permanent and everytime server boots it wpont check the fsck. If you want t od oonly one time ,then edit the grub
at the time of boot by pressing the key "e".



2. To change /etc/fstab option:

You can sckip the fsck option by modifying the /etc/fstab file like below .

In /etc/fstab end of the mount point option the values to 0 . (sixth field)

If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. Here is sample entry:


LABEL=/disk1        /disk1            ext3    defaults    0 0

then save and exit.


By using the above  2 way we can skip or bypass fsck.


YUM RPM repositary creation in LINUX : How to ??

1. Copy all RPM files to /var/ftp/pub/server
2. Install the createrepo rpm (If its not inistalled)

   #rpm -ivh createrepo-0.4.10-1.el5.rf.noarch.rpm

3. vi /etc/yum.repos.d/myrpm.repo
[myrpm]
name=repository
baseurl=file:///var/ftp/pub/Server (Use ftp URL to setup this in client side)
enabled=1
keepcache=0
(there should not be any other *.repo file exists..remove or rename the other repositories file)
4. createrepo -v /var/ftp/pub/Server
5. yum clean all
6. yum update



If you want to manually enable and use Yum then use the below command

# vi /etc/yum.repos.d/myrpm.repo
[myrpm]
name=repository
baseurl=file:///var/ftp/pub/Server (Use ftp URL to setup this in client side)
enabled=0 
keepcache=0

save and exit

(note : i modified the enabled as "0")

Now yum won't automatically use the repo by default. This is to avoid conflict between packages from the official repos and your repo.
Now you need to use the below command to use ur own repo.

#yum --enablerepo=myrpm install


crontab - Easy header - Reference

 Below if just for reference ..its very handy...
 
 
# minute (0-59),
# |      hour (0-23),
# |      |       day of the month (1-31),
# |      |       |       month of the year (1-12),
# |      |       |       |       day of the week (0-6 with 0=Sunday).
# |      |       |       |       |       commands
3       2       *       *       0,6     /some/command/to/run
3       2       *       *       1-5     /another/command/to/run

hpacucli - commands referrence

Hi Friends,

Please find the hpacucli commands reference. 


Abbreviations   chassisname = ch
controller = ctrl
logicaldrive = ld
physicaldrive = pd
drivewritecache = dwc
hpacucli utility  hpacucli # hpacucli

# hpacucli help

Note: you can use the hpacucli command in a script 
Controller Commands  Display (detailed) hpacucli> ctrl all show config
hpacucli> ctrl all show config detail
     
  Status hpacucli> ctrl all show status
     
  Cache hpacucli> ctrl slot=0 modify dwc=disable
hpacucli> ctrl slot=0 modify dwc=enable
     
  Rescan hpacucli> rescan

Note: detects newly added devices since the last rescan
     
Physical Drive Commands  Display (detailed) hpacucli> ctrl slot=0 pd all show
hpacucli> ctrl slot=0 pd 2:3 show detail

Note: you can obtain the slot number by displaying the controller configuration (see above) 
     
  Status hpacucli> ctrl slot=0 pd all show status
hpacucli> ctrl slot=0 pd 2:3 show status
     
  Erase hpacucli> ctrl slot=0 pd 2:3 modify erase
     
  Blink disk LED hpacucli> ctrl slot=0 pd 2:3 modify led=on
hpacucli> ctrl slot=0 pd 2:3 modify led=off
     
Logical Drive Commands  Display (detailed) hpacucli> ctrl slot=0 ld all show [detail]
hpacucli> ctrl slot=0 ld 4 show [detail] 
     
  Status hpacucli> ctrl slot=0 ld all show status
hpacucli> ctrl slot=0 ld 4 show status
     
  Blink disk LED hpacucli> ctrl slot=0 ld 4 modify led=on
hpacucli> ctrl slot=0 ld 4 modify led=off
     
  re-enabling failed drive hpacucli> ctrl slot=0 ld 4 modify reenable forced 
     
  Create # logical drive - one disk
hpacucli> ctrl slot=0 create type=ld drives=1:12 raid=0

# logical drive - mirrored
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14 size=300 raid=1

# logical drive - raid 5
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14,1:15,1:16,1:17 raid=5

Note:
drives - specific drives, all drives or unassigned drives
size - size of the logical drive in MB
raid - type of raid 0, 1 , 1+0 and 5 
     
  Remove hpacucli> ctrl slot=0 ld 4 delete
     
  Expanding hpacucli> ctrl slot=0 ld 4 add drives=2:3
     
  Extending hpacucli> ctrl slot=0 ld 4 modify size=500 forced
     
  Spare hpacucli> ctrl slot=0 array all add spares=1:5,1:7
     

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks