Monday 7 September 2015

Using OpenStack for Solaris project HEAT to deploy Oracle VM Templates for Weblogic 12.1.3


This post explains how OpenStack for Solaris can use HEAT (YAML or HOT ) Templates to create complex topologies of connected and configured guest VMs running WebLogic Server using pre-assembled Oracle VM Templates based on the OVF specification.


HEAT is the OpenStack orchestration facility, it enables complex topologies of guest virtual machines to be automatically created and configured by cloud-users. HEAT templates are described in YAML or JSON format and will deploy images from the OpenStack Glance repository. In our case the "image" is a specially prepared Solaris VM Template for zones i.e. a Solaris unified archive.

The Oracle VM Template for WebLogic 12.1.3 (unified archive) for solaris zones is an OVF based VM Template that contains a fully installed but not yet configured installation of Solaris 11.2 and WebLogic Server 12c. The benefits of using this VM Template with HEAT include  simplification of the creation of the HOT templates and simplified configuration of the resulting VMs. Much of the simplification results from the Oracle WebLogic server installation and configuration being done up-front inside the WebLogic VM Template by Oracle rather than at deploy time by the end-user.  You can read much more about the Oracle VM Templates for WebLogic by looking at the readme instructions on the downloads page

 

Starting Point

These instructions assume that  OpenStack for Solaris Juno (SPARC) is installed and running and  OpenStack project HEAT is also configured.
Instructions for installing and configuring OpenStack are available as part of Solaris 11.3  see:- Installing and Configuring OpenStack in Oracle Solaris 11.3

Refer to section #7 of the above instructions for installation and configuration of HEAT.

Following the example in the above documents,  to test the HEAT setup, login to the OpenStack dashboard as the heat admin user "admin" and then select Orchestration -> Stacks. An empty list may appear but if things are configured correctly no errors should be displayed.

OpenStack Juno Meta Data Service Setup :

For generic OpenStack instructions metadata installation see:
http://docs.openstack.org/juno/install-guide/install/apt/content/neutron-network-node.html

OpenStack for Solaris Meta Data Service Setup specifics

l3_agent.ini
[default]
    enable_metadata_proxy = True

/etc/nova/nova.conf
[neutron]
    service_metadata_proxy=True
    metadata_proxy_shared_secret=True

# export METADATA_SHARED_SECRET = `/usr/bin/openssl rand -hex 10`

/etc/neutron/metadata_agent.ini
[default]
    auth_url = http://$CONTROLLER_ADM_NODE:5000/v2.0
    admin_tenant_name = service
    admin_user = neutron
    admin_password = servicepw
    nova_metadata_ip = $CONTROLLER_ADM_NODE
    metadata_proxy_shared_secret=$METADATA_SHARED_SECRET

enable or restart the OpenStack for Solaris services

svcadm enable -rs neutron/neutron-metadata-agent:default
svcadm enable -rs nova/nova-api-metadata:default
svcadm enable -rs neutron/neutron-l3-agent:default

to test this deploy a guest vm (solaris zone) and then login to the guest as root and execute  : -
# curl http://169.254.169.254/openstack/2013-10-17/user_data

Deploy Oracle WebLogic 12c VM Templates from a HEAT (HOT)  template 

Download and import the WebLogic 12c  Template (.uar) into OpenStack Glance
E.g. download http://download.oracle.com/otn/vm/solaris/weblogic-12c-solaris-11_2-sparc-uar.zip


As the root user logged into the $CONTROLLER_ADM_NODE
# mkdir /tmp/templates
# cd /tmp/templates
# unzip weblogic-12c-solaris-11_2-sparc-uar.zip
# ls 
  weblogic-12c-solaris-11_2-sparc-uar.uar
  weblogic-12c-solaris-11_2-sparc-uar.zip

# export OS_USERNAME=glance
# export OS_PASSWORD=your service password 
# export OS_TENANT_NAME=service
# export OS_AUTH_URL=http://controller:5000/v2.0

# glance image-create --name wls12c --container-format bare --disk-format zfs \
--file /tmp/templates/weblogic-12c-solaris-11_2-sparc-uar.uar --is-public True --property architecture=sparc64  --property hypervisor_type=solariszones \
--property vm_mode=solariszones --progress
Note that as an alternative to the above glance image-create command the OpenStack dashboard can be used.  Login to Horizon as admin user "admin" , make sure you are using the "demo" project and click Compute->Images->+Create Image and use the settings above to import the  weblogic-12c-solaris-11_2-sparc-uar.uar as wls12c.

