OpenVZ Forum


Home » General » Support » Linux version host/guest
Linux version host/guest [message #27785] Wed, 27 February 2008 10:57 Go to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
Hello,

Everything seems to run correctly. But I have a question on the Linux version: It is the same on host and guest.

Host OS (uname -a):
Linux cs-936-dev1 2.6.18-53.1.6.el5.028stab053.6 #1 SMP Mon Feb 11 20:14:31 MSK 2008 x86_64 x86_64 x86_64 GNU/Linux

This is normal.

Guest OS (uname -a):
Linux cs-936-vz01 2.6.18-53.1.6.el5.028stab053.6 #1 SMP Mon Feb 11 20:14:31 MSK 2008 x86_64 x86_64 x86_64 GNU/Linux

This is curious as it is the host kernel.

If I run the command rpm -qa | grep kernel-2 in guest, I have:
kernel-2.6.18-53.1.13.el5
kernel-2.6.18-53.1.4.el5


Is it normal or did I make a mistake while installing?
Re: Linux version host/guest [message #27804 is a reply to message #27785] Thu, 28 February 2008 07:14 Go to previous messageGo to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
It's a pity there is no reply. Maybe the answer is obvious but I don't know it. And I've got a look at the documentation without finding anything pertinent.

To get a more general question, I would write: How select the kernel I want to boot on? Here there are the kernel-2.6.18-53.1.4.el5 and the 2.6.18-53.1.13.el5 versions. I suppose grub is not used to boot the guest...

Thanx in advance for any reply.
Re: Linux version host/guest [message #27805 is a reply to message #27785] Thu, 28 February 2008 08:16 Go to previous messageGo to next message
xemul is currently offline  xemul
Messages: 248
Registered: November 2005
Senior Member
The kernel version seen in the guest's uname is derived from the host's one.

http://static.openvz.org/userbars/openvz-developer.png
Re: Linux version host/guest [message #27807 is a reply to message #27805] Thu, 28 February 2008 08:30 Go to previous messageGo to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
Thank you Pavel for your reply.

So, as there is only one real kernel running, the uname -r command provides the name of the host kernel, right?

Imagine that I run yum update from within the guest and the kernel is updated. Then I reboot the guest. Is the guest Linux version changed? If so is it possible to check the running version?
Re: Linux version host/guest [message #27847 is a reply to message #27785] Fri, 29 February 2008 08:44 Go to previous messageGo to next message
xemul is currently offline  xemul
Messages: 248
Registered: November 2005
Senior Member
Quote:

... the uname -r command provides the name of the host kernel, right?


Basically - yes, but read my next comment.

Quote:

Then I reboot the guest. Is the guest Linux version changed?


Automatically - no, but we have a /proc/sys/kernel/virt_osrelease file. Writing to it causes all VEs that start after the change get the new uname -r. Further file updates do not affect already running VEs

Quote:

If so is it possible to check the running version?


Considering the /proc/sys/kernel/virt_osrelease screwup ability, you have no way to check the actual kernel version from inside the guest.


http://static.openvz.org/userbars/openvz-developer.png
Re: Linux version host/guest [message #27855 is a reply to message #27847] Fri, 29 February 2008 10:35 Go to previous messageGo to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
Thank you again, Pavel, for your precise answer.

I'm afraid this open my mind and finally I have another question. If we decide to switch to OpenVZ for our ~ 150 servers, we need to manage them in an easy, logical manner.

Imagine we got hosts and guests running fine. One day a kernel update is available for guests and we would like to spread this new version.

We have two possibilities to make the update:

1) We make a new guest cache and re-install all servers, one by one. It seems to be less than a minute for each guest to be re-installed. Brute force, local data must be saved-restored. This is the static way of updating: /etc/vz/conf/<guest_id>.conf provides the kernel version.

2) We use vzyum (or vzrpm) from each host to update all guests. This solution is not possible as we run a 64 bit OS (based on RHEL 5.1) and vzyum (or vzrpm) cannot be installed. So we enter each guest from hosts and make the update from inside (yum or rpm). This is the dynamic way of updating: the config file does not give the kernel version and we have to check it.

So here is my question: Is the dynamic kernel update is possible (then how check Linux version?), usable and used? Or the static way is a better solution even if there is a bit more work...
Re: Linux version host/guest [message #27857 is a reply to message #27855] Fri, 29 February 2008 13:32 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Excuse my intrussion Embarassed but I have some question:
1.
Quote:

/etc/vz/conf/<guest_id>.conf provides the kernel version.

What parameter in conf file provides the kernel version?
2. What is the main goal of your experiment? Do you want to control "uname" output inside VE? Do you want to install kernel rpm inside VE? Anyway there is only one real running kernel. If you install kernel rpm inside VE you will not be able to boot VE in it. Or I've misunderstood you?
Re: Linux version host/guest [message #27873 is a reply to message #27857] Fri, 29 February 2008 14:23 Go to previous messageGo to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
Hello Marat,

1.
I did not exactly write what I meant: <guest_id>.conf does not provide directly the kernel version, but the record OSTEMPLATE gives the name of the cache and as I am the one who realized it from scratch, I know exactly the kernel version Cool. I can even put it in the name of the cache!

2.
The final goal is to be able to update the guest kernels without too much efforts and down time. So getting the kernel version can be important to know whether a guest has already been updated or not!

I'm not confident yet with the way we can update kernels: Is it possible to update a guest without changing the host? If yes how to do so?

Hope I've been clearer this time.
Re: Linux version host/guest [message #27877 is a reply to message #27873] Fri, 29 February 2008 16:22 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

1. OK, you want to distinguish your VEs (which is has been updated and which is not yet). But you could simply change VE's name
vzctl set VEID --name YOUR_NAME_UPDATED --save
. Let's assume that we have updated our VPS. We should simply change VE's name (OLD_NAME ---> OLD_NAME_UPDATED).
Why do you use OSTEMPLATE parameter from conf file for these purposes? To my mind you shouldn't do that. And there is some reasons:
a) Some vz* utilities (for example vzyum utility) use OSTEMPLATE value from VE's conf file. So if it will not be able to parse OSTEMPLATE parameter you will not be able to use this utility. You must keep it in mind.
b) from OpenVZ user's guide "You do not have to change this parameter" Smile

2. Why do you want to update guest's kernel?
3.
Quote:

Is it possible to update a guest without changing the host?

You can update guests like common operating systems (via yum, vzyum etc). But you cannot update kernel, you can only install appropriate package, but you will not be able to boot in it. HN and VE use the same OVZ kernel. BUT! any software inside VE might be considered like the software on the separate system.

P.S.
save your data before upgrading your guests.
Some wiki pages are describing the update process. For example
http://wiki.openvz.org/Fedora_7_to_8_update
Re: Linux version host/guest [message #27893 is a reply to message #27877] Sat, 01 March 2008 10:08 Go to previous messageGo to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
First of all, I want to thank you all spending time to explain things.

As I understand, the guests run the same kernel as their host. I've read that it was possible to run different distros on the same host, but the restriction of the kernel was not clearly written. Now it's simpler: If we need to upgrade the kernel of a guest, we have to upgrade the host and then all the guests will be automatically upgraded. Is that correct? This is another constraint: If we want to upgrade the kernel, we have to wait you (as the OpenVZ developers) make the new ovzkernel package available. Fortunately we use a RHEL5 based distro and last time the package has been out just one month after the official RedHat update.

Some information about what I do:
We need to be able to install, re-install, update or retrieve previous installations in an easy and automatic way because we have many, many servers. At the present moment I have almost finished the scripts of installation, with all our specific stuff. It can be very fast: Less than one minute for a full installation and start of a guest. Installation of a host is now automatic with its guest installations (common and specific stuff); creation of the default cache is done as well. Changing the automatic installation of a guest from one host to another is just changing a sym link. I've not yet made a GUI, but others sys admins are fond of script commands Smile.

Next steps will be: (1) dynamic management of guest resources, (2) alarms and (3) check-pointing. So you will receive questions from time to time, sometime just stupid...
Re: Linux version host/guest [message #27905 is a reply to message #27893] Sun, 02 March 2008 04:25 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
jmelyn wrote on Sat, 01 March 2008 05:08

First of all, I want to thank you all spending time to explain things.

As I understand, the guests run the same kernel as their host. I've read that it was possible to run different distros on the same host, but the restriction of the kernel was not clearly written. Now it's simpler: If we need to upgrade the kernel of a guest, we have to upgrade the host and then all the guests will be automatically upgraded. Is that correct? This is another constraint: If we want to upgrade the kernel, we have to wait you (as the OpenVZ developers) make the new ovzkernel package available. Fortunately we use a RHEL5 based distro and last time the package has been out just one month after the official RedHat update.



Yes, you are right. When you update the host's ovzkernel on the host, then reboot, then the hosts will boot in the new kernel, so the guests will also be using this new kernel.

jmelyn wrote on Sat, 01 March 2008 05:08
Some information about what I do:
We need to be able to install, re-install, update or retrieve previous installations in an easy and automatic way because we have many, many servers. At the present moment I have almost finished the scripts of installation, with all our specific stuff. It can be very fast: Less than one minute for a full installation and start of a guest. Installation of a host is now automatic with its guest installations (common and specific stuff); creation of the default cache is done as well. Changing the automatic installation of a guest from one host to another is just changing a sym link. I've not yet made a GUI, but others sys admins are fond of script commands :).
[/quote


I use vzdump a lot to do that. You can creste some master image then copy and restore them easily.

Next steps will be: (1) dynamic management of guest resources, (2) alarms and (3) check-pointing. So you will receive questions from time to time, sometime just stupid...


Ok, please read the doc and wiki and hang around on this forum, maybe a lot of answers are already there. See my signature for links.


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Linux version host/guest [message #27914 is a reply to message #27905] Mon, 03 March 2008 08:25 Go to previous messageGo to next message
jmelyn is currently offline  jmelyn
Messages: 27
Registered: June 2007
Junior Member
OK Ugo,

Thanx for the reply. I already have the "OpenVZ User's Guide" printed and I search wikis before asking questions. But doc is difficult for me I mean the organization, the structure. When I need to find information again it takes me minutes to retrieve it. I suppose this is because I don't know well OpenVZ...

Well, that's the time to dig deeper in virtualization Cool.
Re: Linux version host/guest [message #28219 is a reply to message #27914] Tue, 11 March 2008 20:10 Go to previous message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
Just to clarify... there is one and only one kernel running period... and that is on the host node. You can install all of the kernels you want inside the containers... but you are never going to be able to run them... as there is only one kernel running. While it may be possible to change what kernel a container reports as running... that's just a cosmetic thing.

To get a better picture, understand that OpenVZ is OS virtualization and not machine virtualization. A container is nothing more than a grouping of processes together... with their own resources and filesystem.

From the host node do "pstree -nup". You'll see a number of init processes and children processes under them. The init process with PID 1 is the real init process for the host node and the other init processes are the init processes for each container.

Please note that a container is the init process and its children processes... and the virtualized resources that the OpenVZ kernel provides to isolate these groups of processes. There is only one kernel running.

If you want, you can delete all kernels from your containers... I imagine the kernel packages are installed because they were needed to satisfy package dependencies by the package manager inside of your container. Normally a container doesn't have a kernel package installed.


--
TYL, Scott Dowdle
Belgrade, Montana, USA

[Updated on: Tue, 11 March 2008 20:13]

Report message to a moderator

Previous Topic: How to force a frozen VE to stop?
Next Topic: Problem with OpenVPN in VE
Goto Forum:
  


Current Time: Sun Nov 27 19:37:01 GMT 2022

Total time taken to generate the page: 0.01021 seconds