OpenVZ Forum


Home » General » Support » "cpus" config option and "--set cpus" issue
"cpus" config option and "--set cpus" issue [message #34544] Fri, 16 January 2009 11:39 Go to next message
pauld is currently offline  pauld
Messages: 5
Registered: January 2009
Junior Member
Hello there,

I'm just starting out with openvz and have created my initial template following the walkthrough at http://wiki.openvz.org/Ubuntu_Hardy_template_creation.

I didn't really run into any issues with this (quite excellent) howto, but when trying to set the number of CPUs visable from a container, either using the command vzctl set <veid> --cpus <num> --save or by specifying and applying a ve config CPUS="1" the number of processors within the container stays the same as the hardware host.

root@vz:~# vzctl --version
vzctl version 3.0.22
root@vz:~# uname -a
Linux vz 2.6.24-23-openvz #1 SMP Thu Nov 27 20:50:16 UTC 2008 x86_64 GNU/Linux
root@vz:~# vzlist
      VEID      NPROC STATUS  IP_ADDR         HOSTNAME
       777          9 running -               -
root@vz:~# cat /proc/cpuinfo | egrep "processor|vendor_id"
processor       : 0
vendor_id       : GenuineIntel
processor       : 1
vendor_id       : GenuineIntel
processor       : 2
vendor_id       : GenuineIntel
processor       : 3
vendor_id       : GenuineIntel
processor       : 4
vendor_id       : GenuineIntel
processor       : 5
vendor_id       : GenuineIntel
processor       : 6
vendor_id       : GenuineIntel
processor       : 7
vendor_id       : GenuineIntel
root@vz:~# vzctl set 777 --cpus 1 --save
Setting CPUs: 1
Saved parameters for VE 777
root@vz:~# vzctl restart 777
Restarting VE
Stopping VE ...
VE was stopped
VE is unmounted
Starting VE ...
VE is mounted
Setting CPU units: 1000
Setting CPUs: 1
Configure meminfo: 9223372036854775807
File resolv.conf was modified
VE start in progress...
root@vz:~# vzctl exec 777 cat /proc/cpuinfo | egrep "processor|vendor_id"
processor       : 0
vendor_id       : GenuineIntel
processor       : 1
vendor_id       : GenuineIntel
processor       : 2
vendor_id       : GenuineIntel
processor       : 3
vendor_id       : GenuineIntel
processor       : 4
vendor_id       : GenuineIntel
processor       : 5
vendor_id       : GenuineIntel
processor       : 6
vendor_id       : GenuineIntel
processor       : 7
vendor_id       : GenuineIntel



Is there any more information I can provide to shine more light on this issue? (If it is indeed an issue and I amn't just misunderstanding the --cpus flag!) Any suggestions are greatly appreciated.

Regards,
Paul

[Updated on: Fri, 16 January 2009 11:50]

Report message to a moderator

Re: "cpus" config option and "--set cpus" issue [message #34545 is a reply to message #34544] Fri, 16 January 2009 11:54 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Hi Paul,

can you please check if --cpus works OK with RHEL5-based OpenVZ kernel?
If it works as expected, please, file a bug for 2.6.24 kernel.

Thank you!

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: "cpus" config option and "--set cpus" issue [message #34546 is a reply to message #34545] Fri, 16 January 2009 12:02 Go to previous messageGo to next message
pauld is currently offline  pauld
Messages: 5
Registered: January 2009
Junior Member
Hi Konstantin,

It will require me to reinstall the OS on the physical box as I am currently on ubuntu. Might make it difficult to provide more info if I re-install!

But if you suspect it is a bug, I shall try a redhat based os.

Thanks,
Paul
Re: "cpus" config option and "--set cpus" issue [message #34547 is a reply to message #34546] Fri, 16 January 2009 12:12 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Well, surely i don't want to force you to reinstall the host OS. But can you please try to install just the RHEL5-based OVZ kernel?
Not 100% sure that it will work fine, but it is worth to try i believe.

Quote:

But if you suspect it is a bug, I shall try a redhat based os.

In fact i suspect that simply that feature was not migrated from 2.6.18-x to 2.6.24. Why - this is the question.

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: "cpus" config option and "--set cpus" issue [message #34551 is a reply to message #34547] Fri, 16 January 2009 18:18 Go to previous messageGo to next message
pauld is currently offline  pauld
Messages: 5
Registered: January 2009
Junior Member
finist wrote on Fri, 16 January 2009 07:12

Well, surely i don't want to force you to reinstall the host OS. But can you please try to install just the RHEL5-based OVZ kernel?
Not 100% sure that it will work fine, but it is worth to try i believe.



I didn't realise it was possible to install a RHEL5-based OVZ kernel instead of my ubuntu kernel without a need to reinstall?

I shall look into and attempt this and return with my findings.

Regards,
Paul
Re: "cpus" config option and "--set cpus" issue [message #34553 is a reply to message #34544] Fri, 16 January 2009 18:41 Go to previous messageGo to next message
n00b_admin is currently offline  n00b_admin
Messages: 77
Registered: July 2006
Location: Romania
Member
Do not attempt to convert the rpm packages to deb since there are some pre and post install scripts that will fail on debian based OSes since they rely on redhat specific tools.

I tried a RHEL kernel rpm package on an Ubuntu box as well and that left my deb package manager in an inconsistent state blocking any package install/removal attempts.

Please be careful with this, I recommend checking out the kernel sources and building by hand if your skills allows this.

Re: "cpus" config option and "--set cpus" issue [message #34554 is a reply to message #34553] Fri, 16 January 2009 18:48 Go to previous messageGo to next message
pauld is currently offline  pauld
Messages: 5
Registered: January 2009
Junior Member
n00b_admin wrote on Fri, 16 January 2009 13:41


Please be careful with this, I recommend checking out the kernel sources and building by hand if your skills allows this.




Thanks n00b_admin,

That was the plan alright... wasn't going to fetch rpm and force in the package. Did you managed (or even try!) to build the redhat kernel source on your ubuntu box?

Regards,
Paul
Re: "cpus" config option and "--set cpus" issue [message #34555 is a reply to message #34544] Fri, 16 January 2009 19:35 Go to previous messageGo to next message
n00b_admin is currently offline  n00b_admin
Messages: 77
Registered: July 2006
Location: Romania
Member
Hello,

Unfortunately I am unable to provide you further details since I switched to Gentoo.

I didn't attempt building from sources when i used Ubuntu but i tried the redhat based kernel on Gentoo and worked fine using emerge.

In this respect, i think it should work pretty good on Ubuntu as well.

Watch out for proprietary ATI drivers since my redhat based kernel had the bad habit of panicking on my Gentoo box as soon as firefox was started.

If possible, i recommend the 2.6.24 branch that, for the moment, is stable on my machine.

I'm using this setup in a desktop environment, if you do not require the latest and greatest of the OSS i strongly recommend CentOS in any server deployments.

I managed for about a year a CentOS 4 server running like 40 VE's on it without a hitch.

If you do not have strong reasons against RHEL or CentOS, OpenVZ will work at its best on this OSes.

Cheers!
Re: "cpus" config option and "--set cpus" issue [message #34572 is a reply to message #34554] Mon, 19 January 2009 10:01 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Hi Paul,

Quote:

That was the plan alright... wasn't going to fetch rpm and force in the package. Did you managed (or even try!) to build the redhat kernel source on your ubuntu box?


BTW, you can just extract files from rpm from the site (rpm2cpio kernel | cpio -id) and then manually put kernel itself (vmlinuz-...) to /boot and modules into /lib/modules/$KERNEL_VER

The only thing you'll have to do after that is to manually create initrd and add an entry to the bootloader.

Just wanted to say - you don't have to rebuild the kernel yourself (although, surely you can if you prefer that way. Smile )

Good luck!

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: "cpus" config option and "--set cpus" issue [message #34576 is a reply to message #34572] Mon, 19 January 2009 10:56 Go to previous message
pauld is currently offline  pauld
Messages: 5
Registered: January 2009
Junior Member
Hi finist,

I build it from the src-rpm package. Seemed to work well enough I think. Will try and report back with any developments! (Haven't really had a change to play with it in any depth yet)

-Paul
Previous Topic: Checkpoint/Backup of a container
Next Topic: Devnodes question
Goto Forum:
  


Current Time: Sat Oct 05 12:24:07 GMT 2024

Total time taken to generate the page: 0.03604 seconds