![]() | Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition | ||
|
|
![]() |
||||||||||||||
Solution Type Technical Instruction Sure Solution 2041460.1 : Oracle SuperCluster - An Example of Creating Application Zones
An Example Of Creating Application Zones using SSC_EXAVM on an Oracle M7 SuperCluster In this Document
Applies to:Oracle SuperCluster M7 Hardware - Version All Versions and laterSPARC GoalCreate an application zone on SuperCluster Solution
This tool is driven by a file named ZONE_INFO. The file is assumed to be in the current working directory. It contains a line for each zone. The lines have the following blank delimited fields:
Field 1: zonename (must match either the management hostname or the hostname of the client interface)
Field 2:10_gig_name (client hostname)
Field 3: 10_gig_ip (client ip address)
Field 4: 10_gig_netmask (255.255.2 55.0 for example)
Field 5: mgmt_name (management hostname)
Field 6: mgmt_ip (if 0 no management network connection will be implemented)
Field 7:mgmt_netrmask (255.255.254.0 for example)
Field 8: storage_name (hostname of the storage IB connection)
Field 9: storage_ip (storage IB network IP address)
Field 10: storage_netmask (255.255.252.0 for example)
Field 11: size_LUN_GB (size of rpool in gigabytes)
Field 12:NUMBER_OF_CORES (if zero no cpu pool will be created)
Field 1 3: VLAN_ID (Vlan id , if zero no vlan will be created)
Field 14: DB_IB_NAME (hostname of Exa IB (0xFFFF) IB partition)
Field 15: DB_IB_IP (EXA IB ip address, if 0 no EXA IB connection will be created)
Field 16: DB_IB_NETMASK (255.255.252.0 for example)
Sample entries
rcwtest1 rcwtest1-ioclient 10.250.91.218 255.255.254.0 rcwtest1 10.250.93.68 255.255.252.0 rcwtest2-stor 192.168.33.34 255.255.252.0 200G 1 390 rcwtest1-ib 192.168.9.26 255.255.252.0 rcwtest2 rcwtest2-ioclient 10.250.91.219 255.255.254.0 rcwtest2 10.250.93.60 255.255.252.0 rcwtest2-stor 192.168.33.35 255.255.252.0 200G 1 390 rcwtest1-ib 192.168.9.27 255.255.252.0
The first parameter passed to the script is the zonename. The second optional parameter indicates whether batch mode will be used. If the second parameter is script, then batch mode is used. So "./zone_creation_v12_vlan.ksh rcwtest1" is interactive and "./zone_creation_v12_vlan.ksh rcwtest1 script" is batch.
!/usr/bin/ksh
# updated 02/28/2018
# 20180228: Added VLAN support # 20171117: Changed how TIMEZONE is determined. Was not working properly when # Continent/City was used. At least for Toronto # 20171117: Corrected test for "script" to work properly IF not included in # command line # 20171005: Added opportuniity to run without prompts (SWeiberle) # arg2 must be "script" to be non-interactive # 20171003: Added VLAN FIELD so this will work in IO Domains with VLANs (SWeiberle) # 20171218: Added DB IB
ZONE_BASE=$(pwd) # The location of the control FILES
The following controls the interaction:
function r_continue
{ response="N" while [ "${response}" != "Y" ] do # If the second passed parameter is _script, then run in batch mode. if [ "_$SCRIPT" == "_script" ] then print "Non-interactive mode, you have 5 seconds to enter control-c before script will proceed." sleep 5 response="Y" else print " " print "Shall WE Continue (Y to r_continue) break out(^C) to exit" print " " read response fi done }
Parameter check
clear
if [ $# -lt 1 ] ; then print "Usage: zone_creation.ksh 'zone name' ['script']" exit fi ZONENAME=$1
SCRIPT=$2 if [ "_$2" != "_script" ] then SCRIPT="" print "Running in interactive mode" else print "Running in non-interactive mode, make note of errors, and control-c out during 5 second sleep" fi
print "======= Creating zone ," ${ZONENAME} r_continue print "======= Control FILES ZONE_INFO are in " ${ZONE_BASE}
################### Validate CONFIGURATION ###########################3
if [ ! -e ${ZONE_BASE}/ZONE_INFO ] ; then
print "======= ${ZONE_BASE}/ZONE_INFO does not exist " exit fi
############ ZONE_INFO format
#zonename 10_gig_name 10_gig_ip 10_gig_netmask(xxx.xxx.xxx.xxx) mgmt_name mgmt_ip mgmt_netmask storage_IF storage_IF_ip storage_netmask SIZE(in GB for rpool) Number_of_cores_for_resource_pool VLAN_ID_10_gig DB_IB_NAME DB_IB_IP DB_IB_netmask ##################################################################### # 10 gig client network
GIG_NAME=$(nawk -v Z=${ZONENAME} '$1 == Z {print $2 }' ${ZONE_BASE}/ZONE_INFO )
GIG=$(nawk -v Z=${ZONENAME} '$1 == Z {print $3 }' ${ZONE_BASE}/ZONE_INFO ) TENGIG_NETMASK_BITS=$(nawk -v Z=${ZONENAME} '$1 == Z {print $4 }' ${ZONE_BASE}/ZONE_INFO )
# Management/admin network
MGMT_NAME=$(nawk -v Z=${ZONENAME} '$1 == Z {print $5 }' ${ZONE_BASE}/ZONE_INFO )
MGMT=$(nawk -v Z=${ZONENAME} '$1 == Z {print $6 }' ${ZONE_BASE}/ZONE_INFO ) MGMT_NETMASK=$(nawk -v Z=${ZONENAME} '$1 == Z {print $7 }' ${ZONE_BASE}/ZONE_INFO )
#storage network
IB_NAME=$(nawk -v Z=${ZONENAME} '$1 == Z {print $8 }' ${ZONE_BASE}/ZONE_INFO )
IB=$(nawk -v Z=${ZONENAME} '$1 == Z {print $9 }' ${ZONE_BASE}/ZONE_INFO ) IB_NETMASK=$(nawk -v Z=${ZONENAME} '$1 == Z {print $10 }' ${ZONE_BASE}/ZONE_INFO )
Storage and CPU Pool
ROOT_SIZE=$(nawk -v Z=${ZONENAME} '$1 == Z {print $11 }' ${ZONE_BASE}/ZONE_INFO )
N_CORES=$(nawk -v Z=${ZONENAME} '$1 == Z {print $12 }' ${ZONE_BASE}/ZONE_INFO )
VLAN info
VLAN_ID=$(nawk -v Z=${ZONENAME} '$1 == Z {print $13 }' ${ZONE_BASE}/ZONE_INFO )
#IB DB network
IBDB_NAME=$(nawk -v Z=${ZONENAME} '$1 == Z {print $14 }' ${ZONE_BASE}/ZONE_INFO )
IBDB=$(nawk -v Z=${ZONENAME} '$1 == Z {print $15 }' ${ZONE_BASE}/ZONE_INFO ) IBDB_NETMASK=$(nawk -v Z=${ZONENAME} '$1 == Z {print $16 }' ${ZONE_BASE}/ZONE_INFO )
Review data
print "======= 10 GIG = " $GIG_NAME, $GIG, $TENGIG_NETMASK_BITS print "======= VLAN ID on 10GbE network = " $VLAN_ID
The zonename must match a network hostname
if [ "${ZONENAME}" != "${MGMT_NAME}" -a "${ZONENAME}" != "${GIG_NAME}" ]; then
print "!!!!! ERROR ZONENAME MUST MATCH either management name or 10 GIG name" exit 1 fi r_continue
#################### creating xml
print "======= Creating zone xml"
#Here we pull the dns from SMF on the domain.
j=$(svcprop svc:/network/dns/client:default | nawk ' $1 == "config/nameserver" {for (i = 3; i<= NF; i=i+1)print $i}'| sed -e 's/ //g')
NAMESERVERS=$(print $j | sed -e 's/ /,/g') print ' <DNSSERVERS>'${NAMESERVERS}'</DNSSERVERS>' >> $ZONENAME.xml
#Extract default router from netstat
ROUTE=$(netstat -rn | nawk ' $1 == "default" {print $2}')
print ' <DEFAULTGW>'${ROUTE}'</DEFAULTGW>' >> $ZONENAME.xml
#Extract domainname
DOMAIN=$(svcprop svc:/network/dns/client:default | nawk ' $1 == "config/domain" {print $3}') print ' <NODETYPE>app</NODETYPE>' >> $ZONENAME.xml
#Extract NTP server and timezone
NTP=$(nawk ' $1 == "server" {print $2}' /etc/inet/ntp.conf)
#Management network
if [ "${MGMT}" != "0" ] ; then IPMP=$(ipadm | grep -c scm_ipmp0)
#Client network
IPMP=$(ipadm | grep -c sc_ipmp0) print ' <NETMASK>'${TENGIG_NETMASK_BITS}'</NETMASK>' >> $ZONENAME.xml
#Storage network
print ' <NETWORK>' >> $ZONENAME.xml
print ' <id>c0_'${ZONENAME}'_stor</id>' >> $ZONENAME.xml STOR_GW=$(netstat -rn | nawk ' $6 == "stor_ipmp0" {print $2}') print ' <GATEWAY>'${STOR_GW}'</GATEWAY>' >> $ZONENAME.xml print ' <INTERFACENAME>stor_ipmp0</INTERFACENAME>' >> $ZONENAME.xml print ' <NETWORKPKEY>8503</NETWORKPKEY>' >> $ZONENAME.xml print ' <IPADDRESS>'${IB}'</IPADDRESS>' >> $ZONENAME.xml print ' <NETMASK>'${IB_NETMASK}'</NETMASK>' >> $ZONENAME.xml print ' <NETWORKHOST>'${IB_NAME}'</NETWORKHOST>' >> $ZONENAME.xml print ' <NETWORKNAME>private</NETWORKNAME>' >> $ZONENAME.xml print ' <NETWORKTYPE>IB</NETWORKTYPE>' >> $ZONENAME.xml print ' <NETWORKVERSION>1.0</NETWORKVERSION>' >> $ZONENAME.xml print ' <SLAVES> </SLAVES>' >> $ZONENAME.xml print ' </NETWORK>' >> $ZONENAME.xml
#Private IB network
if [ "${IBDB}" != "0" ] ; then
print ' <NETWORK>' >> $ZONENAME.xml print ' <id>c0_'${ZONENAME}'_priv</id>' >> $ZONENAME.xml print ' <GATEWAY></GATEWAY>' >> $ZONENAME.xml print ' <INTERFACENAME>bondib0</INTERFACENAME>' >> $ZONENAME.xml print ' <IPADDRESS>'${IBDB}'</IPADDRESS>' >> $ZONENAME.xml print ' <NETMASK>'${IBDB_NETMASK}'</NETMASK>' >> $ZONENAME.xml print ' <NETWORKHOST>'${ZONENAME}'-priv1</NETWORKHOST>' >> $ZONENAME.xml print ' <NETWORKNAME>private</NETWORKNAME>' >> $ZONENAME.xml print ' <NETWORKTYPE>IB</NETWORKTYPE>' >> $ZONENAME.xml print ' <NETWORKVERSION>1.0</NETWORKVERSION>' >> $ZONENAME.xml print ' <SLAVES> </SLAVES>' >> $ZONENAME.xml print ' </NETWORK>' >> $ZONENAME.xml print ' </NETWORKS>' >> $ZONENAME.xml fi
#Size of root pool
print ' <SPACE>' >> $ZONENAME.xml print ' <STORAGEBASE>'${ZONENAME}'</STORAGEBASE>' >> $ZONENAME.xml
#Configure CPU Pool
if [ "${N_CORES}" != "0" ] ; then
fi # End of Use new file conditional
r_continue print "About to edit #${ZONENAME}.xml to check for correctness"
###################### end of creating xml, examine with vi if not batch
if [ "_$SCRIPT" == "_script" ] r_continue print "About to run ssc_exavm"
###################### end of creating xml, run ssc_exavm
/opt/oracle.supercluster/zonetools/ssc_exavm/ssc_exavm -create -xml $(pwd)/$ZONENAME.xml r_continue
#################### zone customization
print "======= Customizing zone " r_continue
########################### install some useful utilities and enable nfs client services
zlogin ${ZONENAME} pkg install pkg://solaris/system/locale r_continue
##################### end of customization
The sample script is in the attachments. For your convenience select prior versions of the tool are also attached.
Attachments This solution has no attachment |
||||||||||||||
|