Project

General

Profile

Solaris Unattended installation » History » Version 28

David M., 03/15/2012 08:45 AM

1 1 Romain Vrignaud
h1. Solaris Unattended installation
2
3 27 David M.
There are two ways of getting started with installing solaris via foreman. 
4
An more or less automatic setup of everything using a script, or
5
the good old manual way.
6
7
The script for automatic setup currently only works on linux (Tested with RHEL 6, but should also work on other distris as well) and only with ISOs for Solaris 10 (tested with x86 and sparc).
8
9
If you want to use the manual way, scroll down a bit.
10
I recommend to read the manual way even if you using the script, as there might be some useful
11
hints, if automatic setup fails or doesnt seem to work.
12 28 David M.
(At least take a look at the troubleshooting part at the end of the page!)
13 27 David M.
14
15
h2. Automatic Setup of Solaris media
16
17
Currently the script isn't shipped with foreman, but you can find it "here":http://www.case-of.org/~maniac/foreman/import_solaris_disk.sh
18
19
Using the script is pretty simple. You can either just run it (ensure you are using BASH).
20
If you are lazy (like me), you can pass the name of the Solaris ISO file as first parameter.
21
22
Then just answer the questions you get asked. The part in square-brackets is the default. 
23
It gets used if you just press enter.
24
25
When the script is completed you may have to add the HWModel to Foreman (More->Hardware Model) (basically on SPARC). 
26
27
28
29
h2. Manual setup of Solaris media
30
31
32 4 Oliver Weinmann
h2. Installation Media
33 27 David M.
34 1 Romain Vrignaud
35 11 Oliver Weinmann
First you have to identify the release name of you Solaris install media. To do this check the disc label on your Solaris DVD. 
36
37
<pre>
38
SOL_10_811_SPARC = hw0811
39
</pre>
40
41
I recommend to create a structure to hold more than just one Solaris install media like the following:
42
43
<pre>
44
/Solaris
45
/Solaris/install
46
/Solaris/images
47
/Solaris/jumpstart
48
</pre>
49
50 10 Oliver Weinmann
h3. Linux:
51 1 Romain Vrignaud
52 11 Oliver Weinmann
Copy the contents of the Solaris 10 Install DVD to the local install directory.
53 10 Oliver Weinmann
54 17 Oliver Weinmann
h3. Sparc:
55
56 10 Oliver Weinmann
<pre>
57 11 Oliver Weinmann
cp -r /media/dvd /Solaris/install/Solaris_5.10_sparc_hw0811
58 17 Oliver Weinmann
</pre>
59
60
h3. i386:
61
62
<pre>
63
cp -r /media/dvd /Solaris/install/Solaris_5.10_i386_hw0811
64
</pre>
65
66
Create a link of Solaris_5.10_i386_hw0811 to Solaris_5.10_x86_64_hw0811.
67
68
<pre>
69
cd /Solaris/install
70
ln -s Solaris_5.10_i386_hw0811 Solaris_5.10_x86_64_hw0811
71 1 Romain Vrignaud
</pre>
72
73 12 Oliver Weinmann
Note that hw0811 is the release name that has to match your Solaris install media.
74 11 Oliver Weinmann
75 9 Oliver Weinmann
h3. Solaris:
76 4 Oliver Weinmann
77 1 Romain Vrignaud
Create a directory and run the following script from the Solaris 10 Installation DVD on a Solaris 8 / 10 machine:
78
79 4 Oliver Weinmann
<pre>
80 11 Oliver Weinmann
mkdir -p /Solaris/install/Solaris_5.10_sparc_hw0811
81 4 Oliver Weinmann
cd /cdrom/cdrom0/Solaris_10/Tools
82 11 Oliver Weinmann
./setup_install_server /Solaris/install/Solaris_5.10_sparc_hw0811
83 4 Oliver Weinmann
</pre>
84
85 3 Oliver Weinmann
A Solaris distribution should be declared in the same form as a Linux distribution. There should be an http based access URL, (the path variable,) so that the smart-proxy can
86
download the required components for the build. Currently this step has to be done manually. Simply copy the inetboot files to your tftp directory.
87
88 18 Oliver Weinmann
h3. Sparc
89
90 3 Oliver Weinmann
<pre>
91 4 Oliver Weinmann
cp /Solaris/install/Solaris_5.10_sparc_hw0811/Solaris_10/Tools/Boot/platform/sun4u/inetboot /var/lib/tftpboot/Solaris-5.10-hw0811-SUN4U-inetboot
92 3 Oliver Weinmann
</pre>
93 18 Oliver Weinmann
94
h3. i386
95 21 Oliver Weinmann
96 20 Oliver Weinmann
<pre>
97 22 Oliver Weinmann
cp /Solaris/install/Solaris_5.10_i386_hw0811/boot/grub/pxegrub /var/lib/tftpboot/Solaris-5.10-hw0811-pxegrub
98 20 Oliver Weinmann
</pre>
99 18 Oliver Weinmann
100 3 Oliver Weinmann
As the Solaris jumpstart process is performed via NFS rather than TFTP the distribution media must also be made available for
101 15 Oliver Weinmann
ReadOnly mounting on the clients.
102 1 Romain Vrignaud
103 13 Oliver Weinmann
h3. Linux:
104
105 2 Oliver Weinmann
<pre>
106 13 Oliver Weinmann
vi /etc/exports
107
"/Solaris" *(ro,async,no_root_squash,anonuid=0)
108
</pre>
109
110
h3. Solaris:
111
112
<pre>
113 1 Romain Vrignaud
share -F nfs -o ro,anon=0 /Solaris
114
echo "share -F nfs -o ro,anon=0 /Solaris" >> /etc/dfs/dfstab
115
</pre>
116 15 Oliver Weinmann
117
The fields describing this alternative access naming scheme are revealed on the Media page when a Solaris operating system is selected. The
118
Solaris build can proceed via a conventional package build, where the packages selected are the SUWNCreq minimal install, or a flash build. The flash archives are located under 
119
the distribution directory by default but can be located anywhere that can be accessed via NFS.
120 13 Oliver Weinmann
121
<pre>
122 2 Oliver Weinmann
Name: Solaris Install Media
123
124
Path: http://server/Solaris/install/Solaris_$major.$minor_$arch_$release
125
Media Path: server:/Solaris/install/Solaris_$major.$minor_$arch_$release
126 5 Oliver Weinmann
Config Path: server:/jumpstart
127 2 Oliver Weinmann
Image Path: server:/Solaris/images
128
</pre>
129
130 5 Oliver Weinmann
h2. Jumpstart files
131 1 Romain Vrignaud
132 24 David M.
The Solaris jumpstart process occurs in two phases; a diskless client is first booted and then in phase two, the host mounts its build media and configuration files from an NFS location and proceeds with the build. Foreman provides a skeleton configuration directory structure suitable for NFS mounting on the host. In this structure are files that are customised to forward configuration requests to the Foreman instance. This directory tree, located at .../foreman/extras/jumpstart, should be NFS shared to the subnet that contains any potential Solaris clients. Some customization of this directory tree may be required. 
133
134
h3. Customize dynamic_* scripts
135
136
An important step, as mentioned above, is to check if the dynamic_profile and dynamic_finish scripts fits your needs.
137
If your foreman host is not called "foreman" in DNS or is not reachable on port 80, you have to change the value of the "foreman" variable.
138
139
dynamic_profile (line #15):
140
<pre>
141
perl -p -i -e "s/hosts:.*/hosts: files dns/" /tmp/root/etc/nsswitch.conf
142
# and then download our configuration from foreman
143
foreman="foreman"
144
./curl.$arch -s http://$foreman/unattended/provision > ${SI_PROFILE}
145
</pre>
146
147
dynamic_finish (line #4):
148
<pre>
149
arch=`uname -p`
150
foreman=foreman
151
# We load the finish script into the logs directory so as to leave a record
152
./curl.$arch -s http://$foreman/unattended/finish > /a/var/sadm/system/logs/puppet.postinstall
153
</pre>
154
155
156
See [[Solaris_jumpstart_directory]] for more details
157 7 Oliver Weinmann
158 23 Oliver Weinmann
The files are read in the following order:
159
160
1. server:/jumpstart/rules.ok
161
2. server:/jumpstart/dynamic_profile
162
3. Foreman -> Provision template: Jumpstart Default
163
4. server:/jumpstart/dynamic_finish
164
5. Foreman -> Provision template: Jumpstart Default Finish
165
166 7 Oliver Weinmann
h3. Linux:
167
168 1 Romain Vrignaud
<pre>
169 16 Oliver Weinmann
cp -r /usr/share/foreman/extras/jumpstart /Solaris/jumpstart
170 7 Oliver Weinmann
vi /etc/exports
171 12 Oliver Weinmann
"/Solaris/jumpstart" *(ro,async,no_root_squash,anonuid=0)
172 7 Oliver Weinmann
</pre>
173
174 1 Romain Vrignaud
h3. Solaris:
175
<pre>
176 16 Oliver Weinmann
cp -r /usr/share/foreman/extras/jumpstart /Solaris/jumpstart
177 7 Oliver Weinmann
share -F nfs -o ro,anon=0 /jumpstart
178 13 Oliver Weinmann
echo "share -F nfs -o ro,anon=0 /jumpstart" >> /etc/dfs/dfstab
179 7 Oliver Weinmann
</pre>
180 1 Romain Vrignaud
181 5 Oliver Weinmann
h2. Edit Model
182
183
You need to setup a model for each Solaris Sparc host that you want to deploy.
184
185
<pre>
186
Name: Sun Ultra 10
187
Hardware Model: SUN4U
188
Vendor Class: Ultra-5_10
189
</pre>
190
191 1 Romain Vrignaud
h2. Model consolidation
192
193 5 Oliver Weinmann
When Foreman imports a host that has not been configured and built by Foreman it will attempt to determine the model of that machine by analyzing the facts that are associated with the host. This can often result in many badly named models all referring to what should be a single manufacturers model. A rake task has been provided that attempts to consolidate all these duplicate malformed names into a single sensible model together with the appropriate Solaris vendor class and Solaris hardware model. See [[models_consolidate|rake models::consolidate]]
194 25 David M.
195 26 Oliver Weinmann
h2. Starting deployment
196
197
After setting up a new host in foreman start your Intel Solaris machine and boot from PXE. On Sparc machines press STOP+a during bootup and enter the following:
198
199
boot net:dhcp - install
200
201 25 David M.
h1. Troubleshooting
202
203
h2. The installer doesnt load the jumpstart template
204
205
If you get an error about an empty jumpstart-template or something like "'<!DOCTYPE' invalid...", you have to fix your default_finish and default_profile scripts.
206
207
Remove this from default_profile:
208
<pre>
209
# and then download our configuration from foreman
210
foreman="foreman"
211
./curl.$arch -s http://$foreman/unattended/provision > ${SI_PROFILE}
212
</pre>
213
And add this instead:
214
<pre>
215
foreman="your.foreman.host:port"
216
ipaddress=`ifconfig -a | grep -v ether | grep -v zone | grep -v groupname | grep -v flags= | grep -v 0.0.0.0 | grep -v 127.0.0. | awk '{print $2}' | tail -1`
217
218
./curl.$arch -s http://$foreman/unattended/provision?spoof=$ipaddress > ${SI_PROFILE}
219
</pre>
220
221
Remove this from default_finish:
222
<pre>
223
foreman=foreman
224
# We load the finish script into the logs directory so as to leave a record
225
./curl.$arch -s http://$foreman/unattended/finish > /a/var/sadm/system/logs/puppet.postinstall
226
</pre>
227
and add this instead:
228
<pre>
229
foreman="your.foreman.host:port"
230
ipaddress=`ifconfig -a | grep -v ether | grep -v zone | grep -v groupname | grep -v flags= | grep -v 0.0.0.0 | grep -v 127.0.0. | awk '{print $2}' | tail -1`
231
232
./curl.$arch -s http://$foreman/unattended/finish?spoof=$ipaddress > /a/var/sadm/system/logs/puppet.postinstall
233
</pre>
234
235
Dont forget to replace the 'foreman="your.foreman.host:port'" with your foreman host.