Archer:License Server for Simics

From Grid-Appliance Wiki

Jump to: navigation, search

Contents

Introduction

HOW-TO Author: Girish Venkatasubramanian, girish
Overview: This manual documents how to set up a site license server (flexlm license server) for Simics on a private pool of grid appliances.

Prerequisites

Grid appliance private pool setup

This manual also assumes you are familiar with the process of creating a private pool of Grid appliances and creating a grid appliance opt.vmdk module.

For instructions on how to set up a private pool refer to this tutorial

For instructions on how to create an appliance opt.vmdk module, refer to the Customizing the Grid appliance image for local deployments tutorial.

Simics License Request

This manual assumes that the user has requested for and obtained a site license for Simics. If this has not been done, apply for a site license before continuing any further. Site licenses can be requested from the Simics Website.

Before requesting a license, allocate a Grid appliance in your private pool to be the license server. Boot this appliance up and take note of its virtual IP address:

/sbin/ifconfig tapipop

The output will look something like shown below (obviously the actual IP addresses, MAC addresses will be different). The tap IP address is 242.50.142.92 in this example.

tapipop   Link encap:Ethernet  HWaddr 00:FF:7D:EE:B8:9A  
         inet addr:242.50.142.92  Bcast:242.255.255.255  Mask:255.0.0.0
         UP BROADCAST RUNNING MULTICAST  MTU:1200  Metric:1
         RX packets:317 errors:0 dropped:0 overruns:0 frame:0
         TX packets:261 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:500 
         RX bytes:97445 (95.1 KiB)  TX bytes:91493 (89.3 KiB)

Requesting Site license requires the lmhostid of the grid appliance on which the license server will be run. The lmhostid can be obtained by downloading and running the lmutil application on the grid appliance virtual machine which will run the license server.

wget http://www.grid-appliance.org/files/archer/tutorials/simics/lmutil.gz
gunzip lmutil.gz
chmod +x lmutil
./lmutil lmhostid

The output will look something like

lmutil - Copyright (c) 1989-2004 by Macrovision Corporation. All rights reserved.
The FLEXlm host ID of this machine is "001122334455"

Once the site license has been obtained, install the prerequisite libraries for Simics.

sudo iptables --flush
sudo apt-get update
sudo apt-get install zlib1g-dev


Installing Simics

The site license (if request is approved) is granted via email from Virtutech. This email will contain the instructions for installation and the decryption key ( a 32 digit hexadecimal key). The email will also provide the link from where the Simics packages can be downloaded (referred to as "link" henceforth) and the license file (referred to as license.lic henceforth).

Simics should be installed on all the grid appliances in the private pool. This is best done by installing Simics on the opt.vmdk appliance module and replacing the Grid appliance's opt.vmdk module with the Simics opt.vmdk module. Again, make sure you are familiar with the creation of an opt.vmdk module. Boot a fresh Grid appliance and select development mode. Install Simics within this development appliance using the following procedure.

Download the Simics tar file (replacing link with the actual link from the email sent by Virtutech).

cd /home/griduser
wget --no-check-certificate link

(We assume that the tar file downloaded is called simics-pkg-20-3.0.31-linux.tar. If the file you have downloaded has a different name, replace simics-pkg-20-3.0.31-linux.tar with that name in the following commands.)

/opt/virtutech is the folder where simics will be installed by default. Since we install simics as griduser, the installation script will not be able to create the /opt/virtutech folder. So we create /opt/virtutech/ before we begin the installation and chown it so that simics can be installed in it

sudo mkdir /opt/virtutech/ 
sudo chown -R griduser:griduser /opt/virtutech

Untar and install Simics

tar xf simics-pkg-20-3.0.31-linux.tar
cd /home/griduser/simics-3.0-install
./install-simics.sh

When asked for decryption key enter the key sent via email from Virtutech. Default options may be used for other questions during the installation process. Once the installation completes, Simics will be installed in /opt/virtutech/simics-3.0.31. After installation, the /home/griduser/simics-3.0-install directory may be removed.

Customizing Simics for Integration with Condor

When Simics is started for the first time on a grid appliance it contacts the license server, checks out a license and displays the Service License Agreement (/opt/virtutech/simics-3.0.31/doc/NON_COMMERCIAL_SLA)which spans multiple pages. To scroll through each page, the user has to hit the Enter key. At the end, the user has to accept the SLA by typing Yes. While this works well normally, it causes problems when Simics batch jobs are submtted via Condor (as described in this tutorial).

So, if Simics batch jobs are to be submitted via Condor, the following changes should be done after installing Simics.

  • To prevent the display of a the multipage SLA,we backup and then replace /opt/virtutech/simics-3.0.31/doc/NON_COMMERCIAL_SLA
mv /opt/virtutech/simics-3.0.31/doc/NON_COMMERCIAL_SLA /opt/virtutech/simics-3.0.31/doc/ORIGINAL_NON_COMMERCIAL_SLA
wget http://www.grid-appliance.org/files/archer/tutorials/simics/SHORT_SLA
mv SHORT_SLA /opt/virtutech/simics-3.0.31/doc/NON_COMMERCIAL_SLA
  • To avoid Simics waiting for the user to type Yes at the end of the SLA, we replace /opt/virtutech/simics-3.0.31/x86-linux/lib/python/simics_common.py with a script which does not wait for the user input.
mv /opt/virtutech/simics-3.0.31/x86-linux/lib/python/simics_common.py /opt/virtutech/simics-3.0.31/x86-linux/lib/python/original_simics_common.py
wget http://www.grid-appliance.org/files/archer/tutorials/simics/simics_common.tgz
tar -xzf simics_common.tgz
mv simics_common.py /opt/virtutech/simics-3.0.31/x86-linux/lib/python/simics_common.py

