首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >建议采用什么方法来准备Red /CentOS 7模板?

建议采用什么方法来准备Red /CentOS 7模板?
EN

Server Fault用户
提问于 2014-09-08 01:59:36
回答 1查看 13.3K关注 0票数 10

如果我需要从模板部署红帽7,我想采取建议的步骤,使我的“黄金形象”干净。它应该引导到第一引导提示符并引导用户完成典型的步骤。

在红帽5/6,我在提供的文件之后由供应商。但是,我无法找到Red 7的对应项,具体来说,touch /.unconfigured不会触发第一个引导设置。

9.3.1.将用于部署的封装为一个模板摘要在将一个变成一个模板之前对它进行概括(密封)。这样可以防止从模板部署的虚拟机之间的冲突。程序9.6.将Linux虚拟机登录封入到虚拟机。通过将以下命令作为root运行,将系统标记为重新配置:

  1. # touch /.unconfigured
  2. 移除ssh主机键。运行: # rm -rf /etc/ssh/ssh_host_*
  3. HOSTNAME=localhost.localdomain中设置/etc/sysconfig/network
  4. 删除/etc/udev/Reges.d/70-*。运行: # rm -rf /etc/udev/rules.d/70-*
  5. 从HWADDR=和UUID=行中删除/etc/sysconfig/network-scripts/ifcfg-eth*
  6. 可以选择删除/var/log中的所有日志,并从/root构建日志。
  7. 关闭虚拟机。运行: # poweroff

编辑:步骤1和步骤7可以通过最后运行sys-unconfig来组合。或者,看看libguestfs-tools-c中的virt-sysprep,它做的更多。

代码语言:javascript
复制
 [user@hostname ~]$ virt-sysprep --list-operations
 abrt-data * Remove the crash data generated by ABRT
 bash-history * Remove the bash history in the guest
 blkid-tab * Remove blkid tab in the guest
 ca-certificates   Remove CA certificates in the guest
 crash-data * Remove the crash data generated by kexec-tools
 cron-spool * Remove user at-jobs and cron-jobs
 delete * Delete specified files or directories
 dhcp-client-state * Remove DHCP client leases
 dhcp-server-state * Remove DHCP server leases
 dovecot-data * Remove Dovecot (mail server) data
 firewall-rules   Remove the firewall rules
 firstboot * Add scripts to run once at next boot
 flag-reconfiguration   Flag the system for reconfiguration
 hostname * Change the hostname of the guest
 kerberos-data   Remove Kerberos data in the guest
 logfiles * Remove many log files from the guest
 lvm-uuids * Change LVM2 PV and VG UUIDs
 machine-id * Remove the local machine ID
 mail-spool * Remove email from the local mail spool directory
 net-hostname * Remove HOSTNAME in network interface configuration
 net-hwaddr * Remove HWADDR (hard-coded MAC address) configuration
 pacct-log * Remove the process accounting log files
 package-manager-cache * Remove package manager cache
 pam-data * Remove the PAM data in the guest
 password * Set root or user password
 puppet-data-log * Remove the data and log files of puppet
 random-seed * Generate random seed for guest
 rhn-systemid * Remove the RHN system ID
 rpm-db * Remove host-specific RPM database files
 samba-db-log * Remove the database and log files of Samba
 script * Run arbitrary scripts against the guest
 smolt-uuid * Remove the Smolt hardware UUID
 ssh-hostkeys * Remove the SSH host keys in the guest
 ssh-userdir * Remove ".ssh" directories in the guest
 sssd-db-log * Remove the database and log files of sssd
 tmp-files * Remove temporary files
 udev-persistent-net * Remove udev persistent net rules
 user-account   Remove the user accounts in the guest
 utmp * Remove the utmp file
 yum-uuid * Remove the yum UUID
EN

回答 1

Server Fault用户

回答已采纳

发布于 2014-09-08 02:40:33

我们认为最初的设置实际上有三个部分。前两项是:

  • 初始设置,它要求您接受许可证并创建一个用户。
  • Firstboot,它要求您配置kdump并(在RHEL上)设置您的订阅。

这两种方法现在都是通过systemd启用的;一旦完成,它们就会禁用自己。

因此,您需要做的就是删除在第一个初始安装过程中创建的任何本地用户(S),并重新启用这些服务:

代码语言:javascript
复制
systemctl enable initial-setup-graphical.service
systemctl enable firstboot-graphical.service
> /etc/sysconfig/firstboot

然后重新启动。

我不完全确定第三部分,它要求您使用您的语言并创建用户帐户或将机器加入到域。这至少会继续下去,直到您真正完成向导。(所以不要那么做。)

清理主机键和任何特定于硬件的配置仍然是个好主意。(Mac地址在udev规则和接口配置文件中。)

票数 6
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/626889

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档