Launch a HEAT Stack 

There are a number of ways to launch HEAT stacks and provide configuration input. The instructions below use the OpenStack dashboard to paste the template directly into an input field and launch.

The OpenStack HOT template source is included below.  When launched this HOT Template deploys the WebLogic 12c VM Template twice,  to create a WebLogic Admin Server guest VM and a WebLogic Machine guest VM.  The WebLogic Machine guest VM runs an instance of  WebLogic NodeManager that is automatically  registered back to the admin server
  •  Cut and paste the HOT template listed below to your local machine.
  •  Edit the template and provide details for the items in blue i.e.
    • ADMIN_PASSWORD 
    • network 
    • You might need to adjust the "flavor"  also indicated in blue.  Note that currently the WebLogic 12c Template has been released to OTN for Solaris 11.2 and for Solaris native zones. This example used the installed default flavor of Solaris Native Zone, 1VCPU,2GB Ram, 10GB Disk
  • In Horizon click Orchestration -> Stacks -> +Launch Stack
  • Select Template Source. Select direct input and then cut-n-paste your edited HOT template into the text input box that is displayed. 
  • Click Next (if you get errors after clicking next examine your HOT template and keep in mind that indentation is important)
  • Enter a Stack Name e.g. mywls
  • Click Rollback on failure
  • Enter a password for the user i.e. the admin user password
  • Click Launch. Stack creation should now start.
VM Creation in progress
  • When the stack has finished building, assign a floating IP to the Admin Server VM
    •  In Horizon click  Compute -> Instances.  Associate a floating IP with the wls-admin guest VM using the arrow in the Actions box.




2 Guest VMs running after successful launch of HOT template, admin server with floating-IP

Accessing the WebLogic Instances 

The WebLogic Admin Server should now be accessible via the floating IP and port 7001, so browse to (for example) http://192.168.56.13:7001/console and login with the username weblogic and the password set in the edit HOT Template for  ADMIN_PASSWORD.


To check that the NodeManager is running on the second guest VM and has been registered in Admin Server    In the browser on the left hand side under the heading of Domain Structure select the + alongside of environment to expand -> select machines .  You should see a list of machines which now includes wlsmachine1-m3 displayed.  To check that this is running click on the machine name i.e. click on wls-machine1-m then select monitoring tab. If you get a status of “reachable” then the machine is deployed correctly with NodeManager running and is ready to have WebLogic servers started and WebLogic clusters configured. 



For instructions on creating WebLogic clusters and for deploying applications to the clusters please see the readme on the Oracle VM Templates page.

The HEAT (HOT) Template in YAML format


heat_template_version: 2013-05-23

description: >
  Oracle WebLogic 12.1.3 Multi Server Topology

resources:
    wls-admin:
      type: OS::Nova::Server
      properties:
        networks:
          - port: { get_resource: admin_port }
        name: wls-admin
        image:  wls12c
        flavor: 6
        user_data_format: RAW
        user_data: |
          ADMIN_PASSWORD=your admin server password
          STARTMODE=ADMINSERVER

    wls-machine1:
      type: OS::Nova::Server
      properties:
        name: wls-machine1
        image:  wls12c
        flavor: 6
        networks:
          - port: { get_resource: machine1_port }
        user_data_format: RAW
        user_data:
          str_replace:
            template: |   
              ADMIN_PASSWORD=your admin-server password
              STARTMODE=MACHINE
              ADMINSERVER_IP=$ADMINSERVER_IP
            params:
              $ADMINSERVER_IP: {get_attr: [wls-admin, first_address] }

    admin_port:
      type: OS::Neutron::Port
      properties:
        network: your internal network name
        name: admin_port

    machine1_port:
      type: OS::Neutron::Port
      properties:
        network: your internal network name
        name: machine1_port

outputs:
  admin_server_instance_name:
    description: Name of the instance
    value: { get_attr: [wls-admin, name] }
  admin_server_instance_ip:
    description: IP address of the instance
    value: { get_attr: [wls-admin, first_address] }





1 comment:

  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Oracle Solaris, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Oracle Solaris. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us:
    Name : Arunkumar U
    Email : arun@maxmunus.com
    Skype id: training_maxmunus
    Contact No.-+91-9738507310
    Company Website –http://www.maxmunus.com


    ReplyDelete