LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-24-2013, 01:49 PM   #1
mccabec123
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Rep: Reputation: Disabled
Allocating resources to VPS's using OpenVZ


I need a layman's term definition of these parameters and what they do in terms of allocating resources to servers, as I'm having issues with the VPS's that I set up, as Java seems to be unable to set up a virtual machine on them for minecraft unless they have over 2Gb's of each parameter, and I'm assuming I must be doing something wrong. Here is the current script exert that I use to initially create the server and assign resources:
Code:
    SERVID=$1
    IPPICK=$2
    HOSTNAME=$3
    PW=$4
    EMAIL=$5
    
    if vzctl create $SERVID --ostemplate centos-6-x86_64.2 --config vps.packtwo-basic ;
    	then
    		echo -e "\nVPS container was successfully created...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "Please restart the package install, there was a problem creating the VPS..."
    		exit $?
    fi
    if vzctl set $SERVID --onboot yes --save;
    	then
    		echo -e "\nSet to boot on start...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, the onboot config went wrong...\n"
    		exit $?
    fi
    
    if vzctl set $SERVID --ipadd $IPPICK --save;
    	then
    		echo -e "\nIP added to the VPS successfully...\n"
    	else
    		echo -e "\nThe IP address used, may be used on another server, this may mean that the server has an issue contacting external addresses..\n"
    fi
    
    if vzctl set $SERVID --hostname $HOSTNAME --save;
    	then
    		echo -e "\nHostname assigned to the VPS successfully...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem assigning the Hostname to the VPS...\n"
    		exit $?
    fi
    if vzctl set $SERVID --swappages=2224M:2224M --save;
            then
                	echo -e "\nThe Swap Pages were successfully allocated...\n"
            else
                	vzctl stop $SERVID
                    vzctl destroy $SERVID
                    echo -e "\nPlease restart the package install, there was a problem allocating Swappages to this VPS...\n"
                    exit $?
    fi
    if vzctl set $SERVID --userpasswd root:$PW --save;
    	then
    		echo -e "\nThe root password was successfully assigned...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem assigning the chosen password for the root account...\n"
    		exit $?
    fi
    
    #Resource double checking
    if vzctl set $SERVID --diskspace 30G:32G --save;
    	then
    		echo -e "\nThe resources were successfully allocated...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating resources to this VPS...\n"
    		exit $?
    fi
    
    if vzctl set $SERVID --quotatime 800 --save;
    	then
    		echo -e "\nThe burst settings were successfully added...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating quta burst time to this VPS...\n"
    		exit $?
    fi
    
    
    #Add RAM
    if vzctl set $SERVID --vmguarpages 1124M --save;
    	then
    		echo -e "\nThe Vmguarpages have been successfully allocated...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating Vmguarpages to this VPS...\n"
    		exit $?
    fi
    if vzctl set $SERVID --physpages 1124M:1124M --save;
    	then
    		echo -e "\nThe RAM was successfully allocated...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating the RAM to this VPS...\n"
    		exit $?
    fi
    if vzctl set $SERVID --privvmpages 1124M:1124M --save;
    	then
    		echo -e "\nThe Privvmpages have been successfully allocated...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating Privvmpages to this VPS...\n"
    		exit $?
    fi
    if vzctl set $SERVID --oomguarpages 1124M --save;
    	then
    		echo -e "\nThe Oomguarpages was successfully allocated...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating Oomguarpages to this VPS...\n"
    		exit $?
    fi
    if vzctl start $SERVID;
    	then
    		echo -e "\nThe VPS was successfully started...\n"
    	else
    		vzctl stop $SERVID
    		vzctl destroy $SERVID
    		echo -e "\nPlease restart the package install, there was a problem allocating resources to this VPS...\n"
    		exit $?
    fi
 
  


Reply

Tags
centos, openvz


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asking about OpenVPN and Squid 3.1 on OpenVZ VPS clear_water Linux - Networking 0 10-31-2012 11:12 AM
Problems connecton vps server CentOS 6 OpenVZ acorda Linux - Server 2 09-15-2012 04:18 PM
openvz - limit IP connections - debian 6 VPS dlugasx Linux - Security 1 02-19-2012 06:53 PM
openvz node with only one vps rpereyra Linux - Virtualization and Cloud 3 06-06-2011 10:10 AM
OpenVZ and Slackware running on vps astanton Slackware 1 03-08-2011 02:08 AM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration