Hi, I have a fedora22 server with libvirt/kvm/qemu installed and would like to use it to create a number of kvm virtual instances remotely, non-interactively, according to my parameters (memory, disk layout, package options, etc).
I'm aware of kickstart, but have never used it. Is that the best option, or is something like chef or puppet easier?
I'd really like to create a basic 8GB, 1G RAM fedora22 server setup with a minimal install.
I've experimented with virt-install, but that apparently doesn't provide the ability to select all of the install config options like language, disk layout, IP address, etc.
I'd appreciate any pointers to documents, or tips here, that could help me get started doing this more quickly...
Thanks, Alex
On Wed, Jul 22, 2015 at 10:39:15AM -0400, Alex wrote:
I have a fedora22 server with libvirt/kvm/qemu installed and would like to use it to create a number of kvm virtual instances remotely, non-interactively, according to my parameters (memory, disk layout, package options, etc). I'm aware of kickstart, but have never used it. Is that the best option, or is something like chef or puppet easier?
Kickstart is the way to go for the initial install. You can use a config management system _after_ that. (Personally, I recommend ansible, but it's up to you.)
I've experimented with virt-install, but that apparently doesn't provide the ability to select all of the install config options like language, disk layout, IP address, etc.
It does, if you feed it a kickstart file.
On 07/22/2015 07:39 AM, Alex wrote:
I'm aware of kickstart, but have never used it. Is that the best option, or is something like chef or puppet easier? ... I've experimented with virt-install, but that apparently doesn't provide the ability to select all of the install config options
It might help to picture the virtual machine as a stack.
At the lowest level is the virtualized and emulated hardware. virt-install creates a virtual machine and sets the initial boot parameters. That is, it selects and provides a kernel and initrd, and the kernel command line, for the initial boot.
Anaconda, the Fedora installer is another layer in the stack. It can use some command line arguments, but those are mostly for its initial internal setup. Kickstart is the component that can be used to answer the questions that Anaconda asks during a normal setup.
After the initial boot, the system will boot from its virtual disks, at which point you should have a standard operating system on top of virtual hardware. At that point, you should use a tool (bcfg2, ansible, salt, puppet, chef, etc) to finish configuring the system.
You could also run your configuration management tool from the "post" script in your kickstart file, so that there is never an unconfigured boot.
Hi,
I'm aware of kickstart, but have never used it. Is that the best option, or is something like chef or puppet easier? ... I've experimented with virt-install, but that apparently doesn't provide the ability to select all of the install config options
It might help to picture the virtual machine as a stack.
Okay, got it, cool.
I've created a kickstart file and passed it to virt-install, but have had no success in actually getting it to go through an install:
# virt-install --name demo --hvm --memory 1024 --virt-type kvm \ --disk path=/var/lib/libvirt/images/demo.img,size=8 \ --network network:default --os-variant=fedora22 \ --location /var/lib/libvirt/images/fedora22 \ -x "ks=/var/lib/libvirt/images/anaconda-ks.cfg" \ --graphics vnc,password=foobar,listen=0.0.0.0,port=5910
This is from the command-line on a server in the colo. It fails with a dracut error "Warning: /dev/root does not exist" then the install fails with a dracut prompt.
What's wrong with that command line?
Thanks, Alex
On 07/22/2015 04:12 PM, Alex wrote:
# virt-install --name demo --hvm --memory 1024 --virt-type kvm \ -x "ks=/var/lib/libvirt/images/anaconda-ks.cfg" \
https://rhinstaller.github.io/anaconda/boot-options.html#inst-repo
The kickstart location is read by the operating system inside the VM. It doesn't have access to the filesystem of the KVM host. You'll probably put the kickstart file in a network accessible location, like an HTTP server.
Hi,
# virt-install --name demo --hvm --memory 1024 --virt-type kvm \ -x "ks=/var/lib/libvirt/images/anaconda-ks.cfg" \
https://rhinstaller.github.io/anaconda/boot-options.html#inst-repo
The kickstart location is read by the operating system inside the VM. It doesn't have access to the filesystem of the KVM host. You'll probably put the kickstart file in a network accessible location, like an HTTP server.
That was it, thanks so much.
Still have some work to do to fully understand how the networking works, but I did manage to make it install...