oVirt专题:Hosted Engine之Engine Appliance制作(2)

下面来分析下自动安装虚机时用到的ks文件:

默认情况下,整个自动安装过程会涉及到4个ks文件,但是我们可以根据我们的实际情况及需求进行灵活调整。

(1)ovirt-appliance-fedora.ks.tpl

**导入fedora-cloud-base.ks文件内容**
%include fedora-spin-kickstarts/fedora-cloud-base.ks

#
# Repos
#
# baseurl variant
#url --url=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Fedora/$basearch/os/
#repo --name="fedora" --baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Fedora/$basearch/os/
#repo --name="updates" --baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/

**定义安装源及YUM源**
# mirrorlist variant
url --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
repo --name="updates" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch

#
# Configuration
#
**设置SELinux为permissive模式**
selinux --permissive
**重新配置firstboot**
firstboot --reconfig
**锁定root用户密码**
rootpw --plaintext none --lock
**系统安装完成后关闭电源**
poweroff
**添加一个名为admin的用户,加入到wheel组中**
user --name=admin --plaintext --password=none --groups=wheel

#
# Packages
#
**定义要安装的包**
%packages
**初始配置工具,centos6.5中没有**
initial-setup(The initial-setup utility runs after installation.  It guides the user through a series of steps that allows for easier configuration of the machine.)
**重写磁盘分区表的工具**
dracut-modules-growroot(This dracut module will re-write the partition table of a disk so that the root partition has as much space as possible, bumping it up to the edge of the disk, or the edge of the next partition.)
%end

**安装后执行的任务**
%post --erroronfail
#
**准备initial-setup工具**
echo "Preparing initial-setup"
#
**安装软件包**
yum install -y initial-setup plymouth(Plymouth provides an attractive graphical boot animation in place of the text messages that normally get shown.  Text messages are instead redirected to a log file for viewing after boot.)
**系统启动时initial-setup-text服务发现该文件时确认需要初始化配置系统**
touch /etc/reconfigSys
**设置initial-setup-text(字符界面)服务随系统启动**
systemctl enable initial-setup-text.service
**禁止initial-setup-graphical(图形界面)服务随系统启动**
systemctl disable initial-setup-graphical.service

# Default tty is ttyS0, to display initial-setup on tty0 we need to set this explicitly
sed -i **设置initial-setup在tty0显示**
  -e "/^StandardOutput/ a TTYPath=/dev/tty0"   -e "/^Description/ a Before=cloud-init-local.service cloud-init.service"   /usr/lib/systemd/system/initial-setup-text.service
%end

%post --erroronfail
#
**预安装ovirt-engine及ovirt-guest-agent包**
echo "Pre-Installing oVirt stuff"
#
yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
yum install -y ovirt-engine ovirt-guest-agent

#
**生成ovirt-engine的应答文件**
echo "Creating a partial answer file"
#
cat > /root/ovirt-engine-answers <<__EOF__
[environment:default]
OVESETUP_CORE/engineStop=none:None
OVESETUP_DIALOG/confirmSettings=bool:True
OVESETUP_DB/database=str:engine
OVESETUP_DB/fixDbViolations=none:None
OVESETUP_DB/secured=bool:False
OVESETUP_DB/securedHostValidation=bool:False
OVESETUP_DB/host=str:localhost
OVESETUP_DB/user=str:engine
OVESETUP_DB/port=int:5432
OVESETUP_SYSTEM/nfsConfigEnabled=bool:False
OVESETUP_CONFIG/applicationMode=str:virt
OVESETUP_CONFIG/firewallManager=str:firewalld
OVESETUP_CONFIG/websocketProxyConfig=none:True
OVESETUP_CONFIG/storageType=str:nfs
OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True
OVESETUP_APACHE/configureRootRedirection=bool:True
OVESETUP_APACHE/configureSsl=bool:True
OSETUP_RPMDISTRO/requireRollback=none:None
OSETUP_RPMDISTRO/enableUpgrade=none:None
__EOF__

