Originally posted by: unixgrl
We have our wpar creation scripted. It asks for wparname and IP, then
makes a new volume group with the same name as the wpar. Then it creates
the volumes needed within that volume group. It also creates a config file that will have the correct paths to the filesystems.
The nice thing about doing it with a script is that we can add logic to find free disks, make sure mount points exist etc. When you create a config file first, you can then use "mkwpar -f configfile".
Following is a snippet of a script:
mkvg -f -y ${VGNAME} ${DISK}
mklv -y ${WPARNAME}root -t jfs2 ${VGNAME} 5
mklv -y ${WPARNAME}tmp -t jfs2 ${VGNAME} 5
mklv -y ${WPARNAME}home -t jfs2 ${VGNAME} 5
mklv -y ${WPARNAME}var -t jfs2 ${VGNAME} 5
-
Create wpar configuration file.
##
echo "general:" > /tmp/wparconfig.$$
echo " name=${WPARNAME}" >> /tmp/wparconfig.$$
echo " directory = /wpars/${WPARNAME}" >> /tmp/wparconfig.$$
echo " hostname = ${WPARNAME}" >> /tmp/wparconfig.$$
echo " devices = /etc/wpars/devexports" >> /tmp/wparconfig.$$
echo " vg = ${VGNAME}" >> /tmp/wparconfig.$$
echo " copy_nameres = yes" >> /tmp/wparconfig.$$
echo "network:" >> /tmp/wparconfig.$$
echo " interface=${WPARNIC}" >> /tmp/wparconfig.$$
echo " address=${WPARIP}" >> /tmp/wparconfig.$$
echo " netmask=${WPARMASK}" >> /tmp/wparconfig.$$
echo "" >> /tmp/wparconfig.$$
echo "mount:" >> /tmp/wparconfig.$$
echo " vfs = jfs2" >> /tmp/wparconfig.$$
echo " directory = /" >> /tmp/wparconfig.$$
echo " dev = /dev/${WPARNAME}root" >> /tmp/wparconfig.$$
echo " logname = INLINE" >> /tmp/wparconfig.$$