Thursday May 07, 2009
Automated Install using Virtual Box
These are the notes I wrote while setting up an AI server test bed using Virtual Box. The configuration consists of two Virtual Box clients running on a single host.
The host must have at least 4gb RAM. I configured each client with 1gb of RAM. One of the Virtual Machines acts as the AI server the other as the client. The one acting as the server is configured with two network interfaces, one NAT and one on a Virtual Box internal network. The Virtual Machine to act as the install client is configured with only one network interface on the same Virtual Box internal network as the server.
http://dlc.sun.com/osol/docs/content/2008.11/AIinstall/gentextid-140.html http://www.opensolaris.org/os/project/caiman/auto_install/AI_install_server_setup.html Information on Virtual Box can be found at: http://www.virtualbox.org/
One Virtual Box VM for the AI server. - I used host name "ais": - Network adapter configuration: Adapter 1: Intel PRO/1000 MT Desktop (NAT) Adapter 2: Intel PRO/1000 MT Desktop (internal network, 'AI') - 1024mb RAM One Virtual Box VM for the AI server. One for an AI client (aic) with: - I used host name "aic": - Network adapter configuration: Adapter 1: Intel PRO/1000 MT Desktop (internal network, 'AI') - 1024mb RAM
A: Install OSOL For instructions on installing OSOL look here: http://opensolaris.org/os/newbies/ B: Install and confirm the needed Auto Installer packages on AI server
Set the package publisher accordingly for the desired version.
Note The pkg subcommand has changed from using the term authority to publisher in version 2009.06. If using an older version one may need to use the command pkg set-authority where pkg set-publisher is used in the examples.
% pkg set-publisher -O http://pkg.opensolaris.org/dev \ opensolaris.org OR % pkg set-publisher -O http://ipkg.sfbay/dev opensolaris.org Install the needed packages % pkg install SUNWinstalladm-tools Confirm the needed packages have been installed % pkg list | cat > ./pkg_list.out % grep SUNWdhcs ./pkg_list.out % grep SUNWdhcm ./pkg_list.out % grep SUNWtftp ./pkg_list.out % grep SUNWapch22 ./pkg_list.out % grep SUNWdsd ./pkg_list.out % grep SUNWsqlite3 ./pkg_list.out % grep SUNWpysqlite ./pkg_list.out % grep SUNWpython-cherrypy ./pkg_list.out % grep SUNWpython-lxml ./pkg_list.out C: Configure the AI server Configure /etc/hosts Setup the host name of the AI install server and the clients to be installed in the /etc/hosts file. % tail -10 /etc/hosts # #::1 ais ais.local localhost loghost #127.0.0.1 ais ais.local localhost loghost 10.0.2.15 ais ais.local 192.168.168.100 ais_private ais_private.local 192.168.168.151 client1 192.168.168.152 client2 192.168.168.153 client3 192.168.168.154 client4 192.168.168.155 client5 Configure DNS and router information Ensure that /etc/resolv.conf is populated with correct DNS information on the server e.g.: % cat /etc/resolv.conf domain East.Sun.COM nameserver 10.0.2.3 Ensure that your name service is DNS Do this by checking /etc/nsswitch.conf. It should have dns for hosts and IP nodes. % grep ^hosts /etc/nsswitch.conf % grep ^ipnodes /etc/nsswitch.conf Ensure that the DNS client SMF service /network/dns/client:default is enabled. % svcs | grep dns\/client online 12:44:41 svc:/network/dns/client:default Ensure the default router is set. % netstat -rn | grep default default 10.0.2.2 UG 1 40 e1000g0 % echo 10.0.2.2 > /etc/defaultrouter
Because the AI cliet is on the Virtual Box Internal Network it can not access the Internet, which it will need to do in order to download IPS packages. However because the AI server has an external interface and also an interface on the Virtual Box Internal Network it can be configured to act as a NAT for the AI client. [1] configure the interfaces I let DHCP configure the external NIC1 (e1000g0) * NIC1 (e1000g0) using NAT % touch /etc/dhcp.e1000g0 % echo "" > /etc/hostname.e1000g0 I assign an address to the internal network. (ais_private was added to /etc/hosts above) * NIC2 (e1000g1) using Internal Network % rm /etc/dhcp.e1000g1 % echo ais_private > /etc/hostname.e1000g1 Make sure netmasks is correct for the external, 10., network and the internal 192.168 network: % tail /etc/netmasks 10.0.0.0 255.255.255.0 192.168.168.0 255.255.255.0 [2] enable packet forwarding % routeadm -e ipv4-forwarding % routeadm -u % routeadm [3] configure NAT % echo "map e1000g0 192.168.168.0/24 -> 0/32" > \ /etc/ipf/ipnat.conf Where: e1000g0 - public netowrk interface 192.168.50.0/24 - address of private net [4] enable packet filtering/NAT % svcadm enable network/ipfilter
I used the latest development image available internally to Sun But externally from Sun the image are available at: http://www.opensolaris.com/get/index.jsp The command I used to get the latest Sun internal development image: % /usr/sfw/bin/wget \ ftp://nana.sfbay/products/osol_0906/111/osol-0906-111-ai-x86.iso &
The dhcp-server manifest is not being imported when the dhcp packages are being installed. So it must be done manually. % svccfg import /var/svc/manifest/network/dhcp-server.xml
Create an install service by running 'installadm create-service' as follows: % installadm create-service -n svcAI \ -i 192.168.168.151 \ -c 5 \ -s /var/tmp/ISO_IMAGES/osol-0906-111-ai-x86.iso \ /server/images/osol-0906-111-ai The above command will do the following things - Create a net image at /server/images/osol-0906-111-ai using the AI image passed in the option -s - Start a install service with the name 'svcAI'. - Create a DHCP server, setup a macro and setup 5 addresses starting from 192.168.168.151 - Create the necessary bootfile and lofimounts, web server links for the client to boot
For more information see the section "How to change or replace the default manifest?" here:
http://www.opensolaris.org/os/project/caiman/auto_install/AI_manifest_setup.html
What I did is as follows:
1. Copy the default manifest from the target image path associated with the service. The target imagepath associated with a service can be determined with the following command:
svccfg -s :/system/install/server:default listprop AI<svcname>/image_path
For example:% svccfg -s :/system/install/server:default listprop AIsvcAI/image_path
AIsvcAI/image_path astring /export/aiserver/svcAI
In the above example, svc1's imagepath is /export/aiserver/svc1. The default manifest located in this imagepath is at: /export/aiserver/svcAI/auto_install/default.xml
Note: Only services created with 2009.06 images will contain the a default.xml manifest file in the imagepath. For services created with older images, you can use the default.xml manifest located on the server located at: /usr/share/auto_install/default.xml
2. The <ai_manifest name> tag in your manifest copy must keep the value of “default”.
3. Revise the <ai_embedded_manifest> and <sc_embedded_manifest> sections of your copy as needed.
e.g. To change the pkg publisher
% cp /export/aiserver/svcAI/auto_install/default.xml /var/tmp
vim /var/tmp/default.xml
I change the pkg publisher to use the Sun internal development one.
% grep ipkg /var/tmp/default.xml
<main url="http://ipkg.sfbay/dev" authname="opensolaris.org"/>
4. Use the installadm add command to replace the default manifest for an existing service with your copy as follows:
# /usr/sbin/installadm add -m manifest_file -n svc_name
Where manifest_file is the name of your manifest copy and svc_name is the name of the service. The installadm add command validates your manifest before replacing the default manifest.
For Example:
# /usr/sbin/installadm add -m /var/tmp/default.xml -n svcAI
browse to URL: http://localhost:5555/ . If it is not running start the apache web server. /usr/apache2/2.2/bin/apachectl \ -f /var/installadm/ai-webserver/ai-httpd.conf \ -k start
% /usr/sadm/admin/bin/dhcpmgr & This command starts a GUI. Using the GUI confirm: In macro dhcp_macro_svcAI: "BootSrvA" is set to the ais_privet address: 192.168.168.100 In macro 192.168.168.0 "router" is set to ais_privet address: 192.168.168.100 Restart the DHCP server if needed % svcadm restart dhcp-server:default
% /usr/bin/svcs | grep tftp
Configure the Virtual Box AI Client Virtual Machine to boot from the network and boot it. (Virtual Machine preferences/advance/boot set it to network) This will install the default configuration. For setting up different manifests other than the default refer to Automated Installer Manifests.
Enable ssh: Enable ssh to allow more windows, besides the console, to track progress. % /lib/svc/method/sshd -c % svcadm enable ssh Monitor the log files: % tail -f /tmp/install_log % tail -f /tmp/ai_sd_log % tail -f /var/svc/log/application-auto-installer\:default.log To monitor progress I suggest monitoring this log file during installation: % /var/svc/log/application-auto-installer\:default.log
The VirtualBox Client is configured to boot from the network. This must be reconfigured to boot from the installed virtual disk. - shutdown - Change VB settings for AI Client to boot from hard disk - Start VB AI client
Posted at 10:55AM May 07, 2009 by Joseph Vlcek in Personal | Comments[1]
wholesale jordans shoes in http://www.wholesalejordans23.com/index.asp or http://www.wholesalejordan23.com
Posted by tonychen on May 07, 2009 at 11:59 PM EDT #