[Vserver] How to use the idle-time feature in the new devel-branch scheduler?

2006-08-09 Thread EKC

Hello,

I am trying to figure out how to use the idle time feature in the
devel branch and the vsched-0.02 tool.

What I want to do is have P guests each use 1/P of host CPU time and
to dynamically adjust to use 1/(P+Y) of CPU time when Y new guests are
started. When guests are stopped, I want hard_sched to adjust
accordingly for the remaining guests.

I am using hard_sched now and I have to re-run vsched for every guest
every time that I start a new guest. I understand (thank you Bertl for
enlightening me on IRC) that the idle-time feature in the devel branch
will take care of this for me.

What's a simple example of how to use vsched0.02
(http://vserver.13thfloor.at/Experimental/TOOLS/vsched-0.02.tar.bz) to
have P guests dynamically adjust to use 1/P of cpu time? Is the new
vsched the best tool for this job?

What would I need to do differently if I have more than 1 CPU?

Thanks a lot!

ekc
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Michael S. Zick
On Wed August 9 2006 10:56, Jim Wight wrote:
> On Wed, 2006-08-09 at 09:58 -0500, Michael S. Zick wrote:
> > On Wed August 9 2006 09:30, Jim Wight wrote:
> > > On Wed, 2006-08-09 at 08:50 -0500, Michael S. Zick wrote:
> > > > Since the chroot command does not change the context (or namespace) then
> > > > it must be the act of trying to run in a different context that breaks
> > > > something.
> > > > 
> > > > My guess, the dynamic library handling.
> > > > 
> > > > Try executing /lib/libc.so.6 in the guest context, see if you get a
> > > > normal report out of it.  It should print its build information,
> > > > including its version.
> > > 
> > > What command is required to accomplish that?
> > > 
> > 
> > The file libc.so.6 is an executable.
> > 
> > Just substitute "/lib/libc.so.6" for where you are using "/usr/bin/env"
> > in your testing.
> 
> OK. I changed the value of _ENV in util-vserver-vars, which results in
> 
> # vserver fc5 start
> GNU C Library development release version 2.3.5, by Roland McGrath et
> al.

Oops.

> Copyright (C) 2005 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 4.0.1 20050727 (Red Hat 4.0.1-5).
> Compiled on a Linux 2.4.20 system on 2005-08-15.
> Available extensions:
> GNU libio by Per Bothner
> crypt add-on version 2.1 by Michael Glad and others
> Native POSIX Threads Library by Ulrich Drepper et al
> The C stubs add-on version 2.1.2.
> BIND-8.2.3-T5B
> NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
> Glibc-2.0 compatibility add-on by Cristian Gafton
> GNU Libidn by Simon Josefsson
> Thread-local storage support included.
> For bug reporting instructions, please see:
> .
> vshelper.init: can not determine xid of vserver 'fc5'; returned value
> was ''
> 
> which is what executing /lib/libc.so.6 on the (FC4) host gives.
> Presumably you would expect the output to be the same as
> 
> # chroot /vservers/fc5 /lib/libc.so.6
> GNU C Library development release version 2.4, by Roland McGrath et al.
>

Super!

> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 4.1.0 20060304 (Red Hat 4.1.0-3).
> Compiled on a Linux 2.6.9 system on 2006-05-12.
> Available extensions:
> The C stubs add-on version 2.1.2.
> crypt add-on version 2.1 by Michael Glad and others
> GNU Libidn by Simon Josefsson
> GNU libio by Per Bothner
> NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
> Native POSIX Threads Library by Ulrich Drepper et al
> BIND-8.2.3-T5B
> Thread-local storage support included.
> For bug reporting instructions, please see:
> .
> 
> > Or build your own command out of the low level tools, similar too:
> > 
> > chbind --ip ${VADDRESS} -- vcontext --create --xid ${VID} --chroot -- \
> > /usr/bin/env -i HOSTNAME=${VROOT} HOME=/root TERM="${TERM}" PS1='\u:\w\$ ' \
> > PATH='/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin' 
> > /bin/bash --login +h
> 
> Like this
> 
> # cd /vservers/fc5
> # vcontext --create --xid 49142 --chroot -- /usr/bin/env -i HOME=/root
> PATH='/bin:/sbin:/usr/bin:/usr/sbin' /bin/bash --login +h
> New security context is 49142
> [EMAIL PROTECTED] /]# cat /etc/redhat-release
> Fedora Core release 5 (Bordeaux)
> [EMAIL PROTECTED] /]# /lib/libc.so.6
> GNU C Library development release version 2.4, by Roland McGrath et al.
> Copyright (C) 2006 Free Software Foundation, Inc.
>

