Automated environment setup tool for IBM Systems Director VMControl

Tool to prepare IBM Systems Director VMControl end-to-end environments

IBM® Systems Director is a platform management solution that is used to manage physical and virtual systems. IBM Systems Director provides systems management personnel with a single pane of glass, helping to reduce IT management complexity and cost. IBM Systems Director VMControl™ is an advanced plug-in installed on top of IBM Systems Director to provide the virtualization capabilities. This article talks about a tool for automatic environment setup for IBM Systems Directors testing and development. The tool is designed to work for almost all the supported resource features, such as kernel-based virtual machine (KVM), IBM z/VM®, VMware, and IBM Power® Systems™ platforms.

Share:

Prashant Pareek (prashant.pareek@in.ibm.com), Senior Staff Software Engineer, IBM  

Prashant PareekPrashant Pareek is a Senior Staff Software Engineer at IBM. He is currently working on VMControl under IBM Systems Director, a critical product in the IBM product portfolio. He has an overall experience of 8.5 years and holds a bachelor's degree in Information Technology Engineering from Visvesvaraya Technological University (VTU), Karnataka, India.



Piyush Jain (piyushjain@in.ibm.com), Staff Software Engineer, IBM  

Piyush Jain Piyush Jain is a Staff Software Engineer at IBM. He is currently working on VMControl under IBM Systems Director, a critical product in the IBM product portfolio. He has an overall experience of around 6 years and holds a bachelor's degree in Information Technology Engineering from Institute of Engineering and Technology (IET) Alwar, Rajasthan, India. You can contact him at piyushjain@in.ibm.com.


developerWorks Contributing author
        level

Aravindo Swain (araswain@in.ibm.com), Associate Software Engineer, IBM

Aravindo Swain photoAravindo Swain is working as an Associate Software Engineer for the VMControl project under IBM Systems Director, a critical product in the IBM product portfolio. Aravindo has an overall experience of 2 years in Java technologies and holds a master’s degree in Computer Applications from Institute of Technical Education and Research (ITER) Bhubaneswar, Orissa, India.



05 March 2013

Also available in Chinese

Section 1. Before you start

Objectives

The main objective of this article is to make developers and testers working on IBM Systems Director aware of a utility to automatically set up their test or development environment. This approach reduces the human intervention during the setup process, and therefore, is less error prone. It is even quicker than the time required for manual setup. Also, it has a set of validation scripts that validates the environment for correctness after setting it up.

Prerequisites

You should have IBM Systems Director installed on your machine along with VMControl. This article assumes that you are familiar with IBM Systems Director and VMControl functionality.

System requirements

User should have the following components on the system:

  • Python 2.6.x or above along with Pexpect. Steps to install Pexpect module:
    • wget http://pexpect.sourceforge.net/pexpect-2.3.tar.gz
    • tar xzf pexpect-2.3.tar.gz
    • cd pexpect-2.3
    • python ./setup.py install
  • wget module

Section2: How to use the automated environment setup tool with IBM Systems Director?

IBM Systems Director supports three types of interfaces: graphical user interface (GUI), command-line interface (CLI), and web service interface using web services pertaining to application and services that conform to Representation State Transfer (REST). As IBM Systems Director manages variety of environments, it becomes essential to have a proper working environment for development and test purpose. Development and test teams working on IBM Systems Director always end up spending more time on setting up the environment than the actual development or testing activities.

This article talks about a tool for automatic environment setup for IBM Systems Directors for testing and development. The tool is designed to work on Linux for almost all the supported resource features, such as KVM, z/VM, VMware, and Power. This tool is developed using python and is a collection of various independent modules. Users have the flexibility to run any of these modules independently or can choose to run all the modules in one go through a main file which in turn is user configurable.

For example, if a user wants to only activate the VMControl plug-in, then the user can run the activateVMC.pyc script or can add it to the main file to run it through the main file.

