I have a setup where I perform a kickstart of a new VM through a virt-install.
Everything runs fine but in stead of performing a reboot, as instructed in the kickstart file, the virtual machine shuts down.
The VM host is a CentOS 7.2 system running libvirt 1.2.17-13
Once I manually start up the new VM, everything is as it is expected.
Does anyone know WHY the system refuses to reboot and HOW this problem can be solved?
Thanx.
This is the template for my kickstart file:
(Please, let's not start a discussion about disabling selinux and not using firewalld. The question is about the reboot ;-) )
# 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
Here are the last 10 lines of all the log files in /var/log/anaconda:
==========
= 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 []
And a tail of /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]