White Papers
Abstract
This article introduces a new way of using the IBM® WebSphere® DataPower appliance, namely running it as a virtual appliance in IBM PureApplication™ System. This virtual appliance supports the same set of functionality you get with the physical appliance, just in a different form factor. Moreover, its support for PureApplication System lets you include DataPower appliances in virtual system patterns, allowing you to automate its install, configuration, and integration with other parts of your infrastructure.
Content
First, a summary of the differences between the DataPower Virtual Edition images compared to other product images in PureApplication System is discussed in this article. Then, you will learn how to use the PureApplication System web console to import the DataPower XI52 Virtual Edition into the image catalog, create a virtual system pattern using the XI52 part, and deploy the pattern into the cloud. Finally, an example script package is provided that allows you to perform advanced configuration and install features into the DataPower appliance on deployment. The DataPower product portfolio offers two types of virtual appliances: The virtual appliances offer the same functional features that you are familiar with in the DataPower physical appliances, without some of the physical security features such as a Trusted Platform Module (TPM), crypto acceleration card, Hardware Security Module (HSM) card, and tamper-proof casing. Each virtual edition product is offered through a non-production or a production license with different pricing. The non-production license is designed for development purposes and has all of the licensed add-on features enabled, except for the Tibco This article uses BM WebSphere DataPower Integration Appliance XI52 Virtual Edition. This is a purpose-built, virtual appliance that delivers rapid data transformations and security enforcement for cloud and mobile applications. It provides security-enhanced and scalable business integration in an edge-of-network security gateway. Here are some of the XI52 Virtual Edition features: For more information about WebSphere DataPower appliance, see the WebSphere DataPower SOA Appliances page. IBM PureAplication System is an integrated system that combines hardware resources (compute nodes, storage, and networking) with software resources, using virtualization to maximize the utilization of the system. Workloads (such as transactional applications, web applications, or data-centric applications) are supported via the use of "patterns", which offer abstract views of the software components of a solution, for example, web applications or databases. PureApplication System also supports defining topologies consisting of virtual images and scripts that are used to configure the resulting virtual machines. This includes installation of middleware, or the integration of multiple nodes (for example, virtual machines) with each other. These topologies are defined as so-called "virtual system patterns" and can be deployed repeatedly and predictably, because every step of the deployment process is codified. Workloads that are deployed as part of a pattern, and which run in PureApplication System, are easily monitored and managed through the system. It offers a single point of control for all of the virtual machines that are running with multiple levels of monitoring and logging, as well as emergency fix support. The ability to quickly deploy environments in a predictable and repeatable fashion, literally at the push of a button, and to do so in a way that delivers highly available and manageable topologies, is a very attractive proposition for the use of PureApplication System. One type of workload that we expect to become a common use case within the collection of patterns available for PureApplication System is that of an Enterprise Service Bus or, more generally, an Integration Layer, which connects multiple frontend consumers to multiple back-end providers of services. Appliances like the IBM WebSphere DataPower appliance are central to many integration layer implementations, covering, for example, the security of the interactions between consumers and providers. The remainder of this article will describe how you can leverage the WebSphere DataPower appliance within a workload pattern deployed on PureApplication System. Originally, DataPower products were only offered as secure rack-mounted appliances utilizing special purpose hardware and a custom operating system. DataPower appliances are widely deployed in enterprise demilitarized zones (DMZs), which have driven requirements for critical security features in the DataPower product offerings. Some of the physical security features are not possible when running as a guest on a standard hypervisor, but the virtual offering has retained most of the secure design principles that are available on the physical appliances. To retain some of the security features present in the physical appliances, the DataPower virtual image was built using a custom build process instead of using the IBM Image Composition and Construction Tool Some of the differences between the DataPower virtual image and other products in the PureApplication System catalog are: Due to the custom nature of the DataPower appliance, the following PureApplication functions are not supported at this time: The pattern described in this article requires the following: There are three types of patterns in PureApplication System: virtual application patterns, virtual system patterns, and database patterns. You can only use the DataPower part in virtual system patterns. Virtual system patterns typically contain a virtual machine hosting Linux-, Windows-, or AIX-based images, on top of which the middleware or other software is installed. Additional configuration is then done using script packages, which can bundle additional files that are loaded into the virtual machine and then executed. The virtual image hosting the DataPower appliance is different. It is not based on a general purpose operating system, and thus cannot host additional scripts. In other words, you cannot inject script packages into it using the virtual system pattern editor. All additional configuration after the virtual appliance has been deployed and started has to happen externally. The approach we recommend for hosting script packages that can be executed against virtual DataPower appliances is to deploy a regular Linux VM, with all the appropriate script packages included and set to execute "when I initiate it…" This "DataPower control" VM can either coexist in the same pattern with the appliances, or it can be in its own pattern and be deployed separately. It can then be used to control any virtual appliance deployed in the system. Figure 3 shows an example for such a control VM. It includes several script packages, all of which are executed on demand, and which address specific administrative functions that you can execute on the targeted virtual appliance. The interface we use for the remote administration is the DataPower XML Management Interface. This interface uses SOAP over HTTP to access the appliance. The default port for the XML Management interface is 5550, even though you can set it to a different value during the deployment of the virtual appliance. In order to connect to this port, you have to update the firewall rules on the control VM to allow outgoing traffic. The "DataPower – Open firewall port" script handles this. It contains the following line: The As mentioned above, the configuration approach we use is based on DataPower's XML Management interface. This means our scripts all must build a SOAP envelope that is appropriate for the request we want to send. In this article, we will show you a sample collection of different script packages, all of which follow the same basic structure. This makes it easier for you to create scripts for your own purposes. Let's take a look at the "DataPower – Create Domain" script package (this as well as other scripts and patterns introduced in this article are found in the Download section of this article). It requires a set of parameters to be set on its execution, as shown in Figure 4. The first parameter asks for the IP address of the DataPower appliance that the request will be sent to. In the context of this article, we expect this to be a virtual appliance deployed in a PureApplication System, but it can actually be any physical DataPower appliance, too, as long as its IP address and port are reachable. To find the IP address of the target appliance, simply open the Virtual System Instance view in the PureApplication System console, find the pattern instance with the appliance you want to configure, and expand the Virtual Machines section to find the network interface, as shown in Figure 5. The second parameter is the port number, and 5550 is the default. The next parameters ask for the user ID and password to be used to authenticate with the appliance. Finally, the last parameter lets you enter the name of the new domain that is created. Note that all of the script packages we use for this article have the same set of parameters at the beginning, namely IP address of the target appliance, as well as port number, user ID, and password. The script itself is a shell script that simply calls a generic Python program named "dpManage.py". This Python program uses a generic argument parser to read the passed arguments and delegates all request specific processing to another Python program identified by the "request" parameter. For example, the "Create Domain" script package contains a "createDomain.py" file that reads in the "NEW_DOMAIN" parameter and sets up the basic SOAP message that is sent to the appliance, as shown in Listing 1. You can create your own script package for any required admin function following the same approach as shown here, namely by using the dpManage.py program augmented by a request specific module for specific parameters and setting up the SOAP request message. Creating the connection to the target appliance as well as sending the request message is handled by dpManage.py for all requests. Besides executing these configuration scripts via the PureApplication System console, you can also invoke the script packages in an automated way using the Command Line Interface or CLI. You can use either the CLI can in an interactive mode, or by passing in a Python program that executes the desired function. Do not confuse this CLI with DataPower's own CLI. In this case, you issue commands to PureApplication System to launch the script package defined above. You are not interacting with DataPower's CLI. Listing 2 shows an example Python program that executes the "Create Domain" script package via the CLI. Note that the script package parameters are now inserted as parameters into the Python module. To invoke this module, you use the CLI client program, passing in the appropriate parameters as follows: Replace the user ID and password values as required for your environment. You can use the same type of program for all the script packages for DataPower configuration, with minor adjustment to the parameter list, of course. So far in this article, we have assumed that you want to deploy and configure a single virtual DataPower appliance. In a real test or, even more so, a production environment, you will want to deploy multiple appliances for load balancing and high availability. Given that we can reuse all of the techniques we have described already, you will see how easy it is to set up a fully clustered and load balanced set of virtual appliances using the DataPower Application Optimization (AO) feature! As explained earlier, the non-production images have all of the licensed add-on features enabled except for the Tibco integration feature. Production images, however, require that you install the licensed features that you have purchased. You can install licensed features into the DataPower appliance using the "boot image" DataPower CLI command, or you can install them automatically as part of a script package using the XML Management interface. You must reboot the appliance after a feature is installed. An example script package is provided with this article to install a licensed feature. The script called "Install Feature" in Figure 3 downloads a "scrypt4" from a provided URL, base64 encodes it, sends the encoded scrypt4 to the appliance, and then uses it to upgrade the appliance. There is also a script for rebooting the appliance called "Reboot", which is a required operation before you can use the AO feature You can use the AO feature by creating a virtual system pattern that contains more than one appliance. In this example, we will assume that you want to deploy two appliances, so that there is a backup in case one of them fails. However, keep in mind that you can easily deploy more than two appliances, and you simply configure them to all be part of the same standby group. Figure 6 shows such a simple pattern, with two appliances, both having their extra NICs removed. Next, you have to configure them to be part of the same standby group. When running in this mode, the appliances support two functions: This ensures that the address (in our example, 9.5.84.136) is no longer available to be assigned to a virtual machine, so that it can be used as the VIP for our DataPower standby group. In both cases, record the IP addresses that you have made available, because you will have to define it when configuring the standby group. To configure the virtual appliances to form a standby control group, use the same mechanism as before for the basic configuration: execute a script package that exists on the "DataPower Control VM". The script package is named "Set Standby Control" and its parameter list looks like what is shown in Figure 9. Besides defining the target for the configuration, such as the DataPower appliance that will contain the standby definition, you define the following parameters: Additional definitions are available on the interface, for example the algorithm used to distribute incoming traffic. In our example script, we have hard-coded this to "Round Robin". Note that you have to run this script package against every appliance that you want to be added to the standby control group. Whether these appliances are part of the same pattern instance or not is not relevant for this. In the DataPower admin console, the completed standby definition looks like Figure 10. Once you have configured all DataPower appliances that you want to be part of the same standby group, traffic can be directed to the virtual IP address shared by all of them. This traffic is distributed automatically across all members of the group. If one of the appliances has a failure, the others automatically take over. This article introduced a new way of using the IBM WebSphere DataPower appliance, namely running it as a virtual appliance within PureApplication System. This virtual appliance supports the same set of functionality you get with the physical appliance, just in a different form factor. Moreover, its support for PureApplication System lets you include DataPower appliances in virtual system patterns, which means you can automate its install, configuration, and integration with other parts of your infrastructure. We have shown you some examples of how you can automatically configure your virtual appliance using script packages that use DataPower's XML Management interface. The script packages are hosted on a separate "control" virtual machine that can execute admin requests against any virtual DataPower appliance deployed on the system. Finally, we described how to create a highly available topology containing more than one appliance. Multiple appliances are logically joined together by using the Application Optimization feature, which provides functions to create a cluster of self-balancing appliances that support automatic failover in case an appliance fails. Note that all of the introduced patterns and script examples are available to download with this article. The authors would like to thank Andrew Grohman for reviewing this article and for providing a Python script that calls the DataPower XML Management Interface.Introduction
DataPower background
PureApplication System background
A secure appliance
Requirements
Importing the image

