OpenVZ Forum


Home » General » Support » Starting & Stopping Multiple VPS...
Starting & Stopping Multiple VPS... [message #26789] Fri, 01 February 2008 01:28 Go to next message
joelee is currently offline  joelee
Messages: 63
Registered: April 2006
Member
Is there a way to start and/or stop VPS using a range or a series of VPSes at once. Example: vzctl stop 200-210 or vzctl stop 200,201,205... Also, I would ask same for destroying VPSes...

Joe

[Updated on: Fri, 01 February 2008 01:31]

Report message to a moderator

Re: Starting & Stopping Multiple VPS... [message #26796 is a reply to message #26789] Fri, 01 February 2008 03:55 Go to previous messageGo to next message
jonwatson is currently offline  jonwatson
Messages: 21
Registered: March 2007
Junior Member
I don't think there is per se, but I can envision a fairly simple wrapper script that could do it for you. Create a BASH (or whatever shell strikes your fancy) script that calls vzctl destroy or vzctl stop for each VEID you specify on the command line.

-jdw
Re: Starting & Stopping Multiple VPS... [message #26810 is a reply to message #26789] Fri, 01 February 2008 10:18 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

The easiest way to do it in sh is something like:

for C in $(seq 200 210); do echo $C; vzctl start $C; done


or

for C in 201 202 205; do echo $C; vzctl start $C; done


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Starting & Stopping Multiple VPS... [message #26821 is a reply to message #26789] Fri, 01 February 2008 15:51 Go to previous messageGo to next message
joelee is currently offline  joelee
Messages: 63
Registered: April 2006
Member
Thanks all... Kir, thanks for the tip... will try this out!
joe
Re: Starting & Stopping Multiple VPS... [message #27081 is a reply to message #26789] Fri, 08 February 2008 13:57 Go to previous message
shuaib85 is currently offline  shuaib85
Messages: 59
Registered: September 2007
Member
Hi guys, I have created this tiny shell script to create centos 5 templates based on the range you add

I wish it would help



echo "Enter low ID"
read low
echo "Enter high ID"
read high

for (( i=$low; i <= $high; i++ ))
{
k=`expr $i - 100`
vzctl create $i --ostemplate centos-5-x86_64-default
vzctl set $i --diskspace 4000000 --save
vzctl set $i --ipadd 192.168.0.$k --save
vzctl set $i --hostname centos5_$k --save
vzctl set $i --nameserver 10.0.0.1 --save
vzctl set $i --onboot yes --save
vzctl start $i
}


WebVZ: OpenVZ Web Management Tool
http://webvz.sourceforge.net
Previous Topic: But why is the RAM gone?!
Next Topic: MAX_ULONG value
Goto Forum:
  


Current Time: Sat May 18 04:40:55 GMT 2024

Total time taken to generate the page: 0.00450 seconds