gpt4 book ai didi

centos - 通过 virt-install 启动不会重启

转载 作者:太空宇宙 更新时间:2023-11-03 17:17:16 26 4
gpt4 key购买 nike

我有一个设置,我通过 virt-install 执行新 VM 的 kickstart。

一切运行正常,但虚拟机没有按照 kickstart 文件中的指示执行重启,而是关闭了。

VM主机为运行libvirt 1.2.17-13的CentOS 7.2系统

一旦我手动启动新的 VM,一切都如预期的那样。

有谁知道系统拒绝重启的原因以及如何解决这个问题?

谢谢。

这是我的 kickstart 文件的模板:

(请不要开始讨论禁用 selinux 和不使用 firewalld。问题是关于重启 ;-))

# Kickstart Configuration for MINIMAL CENTOS
# We are going to perform a fresh installation
install
eula --agreed

# Set language, keyboard and timezone
lang en_US.UTF-8
keyboard us
timezone Europe/Amsterdam

# Set authentication options
# authconfig --enableshadow --enablemd5
auth --useshadow --enablemd5

# No SELinux
selinux --disabled

# Enable the firewall and open the ssh port
# firewall --enable --ssh
firewall --disable

# Set services
services --enabled=NetworkManager,sshd

# Run the installation in text mode
text
# Skip initialization of X
skipx

# Configure the harddisk
# This is a macro that will be replaced by the actual disk configuration
{DISKCONFIG}

# Define the network interface and the hostname
# {IP} and {FQDN} are macros that will be replaced by correct values
network --activate --device=eth0 --bootproto=static --ip=192.168.1.{IP} --netmask=255.255.255.0 --gateway=192.168.1.1 --nameserver=192.168.1.199 --hostname={FQDN} --noipv6

# Set the root password
# For obvious reasons, I have removed the root hash here
rootpw --iscrypted {ROOTHASH}

# configer epel and puppetlab client repo
# {BASEURL} and {NETINSTURL} are macros that are replaced by the actual values
repo --name=base --baseurl={BASEURL}/os/x86_64
repo --name=extras --baseurl={BASEURL}/extras/x86_64
repo --name=updates --baseurl={BASEURL}/updates/x86_64

# We will install from internet
url --url {NETINSTURL}

# Reboot after the kickstart process is finished
# HERE is the reboot command
reboot

# Install the minimal system with some extras
%packages --nobase
coreutils
yum
yum-cron
rpm
e2fsprogs
lvm2
grub2
sysstat
ntp
openssh-server
openssh-clients
man
mlocate
epel-release
wget
%end

%post --log=/root/ks-post.log
exec < /dev/tty3 > /dev/tty3
chvt 3
echo
echo "################################"
echo "# Running Post Configuration #"
echo "################################"

echo
echo "################################"
echo "# Install puppetlabs and stdlib library"
echo "################################"
rpm -ivh {PUPPETLABS}

yum install -y puppet
puppet module install puppetlabs-stdlib

# retrieve the configuration files
# {CONFIGFILEHOST} is a macro that will be replaced by a correct value
wget -O /etc/puppet/puppet.conf http://{CONFIGFILEHOST}/puppet.conf

# Now run puppet to finish configuration
puppet agent -t

# swap to console 1
chvt 1

%end

这是/var/log/anaconda 中所有日志文件的最后 10 行:

==========
= anaconda.log
==========
05:38:32,645 INFO anaconda: Writing network configuration
05:38:32,646 INFO anaconda: Creating users
05:38:32,646 INFO anaconda: Clearing libuser.conf at /tmp/libuser.bNJxLy
05:38:32,898 INFO anaconda: Creating users
05:38:32,899 INFO anaconda: Configuring addons
05:38:32,906 INFO anaconda: Configuring addons
05:38:32,906 INFO anaconda: Generating initramfs
05:38:56,905 INFO anaconda: Generating initramfs
05:38:56,905 INFO anaconda: Running post-installation scripts
05:38:56,905 INFO anaconda: Running kickstart %%post script(s)
==========
= ifcfg.log
==========
05:31:10,594 DEBUG ifcfg: ONBOOT=yes
05:31:10,594 DEBUG ifcfg: IPV6INIT=no
05:31:10,594 DEBUG ifcfg: TYPE=Ethernet
05:31:10,594 DEBUG ifcfg: IPADDR=192.168.1.122
05:31:10,594 DEBUG ifcfg: PREFIX=24
05:31:10,594 DEBUG ifcfg: GATEWAY=192.168.1.1
05:31:10,594 DEBUG ifcfg: DEFROUTE=yes
05:31:10,594 DEBUG ifcfg: IPV4_FAILURE_FATAL=no
05:31:10,594 DEBUG ifcfg: NAME="System eth0"
05:31:10,598 DEBUG ifcfg: all settings: [{'802-3-ethernet': {'mac-address-blacklist': [], 's390-options': {}}, 'connection': {'interface-name': 'eth0', 'timestamp': 1460179868L, 'uuid': '81805767-a6d5-4aa2-8c01-7e425bf4dbf5', 'secondaries': [], 'type': '802-3-ethernet', 'id': 'System eth0', 'permissions': []}, 'ipv4': {'addresses': [[2046929088L, 24L, 16885952L]], 'dns-search': [], 'gateway': '192.168.1.1', 'route-data': [], 'dns': [3338774720L], 'routes': [], 'address-data': [{'prefix': 24L, 'address': '192.168.1.122'}], 'method': 'manual'}, 'ipv6': {'addresses': [], 'dns-search': [], 'route-data': [], 'dns': [], 'routes': [], 'address-data': [], 'method': 'ignore'}}]
==========
= journal.log
==========
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 70269 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/dm-snapshot.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 14245 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/dm-switch.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 110245 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/dm-thin-pool.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 25797 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/dm-verity.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 5869 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/dm-zero.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 11701 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/linear.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: drwxr-xr-x 2 root root 0 Apr 9 07:38 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/persistent-data
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 108901 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/persistent-data/dm-persistent-data.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 26061 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/raid0.ko
Apr 09 05:38:56 <FQDN> dracut[32525]: -rw-r--r-- 1 root root 63909 Mar 31 18:46 usr/lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/md/raid1.ko
==========
= ks-script-6SQvP5.log
==========
==========
= packaging.log
==========
05:38:29,324 INFO packaging: iwl7260-firmware-22.0.7.0-43.el7.noarch (304/306)

05:38:29,324 INFO packaging: iwl5150-firmware-8.24.2.2-43.el7.noarch (305/306)

05:38:29,324 INFO packaging: iwl100-firmware-39.31.5.1-43.el7.noarch (306/306)

05:38:29,324 INFO packaging: 2620 blocks

05:38:29,324 INFO packaging: ==== end rpm scriptlet logs ====
05:38:32,906 INFO packaging: recreating initrd for 3.10.0-327.13.1.el7.x86_64
==========
= program.log
==========
05:41:33,559 INFO program: HTTP request sent, awaiting response... 200 OK
05:41:33,559 INFO program: Length: 260 [text/plain]
05:41:33,559 INFO program: Saving to: '/etc/puppet/puppet.conf'
05:41:33,560 INFO program:
05:41:33,560 INFO program: 0K 100% 85.8M=0s
05:41:33,560 INFO program:
05:41:33,570 INFO program: 2016-04-09 07:39:51 (85.8 MB/s) - '/etc/puppet/puppet.conf' saved [260/260]
05:41:33,570 INFO program:
05:41:33,570 DEBUG program: Return code: 0
05:41:33,574 INFO program: Running... /bin/sh /tmp/ks-script-6SQvP5
==========
= storage.log
==========
05:31:22,498 DEBUG blivet: DeviceTree.getDevicesByType returned []
05:31:22,498 DEBUG blivet: DeviceTree.getDevicesByType: hidden: False ; incomplete: False ; device_type: mdcontainer ;
05:31:22,499 DEBUG blivet: DeviceTree.getDevicesByType returned []
05:31:22,499 DEBUG blivet: DeviceTree.getDevicesByType: hidden: False ; incomplete: False ; device_type: dm-multipath ;
05:31:22,500 DEBUG blivet: DeviceTree.getDevicesByType returned []
05:31:22,500 INFO blivet: not writing out mpath configuration
05:31:22,500 DEBUG blivet: DeviceTree.getDevicesByType: hidden: False ; incomplete: False ; device_type: zfcp ;
05:31:22,501 DEBUG blivet: DeviceTree.getDevicesByType returned []
05:38:29,391 DEBUG blivet: DeviceTree.getDevicesByInstance: hidden: False ; incomplete: False ; device_class: <class 'blivet.devices.network.NetworkStorageDevice'> ;
05:38:29,392 DEBUG blivet: DeviceTree.getDevicesByInstance returned []

还有/root/ks-post.log 的尾部:

Resolving <CONFIGFILEHOST> (<CONFIGFILEHOST>)... 192.168.1.15
Connecting to <CONFIGFILEHOST> (<CONFIGFILEHOST>)|192.168.1.15|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 260 [text/plain]
Saving to: '/etc/puppet/puppet.conf'

0K 100% 85.8M=0s

2016-04-09 07:39:51 (85.8 MB/s) - '/etc/puppet/puppet.conf' saved [260/260]

最佳答案

如果这出现在其他任何人的搜索结果中,安装程序很可能由于来自 puppet 代理的非零退出代码而停止。尝试以下补丁:

puppet agent -t || true

关于centos - 通过 virt-install 启动不会重启,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36450384/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com