Users can update the main file as per requirement and can add the modules in a sequence in which they want them to be run. When the main setup file is run, it in turn calls all the modules in a proper sequence to perform the complete setup.

Using this script, we can perform the following operations independently:

  • Activate IBM Systems Director
  • Activate VMControl
  • Unmanage and clean up of end points (for common architecture service [CAS]-managed endpoints)
  • Discovery (single IP, multiple IPs separated by comma or range of IPs)
  • Discovery of storages
  • Discovery of switches
  • Request access
  • Collect inventory (single IP, multiple IPs separated by comma or a range of IPs)
  • Installation of subagent and common repository agent
  • Uninstall Systems Director server
  • Validate the environment
Figure 1. Flow diagram of an automated environment setup tool
A pixel ruler showing the maximum width of an image used for an article (580 pixels)

Figure 1 explains the entire flow of the tool. Users are required to first run the prerequisite.sh script to check on the required modules to run the automation tool. If the prerequisite.sh script passes, then update the environment.json file with the details of user's environment, such as IP addresses, passwords, usernames, and so on. After the user enters all the required details in the json file, the user is good to run the environment setup scripts. The user has to update the env_setup_main.py file according to the order in which the user wants to run the scripts.

The tool contains the following scripts:

  1. prerequisite.sh: This script checks whether the required python and wget modules are installed. If any of the required modules are not present in the system, then it shows the proper error message and exits the setup. We can start the setup if the prerequisite script is successful.
    Listing 1. Detailed output of the prerequisite script
    [root@z1-9-5-124-25 code]# sh prerequisite.sh
    Before setup the System should have :
    1. wget 1.11.4
    2. Python 2.6.x or above
    3. Pexpect module installed in it.
    
    1. CHECKING FOR WGET.
    wget is installed in the machine with the following version :
    GNU Wget 1.12 built on linux-gnu.
    Wgetrc:
    
    2. CHECKING FOR PYTHON.
    Python 2.7.2
    Python is installed in the system
    
    3. CHECKING FOR PEXPECT
    [SUCCESS] Pexpect is currently installed.
    [root@z1-9-5-124-25 code]#
  1. activateVMC.pyc: This script is used to activate the VMControl plug-in. It first checks the IBM Systems Director status. If it is inactive, it activates it. Second, it checks for VMControl status. If it is already active, it returns without any action and if it is not active, it activates the VMControl and restarts the Systems Director server.
    Listing 2. Detailed output of the activateVMC.pyc script
    [root@z1-9-5-124-25 code]# python activateVMC.pyc
    Director is already Active.
    VMControl is not Active.
    [SUCCESS] VMControl is activated successfully.
    Director CLI daemon is in state Starting  - time left is 600 seconds
    Director CLI daemon is in state Starting  - time left is 590 seconds
    Director CLI daemon is in state Starting  - time left is 580 seconds
    Director CLI daemon is in state Starting  - time left is 570 seconds
    Director CLI daemon is in state Starting  - time left is 560 seconds
    Director CLI daemon is in state Starting  - time left is 550 seconds
    Director CLI daemon is in state Starting  - time left is 540 seconds
    Director CLI daemon is in state Starting  - time left is 530 seconds
    Director CLI daemon is in state Starting  - time left is 520 seconds
    Director is now Active
    [root@z1-9-5-124-25 code]#
  1. cleanup.pyc: This script is used to cleanup a CAS managed endpoint independently for Power environment. We have to provide machine type (IVM or VS), IP address, username and password of the machine with the command.

    Example:

    python cleanup.pyc IVM ip_address username password
    python cleanup.pyc VS ip_address username password
    Listing 3. Detailed output of the cleanup.pyc script
    [root@z1-9-5-124-25 code]# python cleanup.pyc VS 10.11.12.13 username password
    Now will unmanage the endpoint 10.11.12.13
    [SUCCESS] Not Cleaned the machine 10.11.12.13 as it is unmanaged already
    
    [root@z1-9-5-124-25 code]# python cleanup.pyc IVM 5.6.7.8 username password
     (yes/no)? yes
    Warning: Permanently added '5.6.7.8' (RSA) to the list of known hosts.
    @5.6.7.8's
    Checking for management endpoint for 5.6.7.8
    Now will unmanage the endpoint 5.6.7.8
    [SUCCESS] Cleaning up of the IVM 5.6.7.8 completed.
    Now will stop the endpoint 5.6.7.8
     /opt/ibm/director/agent/runtime/agent/bin/endpoint.sh stop
    0513-044 The cas_agent Subsystem was requested to stop.
    Stopping The LWI Nonstop Profile...
    Waiting for the LWI Nonstop Profile to exit ...
    Waiting for the LWI Nonstop Profile to exit ...
    Waiting for the LWI Nonstop Profile to exit ...
    Waiting for the LWI Nonstop Profile to exit ...
    Waiting for the LWI Nonstop Profile to exit ...
    Stopped The LWI Nonstop Profile.
    
    (0) root @ c610am4b1: /home/padmin
    
    #
  1. discovery.pyc: This script is used to discover an endpoint. We can use this script to discover single, multiple, or a range of IPs at a time.

    Example:

    python discovery.pyc ip_address
    python discovery.pyc ip_address1, ip_address2, .... ,ip_addressN
    python discovery.pyc ip_range (for example:discovery 1.2.3.4-1.2.3.8)
    Listing 4. . Detailed output of the discovery.pyc script
    [root@z1-9-5-124-25 code]# python discovery.pyc 5.6.7.8
    smcli discover -i 5.6.7.8
    Discovery of 5.6.7.8 started . . .
    [SUCCESS] Discovery of 5.6.7.8 completed successfully
    [root@z1-9-5-124-25 code]#
  1. requestaccess.pyc: This script is used to get access to a discovered endpoint. We have to provide the IP, username, and password of the computer with the command.

    Example:

    python requestaccess.pyc ip_address username password
    Listing 5. Detailed output of the requestaccess.pyc script
    [root@z1-9-5-124-25 code]# python requestaccess.pyc 9.114.148.39 username password
    Requesting for access on : 9.114.148.39
    [SUCCESS] Request Access Successful on 9.114.148.39
    [root@z1-9-5-124-25 code]#
  1. collectinv.pyc: This script is used for collecting inventory on a single endpoint or multiple endpoints. It takes comma-separated IP addresses as input.

    Example:

    python collectinv.pyc ip_address
    python collectinv.pyc ip_address1, ip_address2, ...., ip_addressN
    Listing 6. This shows the detailed ouput for collectinv.pyc script:
    [root@z1-9-5-124-25 code]# python collectinv.pyc 5.6.7.8
    smcli collectinv -i 5.6.7.8 -p "All Inventory"
    Collecting inventory on : 5.6.7.8
    Inventory collection percentage 7%
    Inventory collection percentage 87%
    Inventory collection percentage 92%
    Inventory collection percentage 99%
    Inventory collection completed:
    100%
    
    [SUCCESS] Collect inventory successfuly completed on 5.6.7.8
    [root@z1-9-5-124-25 code]#
  1. installNIMSubagent.pyc: This script installs or updates the Network Installation Management (NIM) subagent on a discovered NIM master logical partition (LPAR). It first uninstalls the NIM subagent from the NIM master (if already installed), copies the NIM subagent JAR file from the Systems Director server to the NIM master and installs the NIM subagent in the NIM master. To run the installNIMSubAgent.pyc script, we need to update the following data in the environment.json file:
    "NIMaster" : { "hostip":"1.2.3.7", "user":"root", "password":"passw0rd" },

    Example:

    python installNIMSubagent.pyc
    Listing 7. Detailed output of the installNIMSubagent.pyc script
    [root@z1-9-5-124-25 code]# python installNIMSubAgent.pyc
    Uninstallation completed successfully.
    NIM Subagent copied to NIM Master successfully.
    Installation of NIM Subagent is completed.
    
      com.ibm.director.im.rf.nim.subagent_9.9.9.9-201301182038 Enabled
    
    NIM Subagent installed properly.
    [root@z1-9-5-124-25 code]#
  1. installKVMCommonAgent.pyc: This script installs or updates the KVM common repository agent on the Systems Director server computer. It first uninstalls the KVM subagent (if existing) and then installs the latest KVM subagent to the Systems Director server computer.

    Example:

    python installKVMCommonAgent.pyc
    Listing 8. Detailed output of the installKVMCommonAgent.pyc script
    [root@z1-9-5-124-25 code]# python installKVMCommonAgent.pyc
    
    Archive:  /tmp/repo/CommonAgentSubagent_VMControl_CommonRepository_2.4.0.jar
       creating: /tmp/repo/META-INF/
       creating: /tmp/repo/TC-INF/
       creating: /tmp/repo/xml/
      inflating: /tmp/repo/META-INF/MANIFEST.MF
      inflating: /tmp/repo/TC-INF/tc-driver.xml
      inflating: /tmp/repo/plugin.xml
      inflating: /tmp/repo/xml/CommonAgentSubagent_VMControl_CommonRepository.xml
       creating: /tmp/repo/repository/
      inflating: /tmp/repo/repository/com.ibm.director.im.cr.agent.installer.zip
    
    Archive:  /tmp/repo/repository/com.ibm.director.im.cr.agent.installer.zip
       creating: /tmp/repo/repository/features/
       creating: /tmp/repo/repository/features/com.ibm.director.im.cr.agent.installer_
    										2.4.0/
       creating: /tmp/repo/repository/plugins/
       creating: /tmp/repo/repository/temp/
      inflating: /tmp/repo/repository/features/com.ibm.director.im.cr.agent.installer_
    										2.4.0.jar
      inflating: /tmp/repo/repository/features/com.ibm.director.im.cr.agent.installer_
    									2.4.0/kvm-ae.zip
      inflating: /tmp/repo/repository/plugins/com.ibm.director.im.cr.agent_2.4.0.jar
      inflating: /tmp/repo/repository/plugins/com.ibm.director.im.cr.common.nl1_2.4.0.jar
      inflating: /tmp/repo/repository/plugins/com.ibm.director.im.cr.common_2.4.0.jar
      inflating: /tmp/repo/repository/plugins/com.ibm.director.im.rf.events_2.4.0.jar
      inflating: /tmp/repo/repository/plugins/derby_10.3.3.1.jar
      inflating: /tmp/repo/repository/site.xml
    
    ALR0276I: Install processing for the following features were successful :
    com.ibm.director.im.cr.agent.installer_2.4.0
    
    ALR0282I: The platform needs to be restarted to complete the operation.
    
    Stopping The LWI Nonstop Profile...
    Waiting for The LWI Nonstop Profile to exit...
    Waiting for The LWI Nonstop Profile to exit...
    Waiting for The LWI Nonstop Profile to exit...
    Waiting for The LWI Nonstop Profile to exit...
    Waiting for The LWI Nonstop Profile to exit...
    Stopped The LWI Nonstop Profile.
    Starting The LWI Nonstop Profile...
    
    KVM Common Agent is installed successfully, Verification completed.
    [root@z1-9-5-124-25 code]#
  1. installSCSCommonAgent.pyc: This script installs or updates the SCS common repository agent on Virtual I/O Server (VIOS). It first uninstalls the SCS common agent repository (if already installed) and then installs the SCS common agent on the SCS repository computer and verifies the installation. To run the installSCSCommonAgent.pyc script, we need to update the following parameters in the environment.json file:
    "SCSRepo" : { "hostip":"1.2.3.7", "user":"root", "password":"passw0rd" },
    "RepositoryName" : "Repository",
    "RepositoryOS" : "abc7.pdl.pok.ibm.com",

    Example:

    python installSCSCommonAgent.pyc
  1. storage.pyc: This script is used for discovery of storage subsystem and storage array. To run the storage.pyc script, we need to update the following parameters in the environment.json file:
    "StorageProvider" : { "hostip":"1.2.3.5", "user":"root", "password":"passw0rd" },

    Example:

    python storage.pyc
    Listing 9. Detailed output of the storage.pyc script
    [root@z1-9-5-124-25 code]# python storage.pyc
    [SUCCESS] Storage setup done successfully with the Storage Provider : 1.2.3.5
    [root@z1-9-5-124-25 code]#
  1. switch.pyc: 11. switch.pyc: This script is used to set up the switch, that is, discover the switch provider and the switches. To run the switch.pyc script, we need to update the following parameters in the environment.json file:
    "SwitchProvider" : { "hostip":"1.2.3.4", "user":"root", "password":"passw0rd" },

    Example:

    python switch.pyc
    Listing 10. Detailed output of the switch.pyc script
    [root@z1-9-5-124-25 code]# python switch.pyc
    [SUCCESS] Switch setup done successfully with the Switch Provider : 1.2.3.4
    [root@z1-9-5-124-25 code]#
  1. uninstallDirector.pyc: This script uninstalls the Systems Director server from the local system. It first uninstalls all the advanced managers, such as VMControl, Storage Control, and Network Control before uninstalling the Systems Director server.

    Example:

    python uninstallDirector.pyc
  1. verifySetup.pyc: This script checks whether the setup is done properly by verifying virtual server and OS managed endpoints (MEPs) of all discovered systems, installing the agents, listing storage array and switches, listing the repositories and so on.

    Example:

    python verifySetup.pyc
  1. env_setup_main.py: User can update the main file as per the requirement and can add the modules in a sequence in which the user wants to run them. When the main setup file is ran, it will in turn call all the modules in a proper sequence to perform the complete setup.

    Before running the env_setup_main.py script, we have to enter the correct system details in the environment.json file.

    Example:

    python env_setup_main.py
  1. environment.json: This file contains the details about the hardware environment in the JavaScript Object Notation (JSON) format. Here, we have to enter all the details of all the computers in a proper format.
    Listing 11. A sample environment.json file
    {
    	"Platform" : "NIM",
    	"IVM1" : { "hostip":"9.12.3.1", "user":"padmin", "password":"ivmpass" },
    	"VS1" : { "hostip":"9.12.1.2", "user":"root", "password":"pass" },
    	"VS2" : { "hostip":"9.12.1.2", "user":"root", "password":"pass" },
    	"NIMaster" : { "hostip":"9.12.4.1", "user":"root", "password":"pass" },
    	"SCSRepo" : { "hostip":"9.12.5.1", "user":"root", "password":"pass" },
    	"StorageProvider" : { "hostip":"9.12.6.2", "user":"root", "password":"pass1" },	
    	"SwitchProvider" : { "hostip":"9.12.6.4", "user":"Admin", "password":"pass2" },
    	"SubAgentVersion" : "2.4.1",
    }

    Users have to create a single environment.json file for a given environment and reuse it for subsequent setup script runs. The details should be entered in a key-value pair, separated by colon, in the format specified in the JSON file.

    Note: Users should follow the same convention for putting the VS and IVM. For example: VS1, VS2, and so on.


Download

DescriptionNameSize
Automated Environment Setup tool for ISDenv_setup.zip28KB

Resources

Learn

  • Refer to IBM Systems Director for information about the IBM Systems Director product.
  • Refer to Python for information about it.
  • Refer to JSON for information about it.

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into AIX and Unix on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX
ArticleID=860281
ArticleTitle=Automated environment setup tool for IBM Systems Director VMControl
publish-date=03052013