Skip to main content

IBM Systems  >   System z  >   z/VM  >  

 

Cloning Linux Images in z/VM


Tung-Sing Chong
IBM Corporation
Endicott, NY 13760
E-Mail Chongts@us.ibm.com
Date: 5/15/2002


Preface

This document provides one example of the many ways to clone Linux images using z/VM. A scaled down "LinuxWorld Linux Images Cloning Demo" is used to illustrate the cloning process. The demo that I used at the last LinuxWorld Conference clones Turbolinux 6.5.1, SuSE SLES-7.0 and RedHat 7.2 images. However this example demo clones only SuSE SLES-7.0 images.

Table of Content

1.0 Overview of the LinuxWorld Linux Image Cloning Demo
2.0 Cloning Methology
2.1 Network Topology Inside z/VM
2.2 Some Important VM User IDs
3.0 LinuxWorld Linux Image Cloning Demo Install/Setup Steps
3.0.1 Step 1 - Paging,  spool and DASD pool setup
3.0.2 Step 2 - Install/Enabled DirMaint
3.0.3 Step 3 - Update TCPMAINT user directory
3.0.4 Step 4 - Create the following user profile and VM user IDs from MAINT
3.0.5 Step 5 - Setup VM user IDs and Linux images
4.0 REXX execs used by LXOPR User ID
4.1 Files used by LXOPR User ID
5.0 REXX execs and CGI used by "LXADMIN" User ID
5.1 Files used by LXADMIN User ID
5.2 HTMLs and JPGs used by LXADMIN User ID
6.0 Starting the DEMO to Create Images
7.0 Deleting the Cloned Images
8.0 In Conclusion

1.0 Overview of the LinuxWorld Linux Image Cloning Demo

This example has the following components:

  • Cloning Continuously - Defaults to create a maximum of 300 images (can be changed to higher or lower number). A REXX exec, "MAKESUSE",  is used to clone images that use DASD for swap or "MKSUSEV" is used to clone images that use VDISK for swap. When 300 images are created, "MAKESUSE  or MKSUSEV" will exit. The status of the cloning process is on the website. The following is a copy of this website:
screen image
  • Cloning on Demand - SuSE images can be cloned one at a time on a website while Cloning Continuously is running at the same time. A VM web server (Webshare) is used on z/VM along with a REXX cgi and REXX exec (defaults to create a maximum of 10 images, can be changed to higher or lower number). The following is a copy of the "Linux Image Administration" website interface:
linux image admin screen

Linux Images Configuration:

  • Each Linux image created by Cloning Continuously has 64MB virtual memory for demo purposes (recommended minimum memory for production is 128MB) , 150 cylinders R/W "/" and 100 cylinders swap or 64MB VFB-512 swap disk. "/usr" and  "/usr/src" are shared as R/O file systems. Each Linux image starts the  Apache Web Server.
  • Cloning on Demand can create the three types of SuSE images. Each image has R/O "/usr" and 64MB virtual memory for demo purposes (recommended minimum memory is 128MB in production). Each Linux image starts the Apache Web Server. The three types of SuSE images are:
    1.   150 cylinders R/W "/", 400 cylinders R/W "/usr/src" and 100 cylinders swap
    2.   150 cylinders R/W "/", R/O "/usr/src" and 100 cylinders swap
    3.   150 cylinders R/W "/", R/O "/usr/src" and 64M VFB-512 VDISK for swap

  • The VM user IDs for these images have the format of "LXnnn" where nnn is a number from 1 to 500. This demo can create images from LX1 to LX500 shared between Cloning Continuously and Cloning on Demand. Example: When Cloning  SuSE Continuously is set to clone 300 (LX1 to LX300) images, then Cloning on Demand can clone image LX301 to LX500 at the same time.

2.0 Cloning Methodology

There are many different ways to clone Linux images under z/VM. I chose to implement the cloning process as simply as possible. Of course I also like to use VM as much as possible.  DirMaint, REXX execs, DDR, VM TCP/IP stacks, GA/Golden level of Turbolinux/SuSE/RedHat distributions, and IUCV as point-to-point connection are used for cloning images. No extra packages are required other than what is shipped with GA distributions. No modification of the GA level of distributions was required (no need to rebuild the kernel). This cloning process DOES NOT take control of the z/VM user directory. It uses DirMaint to manage the z/VM user directory.

Steps used for cloning Linux images:

  1. Call DirMaint to create a VM user ID for Linux image.
  2. Obtain an IP address from the IP address pool (A CMS file that maps VM user ID to IP address).
  3. Obtain the peer-to-peer IP address (A CMS file that maps VM user ID/hostname to peer-to-peer IP address).
  4. Update the network configuration files with the appropriate network information (IP address, hostname, gateway, etc) on the master copy of Linux system.
  5. Use DDR to copy the master copy of Linux system onto the new image's minidisks.
  6. IPL the new image.
  7. Ping the new image. Image cloning is complete when the new image replies to the ping.

System levels and Software products used:

VM TCPIP stacks:

This demo uses IUCV and 3 VM TCPIP stacks. One stack for VM, one stack for each class C network for Linux images. An OSA connection was used on the VM stack to communicate to the outside world. This VM stack uses "192.168.46.140" as the host IP address. 9.130.111.xxx and 9.130.112.xxx were used for Linux images IP addresses. Only 250 IP addresses are being using on each class C networks.  500 IP addresses are available for cloning when using 2 class C networks.

VM user ID and Linux images used for the cloning process:

  • 3 VM user IDs (LXOPR, LXADMIN and LXCNTL)
  • 3 Linux images (LXMSTR, LXDISP and LXMNT)

