OpenVZ Forum


Home » General » Support » TEST IDEA - Scaling with openvz
Re: TEST IDEA - Scaling with openvz [message #13514 is a reply to message #13479] Tue, 29 May 2007 06:43 Go to previous messageGo to previous message
kingneutron is currently offline  kingneutron
Messages: 30
Registered: May 2007
Location: NE IL, USA
Member
[[
I'm pretty sure I can do this programmatically with simple Bash scripting; but is there a way in-VE to have it determine what its number is on the host? (i.e. VE 1003 should "know" it's number is 1003 somehow without having networking enabled yet.)
]]

--What I've got so far is that beancounters knows what its VE number is:

BEGIN VE 101 /etc/init.d/rc.local (PARTIAL)
do_start() {
        if [ -x /etc/rc.local ]; then
                [ "$VERBOSE" != no ] && log_begin_msg "Running local boot scrip
                /etc/rc.local
                ES=$?
                [ "$VERBOSE" != no ] && log_end_msg $ES
                return $ES
        fi

# Openvz mods: 2007.0528
/bin/rm /dev/shm/THISVE

thisve=`cat /proc/user_beancounters \
  |grep kmemsize \
  |awk '{ print $1 }'`

thisve=${thisve//:/} # Take out the trailing ":"

echo $thisve > /dev/shm/THISVE

# If THISVE < 1000, it is a Master Image.  

# If not, consider it a clone:
# o Setup IP
#  and start listening.

}

case "$1" in
    start)


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HELP: After update /dev files missing
Next Topic: *SOLVED* Is there a way to "suspend" a VE?
Goto Forum:
  


Current Time: Wed Nov 06 12:18:52 GMT 2024

Total time taken to generate the page: 0.03350 seconds