Deploying Avantra Agents using the AWS Systems Manager

This section describes the deployment of Avantra Agents to EC2 instances running SUSE Linux Enterprise and RedHat Enterprise Linux, i.e. the platforms commonly used ro SAP installations in the cloud.

We describe the deployment scenario using the AWS Systems Manager. See also Prerequisites and Requirements. If you do not want to use the AWS Systems Manager, you can of course use the standard installation procedure described in section Installing the Avantra Agent.

Get the available Avantra Agent package version

  1. Start the Avantra UI as described in Changing the Administrator Password.

  2. Choose Administration  Agent Updates and switch to the Packages tab.

  3. Find the most recent Avantra Agent version in the Version column.

    ui agent package version

Deploying the Java Runtime Environment 8

  1. Open the AWS Console and choose AWS Systems Manager Run Command. Push the Run Command button.

  2. Find AWS-RunShellScript in the list and check the radio button next to it.

  3. In the field Command fill in the following value

    For RHEL, CentOS, Amazon Linux (and other Fedora-based)
    sudo yum install -y java-1.8.0-openjdk
    For SLES, openSUSE
    sudo zypper install -y java-1_8_0-openjdk
  4. In Targets, select the EC2 instances to run this command on, either using Tags, a Resource Group, or by selecting the instances manually.

  5. In Output Options, choose your desired way to capture the output. We recommend to un-check Enable writing to an S3 bucket and check CloudWatch output.

  6. Push the Run button.

Deploying the Avantra Agents

The deployment uses the same Run Command option as above, but you need to find and adapt the following information first:

MASTERHOST
  • For EC2 instances in the same VPC as the Avantra Server, directly reachable by VPN or VPC peering, use the value MasterHost displayed in the Outputs tab of Launching the CloudFormation Stack.

  • For EC2 instances in a VPC using Private Link, use the DNS names value as described in Creating the Endpoint.

AGENT_VERSION

Use the value retrieved in Get the available Avantra Agent package version.

AGENT_USER

The OS user use to run the Avantra Agent with. Can be the default user of the AMI, but the <sid>adm may also be a good choice for servers hosting SAP application servers.

Use the following template:

#!/bin/sh -xe
MASTERHOST=<use value determined above>
AGENT_VERSION=<use value determined above>
AGENT_USER=ec2-user
DISTDIR=/opt/avantra
SERVICE_NAME=avantra-agent
## -- get instance id for further use --
INSTANCE_ID=$(curl --silent http://169.254.169.254/latest/meta-data/instance-id)
## -- install agent --
sudo mkdir -p "$DISTDIR" \
    && chown -R $AGENT_USER: "$DISTDIR" \
    && cd "$DISTDIR" \
    && sudo -u $AGENT_USER curl -s http://$MASTERHOST:9050/AgentUpdate/agent-$AGENT_VERSION.bin -o agent-$AGENT_VERSION.bin \
    && sudo -u $AGENT_USER chmod 755 ./agent-$AGENT_VERSION.bin \
    && sudo -u $AGENT_USER ./agent-$AGENT_VERSION.bin -- --silent --start=no
## -- create service file for systemd --
sudo cat <<ENDSVCFILE > "/etc/systemd/system/$SERVICE_NAME.service"
[Unit]
Description=Avantra Agent $AGENT_VERSION
After=network.target

[Service]
ExecStart=$DISTDIR/agent/rc.agent start
ExecStop=$DISTDIR/agent/rc.agent stop
User=$AGENT_USER
Type=forking
PIDFile=$DISTDIR/agent/log/agent.pid

[Install]
WantedBy=multi-user.target
ENDSVCFILE
## -- enable service --
sudo systemctl enable "/etc/systemd/system/$SERVICE_NAME.service" \
    && sudo systemctl start $SERVICE_NAME
  1. Open the AWS Console and choose AWS Systems Manager Run Command. Push the Run Command button.

  2. Find AWS-RunShellScript in the list and check the radio button next to it.

  3. In the field Command fill in the template from above, and replace the values for MASTERHOST, AGENT_VERSION, and AGENT_USER, if required.

  4. In Targets, select the EC2 instances to run this command on, either using Tags, a Resource Group, or by selecting the instances manually.

  5. In Output Options, choose your desired way to capture the output. We recommend to remove the flag Enable writing to an S3 bucket and check CloudWatch output.

  6. Push the Run button.

Please make sure you configure the security groups of the EC2 instances you installed agents on as described in Security Groups for EC2 Instances running Avantra Agents.

Post-installation Setup

After you have deployed the Avantra Agents, please follow the steps described in section Preparing the Installation of the Product Guide.

There is nothing wrong if you do this after the agent deployment although the Product Guide says Preparing.

The transport request mentioned in there is already available at /opt/avantra/AgentUpdate on the Avantra Server. It can be accessed in the same way (via http) as described in the Product Guide (and as described in the deployment steps above).

Please also consider the steps 3 to 6 of Installing the Agent on Unix. Replace the OS user xandria referenced there with whatever you have chosen for AGENT_USER above.