2.1 Network Topology Inside zVM

                                   +---------------+      +------------------+
                                   | 9.130.111.xxx |      | 250 Linux images |
                              +--->|    stack      |------| (9.130.111.1 to  |
                              |IUCV| VM user ID -  | IUCV | 9.130.111.250)   |
                              |    |  TCPIP111     |      | VM user ID - LX1 |
                              |    +---------------+      |    to LX250      |
                              |                           |                  |
                              |                           | 9.130.111.251 -  |
                              |                           |    used by LXMSTR|
                              |                           | 9.130.111.252 -  |
                              |                           |    used by LXDISP|
                              |                           | 9.130.111.253    |
                              |                           |    used by LXMNT |
                              |                           | 9.130.111.254 -  |
                              |                           |    peer-to-peer  |
                              |                           +------------------+
          +--------------+    |
          |192.168.46.140|    |
 <------->|     stack    |<---+
  OSA to  |VM user ID -  |    |
  private | TCPIP        |    |
  network +--------------+    |
                              |    +---------------+      +------------------+
                              |    | 9.130.112.xxx |      | 250 Linux images |
                              +--->|    stack      |------| (9.130.112.1 to  |
                               IUCV| VM user ID -  | IUCV |  9.130.112.250)  |
                                   |  TCPIP112     |      | VM user ID -LX251|
                                   +---------------+      |    to LX500      |
                                                          |                  |
                                                          | 9.130.112.254 -  |
                                                          |    peer-to-peer  |
                                                          +------------------+

2.2 Some Important VM User IDs

  • LXOPR - For Cloning Continuously with REXX execs.
  • LXADMIN - For Cloning on Demand using a web interface. Webshare webserver is required.
  • LXCNTL - Second console for all Linux images. To display Linux console messages.
  • LXMNT  - Linux image to manage different types of Linux images/distributions to be cloned:

    1. New image that has R/O "/usr/src" and use DASD swap copies 251 and 255 from LXMNT. 251 is R/W "/" and 255 is the swap.
    2. New image that have R/O "/usr/src" and use VDISK swap copies 251 from LXMNT and create a 64MB VDISK as 255.
    3. New image that has R/W "/usr/src" copies 5251, 254 and 255. 5251 is the R/W "/", 254 is R/W "/usr/src" and 255 is the swap.

    LXMNT has the IP address 9.130.111.253.

  • LXMSTR - Linux image to manage the IP addresses. The correct network files are FTPed to this image from the LXOPR or LXADMIN. LXMSTR has R/W access to LXMNT's master copy of Linux image's "/" (251 and 5251). The network files on the LXMNT's master copy of Linux image's "/" are replaced before DDR occurs. LXMSTR has the IP address 9.130.111.251.
  • LXDISP - Linux Apache Web Server to display how many images are created. LXDISP has the IP address 9.130.111.252.
  • DIRMAINT -  Maintain z/VM user directory.
  • TCPMAINT - Manage all the TCP/IP stacks.
    - minidisk 198 for tcpip   , access as L
    - minidisk 298 for tcpip111, access as M
    - minidisk 398 for tcpip112, access as N
  • TCPIP    - VM TCP/IP stack (VM IP address is 192.168.46.140)
  • TCPIP111 - stack for 9.130.111.xxx
  • TCPIP112 - stack for 9.130.112.xxx

3.0 LinuxWorld Linux Image Cloning Demo Install/Setup Steps

