Tuesday, September 11, 2012

Moving the DVD-RAM Between LPARs using the VIO server

We will assigne CDROM to VIO server and move CDROM to diffrent LPAR's

One of the common features normally available with HMC attached System p servers is the ability to use Dynamic Logical Partitioning (DLPAR) to add/move/remove I/O devices such as the CDROM or DVD controller between LPARs without taking an outage. The functionality required for DLPAR actions includes an active network connections between the LPARs and the HMC over port 657. If you have a virtual I/O (VIO) server partition that owns the DVD controller then you can run a few simple commands on the VIO server to allow you to map cd0 from one client LPAR to another using virtual SCSI. The process to move cd0 from one logical partition to another using VIO server commands is illustrated below. The example assumes the user is logged in as padmin on VIO server:

1> Determine if the VIO server owns an optical device we use the lsdev command.

    $ lsdev -type optical
        name status description
        cd0 Available IDE DVD-ROM Drive

- Determine if cd0 is already mapped to a client LPAR we use the lsmap command.
        $ lsmap -all |more
                SVSA Physloc Client Partition ID
                --------------- -------------------------------------------- ------------------
                vhost0 U9111.520.104797E-V1-C11 0x00000002

                VTD vtscsi0
                LUN 0x8100000000000000
                Backing device rootvg2a
                Physloc

                SVSA Physloc Client Partition ID
                --------------- -------------------------------------------- ------------------
                vhost1 U9111.520.104797E-V1-C13 0x00000003

                VTD vtscsi1
                LUN 0x8100000000000000
                Backing device rootvg3a
                Physloc

                VTD vtscsi2
                LUN 0x8200000000000000
                Backing device datavg3a
                Physloc

    - Looking through the "Backing device" section of each vhosts we do not see cd0 listed.
        We could have run "lsmap -all | grep cd0" as a quick check as well.
    - To assign device cd0 to LPAR ID 2 we first need to locate its associated virtual SCSI server (vhost) device from the output listed above. If you look at the "Client Partition ID" section of the lsmap output you can see that vhost0 is associated with partition ID 2 (hex 0x00000002).

2> - To make the virtual SCSI map of cd0 to LPAR ID 2, we use mkvdev as follows:

    $ mkvdev -vdev cd0 -vadapter vhost0
        vtopt0 Available

    - To check to see if cd0 and vtopt0 show up under vhost0 resources we use lsmap.

        $ lsmap -vadapter vhost0
            SVSA Physloc Client Partition ID
            --------------- -------------------------------------------- ------------------
            vhost0 U9111.520.104797E-V1-C11 0x00000002

            VTD vtopt0
            LUN 0x8200000000000000
            Backing device cd0===============>"now CDROM is presented to Vhost0"
            Physloc U787A.001.DPM06E2-P4-D2

            VTD vtscsi0
            LUN 0x8100000000000000
            Backing device rootvg2a
            Physloc

    NOTE=>By virtually mapping the DVD device cd0 to LPAR 2's vhost, there is no need to make changes to the LPAR's   profile or perform further actions such as DLPAR functions from the HMC. The cd0 device is now ready for the client LPAR to use.

    NOTE=>If the LPAR is already in a running state, the cfgmgr command would need to be run as root on the client LPAR so the new device could be configured. If the LPAR is not activated then once it is started, the DVD device will be available for performing installation or maintenance functions on the LPAR.

MOVING CDROM to Different LPAR's if its presented to VIO server and assigned to LPAR-
======================================================================================
   
Once LPAR 2 is finished using the DVD, it can then be removed and mapped to a different LPAR if desired.
   
$ rmdev -dev vtopt0 -recursive  ===========>will remove CDROM from, vtopt0 is the name of existing CDROM.
    vtopt0 deleted

$ mkvdev -vdev cd0 -vadapter vhost1   ==========>moved cdrom to vhost1
    vtopt0 Available

$ lsmap -vadapter vhost1

    SVSA Physloc Client Partition ID
    --------------- -------------------------------------------- ------------------
    vhost1 U9111.520.104797E-V1-C13 0x00000003

    VTD vtopt0
    LUN 0x8500000000000000
    Backing device cd0
    Physloc U787A.001.DPM06E2-P4-D2

    VTD vtscsi1
    LUN 0x8100000000000000
    Backing device rootvg3a
    Physloc

    VTD vtscsi2
    LUN 0x8200000000000000
    Backing device datavg3a
    Physloc

The process of virtual mapping of the optical device, cd0, between client LPARs of a VIO server is
much simpler than trying to perform DLPAR related functions to achieve the same result since all
the interaction takes place on the VIO server command line.

Mounting ISO in AIX

How do I use dd command to create an ISO image?

Put CD into CDROM
Do not mount CD. Verify if cd is mounted or not with mount command:
    # mount
If cd was mouted automatically unmout it with umount command:
    # umount /dev/cdrom
OR
    # umount /mnt/cdrom
    Create CD-ROM ISO image with dd command:
    # dd if=/dev/cdrom of=/tmp/cdimg1.iso

Mounting ISO in AIX-
   
    Starting in AIX 6.1, you can use the loopmount command to create a loopback device and mount an ISO directly:
        #loopmount -i cdrom.iso -o “-V cdrfs -o ro” -m /mnt
    And, loopumount unmounts the ISO and removes the loopback device:
        #loopumount -i cdrom.iso -o "/mnt"
    There are a couple of gotcha's, but nothing unusual. An ISO can only be associated with one loopback device at a time,
    the mount is only readonly, and it's not supported in WPARs.

    There is another way to mount those images, but it's not a one-step process.
    What you need to do is create a LV at least as big as your ISO image,
    then copy the ISO data to that LV, and then mount the LV:

        #mklv -y cdlv -s n rootvg 704M hdisk0
        #dd if=cdrom.iso of=/dev/cdlv
        #mount -v cdrfs -o ro /dev/cdlv /mnt

Solaris-Remote-RSC-setup-v890

SUN ships the 890s with the rsc disabled.  The easiest way to set it up is
with "rscadm".  To make sure the RSC software is installed:

    cd /local/RSC/
        pkgadd -G -d . SUNWrsc
        pkgadd -G -d . SUNWrscd
        pkgadd -G -d . SUNWrscj

# pkginfo | grep rsc
system      SUNWrsc                          Remote System Control
system      SUNWrscd                         Remote System Control User Guide
system      SUNWrscj                         Remote System Control GUI

Porcedure - I
    To enable the rsc: 
        # pwd
        /usr/platform/SUNW,Sun-Fire-V890/rsc
        # ./rscadm useradd admin
        # ./rscadm userperm admin cuar
        # ./rscadm userpassword admin
            and set a password

        Set the network console's network parameters:
        # ./rscadm set ip_mode config
        # ./rscadm set ip_addr xx.xx.xx.xx
        # ./rscadm set ip_netmask xx.xx.xx.xx
        # ./rscadm set ip_gateway xx.xx.xx.xx
        # ./rscadm set hostname hostname
        # ./rscadm date 113011402005.00
        # ./rscadm set escape_char # .  (note: it is # space .)
        # ./rscadm resetrsc

Porcedure - II
    OR USE rsc-config script to configure above setting--
    Log in as root and run the command:
        #/usr/platform/SUNW,Sun-Fire-880/rsc/rsc-config.
        bash-3.00# /usr/platform/SUNW,Sun-Fire-880/rsc/rsc-config

                Continue with RSC setup (y|n): y

                Set RSC date/time now (y|n|?) [y]:
                Server Hostname [torzone01]:
                Edit customer info field (y|n|?) [n]:
                Enable RSC Ethernet Interface (y|n|s|?) [n]: y
                   RSC IP Mode (config|dhcp|?) [dhcp]: config
                   RSC IP Address []: 10.1.5.34
                   RSC IP Netmask [255.255.255.0]: 255.255.0.0
                   RSC IP Gateway []: 10.1.32.167
                Enable RSC Alerts (y|n|s|?) [n]:
                Enable RSC Serial Port Interface (y|n|s|?) [n]: y
                   Serial port baud rate (9600|19200|38400|57600|115200) [9600]:
                   Serial port data bits (7|8) [8]:
                   Serial port parity (even|odd|none) [none]:
                   Serial port stop bits (1|2) [1]:
                Setup RSC User Account (y|n|?) [y]:
                   Username []: admin
                   User Permissions (c,u,a,r|none|?) [cuar]:

                --------------------
                Verifying Selections
                --------------------
               
                  Is this correct (y|n): y

                This script will now update RSC, continue? (y|n): y
                Updating flash, this takes a few minutes
                ........................................
                ........................................
                ...........................
                Download completed successfully

                Resetting RSC (takes about 90 seconds): DONE
                Setting up server to update RSC date on boot: DONE
                Setting up server hostname: DONE
                Setting up ethernet interface: DONE
                Disabling RSC alert engine: DONE
                Disabling modem interface: DONE
                Setting up serial port interface: DONE
                Adding user to RSC:

                A valid password is between 6 and 8 characters, has at least
                two alphabetic characters, and at least one numeric or special
                character.  The password must differ from the user's login name
                and any reverse or circular shift of that login name.
                Setting User Password Now ...

                Password:
                Re-enter Password:
                User has been added to RSC
                Resetting RSC (takes about 90 seconds):
                Are you sure you want to reboot RSC (y/n)?  y

                DONE
                Setting up RSC date: DONE

                *******************************
                RSC has been successfully setup
                *******************************


STEPS to redirecting console to RSC---

Access the system from physical console to get OK prompt :
    -Type the following commands at the system ok prompt:
        ok diag-console rsc
        ok setenv input-device rsc-console
        ok setenv output-device rsc-console
        ok reset-all
