OpenVZ Forum


Home » General » Discussions » What's the correct way to install OpenVZ via kickstart
What's the correct way to install OpenVZ via kickstart [message #51477] Tue, 24 June 2014 16:13 Go to next message
PeterSteele is currently offline  PeterSteele
Messages: 5
Registered: February 2014
Location: United States
Junior Member
I have a streamlined CentOS install that's automated through the kickstart facility. I want my custom image to use the OpenVZ kernel instead of the default CentOS kernel. I'm not sure what the correct way is to do this.

My current kickstart script does not explicitly reference which kernel files are installed. This is handled automatically by the @core entry in the %packages section:

%packages --nobase
@core

I know I can add code in %post to install the kickstart kernel as one of the final stages of the kickstart install process. Is this the best way?
Re: What's the correct way to install OpenVZ via kickstart [message #51489 is a reply to message #51477] Wed, 25 June 2014 13:52 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
Well, not saying it's the best way, but in my kickstarts I exclude the kernel packages from the stock repos entirely, add openvz repos and install the vzkernel and tools form there.

If I remember correctly, I used exclusions in order to stop installing stock kernels even if they are newer then vzkernel (which is often).

I used such kickstarts to create LiveDVDs with Scientific Linux 6.x & OpenVZ.
Re: What's the correct way to install OpenVZ via kickstart [message #51490 is a reply to message #51489] Wed, 25 June 2014 14:04 Go to previous messageGo to next message
PeterSteele is currently offline  PeterSteele
Messages: 5
Registered: February 2014
Location: United States
Junior Member
My approach is a little different. I create a custom iso with just the packages that I want to include, basically a minimal CentOS install plus a few extra packages. I then turn the iso into a bootable USB stick. We have to assume the installation process may not have external web access so everything has to be on the stick.

I now want to include the OpenVZ kernel (and the related vz tools) instead of the stock kernel but I don't see a way to do this directly. What I am doing is letting the install run as normal, which installs the stock kernel, then in the %post session I have code that installs the OpenVZ rpms. This updates the bootloader config so that when the system boots the OpenVZ kernel is loaded like I need. But I actually have two kernels installed and two entries in grub.conf. It works but it's a bit ugly. I'd rather just have the OpenVZ kernel installed, replacing the stock kernel, but I don't see how I can do this via kickstart.
Re: What's the correct way to install OpenVZ via kickstart [message #51492 is a reply to message #51477] Thu, 26 June 2014 00:15 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
I add OpenVZ repos to the kickstart for the purpose of compiling the .iso. The result being an .iso with a single vzkernel, no stock kernels. When the .iso is used, network isn't needed.

I think whether this is done to create a minimal install .iso or custom live .iso, or whether it's burned on DVD or written to USB, shouldn't really matter..? Or is the minimal install process that different form the live usb/dvd one..? It's late over here, I might be missing something... Smile

Relevant repo parts from my kickstart:

repo --name=openvz-kernel-rhel6 --baseurl=http://...
repo --name=openvz-utils        --baseurl=http://...

and:

repo --name=sl6-base    --excludepkgs=kernel,kernel-debug,kernel-debug-devel,kernel-devel,kernel-doc,kernel-firmware,kernel-headers,perf  --baseurl=http://...
repo --name=sl6-security        --excludepkgs=kernel,kernel-debug,kernel-debug-devel,kernel-devel,kernel-doc,kernel-firmware,kernel-headers,perf  --baseurl=http://..
Re: What's the correct way to install OpenVZ via kickstart [message #51493 is a reply to message #51490] Thu, 26 June 2014 13:20 Go to previous messageGo to next message
PeterSteele is currently offline  PeterSteele
Messages: 5
Registered: February 2014
Location: United States
Junior Member
I think we're not talking about quite the same thing. I first create a custom iso from the stock CentOS iso using the createrepo/mkisofs tools, including just the set of rpms that I need. I then turn that iso into a bootable USB image. When I boot a system with that image, it performs a hands-free install of the custom CentOS image I've created. My kickstart script assumes everything needed is included on the USB stick. There can be no references to external repos for example.

I think perhaps what I need to do is figure out how to include the OpenVZ kernel in my createrepo process, replacing the stock kernel that gets included in my custom iso. Then the lines

%packages --nobase
@core

in my kickstart script would automatically select the OpenVZ kernel since it would be the "core" kernel in my custom iso.

Then again, it's early here and I might not be thinking straight yet... Smile
Re: What's the correct way to install OpenVZ via kickstart [message #51494 is a reply to message #51477] Thu, 26 June 2014 15:06 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
Yea, our usage model is a bit different. My kickstart->iso stage is the equivalent of your createrepo/mkisofs stage... So you're right, once you incorporate the vzkernel instead of the stock kernel in that stage, you should be all set.

The vzkernel rpm package provides the "kernel", it should be a drop in replacement (together with other related packages, such as vzkernel-firmware, etc.). I think your .iso -> HN install process should select the vzkernel without any further tweaks.

Btw, for anyone else reading or searching for such information - I use a custom kickstart (with OpenVZ, EPEL, etc. packages added) -> livecd-creator -> .iso -> live-cd-iso-to-disk to create a live usb, which can all be done on the command line. This SL6/OpenVZ live media was then used for demonstration purposes.
Re: What's the correct way to install OpenVZ via kickstart [message #52815 is a reply to message #51477] Tue, 25 April 2017 22:24 Go to previous message
azilber is currently offline  azilber
Messages: 15
Registered: May 2015
Location: Malaysia
Junior Member
PeterSteele wrote on Tue, 24 June 2014 16:13
I have a streamlined CentOS install that's automated through the kickstart facility. I want my custom image to use the OpenVZ kernel instead of the default CentOS kernel. I'm not sure what the correct way is to do this.

My current kickstart script does not explicitly reference which kernel files are installed. This is handled automatically by the @core entry in the %packages section:

%packages --nobase
@core

I know I can add code in %post to install the kickstart kernel as one of the final stages of the kickstart install process. Is this the best way?


I'm going to un-necro this thread.. if you install OpenVZ manually, you can look into /root/anaconda-ks.cfg.

I've tested kickstarts of OpenVZ via Koan/Cobbler. Here's my package list for OpenVZ 7:

%packages
@^cloudserver
@base
@core
@ps
@qemu
@templates
@vz
chrony
kexec-tools

%end

Previous Topic: Considering moving from Docker to OpenVZ
Next Topic: Why Systemd?
Goto Forum:
  


Current Time: Fri Dec 27 00:35:01 GMT 2024

Total time taken to generate the page: 0.03508 seconds