%end

%post --erroronfail
#
**启用wheels组的sudo权限**
echo "Enabling sudo for wheels"
#
**注释掉关于wheel组中用户不输入密码即可使用sudo提升权限的配置行,删除root用户密码并配置密码过期**
sed -i "/%wheel.*NOPASSWD/ s/^#//" /etc/sudoers
passwd --delete root
passwd --expire root
%end

(2)fedora-cloud-base.ks

# This is a basic Fedora 21 spin designed to work in OpenStack and other
# private cloud environments. It‘s configured with cloud-init so it will
# take advantage of ec2-compatible metadata services for provisioning ssh
# keys. Cloud-init creates a user account named "fedora" with passwordless
# sudo access. The root password is empty and locked by default.
#
# Note that unlike the standard F20 install, this image has /tmp on disk
# rather than in tmpfs, since memory is usually at a premium.
#
# This kickstart file is designed to be used with appliance-creator and
# may need slight modification for use with actual anaconda or other tools.
# We intend to target anaconda-in-a-vm style image building for F20.

**设置文本模式安装**
text
**设置语言及编码类型**
lang en_US.UTF-8
**设置键盘类型**
keyboard us
**设置日期显示类型**
timezone --utc Etc/UTC

**设置系统验证信息**
auth --useshadow --enablemd5
**设置SELinux为强制模式**
selinux --enforcing
**锁定root用户密码/root用户密码加密**
rootpw --lock --iscrypted locked
**添加一个名为none的用户**
user --name=none

**禁用防火墙**
firewall --disabled

**bootloader设置,待确认具体参数功能**
bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8" --extlinux

**设置eth0网卡通过dhcp进行网络参数配置,激活/启用该网卡**
network --bootproto=dhcp --device=eth0 --activate --onboot=on
**设置这些服务随系统启动**
services --enabled=network,sshd,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final

**清空mbr**
zerombr
**清空所有分区**
clearpart --all
**设置根分区大小为3000M,格式化为ext4文件系统**
part / --size 3000 --fstype ext4

**导入fedora-repo.ks文件,导入最新源信息,可注释掉**
%include fedora-repo.ks

**系统安装完后重启**
reboot

**要安装的包列表**
# Package list.
%packages
kernel-core(centos6.5无该包)
@core
grubby

# cloud-init does magical things with EC2 metadata, including provisioning
# a user account with ssh keys.
cloud-init(Cloud-init is a set of init scripts for cloud instances.  Cloud instances need special scripts to run during initialization to retrieve and install ssh keys and to let the user run various scripts.)

# this is used by openstack‘s cloud orchestration framework (and it‘s small)
heat-cfntools(Tools required to be installed on Heat provisioned cloud instances)

# need this for growpart, because parted doesn‘t yet support resizepart
# https://bugzilla.redhat.com/show_bug.cgi?id=966993
cloud-utils-growpart(This package provides the growpart script for growing a partition. It is primarily used in cloud images in conjunction with the dracut-modules-growroot package to grow the root partition on first boot.)

# We need this image to be portable; also, rescue mode isn‘t useful here.
dracut-config-generic(centos6.5无该软件包)
-dracut-config-rescue

syslinux-extlinux(The EXTLINUX bootloader, for booting the local system, as well as all the SYSLINUX/PXELINUX modules in /boot.)

**需要初始安装,后续会删除**
# Needed initially, but removed below.
firewalld

**挑选的一些会用到的包**
# cherry-pick a few things from @standard
tar
rsync

**删除@core包组中不需要的软件包**
# Some things from @core we can do without in a minimal install
-biosdevname
-plymouth
-NetworkManager
-iprutils
-kbd
-uboot-tools
-kernel
-grub2

%end

%post --erroronfail

**为EC2创建grub.conf文件**
# Create grub.conf for EC2. This used to be done by appliance creator but
# anaconda doesn‘t do it. And, in case appliance-creator is used, we‘re
# overriding it here so that both cases get the exact same file.
# Note that the console line is different -- that‘s because EC2 provides
# different virtual hardware, and this is a convenient way to act differently
echo -n "Creating grub.conf for pvgrub"
rootuuid=$( awk ‘$2=="/" { print $1 };‘  /etc/fstab )
mkdir /boot/grub

echo -e ‘default=0\ntimeout=0\n\n‘ > /boot/grub/grub.conf
for kv in $( ls -1v /boot/vmlinuz* |grep -v rescue |sed s/.*vmlinuz-//  ); do
  echo "title Fedora ($kv)" >> /boot/grub/grub.conf
  echo -e "\troot (hd0)" >> /boot/grub/grub.conf
  echo -e "\tkernel /boot/vmlinuz-$kv ro root=$rootuuid no_timer_check console=hvc0 LANG=en_US.UTF-8" >> /boot/grub/grub.conf
  echo -e "\tinitrd /boot/initramfs-$kv.img" >> /boot/grub/grub.conf
  echo
done

**为ec2建立grub.conf的链接**
#link grub.conf to menu.lst for ec2 to work
echo -n "Linking menu.lst to old-style grub.conf for pv-grub"
ln -sf grub.conf /boot/grub/menu.lst
ln -sf /boot/grub/grub.conf /etc/grub.conf

**老版本的livecd-tools工具中没有--lock,使用passwd锁定root用户密码**
# older versions of livecd-tools do not follow "rootpw --lock" line above
# https://bugzilla.redhat.com/show_bug.cgi?id=964299
passwd -l root
# remove the user anaconda forces us to make
userdel -r none

**设置kickstart的超时时间为1秒**
# Kickstart specifies timeout in seconds; syslinux uses 10ths.
# 0 means wait forever, so instead we‘ll go with 1.
sed -i ‘s/^timeout 10/timeout 1/‘ /boot/extlinux/extlinux.conf

**设置systemd在正确的运行级别启动**
# setup systemd to boot to the right runlevel
echo -n "Setting default runlevel to multiuser text mode"
rm -f /etc/systemd/system/default.target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
echo .

**如果你想删除rsyslog,只使用journald,需要注释掉这部分**
# If you want to remove rsyslog and just use journald, remove this!
echo -n "Disabling persistent journal"
rmdir /var/log/journal/
echo .

**删除虚拟机中不需要的包linux-firmware**
# this is installed by default but we don‘t need it in virt
echo "Removing linux-firmware package."
yum -C -y remove linux-firmware

**删除firewalld包**
# Remove firewalld; was supposed to be optional in F18+, but is required to
# be present for install/image building.
echo "Removing firewalld."
yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"

**删除其它的一些只在系统安装时需要的包**
# Another one needed at install time but not after that, and it pulls
# in some unneeded deps (like, newt and slang)
echo "Removing authconfig."
yum -C -y remove authconfig --setopt="clean_requirements_on_remove=1"

**禁用串口控制台**
echo -n "Getty fixes"
# although we want console output going to the serial console, we don‘t
# actually have the opportunity to login there. FIX.
# we don‘t really need to auto-spawn _any_ gettys.
sed -i ‘/^#NAutoVTs=.*/ aNAutoVTs=0‘ /etc/systemd/logind.conf

**初始配置脚本需要这个文件**
echo -n "Network fixes"
# initscripts don‘t like this file to be missing.
cat > /etc/sysconfig/network << EOF
NETWORKING=yes
NOZEROCONF=yes
EOF

**删除udev中关于网卡的配置文件(文件中包含网卡的MAC信息,因此需要删除)**
# For cloud images, ‘eth0‘ _is_ the predictable device name, since
# we don‘t want to be tied to specific virtual (!) hardware
rm -f /etc/udev/rules.d/70*
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

**eth0网卡的基本配置信息**
# simple eth0 config, again not hard-coded to the build hardware
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
EOF

**生成localhost域名解析信息**
# generic localhost names
cat > /etc/hosts << EOF
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

EOF
echo .

**禁用将tmpfs挂载到/tmp**
# Because memory is scarce resource in most cloud/virt environments,
# and because this impedes forensics, we are differing from the Fedora
# default of having /tmp on tmpfs.
echo "Disabling tmpfs for /tmp."
systemctl mask tmp.mount

**确保firstboot不会在系统启动时配置系统**
# make sure firstboot doesn‘t start
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot

# Uncomment this if you want to use cloud init but suppress the creation
# of an "ec2-user" account. This will, in the absence of further config,
# cause the ssh key from a metadata source to be put in the root account.
#cat <<EOF > /etc/cloud/cloud.cfg.d/50_suppress_ec2-user_use_root.cfg
#users: []
#disable_root: 0
#EOF

**删除random-seed**
echo "Removing random-seed so it‘s not the same in every image."
rm -f /var/lib/random-seed

**清空yum源缓存数据**
echo "Cleaning old yum repodata."
yum history new
yum clean all
truncate -c -s 0 /var/log/yum.log

**导入RPM GPG key**
echo "Import RPM GPG key"
releasever=$(rpm -q --qf ‘%{version}\n‘ fedora-release)
basearch=$(uname -i)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch

**列出已经安装的软件包列表**
echo "Packages within this cloud image:"
echo "-----------------------------------------------------------------------"
rpm -qa
echo "-----------------------------------------------------------------------"
# Note that running rpm recreates the rpm db files which aren‘t needed/wanted
rm -f /var/lib/rpm/__db*

**修复SELinux上下文**
echo "Fixing SELinux contexts."
touch /var/log/cron
touch /var/log/boot.log
mkdir -p /var/cache/yum
chattr -i /boot/extlinux/ldlinux.sys
/usr/sbin/fixfiles -R -a restore
chattr +i /boot/extlinux/ldlinux.sys

**用0填充空余空间**
echo "Zeroing out empty space."
# This forces the filesystem to reclaim space from deleted files
dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
rm -f /var/tmp/zeros
echo "(Don‘t worry -- that out-of-space error was expected.)"

%end

(3)fedora-repo.ks(导入一些附加的repo源,该源最终会被注释掉)

# Include the appropriate repo definitions

# Exactly one of the following should be uncommented

# For the master branch the following should be uncommented
%include fedora-repo-rawhide.ks

# For non-master branches the following should be uncommented
# %include fedora-repo-not-rawhide.ks

(4)fedora-repo-rawhide.ks

repo --name=rawhide --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch


前一篇中提到make过程中,这些ks文件会被拼接到一起,最后生成一个名为ovirt-appliance-fedora.ks的文件,该文件最终在虚拟机安装时被调用。


#version=DEVEL
#repo --name="rawhide" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=x86_64
repo --name="updates" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f19&arch=x86_64
# Keyboard layouts
keyboard ‘us‘# Shutdown after installation
shutdown
# Root password
rootpw --lock --plaintext none
# System timezone
timezone Etc/UTC --isUtc
# Use network installation
url --mirrorlist="http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-19&arch=x86_64"
# System language
lang en_US.UTF-8
user --name=none
user --groups=wheel --name=admin --password=none
# Firewall configuration
firewall --disabled
# Network information
network --activate
# System authorization information
auth --useshadow --enablemd5
# Use text mode install
# Run the Setup Agent on first boot
firstboot --reconfig --reconfig
# SELinux configuration
selinux --permissive

# System services
services --enabled="network,sshd,initial-setup-text,rsyslog,cloud-init,cloud-init-local,cloud-config,cloud-final"
# System bootloader configuration
bootloader --location=mbr --timeout=1
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --size 8000 --fstype ext4 --fsoptions discard

%post --erroronfail

# Create grub.conf for EC2. This used to be done by appliance creator but
# anaconda doesn‘t do it. And, in case appliance-creator is used, we‘re
# overriding it here so that both cases get the exact same file.
# Note that the console line is different -- that‘s because EC2 provides
# different virtual hardware, and this is a convenient way to act differently
echo -n "Creating grub.conf for pvgrub"
rootuuid=$( awk ‘$2=="/" { print $1 };‘  /etc/fstab )
mkdir /boot/grub
echo -e ‘default=0\ntimeout=0\n\n‘ > /boot/grub/grub.conf
for kv in $( ls -1v /boot/vmlinuz* |grep -v rescue |sed s/.*vmlinuz-//  ); do
  echo "title Fedora ($kv)" >> /boot/grub/grub.conf
  echo -e "\troot (hd0)" >> /boot/grub/grub.conf
  echo -e "\tkernel /boot/vmlinuz-$kv ro root=$rootuuid no_timer_check console=hvc0 LANG=en_US.UTF-8" >> /boot/grub/grub.conf
  echo -e "\tinitrd /boot/initramfs-$kv.img" >> /boot/grub/grub.conf
  echo
done

#link grub.conf to menu.lst for ec2 to work
echo -n "Linking menu.lst to old-style grub.conf for pv-grub"
ln -sf grub.conf /boot/grub/menu.lst
ln -sf /boot/grub/grub.conf /etc/grub.conf

# older versions of livecd-tools do not follow "rootpw --lock" line above
# https://bugzilla.redhat.com/show_bug.cgi?id=964299
passwd -l root
# remove the user anaconda forces us to make
userdel -r none

# Kickstart specifies timeout in seconds; syslinux uses 10ths.
# 0 means wait forever, so instead we‘ll go with 1.
sed -i ‘s/^timeout 10/timeout 1/‘ /boot/extlinux/extlinux.conf

# setup systemd to boot to the right runlevel
echo -n "Setting default runlevel to multiuser text mode"
#rm -f /etc/systemd/system/default.target
#ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
echo .

# If you want to remove rsyslog and just use journald, remove this!
echo -n "Disabling persistent journal"
rmdir /var/log/journal/
echo .

# this is installed by default but we don‘t need it in virt
echo "Removing linux-firmware package."
#yum -C -y remove linux-firmware

# Remove firewalld; was supposed to be optional in F18+, but is required to
# be present for install/image building.
echo "Removing firewalld."
#yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"

# Another one needed at install time but not after that, and it pulls
# in some unneeded deps (like, newt and slang)
echo "Removing authconfig."
#yum -C -y remove authconfig --setopt="clean_requirements_on_remove=1"

echo -n "Getty fixes"
# although we want console output going to the serial console, we don‘t
# actually have the opportunity to login there. FIX.
# we don‘t really need to auto-spawn _any_ gettys.
sed -i ‘/^#NAutoVTs=.*/ aNAutoVTs=0‘ /etc/systemd/logind.conf

echo -n "Network fixes"
# initscripts don‘t like this file to be missing.
cat > /etc/sysconfig/network << EOF
NETWORKING=yes
NOZEROCONF=yes
EOF

# For cloud images, ‘eth0‘ _is_ the predictable device name, since
# we don‘t want to be tied to specific virtual (!) hardware
rm -f /etc/udev/rules.d/70*
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

# simple eth0 config, again not hard-coded to the build hardware
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
EOF

# generic localhost names
cat > /etc/hosts << EOF
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

EOF
echo .

# Because memory is scarce resource in most cloud/virt environments,
# and because this impedes forensics, we are differing from the Fedora
# default of having /tmp on tmpfs.
echo "Disabling tmpfs for /tmp."
systemctl mask tmp.mount

# make sure firstboot doesn‘t start
#echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot

# Uncomment this if you want to use cloud init but suppress the creation
# of an "ec2-user" account. This will, in the absence of further config,
# cause the ssh key from a metadata source to be put in the root account.
#cat <<EOF > /etc/cloud/cloud.cfg.d/50_suppress_ec2-user_use_root.cfg
#users: []
#disable_root: 0
#EOF

echo "Removing random-seed so it‘s not the same in every image."
rm -f /var/lib/random-seed

echo "Cleaning old yum repodata."
yum history new
yum clean all
truncate -c -s 0 /var/log/yum.log

echo "Import RPM GPG key"
releasever=$(rpm -q --qf ‘%{version}\n‘ fedora-release)
basearch=$(uname -i)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-x86_64

echo "Packages within this cloud image:"
echo "-----------------------------------------------------------------------"
rpm -qa
echo "-----------------------------------------------------------------------"
# Note that running rpm recreates the rpm db files which aren‘t needed/wanted
rm -f /var/lib/rpm/__db*

echo "Fixing SELinux contexts."
touch /var/log/cron
touch /var/log/boot.log
mkdir -p /var/cache/yum
chattr -i /boot/extlinux/ldlinux.sys
/usr/sbin/fixfiles -R -a restore
chattr +i /boot/extlinux/ldlinux.sys

echo "Zeroing out empty space."
# This forces the filesystem to reclaim space from deleted files
dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
rm -f /var/tmp/zeros
echo "(Don‘t worry -- that out-of-space error was expected.)"

%end

%post --erroronfail
#
echo "Preparing initial-setup"
#
yum install -y initial-setup plymouth
touch /etc/reconfigSys
systemctl enable initial-setup-text.service
systemctl disable initial-setup-graphical.service

# Default tty is ttyS0, to display initial-setup on tty0 we need to set this explicitly
sed -i   -e "/^StandardOutput/ a TTYPath=/dev/tty0"   -e "/^Description/ a Before=cloud-init-local.service cloud-init.service"   /usr/lib/systemd/system/initial-setup-text.service
%end

%post --erroronfail
#
echo "Pre-Installing oVirt stuff"
#
yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
yum install -y ovirt-engine ovirt-guest-agent

#
echo "Creating a partial answer file"
#
cat > /root/ovirt-engine-answers <<__EOF__
[environment:default]
OVESETUP_CORE/engineStop=none:None
OVESETUP_DIALOG/confirmSettings=bool:True
OVESETUP_DB/database=str:engine
OVESETUP_DB/fixDbViolations=none:None
OVESETUP_DB/secured=bool:False
OVESETUP_DB/securedHostValidation=bool:False
OVESETUP_DB/host=str:localhost
OVESETUP_DB/user=str:engine
OVESETUP_DB/port=int:5432
OVESETUP_SYSTEM/nfsConfigEnabled=bool:False
OVESETUP_CONFIG/applicationMode=str:virt
OVESETUP_CONFIG/firewallManager=str:firewalld
OVESETUP_CONFIG/websocketProxyConfig=none:True
OVESETUP_CONFIG/storageType=str:nfs
OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True
OVESETUP_APACHE/configureRootRedirection=bool:True
OVESETUP_APACHE/configureSsl=bool:True
OSETUP_RPMDISTRO/requireRollback=none:None
OSETUP_RPMDISTRO/enableUpgrade=none:None
__EOF__

%end

%post --erroronfail
#
echo "Enabling sudo for wheels"
#
sed -i "/%wheel.*NOPASSWD/ s/^#//" /etc/sudoers
passwd --delete root
passwd --expire root
%end

%packages --ignoremissing
@core
cloud-init
cloud-utils-growpart
dracut-config-generic
dracut-modules-growroot
firewalld
grubby
heat-cfntools
initial-setup
kernel-core
rsync
syslinux-extlinux
tar

%end
时间: 2024-12-15 23:44:42

oVirt专题:Hosted Engine之Engine Appliance制作(2)的相关文章

oVirt专题:Hosted Engine之Engine Appliance制作

oVirt v3.4开始支持Hosted Engine.什么是Hosted Engine呢?很简单,以前的管理节点是部署在一台物理机器上的,现在我们将管理节点部署到一台虚拟机中,并且这台虚拟机运行在oVirt虚拟化环境中的计算节点上.以前是先部署管理节点,然后部署计算节点,最后把计算节点注册到管理节点,这时通过WEB管理平台可以在计算节点上运行虚拟机.现在的需要先部署计算节点,然后在计算节点上起虚机部署管理节点.先后顺序有了变化. 前面提到需要将管理节点部署在一台虚拟机中,既然是虚拟机,那么我们

oVirt专题:Hosted Engine之Engine Appliance使用(1)

前文中介绍了如何制作Engine Appliance.当Appliance制作好以后,如何使用它呢?下面就来详细介绍下Engine Appliance的使用方法. 首先,我们需要一台物理服务器,在这服务器上要先安装好CentOS7.0的操作系统.然后根据以下步骤进行配置: (1)配置网络 IP:192.168.14.67 NETMASK:255.255.252.0 GATEWAY:192.168.14.1 (2)配置域名解析 192.168.14.67      node.test 192.16

oVirt专题:Hosted Engine之Engine Appliance使用(3)

(6)Engine VM操作流程     a.配置网络 IP:192.168.14.77 NETMASK:255.255.252.0 GATEWAY:192.168.14.1 b.配置域名解析 192.168.14.67      node.test 192.168.14.77      engine.test c.执行命令,部署engine # engine-setup --config-append=/root/ovirt-engine-answers --offline        #(

oVirt专题:Hosted Engine之Engine Appliance使用(2)

(5)执行命令,部署hosted-engine # hosted-engine --deploy [ INFO  ] Stage: Initializing           Continuing will configure this host for serving as hypervisor and create  a VM where you have to install oVirt Engine afterwards.           Are you sure you want

第四季-专题3-嵌入式Linux内核制作

专题3-嵌入式Linux内核制作 一.linux内核简介 系统架构 (1)Linux系统是怎么构成的? (2)为什么linux系统分为了用户空间和内核空间? 现代CPU通常实现了不同的工作模式,以ARM为例,就实现了7中工作模式: 用户模式(usr),快速中断(fiq),外部中断(irq).管理模式(svc),数据访问中止(abt),系统模式(sys),未定义指令异常(und). X86也实现了4个不同的级别:Ring0-Ring3.Ring0下,可以执行特权指令,可以访问IO设备等,在RIng

engine.io分析1--socket.io的基石

转载请注明: TheViper http://www.cnblogs.com/TheViper 在上一篇socket.io迁移指南中提到过一点engine.io.engine.io是socket.io 1.x的抽象,核心. 特点: Maximum reliability(最大的可靠性) 即使在下列情况下,仍然可以建立连接: 1.代理,或负载均衡. 2.存在个人的防火墙,杀毒软件. Minimal client size(最小的客户端) 1.对flash传输方式懒加载 2.去除了冗余的传输方式 S

engine.io分析2--socket.io的基石

转载请注明: TheViper http://www.cnblogs.com/TheViper 源码分析 var engine = require('./node_modules/engine.io/lib/engine.io.js'); var server = engine.listen(8000,{ transports:['polling'] }); server.on('connection', function(socket){ socket.send('utf 8 string')

tomcat(13)Host和Engine容器

[0]README 0.1)本文部分文字描述转自 "how tomcat works",旨在学习 "tomcat(13)Host和Engine容器" 的基础知识: 0.2)Host容器:若你想在同一个tomcat部署 上运行多个Context 容器的话,就需要使用 Host 容器:它是Context容器的父容器:(干货--若你想在同一个tomcat部署 上运行多个Context 容器的话,就需要使用 Host 容器,Host容器表示包含有一个或多个 Context容

使用 Codec Engine 的 API 函数(七)

本文翻译自TI的手册,该手册是学习GPP+DSP开发的金典文档,希望对各位入门有所帮助,有理解不当之处望请赐教. Codec Engine Application Developer User's Guide.pdf (Literature Number: SPRUE67D) <Codec Engine 应用开发使用手册>           http://blog.csdn.net/dyzok88/article/details/42154487 <第一章 Codec Engine 概