You got it and I don't see any complaints from "env", "bash", the loader,
or libc.so.6.

Now the only question is why the high-level tools have a problem starting
your vserver.

Sorry, I can't help with the "why", but you have a shell in the virtual
context to work from.  First would probably be to run /sbin/ldconfig.

Major difference here is the various configuration files that the
high-level scripts use.  These low-level commands aren't referencing them.

Mike
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Jim Wight
On Wed, 2006-08-09 at 09:58 -0500, Michael S. Zick wrote:
> On Wed August 9 2006 09:30, Jim Wight wrote:
> > On Wed, 2006-08-09 at 08:50 -0500, Michael S. Zick wrote:
> > > Since the chroot command does not change the context (or namespace) then
> > > it must be the act of trying to run in a different context that breaks
> > > something.
> > > 
> > > My guess, the dynamic library handling.
> > > 
> > > Try executing /lib/libc.so.6 in the guest context, see if you get a
> > > normal report out of it.  It should print its build information,
> > > including its version.
> > 
> > What command is required to accomplish that?
> > 
> 
> The file libc.so.6 is an executable.
> 
> Just substitute "/lib/libc.so.6" for where you are using "/usr/bin/env"
> in your testing.

OK. I changed the value of _ENV in util-vserver-vars, which results in

# vserver fc5 start
GNU C Library development release version 2.3.5, by Roland McGrath et
al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.1 20050727 (Red Hat 4.0.1-5).
Compiled on a Linux 2.4.20 system on 2005-08-15.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
Native POSIX Threads Library by Ulrich Drepper et al
The C stubs add-on version 2.1.2.
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Glibc-2.0 compatibility add-on by Cristian Gafton
GNU Libidn by Simon Josefsson
Thread-local storage support included.
For bug reporting instructions, please see:
.
vshelper.init: can not determine xid of vserver 'fc5'; returned value
was ''

which is what executing /lib/libc.so.6 on the (FC4) host gives.
Presumably you would expect the output to be the same as

# chroot /vservers/fc5 /lib/libc.so.6
GNU C Library development release version 2.4, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.0 20060304 (Red Hat 4.1.0-3).
Compiled on a Linux 2.6.9 system on 2006-05-12.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
Thread-local storage support included.
For bug reporting instructions, please see:
.

> Or build your own command out of the low level tools, similar too:
> 
> chbind --ip ${VADDRESS} -- vcontext --create --xid ${VID} --chroot -- \
> /usr/bin/env -i HOSTNAME=${VROOT} HOME=/root TERM="${TERM}" PS1='\u:\w\$ ' \
> PATH='/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin' /bin/bash 
> --login +h

Like this

# cd /vservers/fc5
# vcontext --create --xid 49142 --chroot -- /usr/bin/env -i HOME=/root
PATH='/bin:/sbin:/usr/bin:/usr/sbin' /bin/bash --login +h
New security context is 49142
[EMAIL PROTECTED] /]# cat /etc/redhat-release
Fedora Core release 5 (Bordeaux)
[EMAIL PROTECTED] /]# /lib/libc.so.6
GNU C Library development release version 2.4, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.0 20060304 (Red Hat 4.1.0-3).
Compiled on a Linux 2.6.9 system on 2006-05-12.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
Thread-local storage support included.
For bug reporting instructions, please see:
.