Deploying a simple pattern
DataPower into the search box. Select the DataPower part by clicking it and then drag it onto the palette on the right side of the browser. This adds the DataPower part to your pattern. As shown in Figure 2, the DataPower part has two public NICs, in addition to the two base NICs provided for all images. This gives you four total NICs: one private NIC for PureApplication management and three public NICs for use in traditional DataPower management and data plane traffic. 
https://<ip address>:<port>. You can find the IP address of the deployed instance by expanding the details section of the Instance view. The port is "9090" unless you changed it to a non-default value during deployment.Adding a script package to upgrade and configure
The "DataPower Control VM" pattern

/sbin/iptables -I OUTPUT 6 -p tcp --dport $DP_ADMIN_PORT -j ACCEPT
$DP_ADMIN_PORT variable is defined on execution of the script and is set to 5550 by default. This script must be run before any other DataPower configuration can occur, which is why its execution mode is set to "at virtual system creation and when I initiate it".Configuration script packages for DataPower


from string import Template def add_arguments(parser): parser.add_argument('--newdomain',required=True) def get_request(args): template = Template('''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <dp:request xmlns:dp="http://www.datapower.com/schemas/management"> <dp:set-config> <Domain name="${NEWDOMAIN}"> <NeighborDomain class="Domain">default</NeighborDomain> </Domain> </dp:set-config> </dp:request> </soapenv:Body> </soapenv:Envelope>''') return template.substitute(NEWDOMAIN=args.newdomain) Automated configuration using the PureApplication CLI
import argparse # parse arguments parser = argparse.ArgumentParser(description='Process a DataPower XML Management request.') parser.add_argument('--username',required=True) parser.add_argument('--password',required=True) parser.add_argument('--dp_host',required=True) parser.add_argument('--dp_port',required=True) parser.add_argument('--dp_username',required=True) parser.add_argument('--dp_password',required=True) parser.add_argument('--dp_new_domain',required=True) args = parser.parse_args() # select target VM and script package vsp_name = 'DataPower - Control VM' vsp_instance_index = 0 vm_index = 0 script_index = 0 # set up script parameter keys dp_host_key = 'DP_HOST' dp_port_key = 'DP_PORT' dp_username_key = 'DP_USERNAME' dp_password_key = 'DP_PASSWORD' dp_new_domain_key = 'NEW_DOMAIN' # execute script vm = deployer.virtualsystems[vsp_name][vsp_instance_index]. virtualmachines[vm_index] script = vm.scripts[script_index] script_parms = {dp_host_key : args.dp_host, dp_port_key : args.dp_port, dp_username_key : args.dp_username, dp_password_key : args.dp_password, dp_new_domain_key : args.dp_new_domain} parms = {'script': script, 'username' : args.username, 'password' : args.password, 'parameters' : script_parms} vm.executeScript(parms) \pure.cli\bin\pure -h 172.18.104.32 -u someuser -p somepassword -f createDomainCLI.py --username root --password nnn --dp_host 172.17.109.116 --dp_port 5550 --dp_username admin --dp_password mmm --dp_new_domain test99
Making your pattern high availability ready

Establishing a virtual IP address


Defining a standby group


Conclusion
Acknowledgements
Was this topic helpful?
Document Information
Modified date:
08 June 2021
UID
ibm11109649