Customizing the License File

The license.lic file (provided in the email sent by Virtutech) will look something like

#
#        Simics Academic floating license file
#        -------------------------------------
#
#  Template $Revision: 1.4 $
#
#  Contact at ABC: xyz@abc.edu
#
#
#  Place this file in the directory 'simics-x.y.z/licenses/' or set the
#  environment variable VTECH_LICENSE_FILE to the path where it is
#  located.
#
#  For support issues related to licensing please consult
#  http://www.simics.net/support/ or contact license@virtutech.com
#
# Edit servername.
SERVER servername <lhostid_which_was_submitted>
USE_SERVER
#
#
.......

We need to change this by replacing servername with the ip address of the tapipop NIC of grid appliance on which the flexlm server has been set up in a previous step (242.50.142.92 in our example).

Then the license.lic has to be modified as shown below


#
#        Simics Academic floating license file
#        -------------------------------------
#
#  Template $Revision: 1.4 $
#
#  Contact at ABC: xyz@abc.edu
#
#
#  Place this file in the directory 'simics-x.y.z/licenses/' or set the
#  environment variable VTECH_LICENSE_FILE to the path where it is
#  located.
#
#  For support issues related to licensing please consult
#  http://www.simics.net/support/ or contact license@virtutech.com
#
# Edit servername.
SERVER 242.50.142.92 <lhostid_which_was_submitted>
USE_SERVER
#
#
# you may delete all remaining lines for the simics clients; 
# the remaining lines are only needed for the license server
.......

This license.lic file has to be copied to /opt/virtutech/simics-3.0.31/licenses/ in every grid appliance in which Simics is installed.

Wrap up opt.vmdk module

Clean temporary files within the opt.vmdk module:

sudo /usr/sbin/clean.sh

Shutdown the development appliance and save the opt.vmdk file for use in the rest of your private pool:

sudo halt

Setting Up the License Server

The site license server (flexlm server) should be run on the grid appliance whose lmhostid was submitted along with the request for the site license. Install Simics (if not already done) on this using the instructions provided above.

/opt/virtutech/simics-3.0.31/x86-linux/sys/flexlm/bin/ has the necessary tools for running the flexlm server. These may be copied to /usr/local/flexlm/bin, along with the license file as follows.

mkdir /usr/local/flexlm
mkdir /usr/local/flexlm/bin
cp -ax /opt/virtutech/simics-3.0.31/x86-linux/sys/flexlm/bin/* /usr/local/flexlm/bin/

mkdir /usr/local/flexlm/licenses
cp -ax /opt/virtutech/simics-3.0.31/licenses/license.lic /usr/local/flexlm/licenses/license.dat


Next we need to set up directories so that the flexlm server can be started. If not present create /usr/tmp, if present chown to griduser

sudo mkdir /usr/tmp
sudo chown -R griduser:griduser /usr/tmp

If not present create /var/tmp, if present chown to griduser

sudo mkdir /var/tmp
sudo chown -R griduser:griduser /var/tmp

Next we start the flexlm server by

cd /usr/local/flexlm/bin
./lmgrd -l log_file

By looking at log_file, it can be seen whether the server started properly. For instance, if the log reflects that permissions are not set properly (indicated by "file or directory not found" messages), ensure that those directories are present and can be written in by griduser. Using top, it can be verified whether the lmgrd and vtech processes are running.

For testing whether the flexlm license server is working properly, install Simics on a client grid appliance. Then invoke Simics

cd /opt/virtutech/simics-3.0.31/bin
./simics

If the flexlm server has been correctly set up, a license will be checked out Simics will start up.

To shutdown the flexlm server use the command

cd /usr/local/flexlm/bin
./lmutil lmdown

Running the License Server on a different Grid Appliance Virtual Machine

The lmhostid is based on the MAC address of the eth0 interface. For instance if eth0 has the MAC address 00:11:22:33:44:55 then the lmhostid will be 001122334455. Note that the flexlm license server can be run only on the grid appliance whose lmhostid matches the one specified while requesting the license.

If the grid appliance has the MAC address of eth0 (aa:bb:cc:dd:ee:00) different from the lmhostid (001122334455), the following instructions can be used to change the MAC address

sudo /sbin/ifconfig eth0 down hw ether 00:11:22:33:44:55
sudo /sbin/ifconfig eth0 up

Optional: customizing Simics for the Example Tutorial

If you are going to go through the tutorial, it also assumes that certain files (example modules and disk images) are present in certain locations. To comply with these assumptions do the following.

  • Set up a workspace using the following instructions
cd /opt/virtutech/simics-3.0.31/bin
./workspace-setup /home/griduser/workspace
  • Set up example modules and disk images
mkdir /home/griduser/workspace/customized_disk
cd /home/griduser/workspace/customized_disk
wget http://www.grid-appliance.org/files/archer/tutorials/simics/enterprise-archer.craff
wget http://www.grid-appliance.org/files/archer/tutorials/simics/enterprise-archer-common.simics

mkdir /home/griduser/workspace/customized_tlb
cd /home/griduser/workspace/customized_tlb
wget http://www.grid-appliance.org/files/archer/tutorials/simics/x86_tlb.so
wget http://www.grid-appliance.org/files/archer/tutorials/simics/mod_x86_tlb_commands.tgz
tar -xzf mod_x86_tlb_commands.tgz
  • Users can modify and compile their own Simics modules. To ensure that these modules use the libgcc of the GCC version on the grid appliance, we need to rename the Simics provided older libgcc.
mv /opt/virtutech/simic-3.0.31/x86-linux/sys/lib/libgcc_s.so.1 /opt/virtutech/simic-3.0.31/x86-linux/sys/lib/original_libgcc_s.so.1
Personal tools