OpenVZ Forum


Home » General » Support » *SOLVED* startup scripts, network setup
*SOLVED* startup scripts, network setup [message #6498] Tue, 19 September 2006 11:28 Go to next message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
Hi!

I am looking for any documentation (preferably something comprehensive like the old PDF manual, which seems outdated in this regard) on the VPE startup mechanisms, and the scripts involved.
My current suspicion about the startup mechanism is the following:

On vzctl start VEID, the file /etc/vz/conf/VEID.conf is consulted for config options. One of these is "OSTEMPLATE", in my case with value "debian-3.1-i386-minimal".

Prefix matching is done on this string with the filenames in /etc/vz/dists/*.conf. In my case, debian-3.1.conf is the best match. It contains further config options, like ADD_IP or POST_CREATE, which contain script names, relative to the path /etc/vz/dists/scripts.

On these events, the corresponding scripts are run inside the given virtual environment.

So, the question is: is the above correct? What is the VEID.start script I have been advised to use, and where is it supposed to be placed?
Second: Where can I configure what scripts to run on the host machine (or HW node, excuse my Xenism...) on VE startup? I must add veth-s to a bridge.


Thanks for all the help and the great product:

Gabor Szokoli



[Updated on: Tue, 19 September 2006 14:02]

Report message to a moderator

Re: startup scripts, network setup [message #6500 is a reply to message #6498] Tue, 19 September 2006 12:01 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

Quote:

So, the question is: is the above correct?


You're right! Above is correct. Smile

Quote:


What is the VEID.start script I have been advised to use, and where is it supposed to be placed?


Such files shuld reside in /et/vz/conf/ directory.
This scipt runs inside Virtual Environment after VE start.

Quote:

Where can I configure what scripts to run on the host machine (or HW node, excuse my Xenism...) on VE startup? I must add veth-s to a bridge.


At the moment there is no such script. There are plans about creating such file in the near future. BTW, what name for the this file do you suggest? We have som disputes about it...

Thanks!

Re: startup scripts, network setup [message #6501 is a reply to message #6500] Tue, 19 September 2006 12:27 Go to previous messageGo to next message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
vass wrote on Tue, 19 September 2006 08:01

Hello,

At the moment there is no such script. There are plans about creating such file in the near future. BTW, what name for the this file do you suggest? We have som disputes about it...



I don't think I have the experience to make an insightful suggestion, but I'd be happy with a _HOST postfix after the existing option names, like ADD_IP_HOST=debian_add_ip_host.sh, POST_CREATE_HOST=debian_postcreate_host.sh, etc...

It's not that urgent though, we can use wrapper scripts for VE startup, or ssh back to the host from POST_CREATE.

Seriously though, prefix matching on the OSTEMPLATE?
Do all partially matching .conf files get loaded, (debian.conf and debian-3.1.conf in my case) or best match only?

Is there a list of all possible parameter names for the VEID.conf and the dist/distname.conf files somewhere, btw? And could I theoretically duplicate entries between them, and if yes, which overrides the other?


Thank you for your time:

Gabor Szokoli
Re: startup scripts, network setup [message #6505 is a reply to message #6501] Tue, 19 September 2006 13:19 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Quote:

I don't think I have the experience to make an insightful suggestion, but I'd be happy with a _HOST postfix after the existing option names, like ADD_IP_HOST=debian_add_ip_host.sh, POST_CREATE_HOST=debian_postcreate_host.sh, etc...


AFAIK there will be only one file like <veid>.start but it will be ran on HN. Something <veid>.host-start...

Quote:

Do all partially matching .conf files get loaded, (debian.conf and debian-3.1.conf in my case) or best match only?


The rule is the following:
Suppose name of template is "debian-3.1"
If file debian-3.1.conf exists it will be loaded, no other files will be processed. But if debian-3.1.conf doesn't exist, then ostemplate name "debian-3.1" will be truncated till first occurance of "-" from the end. From "debian-3.1" we have "debian", thus debian.conf file will be loaded. Id debian.conf doesn't exist default file will be loaded.

Quote:


Is there a list of all possible parameter names for the VEID.conf and the dist/distname.conf files somewhere, btw? And could I theoretically duplicate entries between them, and if yes, which overrides the other?


man vps.conf gives the list.
dist/distname.conf and vps.conf have different parameters. So no duplicating, overriding is possible.

HTH,
vass.

HTH,
vass.
Re: startup scripts, network setup [message #6508 is a reply to message #6505] Tue, 19 September 2006 14:01 Go to previous messageGo to next message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
Thank you again.
Re: startup scripts, network setup [message #6682 is a reply to message #6505] Thu, 21 September 2006 09:17 Go to previous messageGo to next message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
vass wrote on Tue, 19 September 2006 09:19

Quote:


Is there a list of all possible parameter names for the VEID.conf and the dist/distname.conf files somewhere, btw?



man vps.conf gives the list.



Great!

It does fail to mention the possibility to use $VEID though.

This made me wonder: how wold you formulate a generic VETH= line, where some bytes of the MAC address are VEID-derived thus unique?

(so I can just use the same VEID.conf file for all my otherwise identical VEs.)
Re: startup scripts, network setup [message #6683 is a reply to message #6682] Thu, 21 September 2006 09:36 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Quote:

It does fail to mention the possibility to use $VEID though.

Well, I suppose the logic Smile of man developers was something like that:
the persons looks at manpage about vps.conf, observes there:
Quote:


VE_ROOT="directory"
Corresponds to the --root option.


than moves to manpage about vzctl and discover there $VEID:

Quote:


--root path
Sets the path to root directory for this VPS. This is essentially a mount point for VPS root. Value must contain string $VEID, which will be substituted with numeric VPS ID. Changing this parameter is not recommended, better edit vz(5) global configurationfile.



As concerns
Quote:


This made me wonder: how wold you formulate a generic VETH= line, where some bytes of the MAC address are VEID-derived thus unique?


Sorry. I don't understand you quite. AFAIK MAC address for veth device can be set by user with hand, no relationship with VEID...
Re: startup scripts, network setup [message #6687 is a reply to message #6683] Thu, 21 September 2006 10:56 Go to previous messageGo to next message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
vass wrote on Thu, 21 September 2006 05:36


Well, I suppose the logic Smile of man developers was something like that:



OK, OK, since then I realised I can't even write
VETH="veth$VEID.0 ... "

Quote:


As concerns
Quote:


This made me wonder: how wold you formulate a generic VETH= line, where some bytes of the MAC address are VEID-derived thus unique?


Sorry. I don't understand you quite. AFAIK MAC address for veth device can be set by user with hand, no relationship with VEID...

True.
But MAC addresses must be unique: this is the only reason for separate VEID.conf files in our setup.
I'd like to be able to write something like this:

VETH=" veth${VEID}.0,10.20.30.40.$VEID_LOWBYTE.$VEID_HIBYTE,eth0,10 .20.30.41.$VEID_LOWBYTE.$VEID_HIBYTE "
Re: startup scripts, network setup [message #6688 is a reply to message #6687] Thu, 21 September 2006 11:01 Go to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Now, when I undestand what you want, I agree: there is no such possibility...
Previous Topic: QM_MODULES function not implemented -> install module-init-tools!
Next Topic: *SOLVED* How many veth can we create?
Goto Forum:
  


Current Time: Wed Oct 02 00:19:57 GMT 2024

Total time taken to generate the page: 0.03780 seconds