基于AutoYaST自动化安装SuSE实践
基于AutoYaST自动化安装SuSE实践
前言
在金融行业中我所接触的操作系统主要是AIX和SLES(SuSE Linux Enterprise Server),也许大家平时用得更多是CentOS,虽然有部分差异但原理都是相通的,SMIT和YaST也是灰常实用的功能,推荐大家有机会尝试体验下。因为网上关于SuSE自动化部署的参考文章较少,这套自动化部署方案已经被验证并在生产系统使用了1年半,配置相对成熟和稳定。遵循Don't Repeat Yourself原则,本文主要介绍基于AutoYaST实现半自动化SuSE定制光盘和PXE网络全自动化安装SuSE的实践过程,如需了解更加详细的参数说明可以参考扩展阅读中的SuSE官网。
AutoYaST是自动化部署SuSE的黄金搭档
更新历史
2015年05月28日 - 初稿
阅读原文 - http://wsgzao.github.io/post/autoyast/
扩展阅读
SuSE - https://www.suse.com/zh-cn/ AutoYaST - http://doc.opensuse.org/projects/autoyast/SuSE自动安装光盘
定制版本
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 2
下载地址 - https://www.suse.com/zh-cn/download-linux/
AutoYast简介
AutoYast是SuSE Linux的自动安装工具。通过AutoYast,在DHCP、TFTP、PXE服务的支持下,通过FTP、NFS等网络安装源可以实现SuSE Linux的完全无人值守自动安装。但是,这种方式必须建立独立的服务器且客户端支持PXE网络启动,在现场没有网络或者系统不支持客户端网卡的场景下不适合,通过AutoYast制作的SuSE Linux一键安装光盘可以满足上述场景。本文主要介绍SuSE Linux Enterprise Server 11(简称SLES11)一键安装光盘的制作, 其他SuSE Linux仅供参考。
生成AutoYaST配置文件
AutoYast配置成功后,生成一个名为autoinst.xml的XML配置文件,SuSE Linux通过这个文件控制操作系统的安装。AutoYast生成配置文件有3种方式:
1. 系统安装时自动生成
2. 系统安装后通过运行命令生成
3. 直接编辑生成(偷懒最佳姿势)
系统安装时生成配置文件
按照正常步骤安装SLES11,把必须的软件全部安装。运行到最后一步“安装已完成”,勾选“为AutoYast复制此系统”,系统开始克隆系统生成配置文件,并弹出提示窗口。生成配置文件用时约2分钟左右,生成的配置文件位于/root目录下。
运行命令生成或者修改配置文件
如果在系统安装时没有生成配置文件,可以运行命令生成。在系统中打开终端,以root用户运行命令yast2 autoyast,打开AutoYast配置窗口,选择“工具”->“创建参考配置文件”,弹出“创建参考控制文件”窗口。勾选需要配置的项目,如软件包选择、语言、分区、键盘布局、防火墙、网络设置等,AutoYast根据选择的项目从系统获取相关配置信息。选择“文件”->“保存”,弹出“另存为”窗口,输入文件名“autoinst.xml”,选择“保存”,系统提示文件保存到指定目录下。
有时我们需要对模块做些调整,比如磁盘分区、软件包等。以调整磁盘分区为例介绍配置文件的修改。
以root用户运行yast2 autoyast,打开AutoYast窗口,选择“文件”->“打开”,选择autoinst.xml文件,等系统读取配置后,在AutoYast窗口显示配置配件名称,修改后保存即可。
制作安装光盘
AutoYast配置文件生成后,可以开始制作一键安装光盘了。制作一键安装光盘需要用到SLES11的原安装光盘的数据。
#首先复制SLES11原安装光盘的数据到指定目录
mkdir /tmp/sles11
cp -R /media/S*/* /tmp/sles11
#复制autoinst.xml
cp /root/autoinst.xml /tmp/sles11
#编辑isolinux.cfg文件,找到# install所在位置
cd boot/x86_64/loader/
vi isolinux.cfg
# install
append initrd=initrd autoyast=file:///autoinst.xml splash=silent showopts
:x!
#运行mkisofs命令生成自动安装光盘
cd /tmp/sles11
mkisofs -R -o /tmp/SLES11-SP2-64-AUTO.iso -b boot/x86_64/loader/isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
我的配置文件
预设分区
名称 |
格式 |
大小 |
---|---|---|
swap |
swap |
16G |
boot |
ext3 |
120M |
LVM |
||
root |
ext3 |
5G |
usr |
ext3 |
10G |
var |
ext3 |
5G |
opt |
ext3 |
10G |
home |
ext3 |
15G |
tmp |
ext3 |
10G |
总计 |
71G |
预装软件包
KDE Desktop Environment
Oracle Server Base
C/C++ Compiler and Tools
nmap
java-1_6_0
libstdc++43-devel-32bit
预设语言
主要:英语
添加:中文
预设用户名/密码
root/如果你直接复用我的配置文件请私信我获取密码
预设网络配置
禁用服务:防火墙,IPv6
autoinst.xml
fd0
/dev/fd0
hd0
/dev/sda
true
true
SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27
true
/boot/message
3
8
mptspi
ata_piix
ata_generic
grub
resume=/dev/sda1 splash=silent showopts
/boot/vmlinuz-3.0.13-0.27-default
1
/boot/initrd-3.0.13-0.27-default
0
SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27
linux
/dev/system/root
image
0x317
showopts ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe
/boot/vmlinuz-3.0.13-0.27-default
/boot/initrd-3.0.13-0.27-default
1
Failsafe -- SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27
failsafe
/dev/system/root
image
0x317
1
/dev/fd0
2
Floppy
true
floppy
other
YaST_Default_CA
YaST Default CA (site)
CN
ENTER PASSWORD HERE
postmaster@site
true
false
no
no
no
any eth0
no
yes
no
no
nf_conntrack_netbios_ns
no
yes
no
yes
no
no
no
false
false
false
none
true
true
true
true
false
true
true
100
x
users
true
19
x
floppy
true
1
x
bin
daemon
true
41
x
xok
true
65533
x
nobody
true
43
x
modem
true
5
x
tty
true
7
x
lp
true
104
!
uuidd
true
51
!
postfix
true
115
!
gdm
true
65534
x
nogroup
nobody
true
107
!
oinstall
true
101
!
messagebus
true
59
!
maildrop
true
33
x
video
true
3
x
sys
true
15
x
shadow
true
20
x
cdrom
true
21
x
console
true
42
x
trusted
true
102
!
haldaemon
true
106
!
puppet
true
16
x
dialout
true
110
!
polkituser
true
10
x
wheel
true
112
!
pulse
true
8
x
www
true
40
x
games
true
6
x
disk
true
17
x
audio
pulse
true
114
!
suse-ncc
true
49
x
ftp
true
103
!
tape
true
25
!
at
true
9
x
kmem
true
32
x
public
true
0
x
root
true
12
x
mail
true
2
x
daemon
true
105
!
sfcb
root
true
111
!
ntp
true
14
x
uucp
true
113
!
pulse-access
true
108
!
dba
oracle
true
71
!
ntadmin
true
62
x
man
true
109
!
mysql
true
22
x
utmp
true
13
x
news
true
65
!
sshd
127.0.0.1
localhost
::1
localhost ipv6-localhost ipv6-loopback
addr:127.0.0.1
n n
fe00::0
ipv6-localnet
ff00::0
ipv6-mcastprefix
ff02::1
ipv6-allnodes
ff02::2
ipv6-allrouters
ff02::3
ipv6-allhosts
1.0
false
128M-:64M
false
yes
compressed
0
64
yes
5
auto
file:///var/crash
3
english-us
en_US
zh_CN,en_US
false
false
dc=example,dc=com
127.0.0.1
true
false
true
member
false
exop
false
false
false
AUTO
false
auto
dhcp
eth0
16
onboot
no
dhcp
eth1
16
onboot
no
false
false
auto
false
false
false
false
false
auto
127.127.1.0
################################################################################
## /etc/ntp.conf
##
## Sample NTP configuration file.
## See package 'ntp-doc' for documentation, Mini-HOWTO and FAQ.
## Copyright (c) 1998 S.u.S.E. GmbH Fuerth, Germany.
##
## Author: Michael Andres, <ma@suse.de>
## Michael Skibbe, <mskibbe@suse.de>
##
################################################################################
##
## Radio and modem clocks by convention have addresses in the
## form 127.127.t.u, where t is the clock type and u is a unit
## number in the range 0-3.
##
## Most of these clocks require support in the form of a
## serial port or special bus peripheral. The particular
## device is normally specified by adding a soft link
## /dev/device-u to the particular hardware device involved,
## where u correspond to the unit number above.
##
## Generic DCF77 clock on serial port (Conrad DCF77)
## Address: 127.127.8.u
## Serial Port: /dev/refclock-u
##
## (create soft link /dev/refclock-0 to the particular ttyS?)
##
# server 127.127.8.0 mode 5 prefer
##
## Undisciplined Local Clock. This is a fake driver intended for backup
## and when no outside source of synchronized time is available.
##
# local clock (LCL)
stratum 10
__clock
/var/lib/ntp/drift/ntp.drift
# LCL is unsynchronized
##
## Add external Servers using
## # rcntp addserver <yourserver>
##
##
## Miscellaneous stuff
##
driftfile
/var/log/ntp
# path for drift file
logfile
/etc/ntp.keys
# alternate log file
# logconfig =syncstatus + sysevents
# logconfig =all
# statsdir /tmp/ # directory for statistics files
# filegen peerstats file peerstats type day enable
# filegen loopstats file loopstats type day enable
# filegen clockstats file clockstats type day enable
#
# Authentication stuff
#
keys
1
# path for keys file
trustedkey
1
# define trusted keys
requestkey
false
true
/dev/sda
true
true
false
swap
130
true
defaults
false
swap
device
130
1
false
32G
true
false
ext3
131
true
acl,user_xattr
false
/boot
device
131
2
false
120M
true
false
ext3
142
false
false
system
device
142
3
false
max
CT_DISK
/dev/system
true
true
false
ext3
131
true
acl,user_xattr
false
home
/home
device
131
false
15G
true
false
ext3
131
true
acl,user_xattr
false
opt
/opt
device
131
false
10G
true
false
ext3
131
true
acl,user_xattr
false
root
/
device
131
false
5G
true
false
ext3
131
true
acl,user_xattr
false
tmp
/tmp
device
131
false
10G
true
false
ext3
131
true
acl,user_xattr
false
usr
/usr
device
131
false
10G
true
false
ext3
131
true
acl,user_xattr
false
var
/var
device
131
false
5G
4M
CT_LVM
all
allow,deny
On
Basic
default
localhost:631
/var/run/cups/cups.sock
info
sys root
127.0.0.2
Location
allow,deny
/
Required
Location
allow,deny
/admin
Default
Location
allow,deny
user @SYSTEM
/admin/conf
Policy
default
Limit
deny,allow
user @OWNER @SYSTEM
Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job
Default
Limit
deny,allow
user @SYSTEM
CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default
Default
Limit
deny,allow
user @SYSTEM
Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs
Limit
deny,allow
user @OWNER @SYSTEM
Cancel-Job CUPS-Authenticate-Job
Limit
deny,allow
All
Policy
easy
Limit
allow,deny
any
All
Policy
paranoid
from 127.0.0.0/8
Limit
deny,allow
user @OWNER
Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job
from 127.0.0.0/8
Default
Limit
deny,allow
user @SYSTEM
CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default
from 127.0.0.0/8
Default
Limit
deny,allow
user @SYSTEM
Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs
from 127.0.0.0/8
Limit
deny,allow
user @OWNER
Cancel-Job CUPS-Authenticate-Job
from 127.0.0.0/8
Limit
deny,allow
user @OWNER @SYSTEM
All
false
localhost, 127.0.0.1
true
true
0
true
true
0
true
true
0
true
true
0
5
ConsoleKit-32bit
Mesa-32bit
PolicyKit-32bit
PolicyKit-gnome-libs-32bit
aspell-32bit
at-spi-32bit
audiofile-32bit
audit-libs-32bit
bind-libs-32bit
bison-32bit
cpufrequtils-32bit
cracklib-32bit
cryptconfig-32bit
cyrus-sasl-32bit
cyrus-sasl-gssapi-32bit
cyrus-sasl-plain-32bit
dbus-1-32bit
dbus-1-glib-32bit
device-mapper-32bit
evolution-data-server-32bit
fam-32bit
file-32bit
flex-32bit
freeglut-32bit
freetype-32bit
fribidi-32bit
gcc-32bit
gcc43-32bit
gconf2-32bit
gdbm-devel-32bit
gettext-runtime-32bit
giflib-32bit
glibc-devel-32bit
glibc-locale-32bit
gnome-keyring-32bit
gnome-panel-32bit
gnome-vfs2-32bit
gpm-32bit
hal-32bit
hunspell-32bit
java-1_6_0-ibm
java-1_6_0-ibm-fonts
jpackage-utils
libFLAC8-32bit
libHX13-32bit
libacl-32bit
libaio-32bit
libaio-devel-32bit
libart_lgpl-32bit
libattr-32bit
libavahi-client3-32bit
libavahi-common3-32bit
libavahi-glib1-32bit
libblkid1-32bit
libbonobo-32bit
libbonoboui-32bit
libbz2-1-32bit
libcanberra-gtk-32bit
libcanberra-gtk0-32bit
libcanberra0-32bit
libcap2-32bit
libcroco-0_6-3-32bit
libcurl4-32bit
libdnet1
libdrm-32bit
libesd0-32bit
libfreebl3-32bit
libgcrypt11-32bit
libglade2-32bit
libgnome-32bit
libgnome-desktop-2-11-32bit
libgnomecanvas-32bit
libgnutls26-32bit
libgomp46-32bit
libgpg-error0-32bit
libgsf-1-114-32bit
libgstreamer-0_10-0-32bit
libgthread-2_0-0-32bit
libgweather1-32bit
libical0-32bit
libidl-32bit
libidn-32bit
liblcms1-32bit
libldap-2_4-2-32bit
libltdl7-32bit
liblua5_1
liblzma5-32bit
libmng-32bit
libncurses6-32bit
libnetpbm10-32bit
libnscd-32bit
libnsssharedhelper0-32bit
libogg0-32bit
libopenct1-32bit
libopensc2-32bit
libpciaccess0-32bit
libproxy0-32bit
libproxy0-config-gnome
libproxy0-config-kde4
libpulse0-32bit
libpython2_6-1_0-32bit
libqt4-32bit
libqt4-qt3support-32bit
libqt4-sql-32bit
libqt4-x11-32bit
libreiserfs-32bit
librsvg-32bit
libsepol1-32bit
libsmbclient0-32bit
libsmbios2-32bit
libsndfile-32bit
libsoup-2_4-1-32bit
libsqlite3-0-32bit
libstdc++33-32bit
libstdc++43-devel-32bit
libtalloc2-32bit
libtasn1-3-32bit
libtdb1-32bit
libtool-32bit
libudev0-32bit
libvorbis-32bit
libwbclient0-32bit
libwnck-1-22-32bit
libxcrypt-32bit
libxml2-32bit
libxslt-32bit
mozilla-kde4-integration
mozilla-nspr-32bit
mozilla-nss-32bit
mozilla-xulrunner192-32bit
nautilus-32bit
nautilus-cd-burner-32bit
ncurses-devel-32bit
nmap
opensc-32bit
openslp-32bit
opie-32bit
orbit2-32bit
pam-32bit
pam-modules-32bit
pam_mount-32bit
parted-32bit
pciutils-32bit
pcsc-lite-32bit
popt-32bit
qt3-32bit
qtcurve-gtk2-32bit
rpm-32bit
samba-32bit
samba-client-32bit
startup-notification-32bit
strace-32bit
sysfsutils-32bit
tcl-32bit
tcpd-32bit
tk-32bit
utempter-32bit
xaw3d-32bit
xorg-x11-driver-video-radeonhd
yast2-trans-en_US
autoyast2-installation
autoyast2-installation
Basis-Devel
Minimal
WBEM
apparmor
base
documentation
gnome
kde
oracle_server
print_server
x11
apache2
apache2-prefork
apache2-utils
apache2-worker
emacs-nox
libapr-util1
libapr1
libqt4-sql-sqlite
lprng
pcmciautils
portmap
rsyslog
sendmail
susehelp_de
open-iscsi
localtime
Asia/Shanghai
100
video,dialout
/home
-1
/bin/bash
/etc/skel
022
true
Games account
100
/var/games
-1
99999
0
7
/bin/bash
12
*
games
true
bin
1
/bin
-1
99999
0
7
/bin/bash
1
*
bin
true
nobody
65533
/var/lib/nobody
-1
99999
0
7
/bin/bash
65534
*
nobody
true
Printing daemon
7
/var/spool/lpd
-1
99999
0
7
/bin/bash
4
*
lp
true
User for uuidd
104
/var/run/uuidd
99999
0
7
/bin/false
102
*
uuidd
true
Postfix Daemon
51
/var/spool/postfix
99999
0
7
/bin/false
51
*
postfix
true
Novell Customer Center User
114
/var/lib/YaST2/suse-ncc-fakehome
99999
0
7
/bin/bash
107
*
suse-ncc
true
FTP account
49
/srv/ftp
-1
99999
0
7
/bin/bash
40
*
ftp
true
Gnome Display Manager daemon
115
/var/lib/gdm
99999
0
7
/bin/false
108
*
gdm
true
Batch jobs daemon
25
/var/spool/atjobs
99999
0
7
/bin/bash
25
*
at
true
root
0
/root
-1
99999
0
7
/bin/bash
0
$2y$05$PgHRKTw9p..KhpR4r3bhF.8yFRP30eBTO6bQSfDspTz8J5/8yw.qW
root
true
Mailer daemon
12
/var/spool/clientmqueue
-1
99999
0
7
/bin/false
8
*
mail
true
Daemon
2
/sbin
-1
99999
0
7
/bin/bash
2
*
daemon
true
NTP daemon
111
/var/lib/ntp
99999
0
7
/bin/false
74
*
ntp
true
Unix-to-Unix CoPy system
14
/etc/uucp
-1
99999
0
7
/bin/bash
10
*
uucp
true
User for D-Bus
101
/var/run/dbus
0
7
/bin/false
100
*
messagebus
true
User for haldaemon
102
/var/run/hald
0
7
/bin/false
101
*
haldaemon
true
Oracle user
107
/opt/oracle
99999
0
7
/bin/false
104
*
oracle
true
WWW daemon apache
8
/var/lib/wwwrun
-1
99999
0
7
/bin/false
30
*
wwwrun
true
Puppet daemon
106
/var/lib/puppet
99999
0
7
/bin/false
103
*
puppet
true
Manual pages viewer
62
/var/cache/man
-1
99999
0
7
/bin/bash
13
*
man
true
MySQL database admin
109
/var/lib/mysql
99999
0
7
/bin/false
60
*
mysql
true
PolicyKit
110
/var/run/PolicyKit
99999
0
7
/bin/false
105
*
polkituser
true
News system
13
/etc/news
-1
99999
0
7
/bin/bash
9
*
news
SSH daemon
65
/var/lib/sshd
-1
99999
0
7
/bin/false
71
sshd
true
PulseAudio daemon
112
/var/lib/pulseaudio
99999
0
7
/bin/false
106
*
pulse
24
gdm
true
48
60
31
50
1024X768@60HZ
--> VESA
1024x768 (XGA)
gnome
SuSE自动化PXE网络安装
SuSE自动化PXE网络安装
PXE基本原理
PXE基本原理
什么是PXE
PXE(Pre-boot Execution Environment)是由Intel设计的协议,它可以使计算机通过网络启动。协议分为client和server两端,PXE client在网卡的ROM中,当计算机引导时,BIOS把PXE client调入内存执行,并显示出命令菜单,经用户选择后,PXE client将放置在远端的操作系统通过网络下载到本地运行。
PXE协议的成功运行需要解决以下两个问题:
1. 既然是通过网络传输,那么计算机在启动时,它的IP地址由谁来配置;
2. 通过什么协议下载Linux内核和根文件系统。
对于第一个问题,可以通过DHCP Server解决,由DHCP server来给PXE client分配一个IP地址,DHCP Server是用来给DHCP Client动态分配IP地址的协议,不过由于这里是给PXE Client分配IP地址,所以在配置DHCP Server时,需要增加相应的PXE特有配置。
至于第二个问题,在PXE client所在的ROM中,已经存在了TFTP Client。PXE Client使用TFTP Client,通过TFTP协议到TFTP Server上下载所需的文件。
这样,PXE协议运行的条件就具备了,下面我们就来看看PXE协议的工作过程。
工作过程
在下图中,PXE client是需要安装Linux的计算机,TFTP Server和DHCP Server运行在另外一台Linux Server上。Bootstrap文件、配置文件、Linux内核以及Linux根文件系统都放置在Linux Server上TFTP服务器的根目录下。
PXE client在工作过程中,需要三个二进制文件:bootstrap、Linux 内核和Linux根文件系统。Bootstrap文件是可执行程序,它向用户提供简单的控制界面,并根据用户的选择,下载合适的Linux内核以及Linux根文件系统。
方案介绍
这种方案需要首先设置一个启动服务器和一个安装服务器(可以配置在同一台物理机上),然后通过网络启动存放在启动服务器上的安装程序。安装程序会自动访问存放在安装服务器上的安装配置文件和安装介质来完成安装。
涉及到的技术
该方案主要应用了三种技术:
1. 在PC上从网络启动SLES安装程序的PXE协议
2. SLES安装程序提供的网络安装功能(即指通过网络访问安装介质)
3. SLES安装程序提供的无人值守安装功能(SuSE称为AutoYast)
软硬件需求
要按本文介绍的方法完成自动化安装,你需要如下软硬件资源:
- 一台PC机器作为启动和安装服务器(其它架构机器也可以)
- 一台待安装的PC机器,它的网卡必须带有PXE支持
- 一个建好的局域网,上述两台机器已经连接入同一子网
- 待安装的SLES安装介质
配置tftpd
配置tftpd
为了简化步骤,我们在XP虚拟机下搭建DHCP和TFTP服务端,用tftpd工具来整合实现PXE网络引导,注意服务端与客户端要在同一局域网内。在Linux下配置服务的原理类似,具体方法可参考互联网。
(1)下载tftpd
http://tftpd32.jounin.net/
(2)启动tftpd32程序,选择【Settings】
(3)按需勾选,这里我们仅选择【TFTP】和【DHCP】
(4)TFTP设置如下
Base Directory:对应存放Linux的引导文件
PXE Compatibility:增强对不同型号网卡的网络启动支持
Show Progress bar:在网络引导过程中显示进度
Translate Unix file names:转化Unix文件名
Allow “\” As virtual root:允许虚拟路径
其它高级选项:设置包括兼容性以及一些细节
(5)DHCP配置
重点注意Boot File引导文件的设置和DHCP绑定地址
(6)tftpboot目录结构
file://D:\tftpboot (2 folders, 3 files, 35.86 MB, 36.46 MB in total.)
│ INITRD 32.20 MB
│ LINUX 3.64 MB
│ pxelinux.0 16.04 KB
├─pxelinux.cfg (0 folders, 1 files, 193 bytes, 193 bytes in total.)
│ default 193 bytes
└─tftpd32 (0 folders, 4 files, 620.33 KB, 620.33 KB in total.)
EUPL-EN.pdf 33.51 KB
tftpd32.chm 346.96 KB
tftpd32.exe 200.50 KB
tftpd32.ini 39.36 KB
INITRD和LINUX提取自Linux启动引导镜像
pxelinux.0是pxe启动引导镜像
pxelinux.cfg文件夹下的default文件为启动菜单配置项
编辑tftpboot\pxelinux.cfg,可以自定义autoinst.xml文件的访问方式和路径
default linux
# Install Linux
label linux
kernel linux
append initrd=initrd autoyast=ftp://198.15.0.106/suse/autoinst.xml install=ftp://198.15.0.106/suse splash=silent showopts
配置FTP
配置FTP
(1)下载Filezilla Server
http://filezilla-project.org/
(2)设置ftp
允许匿名访问帐户即可,配置好ftp路径
提取SLES镜像内的安装目录至ftp目录下
配置AutoYaST
配置AutoYaST
使用SuSE中的AutoYaST工具生成autoinst.xml,复制到ftp任意目录下,注意文件路径与default配置相吻合
网络启动机器
前面的配置工作完成后,下面我们就在待安装机器上通过网络以无人值守的方式来安装
(1)启动待安装机器,选择从网卡启动。具体方法因BIOS版本不同而异。下图是从VMWare虚拟机上得到的选择网络启动的屏幕截图。
<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4NCjxwPjxjb2RlIGNsYXNzPQ=="language-bash hljs ">(2)网卡中的PXE代码会联系DHCP服务器来获取IP地址以及启动镜像,然后启动镜像被载入并运行。
(3)开始全自动安装
安装后添加自定义模块
安装后添加自定义模块
我这里以添加Kernel内核补丁为例
<scripts>
<script>
instkernel.sh
true
shell
</script>
小结
小结
其实在研究自动化部署的过程中我们会遇到各种坑,只有踩过的人才能够体会其中的不容易,如果大家在测试和使用SuSE自动化安装时遇到任何问题,欢迎直接在原文下方留言,我们一起学习和成长^_^。
评论暂时关闭