Freigeben über


Running Micro Focus Enterprise Server 4.0 in a Docker Container in Azure

A few months ago I posted a blog about how to setup Micro Focus Enterprise Server 4.0 and Enterprise Developer 4.0 in Azure.  There was a follow up to that blog outlining how to configure and deploy the BankDemo application that comes with Enterprise Developer.  I'd like to continue in this Micro Focus vein by outlining how to run Micro Focus Enterprise Server in a Docker Container.

New to Micro Focus Enterprise Server 4.0 is the ability to run in a Docker container.  The benefits of running Enterprise Server in Docker are centered around portability, performance, agility and isolation.   For instance, a Docker image can be exported from one Windows VM to another or from another repository, and imported into another Windows server (assuming Docker support is installed there).  It can then be run in the same way without having to install Enterprise Server because it is a part of the image (licensing considerations do still apply).  For the purposes of this blog, I have decided to show how to set this up using the Windows 2016 Datacenter with Containers VM which is available from the Azure Marketplace. The nice thing about this offering is that Docker 18.09.0 is already preinstalled and ready to go.  All we will need to do is deploy the container, run it and then connect to it with a 3270 emulator.  At the end of this post, you will effectively be running a Mainframe application in a container.

Let's get started.

First a note about the media and licensing

In order to complete this walk through, you will need to have access to the Micro Focus media.  This is available for Micro Focus customers and potential customers via a trial.  If you have access to Enterprise Server 4.0 or Enterprise Developer 4.0, you should have access to the accompanying Docker Support files.  If you do not have access, you can go here to get the process started.

There are two sets of demonstrations available: one set for Enterprise Server and another for Enterprise Developer.  Within these two sets, there are demonstrations for Windows based platforms and SUSE Linux. For this blog you are going to walk through the Windows CICS acctdemo demonstration for Enterprise Server. The accompanying files are in a zip file named: ent_server_dockerfiles_4.0_windows.zip.   There is an accompanying licensing file with a name similiar to ES-Docker-Prod-XXXXXXXX.mflic that will be necessary in order to build the Docker images.  Once you have secured the media and the appropriate licensing file, you can begin.

 

  1. Create the VM - The first thing we will need to do is create the VM in Azure via the Azure Portal.  As I mentioned before, we are going to use the Windows Server 2016 Datacenter - with Container VM which is available in the Azure Marketplace.  If you select Create Resource from the top left of the Portal and then filter by "Docker" and then select Windows Server 2016, you can select the VM.

 

Next, you will need to configure the properties for the VM.  The Windows Server with Containers VM is only available in certain VM sizes.  I chose a Standard DS2_v2 with 2 vcpus and 7GB of memory.  You will also need to select the Region and Resource Group you would like to deploy to.  We do not need any Availability options for this walk through.  You will need to input the Username you would like to use for the Administrator Account as well as the Password.  Finally make sure port 3389 RDP is open.  This is the only port you need to publicly expose.  You will need it to log into the VM.  After this you can accept all of the default values and click Review+ Create.

 

 

The deployment could take a couple of minutes.  When it is complete you will be presented with a message stating your VM has been created with a link to Go to Resource.  Click this and you will be taken to the Overview blade for your VM.  In the right pane, you will see a Connect button.  Click this and you will see the Connect to virtual machine dialog pop up on the right.  Click on the Download RDP File button.  This will download the RDP file that will allow you to attach to the VM.  After the file has finished downloading, open it and type in the Username and Password you created for the VM.  Make sure you are not using your corporate credentials to log on since the RDP client will assume you may want to use these.  You do not.  Select More Choices and you will be able to select your VM credentials.  After this, you will be logged into the VM.

2. Create Sandbox Directory and Upload the zip File - Now that we have the machine running and attached via RDP, create a Sandbox Directory and upload the ent_server_dockerfiles_4.0_windows.zip and the ES-Docker-Prod-XXXXXXXX.mflic to that directory.  Extract the zip file contents to the ent_server_dockerfiles_4.0_windows directory (the extract will create this for you).  Inside this directory, you will have a README html and txt file (two versions of the same thing).  You will also have 2 directories EnterpriseServer and Examples.