which is the same as from 'chroot /vservers/fc5 /lib/libc.so.6'

Jim


___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Michael S. Zick
On Wed August 9 2006 09:30, Jim Wight wrote:
> On Wed, 2006-08-09 at 08:50 -0500, Michael S. Zick wrote:
> > Since the chroot command does not change the context (or namespace) then
> > it must be the act of trying to run in a different context that breaks
> > something.
> > 
> > My guess, the dynamic library handling.
> > 
> > Try executing /lib/libc.so.6 in the guest context, see if you get a
> > normal report out of it.  It should print its build information,
> > including its version.
> 
> What command is required to accomplish that?
> 

The file libc.so.6 is an executable.

Just substitute "/lib/libc.so.6" for where you are using "/usr/bin/env"
in your testing.

Or build your own command out of the low level tools, similar too:

chbind --ip ${VADDRESS} -- vcontext --create --xid ${VID} --chroot -- \
/usr/bin/env -i HOSTNAME=${VROOT} HOME=/root TERM="${TERM}" PS1='\u:\w\$ ' \
PATH='/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin' /bin/bash 
--login +h

I use the above to give myself a command shell inside a vserver context without
"starting" the vserver - the above is independent of the vserver config files.

(Note the "+h" on the Bash command - you need to make Bash drop its path hashing
tables.)

Mike
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Jim Wight
On Wed, 2006-08-09 at 08:50 -0500, Michael S. Zick wrote:
> Since the chroot command does not change the context (or namespace) then
> it must be the act of trying to run in a different context that breaks
> something.
> 
> My guess, the dynamic library handling.
> 
> Try executing /lib/libc.so.6 in the guest context, see if you get a
> normal report out of it.  It should print its build information,
> including its version.

What command is required to accomplish that?

Jim


___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Michael S. Zick
On Wed August 9 2006 08:22, Jim Wight wrote:
> On Wed, 2006-08-09 at 08:17 +0200, Guenther Fuchs wrote:
> > on Tuesday, August 8, 2006 at 9:46:04 PM there was posted:
> > 
> > JW>   # vserver fc5 start
> > JW>   /usr/bin/env: /lib/libc.so.6: version `GLIBC_2.4' not found
> > JW> (required by /usr/bin/env)
> > 
> > Don't know where this comes from, but it definately relates _only_ to
> > the guest.
> 
> > JW> FC5 has glibc 2.4 whereas FC4 has glibc 2.3. Is that really the
> > JW> problem, or is the message a side-effect of some other problem?
> > 
> > It is definately an effect of a guest related problem, which does
> > _not_ relate to the hosts glibc.
> 
> Well, that's the error I get when I run /vservers/fc5/usr/bin/env on the
> host. 'chroot /vservers/fc5 /usr/bin/env' is OK.
> 

Which means that the env binary and all of its dependencies are complete
within the chroot.

Since the chroot command does not change the context (or namespace) then
it must be the act of trying to run in a different context that breaks
something.

My guess, the dynamic library handling.

Try executing /lib/libc.so.6 in the guest context, see if you get a
normal report out of it.  It should print its build information,
including its version.

Mike
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Guenther Fuchs
Hi there,

on Wednesday, August 9, 2006 at 3:22:14 PM there was posted:

JW> Well, that's the error I get when I run /vservers/fc5/usr/bin/env
JW> on the host.

If you do that, the command is executed in _host_ context and
anvironment, that's exactly, why you get this error when execoting in
host context and root.

JW> 'chroot /vservers/fc5 /usr/bin/env' is OK.

Guessed that and whould have expacted it ;-)

JW> Maybe all my vservers behave the same way.

They do.

JW> It's difficult to tell because in all cases the guest's
JW> /usr/bin/env runs on the host without error.

It shouldn't be run on the host, it should be run in guest context and
root ...

Anyway - I'm not so deep in the starting scripts that I could tell
where the problem lies, I just can answer the above.

JW> By adding 'set -x' to vserver.start I can see that the last output
JW> before the error message is a long command, which appears to be a chain
JW> of util-vserver commands separated by '--', . One of those (in essence)
JW> is  'save_ctxinfo /etc/vservers/fc5 /usr/bin/env -i'.
JW> From looking at its source code, I deduce that it must be getting run in
JW> the vserver's context otherwise it would fail with 'save_ctxinfo: Can
JW> not operate in context 0". I'm guessing that that /usr/bin/env, whatever
JW> is done with it, is the source of the problem - but I wouldn't know as
JW> I'm not finding it the easiest thing in the world to make sense of what
JW> the utils do.

-- 
regards 'n greez,

Guenther Fuchs
(aka "muh" and "powerfox")

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Jim Wight
On Wed, 2006-08-09 at 08:17 +0200, Guenther Fuchs wrote:
> on Tuesday, August 8, 2006 at 9:46:04 PM there was posted:
> 
> JW> To what extent do the host and the guest have to be compatible?
> 
> Only to the kernel, no more, none else.

That's what I thought.

> JW>   # vserver fc5 start
> JW>   /usr/bin/env: /lib/libc.so.6: version `GLIBC_2.4' not found
> JW> (required by /usr/bin/env)
> 
> Don't know where this comes from, but it definately relates _only_ to
> the guest.

