LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   virt-install + Kickstart provisioning keeps dropping to dracut shell (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/virt-install-kickstart-provisioning-keeps-dropping-to-dracut-shell-4175639459/)

sleepee 09-30-2018 11:48 AM

virt-install + Kickstart provisioning keeps dropping to dracut shell
 
Hello everybody,
First time posting here on LQ.

So, I've been trying to automate the provisioning of vm's on my KVM host running CentOS7 as much as possible.
So, I created a kickstart file, and a virt-install script that calls the kickstart file.
Almost everything works as expected, but a short while after Kickstart starts doing its thing, I start getting a whole bunch of error messages that look like this:

Code:

[  188.602345] dracut-initqueue[699]: Warning: dracut-initqueue timeout - starting timeout scripts
That line repeats dozens and dozens of times until i finally get this message:

Code:

[  188.602345] dracut-initqueue[699]: Warning: dracut-initqueue timeout - starting timeout scripts
[  188.602654] dracut-initqueue[699]: Warning: Could not boot.
[  188.733354] dracut-initqueue[699]: Warning: /dev/root does not exist
        Starting Dracut Emergency Shell...
Warning: /dev/root does not exist

Generating "/run/initramfs/rdsosreport.txt"


Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.


dracut:/#

Here's a link to the rdsosreport.txt

Now, as you can see, the warning says "/dev/root does not exist", and indeed, from the dracut shell, I can see that /dev/root doesn't exist.

Code:

dracut:/# ls -lh /dev/root
ls: cannot access /dev/root: No such file or directory

But I'm not sure why I get that message though. I got the ks.cfg file from an existing vm that I installed with the virt-manager GUI (although I did add/modify a few things).
And from the rdsosreport log, I can't find anything else that's going wrong.


Here's the virt-install script that creates the vm

And here's the ks.cfg kickstart file that the script calls.

I can spin up vm's with no problems whatsoever when I use the virt-manager GUI. Also, the virt-install script seems to do its job of actually creating the VM and calling the kickstart file.
So, I assume that the problem is within the kickstart file, but I just can't seem to find what I'm doing wrong.

Any help or input would be appreciated.
Thanks in advance.

berndbausch 09-30-2018 03:55 PM

I am not sure if it’s relevant, but here you call partition 1 “sda1”:
Code:

part sda1 --size=1024 --fstype=ext4 --asprimary --ondisk=vda
And shouldn’t you create vda2 somewhere?

sleepee 09-30-2018 05:22 PM

Quote:

Originally Posted by berndbausch (Post 5909507)
I am not sure if it’s relevant, but here you call partition 1 “sda1”:
Code:

part sda1 --size=1024 --fstype=ext4 --asprimary --ondisk=vda
And shouldn’t you create vda2 somewhere?


Good catch. I actually didn't see that before.
Probably a typo I left while I was tinkering with the ks.cfg file.

So, I changed the ks.cfg file so that now it reads like this:

Code:

ignoredisk --only-use=vda
#System bootloader configuration
bootloader --location=mbr --boot-drive=vda
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part vda1 --size=1024 --fstype=ext4 --asprimary --ondisk=vda
part /boot --size=1024 --onpart=vda1
part vda2 --size=1 --grow --asprimary --ondisk=vda
part pv.00 --size=1 --grow --onpart=vda2
volgroup rootvg pv.00
logvol / --fstype=ext4 --vgname=rootvg --size=2048 --grow --name=root

So now it reads vda1 instead of sda1
And I added a line to create vda2, which fills the rest of the disk.

But I tried to spin up a VM again after changing the ks.cfg again, and I'm still getting the same "Warning: /dev/root does not exist" error.

I'm totally out of any ideas.
Thanks for the help though.

berndbausch 09-30-2018 10:13 PM

That's hard to troubleshoot, isn't it?

Your virt-install script doesn't specify the disk bus (scsi or virtio). I would think that the default is virtio, so that your kickstart should work, but perhaps I am wrong? Best to specify virtio explicitly, e.g. --disk ${disk_image_file},bus=virtio.

How did you create the kickstart file? A good practice is basing it on a manual installation that is as close as possible to your intended automatic installation. When your manual installation is complete, find the corresponding kickstart file under /root and adapt it.

sleepee 10-02-2018 08:17 AM

Quote:

Originally Posted by berndbausch (Post 5909595)
That's hard to troubleshoot, isn't it?

Your virt-install script doesn't specify the disk bus (scsi or virtio). I would think that the default is virtio, so that your kickstart should work, but perhaps I am wrong? Best to specify virtio explicitly, e.g. --disk ${disk_image_file},bus=virtio.

How did you create the kickstart file? A good practice is basing it on a manual installation that is as close as possible to your intended automatic installation. When your manual installation is complete, find the corresponding kickstart file under /root and adapt it.

Well, I just tried with buses virtio, sata, and scsi, and none of them worked. I still get the same "Warning: /dev/root does not exist" message and dropped to a dracut shell again.
All my other VM's (installed with virt-manager) use virtio.

I actually got the ks.cfg file from another VM. I did modify the ks.cfg and add some stuff, like a different partitioning scheme and language support. But I ran ksvalidator on the ks.cfg file I'm working with, and it gave no errors.

I'd really like this to work, but I have no idea what to even look for anymore. It doesn't seem like this should be that complicated. If it works with virt-manager, I'm not sure why it doesn't work with the virt-install command.

uselesslogin 06-20-2022 05:07 AM

My Issue
 
Just for anyone who may be searching and come across this page.

In my case the actual issue was the kickstart file itself was not at the location specified by the init.ks kernel arg. Basically it was /tmp/some.ks on my system, and I accidentally set the ks.init arg to the same path, when it is actually /some.ks inside of the vm itself.


All times are GMT -5. The time now is 08:44 PM.