VERY IMPORTANT - Make sure you copy the licensing file ES-Docker-Prod-XXXXXXXX.mflic to the C:\Sandbox\ent_server_dockerfiles_4.0_windows\EnterpriseServer directory and the C:\Sandbox\ent_server_dockerfiles_4.0_windows\Examples\CICS.  As I mentioned before, these are necessary for the Docker build step to make sure the images are properly licensed.

3. Check Docker Version and Create Base Image - Very Important:  Creating the appropriate Docker image you need to use is a 2 step process.  First you will need to create the Enterprise Server 4.0 Base image.  After this is complete you will create another image for the x64 platform.  You also have the option to create a x86 (32 bit) image, but since you are running this in Azure, you will need the 64 bit image.  In order to do this, open a Command Prompt.

  • Check that Docker is installed.  At the command prompt, type docker version.  You should see a return similar to the image below.  At the time of  this post, the version is 18.09.0.  This lets us know that Docker is installed.

  • Next, we will need to switch to the C:\Sandbox\ent_server_dockerfiles_4.0_windows\EnterpriseServer .  
    • Type cd\Sandbox\ent_server_dockerfiles_4.0_windows\EnterpriseServer
    • Next type bld.bat IacceptEULA at the prompt.  This will kick off the build process for the initial base image.  This will take a few minutes to run.  When it is done, you will see a return like the following.  Notice the two images that have been created (one for x64 and x86).

 

  • Now we need to switch to the CICS example director and create the final image for the CICS demonstration.
    • Type cd\Sandbox\ent_server_dockerfiles_4.0_windows\Examples\CICS to switch to the CICS directory.
    • Now you need to create the image.  Type bld.bat x64.   Again, this will run for a few minutes.  When it is done, you should see a message stating that the image was created.
    • To confirm this, type docker images.  You will see a list of all of the Docker images installed on the VM. Make sure microfocus/es-acctdemo is one of them.

  • Now lets run the image.  This will launch Enterprise Server 4.0 and the acctdemo application.
    • At the command prompt type docker run -p 16002:86/tcp -p 16002:86/udp -p 9040-9050:9040-9050 -p 9000-9010:9000-9010 -ti --network="nat" --rm microfocus/es-acctdemo:win_4.0_x64.   Now the image is running and we can can attach to it via a 3270 emulator via port 9040.  For this walk though I used x3270, but you can use whichever one you prefer.  Go ahead and install the emulator.
    • Next we will need to get the ip address of the acctdemo container.  Docker acts as a DHCP Server for the Containers is manages.
      • First, we need to get the ID of the running Container.  Type Docker ps at the command prompt and note the ID.  You will need this to get the IP address for the acctdemo Container.  In this example it is 22a0fe3159d0.
      • To get the ip address type docker inspect 22a0fe3159d0 --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" .  You should be presented with the ip address for the acctdemo image like in the image below.

  • Now let's mount the image using the emulator.  Configure the emulator to use the address of the acctdemo image and port 9040.  For this walk though it would be 172.19.202.52:9040.  Yours's will be similiar. You should be presented by a CICS logon screen like the one below.

  • Now you need to logon to the CICS Region.  You can do this by entering SYSAD for the USERID and SYSAD for the Password.
  • Next you need to clear the screen.  You can find this on the keymap of the emulator you are using.  For x3270 select the Keymap menu option.
  • To launch the acctdemo application type ACCT.  You should see the initial screen for the application.

 

  • If you type D for the Request and 11111 for the ACCOUNT, you be taken to some fictional account information.  Other account numbers to try are 22222, 33333....

 

  • Finally, to administer the Enterprise Server, type start http:172.19.202.52:86 from a command prompt.  This will bring up the Enterprise Server Administration console.

 

Summary

Now you are running and managing a CICS application in a Docker Container.  Hopefully this was interesting.  In the future we will explore leveraging Kubernetes in Azure (AKS) for orchestrating and managing the containers.