3.0.1 Step 1 - Paging,  spool and DASD pool setup

  1. Add one 3390-3 for paging for every 43 Linux images (eight 3390-3 packs should be good for 300 images). Ensure all the paging packs are added in the "system config" file. "system config" file is on MAINT CF1 disk.
  2. Add 250 cylinders (150 cylinders for R/W "/" and 100 cylinders for swap) for each image with share R/O "/usr" and "/usr/src", and DASD for swap. One 3390-3 pack can clone 13 images.
  3. Add 150 cylinders (150 cylinders for R/W "/" ) for each image with share R/O "/usr" and "/usr/src", and used VDISK for swap. One 3390-3 pack can clone 22 images.
  4. Add 550 cylinders (150 cylinders for R/W "/", 400 cylinder for R/W "/usr/src and 100 cylinders for swap) for each image with share R/O "/usr" and R/W "/usr/src". One 3390-3 pack can clone 4 images.
  5. Add 300 cylinders for SPOOL space. The console of  LXOPR, LXMSTR, LXADMIN, and LXCNTL are spooled for debugging.
  6. CP format (cpfmtxa) and allocate all added DASD volumes. Allocate "page" for all paging packs and "perm" for all user packs.

3.0.2 Step 2 - Install/Enabled DirMaint (You must have DirMaint Licensed to enable this feature!)

  • DirMaint is pre-installed on z/VM Version 4. You need to set DirMaint to ENABLED state. Follow the Program Directory for IBM z/VM Directory Maintenance Facility Feature to enable DirMaint and place DirMaint in production.

3.0.3 Step 3 - Update TCPMAINT user directory

  1. Add 298 disk for TCPIP111 stack. TCPIP111 links to this disk as 198.
  2. Add 398 disk for TCPIP112 stack. TCPIP112 links to this disk as 198. User directory for TCPMAINT:
    USER TCPMAINT TCPMAINT 16M 512M ABG
     INCLUDE TCPCMSU
     MDISK 0591 3390 3013 038 420RES MR RTCPMAIN WTCPMAIN MTCPMAIN
     MDISK 0592 3390 3051 067 420RES MR ALL WTCPMAIN MTCPMAIN
     MDISK 0191 3390 3127 007 420RES MR RTCPMAIN WTCPMAIN MTCPMAIN
    *198 - first level tcpip stack
     MDISK 0198 3390 3118 009 420RES MR RTCPMAIN WTCPMAIN MTCPMAIN
    *298 - 9.130.111.xxx stack
     MDISK 0298 3390 1571 009 LXSPTD MR RTCPMAIN WTCPMAIN MTCPMAIN
    *398 - 9.130.112.xxx stack
     MDISK 0398 3390 1580 009 LXSPTD MR RTCPMAIN WTCPMAIN MTCPMAIN
 

3.0.4 Step 4 - Create the following user profile and VM user IDs from MAINT

  • LXDFLT  - Directory profile for all Linux images:
    PROFILE LXDFLT
     IPL CMS PARM AUTOCR
     IUCV ALLOW
     MACHINE ESA
     OPTION QUICKDSP
     CONSOLE 0009 3215 T LXCNTL
     SPOOL 000C 2540 READER *
     SPOOL 000D 2540 PUNCH A
     SPOOL 000E 1403 A
     LINK MAINT 0190 0190 RR
     LINK MAINT 019D 019D RR
     LINK MAINT 019E 019E RR
     LINK TCPMAINT 0592 0592 RR
  • LXOPR - VM user ID  for Cloning Continuously; user directory for LXOPR:
    USER LXOPR LXOPR 16M 128M ABCG
     INCLUDE IBMDFLT
     IPL CMS
     IUCV ALLOW
     MACHINE ESA
     OPTION QUICKDSP
     SHARE RELATIVE 1000
     LINK MAINT 051D 051D MR
     LINK MAINT 05E5 05E5 RR
     MDISK 0191 3390 1501 10 LXSPTD MR ALL
     MDISK 0192 3390 3091 02 LXADM MR ALL
    *7191 for SuSE 191 with VDISK for swap
     MDISK 7191 3390 3091 2 LXADM MR ALL
    *8191 *8191 for SuSE 191 with DASD for swap
     MDISK 8191 3390 2981 2 LXADM MR ALL
  • LXCNTL - VM user ID for second console for all Linux images; user directory for LXCNTL:
    USER LXCNTL LXCNTL 128M 128M ABG
     INCLUDE LXDFLT
     OPTION QUICKDSP
     SHARE RELATIVE 1000
     MDISK 0191 3390 3061 02 LXADM MR ALL
  • LXADMIN - VM user ID for Cloning on Demand; user directory for LXAMDIN:
    USER LXADMIN LXADMIN 6M 128M ABCG
     INCLUDE IBMDFLT
     IPL CMS
     IUCV ALLOW
     MACHINE ESA
     SHARE RELATIVE 1000
     LINK MAINT 051D 051D MR
     LINK MAINT 05E5 05E5 RR
     MDISK 0191 3390 3093 10 LXADM MR ALL
 
  • LXMSTR - User directory for LXMSTR:
    USER LXMSTR LXMSTR 128M 256M G
     INCLUDE LXDFLT
    ****************************************
    *Link to Linux master images R/W "/"s  *
    ****************************************
    *1251 is the R/W "/" for SuSE images that have R/O "/usr"
     LINK LXMNT 0251 1251 MR
    *5251 is the R/W "/" for SuSE images that have R/W "/usr/src"
     LINK LXMNT 5251 5251 MR
    *
     MDISK 0191 3390 2207 30 LXSPTD MR ALL
    *************************************
    *0151 is lxmstr's R/W "/"           *
    *0153 is lxmstr's R/W "/usr"        *
    *0154 is lxmstr's R/W "/usr/src"    *
    *0155 is lxmstr's swap              *
    *************************************
     MDISK 0151 3390 0001 150 LXMSTR MR ALL
     MDISK 0153 3390 0151 2500 LXMSTR MR ALL
     MDISK 0154 3390 2651 400 LXMSTR MR ALL
     MDISK 0155 3390 3051 200 LXMSTR MR ALL
  • LXDISP - User directory for LXDISP:
    USER LXDISP LXDISP 128M 128M ABCG
     INCLUDE LXDFLT
     MDISK 0191 3390 3031 0030 LXADM MR READPASS
     MDISK 0151 3390 0001 2600 LXADM MR READPASS WRITPASS MULTPASS
     MDISK 0155 3390 2601 0200 LXADM MR READPASS WRITPASS MULTPASS
  • LXMNT - User directory for LXMNT:
    USER LXMNT LXMNT 128M 128M G
     INCLUDE LXDFLT
     MDISK 0191 3390 3145 100 LXADM MR ALL
    **********************************************
    *Only SuSE master image is used              *
    *0251 is "/" and it is for R/O "usr" and     *
    *       /usr/src                             *
    *0253 is "/usr"                              *
    *0254 is "/usr/src"                          *
    *0255 is swap                                *
    *5251 is "/" for RO "/usr" and R/W           *
    *        "/usr/src"                          *
    **********************************************
     MDISK 0251 3390 0001 150 LXSUSE MR ALL
     MDISK 0253 3390 0151 2500 LXSUSE MR ALL
     MDISK 0254 3390 2651 0400 LXSUSE MR ALL
     MDISK 0255 3390 3051 0100 LXSUSE MR ALL
     MDISK 5251 3390 3151 150 LXSUSE MR ALL
  • TCPIP - This user ID should already be created:
    USER TCPIP TCPIP 32M 128M ABG
     INCLUDE TCPCMSU
     OPTION QUICKDSP SVMSTAT MAXCONN 1024 DIAG98 APPLMON
     SHARE RELATIVE 3000
     IUCV ALLOW
     IUCV ANY PRIORITY
     IUCV *CCS PRIORITY MSGLIMIT 255
     LINK TCPMAINT 591 591 RR
     LINK TCPMAINT 592 592 RR
     LINK TCPMAINT 198 198 RR
     MDISK 191 3390 3316 005 420RES  MR RTCPIP   WTCPIP   MTCPIP
  • TCPIP111 -  VM TCP/IP Stack for 9.130.111.xxx.  TCPIP111's 191 disk should be copied form TCPIP's 191 disk. User directory for TCPIP111:
    USER TCPIP111 TCPIP111 128M 256M ABG
     INCLUDE TCPCMSU
     IUCV ALLOW
     IUCV ANY PRIORITY
     IUCV *CCS PRIORITY MSGLIMIT 255
     OPTION QUICKDSP SVMSTAT MAXCONN 1024 DIAG98 APPLMON
     SHARE RELATIVE 3000
     LINK TCPMAINT 0591 0591 RR
     LINK TCPMAINT 0592 0592 RR
     LINK TCPMAINT 0298 0198 RR
     MDISK 0191 3390 1551 005 LXSPTD MR RTCPIP WTCPIP MTCPIP
  • TCPIP112 -  VM TCP/IP stack for 9.130.112.xxx. TCPIP112's 191 disk should be copied from TCPIP's 191 disk. User directory for TCPIP112:
    USER TCPIP112 TCPIP112 128M 256M ABG
     INCLUDE TCPCMSU
     IUCV ALLOW
     IUCV ANY PRIORITY
     IUCV *CCS PRIORITY MSGLIMIT 255
     OPTION QUICKDSP SVMSTAT MAXCONN 1024 DIAG98 APPLMON
     SHARE RELATIVE 3000
     LINK TCPMAINT 0591 0591 RR
     LINK TCPMAINT 0592 0592 RR
     LINK TCPMAINT 0398 0198 RR
     MDISK 0191 3390 1556 005 LXSPTD MR RTCPIP WTCPIP MTCPIP

3.0.5 Step 5 - Set up VM user IDs and Linux images

  • Set up and activate VM TCP/IP connection
    1. Update/change the "TCPIP DTCPARMS" on the TCPMAINT's 198 disk to only have the following lines. The xxxx and yyyy will be the OSA/Ethernet real addresses.  "PROFILE TCPIP" will reference xxxx as 430.
    2.   :nick.TCPIP     :type.server  :class.stack:nick
                        :ATTACH.xxxx AS 430, yyyy AS 431

    3. Use the following DEVICE and LINK, HOME, DEFAULTNET, and START statements to update the PROFILE TCPIP on TCPMAINT's 198 for the VM TCPIP/IP stack. A copy of "PROFILE TCPIP" is on the LXOPR's 191 disk as "PROFILE TCPIP"
      • DEVICE and Link statements:
      •   ; ==========================================================
          ; DEVICE and LINK statements
          ;
          ; Define the network interfaces used in your environment.
          ; (Sample device and link statements are included below).
          ; ==========================================================
          DEVICE LCS1 LCS 430
          LINK LXDEMO ETHERNET 0 LCS1
          DEVICE IUCV111 IUCV 0 0 TCPIP111 A
          LINK TCPIP111 IUCV 0 IUCV111
          DEVICE IUCV112 IUCV 0 0 TCPIP112 A
          LINK TCPIP112 IUCV 0 IUCV112

      • HOME statements:
      •   ; ------------------------------------------------------
          ; Define the internet (IP) address(es) for this VM host
          ; ------------------------------------------------------
          HOME
           9.130.76.26 LXDEMO
          ; (End of HOME address information) Gateway statements:

          GATEWAY
          ; (IP) Network First        Link Max. Packet      Subnet      Subnet
          ; Address      Hop          Name Size (MTU)       Mask        Value
          ; -----------  ------------ -------   ----------- ----------- --------
          ;
           9             =            LXDEMO    1492        0.255.255.0 0.130.76.0
           9             =            TCPIP111  1492        0.255.255.0 0.130.111.0
           9             =            TCPIP112  1492        0.255.255.0 0.130.112.0

      • DEFAULTNET statement:
      •   ; --------------------------------------------------------------------
          ; Define The DEFAULT route used for any network not explicitly routed
          ; via the previous entries.
          ; --------------------------------------------------------------------
          ;
           DEFAULTNET 9.130.76.253 LXDEMO 1492 0

      • START statements:
      •   ; --------------------------------------------------------------
          ; Start all network interface devices used in this environment.
          ; --------------------------------------------------------------
          START LCS1
          START IUCV111
          START IUCV112

  • Workstations on the private network:
    1. Two Window/Linux workstations are needed on the private network (One for Cloning Continuously and one for Cloning on Demand)
    2. X3270 sessions are needed to logon to z/VM from these workstations
    3. Netscape will be needed to display the status of Cloning Continuously, and perform Cloning on Demand via a website
    4. Route all 9.130.111.xxx and 9.130.112.xxx traffic via z/VM TCP/IP stack on these workstations.

  • Unpack LXOPR's 191 and setup 7191 and 8191 disks
    1. Download "LXOPR191 VMARC" to your workstation from http://www.vm.ibm.com/devpages/chongts/lxopr191.vmarc
    2. Logon to LXOPR
    3. CMS format 191, 7191, 8191
    4. Access 191 as A-disk, 7191 as G-disk and 8191 as F-disk
    5. FTP LXOPR191 VMARC from your workstation to A-DISK (use locsite fix 8O from VM FTP)
    6. Use VMARC to unpack LXOPR191 VMARC (vmarc unpack LXOPR191 VMARC a = = a). "LXADM191 VMARC" and "lxdisp.tar" are on the LXOPR's A-disk
    7. Make a copy of DIRMSAPI EXEC on LXOPR's 191 minidisk (access as A-disk)DIRMAPI EXEC is on DirMaint's 11F minidisk.
    8. Copy "PROF7191 EXEC" to G-disk (copy prof7191 exec a profile = g (olddate)
    9. Copy "MKSWAP EXEC" to G-disk (copy mkswap exec a = = g (olddate)
    10. Copy "PROF8191 EXEC" to F-disk (copy prof8191 exec a profile = f (olddate)
    11. 7191 disk will be used by images that have VDISK swap space as 191.
    12. 8191 disk will be used by images that have DASD swap space as 191.

  • Set up LXCNTL's 191:
    1. Logon to LXCNTL
    2. CMS format 191
    3. Create the following profile exec on the A-disk
        /*   */
        SET CMSTYPE HT
        SYNONYM MY
        TERM MODE VM
        'CP SP CONS * START'
        'link tcpmaint 592 592 rr'
        'acc 592 n'
        SET PF12 RETRIEVE
        SET PF24 RETRIEVE
        'SET FILEPOOL VMSYS:'
        'TERM HOLD OFF'
        'TERM MORE 0 0'
        'set run on'
        SET CMSTYPE RT
  • Set up TCPMAINT for 9.130.111.xxx and 9.130.112.xxx stacks:
    1. DDR copy TCPMAINT's 198 to 298 and 398
    2. Update PROFILE TCPIP on TCPMAINT's 298 for 9.130.111.xxx network. A copy  of the "PROFILE TCPIP" is on LXOPR's 191 disk as "PROFILE TCPIP111".
    3. Rename "TCPIP DTCPARMS" on the 298 disk to "TCPIP111 DTCPARMS". Update/change the "TCPIP111 DTCPAMRS" to only have the following line:
    4.    :nick.TCPIP111 :type.server  :class.stack

    5. Update PROFILE TCPIP on TCPMAINT's 398 for 9.130.112.xxx network. A copy of the "PROFILE TCPIP" is on LXOPR's 191 disk as "PROFILE TCPIP112"
    6. Rename "TCPIP DTCPARMS" on the 398 disk to "TCPIP112 DTCPARMS". Update/change the "TCPIP111 DTCPAMRS" to only have the following line:
    7.    :nick.TCPIP111 :type.server  :class.stack

  • Unpack LXADMIN's 191:
    1. Logon to LXADMIN
    2. CMS format 191
    3. Access 191 as A-disk
    4. Copy "LXADM191 VMARC" from LXOPR's 191 disk to the A-DISK
    5. Use VMARC to unpack LXADMIN VMARC (vmarc unpack LXAD191 VMARC a = = a)
    6. Make a copy of DIRMSAPI EXEC on LXOPR's 191 minidisk (access as A-disk)
    7. DIRMAPI EXEC is on DirMaint's 11F minidisk
  • Install and set up Webshare on LXADMIN's 191 disk:
    1. FTP CMSHTTPD VMARC to A-disk (use locsite Fix 80)
    2. Follow Webshare installation documentation to install Webshare(vmarc unpack CMSHTTPD VMARC a = = a)
    3. Change "CGIUSERS=" to "CGIUSERS=LXADMIN" in "HTTPD CONFIG" file
    4. Add "LXADMIN HTML A" to "WEBSHARE FILELIST A"
    5. Add "ALLIMG HTML A" to  "WEBSHARE FILELIST A"
    6. Add "LXADM *CGI A" to "HTBIN FILELIST A"
    7. Add "TUX_SITT JPG A" to "HTLIB FILELIST A"
    8. Add "TUX_DANC JPG A" to "HTLIB FILELIST A"
    9. Copy "TCPIP DATA" from TCPMAINT 592 disk to Disk

  • Set up LXMSTR, install SuSE and access all master images disks (LXMNT must be logged off):
    1. Logoff LXMNT if LXMNT is logged on
    2. Logon to LXMSTR.
    3. CMS format 151, 153, 154 and 155
    4. Install SuSE SLES-7.0
      • Use 9.130.111.251 as the Host IP address
      • Use 9.130.111.254 as the peer-to-peer IP address
      • Use 151 as R/W "/"
      • Use 153 as R/W "/usr"
      • Use 154 as R/W "/usr/src"
      • Use 155 as SWAP
      • Select "SuSE Deve" or "SuSE Network" from the load configuation menu
      • Set "root" password to "linux4vm"

    5. IPL the new installed SuSE system (IPL 151 clear)
    6. Telnet to LXMSTR (9.130.111.251)and sign on as root (password: linux4vm)
    7. Add 1251 and 5251 disks to /etc/zipl.conf. Example:
    8.    [defaultboot]
         default=ipl

         [ipl]
         target=/boot/zipl
         image=/boot/kernel/image
         #ramdisk=/boot/initrd
         parameters="dasd=0155,0151,0153,0154,1251,5251 root=/dev/dasdb1 noinitrd"
         [dumptape]
         target=/boot
         dumpto=/dev/rtibm0

    9. Modify /etc/fstab to access 1251 and 5251 disks. Example:
    10.    /dev/dasda1     swap                      swap            defaults   0   0
         /dev/dasdb1     /                         ext2            defaults   1   1
         /dev/dasdc1     /usr                      ext2            defaults   1   2
         /dev/dasdd1     /usr/src                  ext2            defaults   1   2
         /dev/dasde1     /suser                    ext2            defaults   1   2
         /dev/dasdf1     /susew                    ext2            defaults   1   2
         proc            /proc                     proc            defaults   0   0
         # End of YaST-generated fstab lines

    11. Execute "zipl" and reIPL the Linux system again
    12. If you can cd /suser and /susew, then shutdown the Linux system
    13. logoff from LXMSTR.

  • Set up LXDISP, install SuSE and unpack the website files:
    1. Logon to LXDISP
    2. CMS format 191, 151 and 155
    3. Install SuSE SLES-7.0:
      • Use 9.130.111.252 as the Host IP address
      • Use 9.130.111.254 as the peer-to-peer IP address
      • Use 151 as R/W "/"
      • Use 155 as SWAP
      • Select SuSE Devel or SuSE Network from the load configuation menu
      • Set "root" password to "linux4vm"

    4. IPL the newly installation SuSE system (IPL 151 clear)
    5. Telnet to LXDISP (9.130.111.252) and sign on as root (password: Linux4vm)
    6. FPT lxdisp.tar (in binary) to /usr/local/httpd/htdocs directory (lxdisp.tar is on LXOPR's 191 disk)
    7. Customize the /etc/httpd/httpd.conf
    8. untar lxdisp.tar to /usr/local/httpd/htdocs (tar -xvf lxdisp.tar)
    9. For the blinking banner on the Cloning Continuously website, download the fader.js from www.webreference.com/dhtml/column27/allCode1.html. fader.js must be in the /usr/local/httpd/htdocs directory.

  • Set up LXMNT, install SuSE and master images (LXMSTR must be logged off):
    1. Logoff LXMSTR if LXMSTR is logged on

    2. Logon to LXMNT
    3. CMS format 191, 251, 253, 254, 255, 5251
    4. Install SuSE SLES-7.0:
      • Use 9.130.111.253 as the Host IP address
      • Use 9.130.111.254 as the peer-to-peer address
      • Use 251 as R/W "/"
      • Use 253 as R/W "/USR"
      • Use 254 as R/W "/usr/src"
      • Use 255 as swap
      • Select SuSE Devel or SuSE Network from the load configuation menu
      • Set "root" password to "linux4vm"

    5. Shutdown the newly installed Linux system
    6. IPL Linux from 251
    7. Telnet to LXMNT (9.130.111.253)and sign on to root (password: linux4vm)
    8. Modify the fstab for R/O "/usr" and "/usr/src":
    9.    /dev/dasda1     swap                      swap            defaults   0   0
         /dev/dasdb1     /                         ext2            defaults   1   1
         /dev/dasdc1     /usr                      ext2            ro         1   2
         /dev/dasdd1     /usr/src                  ext2            ro         1   2
         proc            /proc                     proc            defaults   0   0
         # End of YaST-generated fstab lines

    10. Shutdown the Linux system
    11. DDR copy 251 to 5251
    12. IPL Linux from 5251
    13. Telnet to LXMNT (9.130.111.253)
    14. Modify the fstab for R/W "/usr/src":
    15.    /dev/dasda1     swap                      swap            defaults   0   0
         /dev/dasdb1     /                         ext2            defaults   1   1
         /dev/dasdc1     /usr                      ext2            ro         1   2
         /dev/dasdd1     /usr/src                  ext2            defaults   1   2
         proc            /proc                     proc            defaults   0   0
         # End of YaST-generated fstab lines

    16. Shutdown the Linux system
    17. Logoff of LXMNT
  • Set up DirMaint:
    1. Add "LXSUSEI PROTODIR" file for cloning R/W "/", R/O "/usr", R/O "/usr/src" and DASD swap images. A copy of LXSUSEI PROTODIR is on LXOPR's191 disk. User prototype directory for LXSUSEI:
    2.    USER LXUSER LXUSER 64M 128M G
         INCLUDE LXDFLT
         LINK LXMSTR 0152 0152 RR
         LINK LXMNT  0253 0253 RR
         LINK LXMNT  0254 0254 RR
         LINK LXOPR 8191 0191 RR
         AMDISK 0251 XXXX AUTOG 150 GROUP1 MR PWS ALL LXWR LXMU
         AMDISK 0255 XXXX AUTOG 100 GROUP1 MR PWS ALL LXWR LXMU

    3. Add "LXSUSEIV PROTODIR" file for cloning R/W "/", R/O "/usr". R/O       "/usr/src" and VDISK swap images. A copy of LXSUSEIV PROTODIR is on LXOPR's191 disk. User prototype directory for LXSUSEIV:
    4.    USER LXUSER LXUSER 64M 128M G
         INCLUDE LXDFLT
         LINK LXMSTR 0152 0152 RR
         LINK LXMNT  0253 0253 RR
         LINK LXMNT  0254 0254 RR
         LINK LXOPR 7191 0191 RR
         AMDISK 0251 XXXX AUTOG 150 GROUP1 MR PWS ALL LXWR LXMU

    5. Add "LXSUSERW PROTODIR" file for cloning R/W "/", R/O "/usr" and R/W "/usr/src" images. A copy of the following LXSUSERW PROTODIR is on lXADMIN's 191 disk. User prototype directory for LXSUSERW:
    6.    USER LXUSER LXUSER 64M 128M G
         INCLUDE LXDFLT
         LINK LXMSTR 0152 0152 RR
         LINK LXMNT  0253 0253 RR
         LINK LXOPR 8191 0191 RR
         AMDISK 0251 XXXX AUTOG 150 GROUP1 MR PWS ALL LXWR LXMU
         AMDISK 0254 XXXX AUTOG 400 GROUP1 MR PWS ALL LXWR LXMU
         AMDISK 0255 XXXX AUTOG 100 GROUP1 MR PWS ALL LXWR LXMU

    7. Update "AUTHFOR CONTROL" file to allow LXOPR and LXADMIN to create VM user IDs. A copy of the following AUTHFOR CONTROL is on LXOPR's 191 disk. AUTHFOR CONTROL file:
    8.    ALL MAINT    *        150A ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
         ALL MAINT    *        140A ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
         ALL LXOPR    *        150A ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
         ALL LXOPR    *        140A ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
         ALL LXADMIN  *        150A ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
         ALL LXADMIN  *        140A ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890

    9. Add/update "EXTENT CONTROL" to contain all the user DASD for cloning. A    example of the EXTENT CONTROL file is on LXOPR's 191 disk

4.0 REXX execs  used by LXOPR user ID

  • MAKESUSE  EXEC A - Main exec to start the demo. Defaults to create 300 images with DASD swap space. First line of the exec is "max_image = 300" and it sets the maximum number of images to be created. This demo uses 2 class C networks and the maximum images can be created is 500.  For example: 490 for Cloning Continuously (LX1 to LX490)  and 10 (LX491 to LX500) for Cloning on Demand.
  • MKSUSEV EXEC A - Main exec to start the demo. Defaults to create 300 images with VDISK swap space. First line of the exec is "max_image = 300" and it sets the maximum number of images to be created. This demo use 2 class C networks and maximum images can be created is 500. For example: 490 for Cloning Continuously (LX1 to LX490)  and 10 (LX491 to LX500) for Cloning on Demand.
  • CLEANUP EXEC A - Delete Linux images and reset the counter to 0. (example "cleanup 5" to delete LX1 to LX5)
  • NEWSUSE EXEC A - Create a SuSE Linux image with R/W "/", R/O "/usr", R/O "/usr/src" and DASD swap space. It is called by MAKESUSE EXEC
  • NEWSUSEV EXEC A - Create a SuSE Linux with R/W "/", R/O "/usr", R/O "/usr/src" and VDISK swap space image. It is called by MKSUSEV EXEC
  • RMLX EXEC A - Delete a linux image. It is called by CLEANUP EXEC.
  • PURGELX EXEC A - Force a image off and delete the image.
  • STLXTCP EXEC A - Start all TCPIP111 and TCPIP112 stacks.
  • STLXVM EXEC A - Start LXDISP and the LXMSTR Linux images.
  • LXCMD EXEC A - Send command to a Linux image.
  • SENDLX EXEC A - Send command to a Linux image.
  • SHUTLX EXEC A - Shutting down LXDISP and LXMSTR Linux images.
  • ATTDASD EXEC A -  Attach all the user DASD for cloning to the system. This exec must be modified to include the DASD in your system.
  • DIRMSAPI EXEC A - This exec can be found on DirMaint's 11F minidisk (access as D-disk). Make a copy of this exec on LXOPR's 191 minidisk (access as A-disk). This exec is used by both MAKESUSE EXEC and MKSUSEV EXEC  to call DirMaint to create VM user ID.

4.1 Files used by LXOPR user ID

  • IPADDRES FILEIUCV A - IP address and Linux images user ID mapping file used by NEWSUSE EXEC and NEWSUSEV EXEC.
  • PT2PT FILEIUCV A1 - Peer-to-peer IP address for each Linux. In this case the peer-to-peer IP address is 9.130.111.254 for image LX1 to image LX250, and 9.130.1112.254 for image LX251 to LX500.
  • FILE TXT A - Images creation time and number status file
  • MODULES SUSEIUCV A - Input file used by NEWSUSE EXEC and NEWSUSEV EXEC to create the "/etc/modules.conf" for SuSE image.
  • RCCONFIG SUSEIUCV A - Input file used by NEWSUSE EXEC and NEWSUSEV EXEC to create the "/etc/rc.config" for SuSE image.
  • HOSTS SUSIUCV A - Input file used by NEWSUSE EXEC and NEWSUSEV EXEC to create the "/etc/hosts" for SuSE image
  • HOSTNAME SUSEIUCV A - Input file used by NEWSUSE EXEC and NEWSUSEV EXEC to create the "/etc/HOSTNAME" for SuSE image.
  • ROUTE  SUSEIUCV A - Input file used by NEWSUSE EXEC and NEWSUSEV EXEC to create the "/etc/route.conf" for SuSE image.
  • DDRCMDS FILE A - DDR command file for creating images that have R/W "/", R/O "/usr, R/O "/usr/src" and DASD swap. Used by NEWSUSE EXEC.
  • DDRCMDV FILE A - DDR command file for creating images that have R/W "/", R/O "/usr, R/O "/usr/src" and VDISK swap. Used by NEWSUSEV EXEC.
  • NETRC DATA A - FTP login file. It has only one line --> "login root  password linux4vm".
  • CLONING IMAGE A - Text file indicates the type of images being cloned. LXADMIN will check this file before cloning any image. This file is used to ensure Cloning Continuously and Cloning on demand do not write to the same master of Linux image's "/" filesystem at the same time.

5.0 REXX exec's  and CGI used by "LXADMIN" user ID

  • SUSELX EXEC A - Create a SuSE Linux image with R/W "/", R/O "/usr", R/W "/usr/src" and DASD swap. It is called by lxadm cgi.
  • NEWSUSE EXEC A - Create a SuSE linux image with R/W "/", R/O "/usr", R/O "/usr/src" and DASD swap space. It is called by lxadm cgi.
  • NEWSUSEV EXEC A - Create a SuSE linux with R/W "/", R/O "/usr", R/O "/usr/src" and VDISK swap space image. It is called by lxadm cgi.
  • RMLX EXEC A - Delete a linux image. It is called by lxadm cgi.
  • PURGELX EXEC A - Force a image off and delete the image.
  • SENDLX EXEC A - Send command to a Linux image.
  • DIRMSAPI EXEC A - This exec can be found on DirMaint's 11F minidisk. Make a copy of this exec on LXOPR's 191 minidisk (access as A-disk). This exec is used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC to call DirMaint to create VM user ID.
  • LXADM CGI A - This is the main REXX CGI exec to create and delete Linux images. It is called by LXADMIN HTML.

5.1 Files used by LXADMIN user ID

  • IPADDRES FILEIUCV A - IP address and Linux images user ID mapping file used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC.
  • PT2PT FILEIUCV A1 - Peer-to-peer IP address for each Linux. In this case the peer-to-peer IP address is 9.130.111.254 for image LX1 to image LX250, and 9.130.1112.254 for image LX251 to LX500.
  • MODULES SUSEIUCV A - Input file used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC to create the "/etc/modules.conf" for SuSE image.
  • RCCONFIG SUSEIUCV A - Input file used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC to create the "/etc/rc.config" for SuSE image.
  • HOSTS SUSIUCV A - Input file used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC to create the "/etc/hosts" for SuSE image.
  • HOSTNAME SUSEIUCV A - Input file used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC to create the "/etc/HOSTNAME" for SuSE image.
  • ROUTE  SUSEIUCV A - Input file used by NEWSUSE EXEC , NEWSUSEV EXEC and SUSELX EXEC to create the "/etc/route.conf" for SuSE image.
  • DDRCMDS FILE A - DDR command file for creating images that have R/W "/", R/O "/usr, R/O "/usr/src" and DASD swap. Used by NEWSUSE EXEC.
  • DDRCMDV FILE A - DDR command file for creating images that have R/W "/", R/O "/usr, R/O "/usr/src" and VDISK swap. Used by NEWSUSEV.
  • DDRCMDSW FILE A - DDR command file for creating images that have R/W "/", R/O "/usr, R/W "/usr/src" and DASD swap. Used by SUSELX EXEC.
  • NETRC DATA A - FTP login file. It has only one line --> "login root  password linux4vm".
  • CUSTLIST TXT A - Text file that stores customer information. It is modified by lxadm cgi.
  • ADMLIST TXT A -  Text file that stores Administrative User ID and Password. It only has one line:
    lxadm linux4vm

5.2 HTMLs and JPGs used by LXADMIN User ID

  • LXADMIN HTML A - The main HTML for Cloning on Demand web interface.
  • ALLIMG HTML A - Contains the names of all the images that were created already. It is modified by lxadmin cgi. The first three lines of this file must be:
    <html>
    <font size=+2>
    <h1> Images are: <p> </h1>
  • CIMAGE HTML A - Contains all the available images (images pool)  that Cloning on Demand can create. Set to 10 images (LX491 - LX500). It is modified by LXADMIN CGI. The last line of this file must be:
    **end**
  • TUX_DANC JPG A - JPG for a dancing TUX. Loaded by LXADMIN HTML.
  • TUX_SITT JPG A - JPF for a sitting TUX. Loaded by LXADMIN HTML.

6.0 Starting the DEMO to Create Images

Start TCP/IP network, LXOPR and LXMSTR

  1. Logon to "LXCNTL".
  2. Logon to "LXOPR".
  3. Enter "STLXTCP" from LXOPR CMS command line to start all 2 TCP/IP stacks. If STLXTCP completed successfully, the network is up and running. Do not proceed if STLXTCP has not completed successfully!
  4. Enter "STLXCM" from LXOPR CMS command line to IPL "LXDISP" (Apache webserver) and "LXMSTR". If STLXCM completed successfully, the LXDISP and LXMSTR Linux images are up and running. Do not proceed if STLXVM has not completed successfully!

Start Cloning Continuously

  1. Start Netscape from your workstation and go to http://9.130.111.252/tscdemo.html (For blinking banner: go to http:/9.130.111.252/speedometer.html. fader.js is required for the blinking banner) When the webpage comes up, reload it one more time by clicking the reload button.
  2. From the CMS command line of "LXOPR", enter "MAKESUSE or MKSUSEV" to start the Cloning Continuosly demo. If the webpage did not get updated when the new images were created, just reload the page one more time.
  3. Leave "LXOPR" and "LXCNTL" logged on. You should be able to observe the cloning process on "LXOPR" and all the Linux image console messages on "LXCNTL"

Start cloning images via the Cloning on Demand web interface:

  1. Logon to "LXADMIN"
  2. From the CMS command line of "LXADMIN" enter "WEBSHARE" or "HTTPD" to start the Cloning on Demand demo.
  3. Start Netscape from your workstation and go to http://192.168.46.140/~lxadmin/lxadmin.html.
  4. Fill in the Name, Title, Company, e-mail, Administrative User ID(lxadm)  and Password (linux4vm) boxes.
  5. Select SuSE, SuSE Web Server-DASD SWAP or SuSE Web Serve-VDISK SWAP button.
  6. Double click Submit to create a image
  7. This web interface can only create one image at a time. When the the image is created, a dancing TUX will display along with the image's name and IP address.
  8. You can click on the sitting TUX to see how many images were created.

7.0 Deleting the Cloned Images

Delete all cloned images that were created by Cloning Continuously (LXOPR)

  1. From LXOPR's CMS command line enter "cleanup nnnn", where nnnn are the number of images to be deleted. Ensure you delete all the cloned images before you rerun the demo again. If you stopped the "MAKESUSE" or "MKSUSEV" before it reached 300 (maximum number of images), you should add 1 to the number of images that is showing on the speedometer web page as the total number of images you are going to delete. Example: If the speedometer web page shows 250 images, then execute "cleanup 251" to delete all the cloned images.
  2. You can also use "PURGELX EXEC" to delete one image at a time. Example: execute "PURGELX LX4" to delete the LX4 image.

Delete all cloned Images that were created by Cloning on Demand (LXADMIN)

  1. Fill in the Image Name, Administrative User ID and Password and then click on the "Delete an Image" button on the "Linux Image Adminstration" website to delete an image.
  2. You can click on the sitting TUX to find out how many images were created.

8.0 In Conclusion

  • I am providing this documentation and the REXX execs as an example for you to experiment with cloning on your system. I used this process for creating my demo in the past 3 LinuxWorld conferences. It has also been used by other IBM locations for demos and other applications. It has worked very well for me. This is my first draft of this documentation. Please feel free to send me your feedback on this documentation or the cloning setup/exec/file/etc to me (chongts@us.ibm.com) . I am working on this demo on the side and I will do my best to provide assistance and answer questions. Please post your questions/problems encountered in the Marist College LINUX-390 Mailing list (LINUX-390@VM.MARIST.EDU). You can also send me an e-mail if you feel uncomfortable posting your questions on the mailing list. Thank your for experimenting with this demo.