In the blog entry "Exalogic Virtual Tea Break Snippets - Create Assets Evolution" I described how the our asset / asssembley creation scripts had evolved to Python as a processing language and JSON as a file format. As part of that blog I briefly described the assembly configuration section and how it defines scripts that can be executed on the previously created vServers. Within this blog I intend to provide a Cookbook for using the new functionality to install and configure a simple OTD / WLS installation consisting of 3 OTD vServers and 3 WLS vServers linked over the Infiniband network. All scripts associated with the process can be found in Exalogic A-Team Tools folder (/exalogic-att) on the downloadable PythonUtilityTemplate and with some simple tweaks you should be able to build your own test environment.
On completion of the Create Assembly process we will have created and configured the following:
If the script requires parameter to be passed these are provided in the parameters array. On the command line call to execute the script the CreateAssembly.py will prefix the name of each parameter with a double minus, i.e. --, and hence the command call generated from the above JSON would be:
As can be seen from the above example the parameters can be one of two types:
It can be seen that we initially call the "CommonAddIpToHosts.sh" script to add the IP addresses of the vServers that will run the Managed Servers to the hosts file. Then we will mount ZFS shares that will be required for the WLS installation using the "WLSMountShares.sh". At this point we are ready to execute the "WLSInstall.sh" to install WLS and we will pass the silent install configuration file "silent.xml" to be used by the install script. Having completed the install we can create/configure the domains using "WLSCreateDomain.sh" and finally set it to auto start using "WLSConfigureDomainAutoStart.sh". At this point we have installed WLS, created an Admin server and 2 Managed servers (WLSCreateDomain.sh will do this) with all product / domain information stored on the ZFS shares.
Again we can see we add the IPs to the hosts file but then we simply need to mount the ZFS shares before configuring the Auto start.
Overview
Within this blog we will be using the /exalogic-att/examples/json/ExalogicAssembly.json file as a definition of our Assembly. Viewing the JSON you will see that we create the following:- Assets:
-
- Networks:
-
- vNetOTD - IPoIB Network for the OTD vServers
- vNetWLS - IPoIB Network for the WLS Servers and communication from the OTD Servers
- Templates
-
- OTDTestTemplate - Simple template for the OTD Servers
- WLSTestTemplate - Simple template for the WLS Servers
- Distribution Groups:
-
- dgOTD - Distribution Group for the OTD Servers
- dgWLS - Distribution Group for the WLS Servers
- Assemblies:
-
- vServers
-
- OTD
-
- otdAdminServer
- otdNode1
- otdNode2
- WLS
-
- wlsAdminServer
- wlsManagedServer1
- wlsManagedServer2
On completion of the Create Assembly process we will have created and configured the following:
Assumptions
The JSON file makes the following assumptions:- The ZFS has the following Projects / Shares
- otd
-
- installer
- instances
- product
- wls
-
- installer
- instances
- product
- The installers for the OTD and WLS existing in the appropriate directory.
- ZFS has been configured with the appropriate NFS Exceptions.
What's in /exalogic-att
[root@EATTUtilityServer /]# tree exalogic-att/ exalogic-att/ |-- automation | |-- ScriptTemplate.sh | |-- bin | | |-- CommonAddIpToHosts.sh | | |-- OTDCreateAdminNode.sh | | |-- OTDCreateAdminServer.sh | | |-- OTDCreateConfiguration.sh | | |-- OTDCreateFailoverGroup.sh | | |-- OTDInstall.sh | | |-- OTDMountShares.sh | | |-- OTDStartFailoverGroup.sh | | |-- WLSConfigureDomainAutoStart.sh | | |-- WLSCreateDomain.sh | | |-- WLSInstall.sh | | |-- WLSMountShares.sh | | |-- el-auto.tgz | | `-- silent.xml | `-- lib | `-- README |-- bin | |-- CaptureVServer.sh | |-- CompareAssemblies.sh | |-- ConvertRunningVServerToTemplate.sh | |-- ConvertVServerToTemplate.sh | |-- CreateAssembly.sh | |-- CreateDistributionGroup.sh | |-- CreateNetwork.sh | |-- CreateVServer.sh | |-- CreateVolume.sh | |-- ListAccounts.sh | |-- ListDistributionGroups.sh | |-- ListNetworks.sh | |-- ListTemplates.sh | |-- ListVServers.sh | |-- ListVolumes.sh | |-- ModifyLVMImg.sh | |-- MountSystemImg.sh | |-- SimpleExaCli.sh | |-- SimplePythonExaCli.sh | `-- UploadTemplate.sh |-- build | `-- BuildPython3.sh |-- examples | `-- json | |-- ExalogicAssembly.json | |-- ExalogicAssemblyResizeEchoBaseTemplate.json | `-- ExampleAssemblyTemplate.json |-- lib | |-- CaptureVServer.py | |-- CompareAssemblies.py | |-- ConvertRunningVServerToTemplate.py | |-- ConvertVServerToTemplate.py | |-- CreateAssembly.py | |-- CreateDistributionGroup.py | |-- CreateNetwork.py | |-- CreateVServer.py | |-- CreateVolume.py | |-- ListAccounts.py | |-- ListDistributionGroups.py | |-- ListNetworks.py | |-- ListTemplates.py | |-- ListVServers.py | |-- ListVolumes.py | |-- SECCommon.py | |-- UnconfigureSystemImg.sh | `-- UploadTemplate.py
Download
JSON Configurations
We can see for the code snippet below that the JSON configurations consists of an array of vServer objects that define an array of scripts to be executed on the specified vServer sequentially as specified in the JSON. It should be noted that a vServer object can appear in the configurations array multiple times allowing for intervening processing to be executed on other vServers."configurations": [ { "vserver": "wlsAdminServer", "scripts": [ { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer1", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer2", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer2" } ] },For each script specified within the script array we define:
- name
- local
- parameters - Optional
- files - Optional
If the script requires parameter to be passed these are provided in the parameters array. On the command line call to execute the script the CreateAssembly.py will prefix the name of each parameter with a double minus, i.e. --, and hence the command call generated from the above JSON would be:
CommonAddIpToHosts.sh --ip <ip address> --hostname wlsManagedServer1
As can be seen from the above example the parameters can be one of two types:
- static
- reference
-
- network
-
- ip
WLS Installation / Configuration
To install and configure WLS in our environment we will need to execute the following steps:- WLS Admin Server
- Add IP Address of WLS vServer to the host files. - (CommonAddIpToHosts.sh)
- Mount the ZFS shared location. - (WLSMountShares.sh)
- Install WLS - (WLSInstall.sh)
- Create Domain - (WLSCreateDomain.sh)
- Configure Auto Start - (WLSConfigureDomainAutoStart.sh)
- Add IP Address of WLS vServer to the host files. - (CommonAddIpToHosts.sh)
- Each Managed Server
- Add IP Address of WLS vServer to the host files.
- Mount the ZFS shared location.
- Configure Auto Start
Admin Server
I have intentionally kept the automation scripts simple and so will call some multiple times. The JSON snippet below shows how we define the installation of the WLS Admin server."configurations": [ { "vserver": "wlsAdminServer", "scripts": [ { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer1", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer2", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsAdminServer", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/WLSMountShares.sh", "local": "true", "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "product-share", "type": "static", "value": "/export/wls/product" }, { "name": "instances-share", "type": "static", "value": "/export/wls/instances" } ] }, { "name": "/exalogic-att/automation/bin/WLSInstall.sh", "local": "true", "files": [ { "name": "/exalogic-att/automation/bin/silent.xml" } ], "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "install-share", "type": "static", "value": "/export/wls/installer" }, { "name": "silent-install", "type": "static", "value": "/tmp/silent.xml" } ] }, { "name": "/exalogic-att/automation/bin/WLSCreateDomain.sh", "local": "true", "files": [ { "name": "/exalogic-att/automation/bin/el-auto.tgz" } ], "parameters": [ { "name": "el-auto-tgz", "type": "static", "value": "/tmp/el-auto.tgz" } ] }, { "name": "/exalogic-att/automation/bin/WLSConfigureDomainAutoStart.sh", "local": "true", "parameters": [ { "name": "node-manager", "type": "static", "value": "wlsAdminServer_ndmgr" } ] } ] },
It can be seen that we initially call the "CommonAddIpToHosts.sh" script to add the IP addresses of the vServers that will run the Managed Servers to the hosts file. Then we will mount ZFS shares that will be required for the WLS installation using the "WLSMountShares.sh". At this point we are ready to execute the "WLSInstall.sh" to install WLS and we will pass the silent install configuration file "silent.xml" to be used by the install script. Having completed the install we can create/configure the domains using "WLSCreateDomain.sh" and finally set it to auto start using "WLSConfigureDomainAutoStart.sh". At this point we have installed WLS, created an Admin server and 2 Managed servers (WLSCreateDomain.sh will do this) with all product / domain information stored on the ZFS shares.
Managed Servers
Because the previous Admin Server install configured the WLS Domain on the ZFS shares the configuration of the Managed servers is quite simple as defined by the following JSON:{ "vserver": "wlsManagedServer1", "scripts": [ { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer1", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer2", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsAdminServer", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/WLSMountShares.sh", "local": "true", "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "product-share", "type": "static", "value": "/export/wls/product" }, { "name": "instances-share", "type": "static", "value": "/export/wls/instances" } ] }, { "name": "/exalogic-att/automation/bin/WLSConfigureDomainAutoStart.sh", "local": "true", "parameters": [ { "name": "node-manager", "type": "static", "value": "wlsManagedServer1_ndmgr" } ] } ] },
Again we can see we add the IPs to the hosts file but then we simply need to mount the ZFS shares before configuring the Auto start.
OTD Installation / Configuration
For the installation and configuration of the OTD System we will need to execute the following step:- OTD Admin Server
- Add OTD and WLS vServer IP Addresses to the Host File. - (CommonAddIpToHosts.sh)
- Mount the OTD ZFS Shares. - (OTDMountShares.sh)
- Install OTD. - (OTDInstall.sh)
- Create an Admin Server. - (OTDCreateAdminServer.sh)
- Add OTD and WLS vServer IP Addresses to the Host File. - (CommonAddIpToHosts.sh)
- For both OTD Admin Nodes
- Add OTD and WLS vServer IP Addresses to the Host File. - (CommonAddIpToHosts.sh)
- Mount the OTD ZFS Shares. - (OTDMountShares.sh)
- Create Admin Node. - (OTDCreateAdminNode.sh)
- OTD Admin Server
- Create Configuration. - (OTDCreateConfiguration.sh)
- Create Failover Group. - (OTDCreateFailoverGroup.sh)
- For both OTD Admin Nodes
- Start Failover Group. - (OTDStartFailoverGroup.sh)
- Start Failover Group. - (OTDStartFailoverGroup.sh)
{ "vserver": "otdAdminServer", "scripts": [ { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer1", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer2", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsAdminServer", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdNode1", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdNode1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdNode2", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdNode2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdAdminServer", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/OTDMountShares.sh", "local": "true", "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "product-share", "type": "static", "value": "/export/otd/product" }, { "name": "instances-share", "type": "static", "value": "/export/otd/instances" } ] }, { "name": "/exalogic-att/automation/bin/OTDInstall.sh", "local": "true", "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "install-share", "type": "static", "value": "/export/otd/installer" } ] }, { "name": "/exalogic-att/automation/bin/OTDCreateAdminServer.sh", "local": "true" } ] }, { "vserver": "otdNode1", "scripts": [ { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer1", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer2", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsAdminServer", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdNode2", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdNode2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdNode1", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdNode1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdAdminServer", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/OTDMountShares.sh", "local": "true", "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "product-share", "type": "static", "value": "/export/otd/product" }, { "name": "instances-share", "type": "static", "value": "/export/otd/instances" } ] }, { "name": "/exalogic-att/automation/bin/OTDCreateAdminNode.sh", "local": "true", "parameters": [ { "name": "admin-host", "type": "static", "value": "otdAdminServer" }, { "name": "node-name", "type": "static", "value": "otdNode1" } ] } ] }, { "vserver": "otdNode2", "scripts": [ { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer1", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsManagedServer2", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsManagedServer2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "wlsAdminServer", "network": "vNetWLS", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "wlsAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdNode1", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdNode1" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdNode2", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdNode2" } ] }, { "name": "/exalogic-att/automation/bin/CommonAddIpToHosts.sh", "local": "true", "parameters": [ { "name": "ip", "type": "reference", "vserver": "otdAdminServer", "network": "vNetOTD", "attribute": "ip" }, { "name": "hostname", "type": "static", "value": "otdAdminServer" } ] }, { "name": "/exalogic-att/automation/bin/OTDMountShares.sh", "local": "true", "parameters": [ { "name": "zfs-ip", "type": "static", "value": "172.17.0.5" }, { "name": "product-share", "type": "static", "value": "/export/otd/product" }, { "name": "instances-share", "type": "static", "value": "/export/otd/instances" } ] }, { "name": "/exalogic-att/automation/bin/OTDCreateAdminNode.sh", "local": "true", "parameters": [ { "name": "admin-host", "type": "static", "value": "otdAdminServer" }, { "name": "node-name", "type": "static", "value": "otdNode2" } ] } ] }, { "vserver": "otdAdminServer", "comment": "Second set of configurations for the otdAdminServer following the creation of the OTS Admin Nodes", "scripts": [ { "name": "/exalogic-att/automation/bin/OTDCreateConfiguration.sh", "local": "true", "parameters": [ { "name": "admin-host", "type": "static", "value": "otdAdminServer" }, { "name": "server-name", "type": "static", "value": "otdAdminServer" }, { "name": "config-name", "type": "static", "value": "A-Team_Config" }, { "name": "listener-port", "type": "static", "value": "8080" }, { "name": "origin-server", "type": "static", "value": "wlsManagedServer1:8080,wlsManagedServer2:8080" }, { "name": "admin-nodes", "type": "static", "value": "otdNode1,otdNode2" } ] }, { "name": "/exalogic-att/automation/bin/OTDCreateFailoverGroup.sh", "local": "true", "parameters": [ { "name": "admin-host", "type": "static", "value": "otdAdminServer" }, { "name": "virtual-ip", "type": "static", "value": "10.128.36.205" }, { "name": "config-name", "type": "static", "value": "A-Team_Config" }, { "name": "cidr", "type": "static", "value": "24" }, { "name": "router-id", "type": "static", "value": "255" }, { "name": "primary-node", "type": "static", "value": "otdNode1" }, { "name": "backup-node", "type": "static", "value": "otdNode2" } ] } ] }, { "vserver": "otdNode1", "comment": "Second set of configurations for the otdNode following the creation of the failover group", "scripts": [ { "name": "/exalogic-att/automation/bin/OTDStartFailoverGroup.sh", "local": "true", "parameters": [ { "name": "config-name", "type": "static", "value": "A-Team_Config" } ] } ] }, { "vserver": "otdNode2", "comment": "Second set of configurations for the otdNode following the creation of the failover group", "scripts": [ { "name": "/exalogic-att/automation/bin/OTDStartFailoverGroup.sh", "local": "true", "parameters": [ { "name": "config-name", "type": "static", "value": "A-Team_Config" } ] } ] }
No comments:
Post a Comment