The system permanently stores the new settings. The changes will take effect after the next reset.

Solairs V210 ILOM configuration from OS

sc> setsc sc_escapechars ## (for example)
hostname console login:
#. ---> switch from console to ALOM

Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Sun(tm) Advanced Lights Out Manager 1.5.4 (hostname)
Please login: admin
Please Enter password: **********

Cannot login to the ALOM?

Try default password which is the last 8 digits of the chassis serial number. Username is admin.
        sc> setsc set if_network true
        sc> setsc netsc_dhcp false
        sc> setsc netsc_ipaddr 192.168.etc.etc
        sc> setsc netsc_ipnetmask 255.255.255.etc
        sc> setsc netsc_ipgateway 192.168.etc.etc
        sc> resetsc
    Are you sure you want to reset the SC [y/n]?  y

For some platforms, like SunFire V240 and V440, ALOM can be configured from OS level using scadm utility.
    To reset the ALOM password for "admin" use:-
--->    /usr/platform/`uname -i`/sbin/scadm userpassword admin

        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set if_network true
Enable Ethernet link integrity test:
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set netsc_tpelinktest true
Enable backup of local user database (username, passwords, permissions) on system configuration card.
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set sc_backupuserdata true
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set netsc_dhcp false
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set netsc_ipaddr 192.168.etc.etc
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set netsc_ipnetmask 255.255.255.etc
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm set netsc_ipgateway 192.168.etc.etc
        /usr/platform/SUNW,Sun-Fire-V240/sbin/scadm resetrsc

    /usr/platform/SUNW,Sun-Fire-V240/sbin> ./scadm shownetwork
        IP Address: 192.168.etc.etc
        Gateway address: 192.168.etc.etc
        Netmask: 255.255.255.etc
        Ethernet address: 00:00:00:00:00:00

Creating Zone from zone config file or Cloning Solaris Zone

The procedure I've used to clone zones are as follows.

Procedure

1. Export the configuration of the zone you want to clone/copy
    # zonecfg -z zone1 export > zone2.cfg

2. Change the details of the new zone that differ from the existing one (e.g. IP address, data set names, network interface etc.)
    # vi zone2.cfg
3. Create a new (empty, unconfigured) zone in the usual manner based on this configuration file
    # zonecfg -z zone2 -f zone2.cfg

NOTE: if you get capped-memory resource error-- ( move the Capped-memory to the top of rlctl entry)
            # zonecfg -z zone2 -f zone2.cfg
            On line 28 of zone2.cfg:
            The capped-memory resource or a related resource control already exists.
            On line 29 of zone2.cfg:
            Cannot set a resource-specific property from the global scope.
                The ordering error in the generated output makes this statement incorrect, or
                at least inaccurate, depending on the meaning of 'suitable'.

            Workaround
                Edit the exported script and move the rctl entry
                after the capped-memory entry

4. Ensure that the zone you intend to clone/copy is not running
    # zoneadm -z zone1 halt
5. Clone the existing zone
    # zoneadm -z zone2 clone zone1
    Cloning zonepath /export/zones/zone1...
    This took around 5 minutes to clone a 1GB zone (see notes below)
6. Verify both zones are correctly installed
    # zoneadm list -vi

    ID NAME STATUS PATH
        0 global running /
        - zone1 installed /export/zones/zone1
        - zone2 installed /export/zones/zone2

7. Boot the zones again (and reverify correct status)
    # zoneadm -z zone1 boot
    # zoneadm -z zone2 boot
    # zoneadm list -vi
    ID NAME STATUS PATH
    0 global running /
    5 zone1 running /export/zones/zone1
6 zone2 running /export/zones/zone2

8. Configure the new zone via its console (very important)

# zlogin -C zone2

dd command to create an ISO image

Put CD into CDROM
Do not mount CD. Verify if cd is mounted or not with mount command:
    # mount
If cd was mouted automatically unmount it with umount command:
    # umount /dev/cdrom
OR
    # umount /mnt/cdrom

Create CD-ROM ISO image with dd command:
    # dd if=/dev/cdrom of=/tmp/cdimg1.iso

Where,
# if=/dev/cdrom: Read from /dev/cdrom (raw format)  of=/tmp/cdimg1.iso: write to FILE cdimg1.iso

i.e. create an ISO image

TOP command - Useful switch

TOP command useful switch--

1> Select - Press 'f' to select unselected parameteres ie SWAP.
1> Sort - To sort top output by any column, Press O (upper-case O)
2> Kill a Task Without Exiting From Top – Press k
3> Renice a Unix Process Without Exiting From Top – Press r
4> Display Selected User in Top Output Using top -u
5> Display All CPUs / Cores in the Top Output – Press 1 (one)
6> Change Refresh Interval - press d , default is 3 second
7> Highlight Running Processes in the Linux Top Command Output – Press z or b
8> Display Absolute Path of the Command and its Arguments – Press c