> JW> FC5 has glibc 2.4 whereas FC4 has glibc 2.3. Is that really the
> JW> problem, or is the message a side-effect of some other problem?
> 
> It is definately an effect of a guest related problem, which does
> _not_ relate to the hosts glibc.

Well, that's the error I get when I run /vservers/fc5/usr/bin/env on the
host. 'chroot /vservers/fc5 /usr/bin/env' is OK.

Maybe all my vservers behave the same way. It's difficult to tell
because in all cases the guest's /usr/bin/env runs on the host without
error. Just today I've upgraded some host machines to FC5 from FC4. They
were supporting FC2 vservers, which I've found still
run. /vservers/fc2/usr/bin/env runs without error on the FC5 host, so
I've no idea whether it is being executed on the host or in the guest
during vserver startup.

By adding 'set -x' to vserver.start I can see that the last output
before the error message is a long command, which appears to be a chain
of util-vserver commands separated by '--', . One of those (in essence)
is  'save_ctxinfo /etc/vservers/fc5 /usr/bin/env -i'.
>From looking at its source code, I deduce that it must be getting run in
the vserver's context otherwise it would fail with 'save_ctxinfo: Can
not operate in context 0". I'm guessing that that /usr/bin/env, whatever
is done with it, is the source of the problem - but I wouldn't know as
I'm not finding it the easiest thing in the world to make sense of what
the utils do.

Jim


___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] Host and guest compatability

2006-08-09 Thread Guenther Fuchs
Hi there,

on Tuesday, August 8, 2006 at 9:46:04 PM there was posted:

JW> To what extent do the host and the guest have to be compatible?

Only to the kernel, no more, none else.

JW>   # vserver fc5 start
JW>   /usr/bin/env: /lib/libc.so.6: version `GLIBC_2.4' not found
JW> (required by /usr/bin/env)

Don't know where this comes from, but it definately relates _only_ to
the guest.

JW> FC5 has glibc 2.4 whereas FC4 has glibc 2.3. Is that really the
JW> problem, or is the message a side-effect of some other problem?

It is definately an effect of a guest related problem, which does
_not_ relate to the hosts glibc.

JW> which is a procedure that has been successful with FC2 and FC4
JW> guests on FC4 hosts.

Here I'm only using the vserver build method I described in the HowTo
- that's working pretty fine.

Sorry for not having a direct solution but maybe my answer will help
you to find it.

-- 
regards 'n greez,

Guenther Fuchs
(aka "muh" and "powerfox")

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver