Configuring Google Cloud Platform for LSF resource connector
Follow these steps to configure Google Cloud Platform (GCP) to create instances for LSF resource connector to make allocation requests on behalf of LSF. The instances launched from Google Cloud Platform join the LSF cluster. If instances become idle, LSF resource connector terminates them.
Before you begin
The Google Cloud Platform provider requires IBM® Spectrum LSF Fix Pack 4 or newer.
- Apply LSF Fix Pack 4 or newer.
- Manually move the required configuration files to the appropriate directory under LSF_TOP/conf/resource_connector/<provider_name>/conf.
- Change the ownership of the new files and directories to the cluster administrator.
For more information about applying Fix Packs to LSF resource connector, see Use the LSF patch installer to update resource connector.
- You must have root access to the LSF management host.
- Both the management host and the Google Cloud Platform instances that act as LSF execution hosts must be reachable from each other.
- The LSF cluster must have a DNS server.
- You must have correct permissions to update the DNS server.
- You must be able to restart the LSF cluster.
- You must be familiar with and have the ability to perform Google Cloud Platform administrative operations.
- Google Cloud VPC (Google Networks) must be configured to be used by the LSF management and Google Cloud instances.
About this task
- Linux x86 Kernel 2.6, glibc 2.11 RHEL 6.x
- Linux x86 Kernel 3.10, glibc 2.17 RHEL 7.x
- Linux x86 Kernel 3.10, glibc 2.17 CentOS 7.x
- LSF 10.1.0 Standard Edition (Fix Pack 4 or newer)
In the following steps, you must perform all operations as the Google Cloud Platform administrator unless otherwise stated.
For full details on installing LSF, see Install IBM Spectrum LSF on UNIX and Linux.
To get the job submitted by a user to run on the instance, the instance must have this user prepared or LSF user mapping configured. For more information about user groups and user account mapping, see Managing LSF user groups and Between-Host User Account Mapping.
Create a Google project and, optionally, a service account authentication file:
- Before you begin to create any type of resources on Google Cloud Platform, you must create a project. Use the Google Cloud Platform console to create a new project: https://console.cloud.google.com/.
a Google service account key.
The resource connector Google Cloud plug-in uses the service account key as the default authentication method. Use the following link to create the service account key: https://console.developers.google.com/apis/credentials?pli=1
- Choose your project.
- Click Create credentials and select Service account key.
- On the next page, choose your service account and key type.
- Select JSON format as the key type. The service account key downloads automatically. Save the key to a safe location.
Create a VPC network and subnetworks.
A default VPC network is created automatically when you create a project on Google Cloud. The subnet creation mode of the default VPC is Auto subnets, which automatically creates one subnetwork named default in each Google Cloud region. All the subnets in one VPC can communicate with each other across regions. Use the default VPC as your LSF network.
Either set the subnet creation node to Auto, which is the same as the default VPC, or alternatively. set it to Custom and create a custom VPC network.
Configure firewall rules for the LSF VPC
Firewall rules control incoming or outgoing traffic to an instance. By default, incoming traffic from outside your network is blocked. However, incoming traffic inside your VPC network is all opened in the default VPC network. You must add customized rules to open all LSF listening ports to the firewall rules that are used by LSF instances. The ports must match the ports from the existing LSF cluster.Use the following default port numbers:
Note: If you only allow the traffic from these ports, some NIOS commands might not work because the ports are configured for them dynamically and are different from the default LSF ports.
- LSF_LIM_PORT=7869 (TCP and UDP)
- LSF_RES_PORT=6878 (TCP)
- LSB_SBD_PORT=6882 (TCP)
You can also accept all traffic from the management host (add the management host IP address).
Connect Google Cloud Instances and SSH keys.
You can use the Google Cloud gcloud command or your browser to connect to your instances. The Google Cloud Platform manages your SSH keys for you to create and apply SSH key pairs when you connect to a Linux instance from the browser (in the Google Cloud Platform Console) or by using the gcloud command.
For more information, see the Google Cloud documentation:For example, the following command connects your instance if it has a public IP.
gcloud compute ssh [INSTANCE_NAME]
Build the LSF cloud
To create a Google Cloud custom image for an LSF execution host, you must first manually launch an instance and install LSF on that instance. Create a custom image from the instance using the Google Cloud Platform console or by using the gcloud command. You can launch subsequent cloud instances dynamically, using this custom image.
- Log in to the instance that you created.
Copy the LSF packages and entitlement file to the instance.
Install the software.
If no software is installed, you can use the command yum install to install.
# yum install ed
Edit the server.config file to set the installation options.
LSF_TOP="/opt/lsf" LSF_ADMINS="lsfadmin" LSF_TARDIR="/opt/install/" LSF_LICENSE="/opt/install/lsf_std_entitlement.dat" LSF_SERVER_HOSTS="management.myserver.com" LSF_LOCAL_RESOURCES="[resource googlehost]" LSF_LIM_PORT="7869" LSF_GET_CONF=lim
- The new resource name googlehost is used by LSF to identify Google Cloud instances. Use the bhosts -a command to see instances that are used by LSF.
- The port number must be the same as the one defined on the LSF management host.
- Updates the LSF configuration to synchronize the cluster configuration with the management host.
Run the LSF
./lsfinstall -s -f server.configAfter installation, make sure the <LSF_TOP>/conf/lsf.conf configuration file contains the "googlehost" resource:
cat /opt/lsf/conf/lsf.conf LSF_GET_CONF=lim LSF_CONFDIR=/opt/lsf/conf LSF_LIM_PORT=7869 LSF_SERVER_HOSTS="management.myserver.com" LSF_VERSION=10.1.0 LSF_LOCAL_RESOURCES="[resource googlehost]" LSF_TOP=/opt/lsf/ ...
If needed, configure your DNS/NIS server.
The default DNS server for Google Cloud works with LSF.
Start the LSF
daemons on the instance manually and make sure that the instance can join the LSF
cluster as a dynamic host.
If the instance does not join the cluster, check the following items:
- The instance firewall, or firewall rules of the VPC network.
- The management host and the instance can ping each other using the private IP address.
- Shut down the LSF daemons and log out from the instance.
Create the LSF
You can create the LSF compute image in the Google Cloud Console or by using the gcloud command. For detailed steps about how to create a custom image, see the Google Cloud documentation:For example, use these steps to create a custom image using the Google Cloud Console.
- Before capturing the image, stop the instance:
In the Compute Engine Service, on the VM instances tab, select your LSF instance, and click Stop.
- Go to the Image tab, and click Create Image.
- Input your image name, select Source disk as your LSF instance, and click Create.
The custom image is in the images list.
Use the name of the image in the imageId parameter in the googleprov_templates.json file.
- Before capturing the image, stop the instance: