Virtualization Define Partitions First

vegas

Account Disabled
I have an openvz kernel on my machine 2.6.32-042stab093.5
I already have my centos template installed but
dont want to create any vps just like that first I have to define
the partitions I want to use from my disc for vps
please help me to do so
 
Hi,

/VZ is where all the private containers store their files and this is the default configuration. If you want to change this path, you can edit the /etc/vz/vz.conf file and set your parameters. Make sure to backup the configuration file before you change anything.

Its always advisable to have /vz on drive that is larger in size.
 
For basic setup, all you need is 1 partition with space on "/" (plus swap partition)

VZ files will be in /vz as mentioned above.

If wanted or convenient (eg for RAID) you can make /vz a separate partition.
 
I want to install the vps here
/dev/sda3
/dev/sda5
but I dont know where to set this in here

## Global parameters
VIRTUOZZO=yes
LOCKDIR=/vz/lock
DUMPDIR=/vz/dump
VE0CPUUNITS=1000
VE_STOP_MODE=suspend

## Logging parameters
LOGGING=yes
LOGFILE=/var/log/vzctl.log
LOG_LEVEL=0
VERBOSE=0

## Disk quota parameters
DISK_QUOTA=yes
VZFASTBOOT=no

# Disable module loading. If set, vz initscript does not load any modules.
#MODULES_DISABLED=yes

# The name of the device whose IP address will be used as source IP for CT.
# By default automatically assigned.
#VE_ROUTE_SRC_DEV="eth0"

# Uncomment to limit CT IP ARP announces only to network interfaces
# having IPs within the same IP network as a container IP.
# Leave commented out to use all interfaces.
NEIGHBOUR_DEVS=all

## Uncomment to skip ARP queries checking for CT IP being used
## by some other machine on the network
#SKIP_ARPDETECT=yes

## Comment out to fail CT start if ARP query detects CT IP being used
ERROR_ON_ARPFAIL="no"

## Template parameters
TEMPLATE=/vz/template

## Defaults for containers
VE_ROOT=/vz/root/$VEID
VE_PRIVATE=/vz/private/$VEID
CONFIGFILE="vswap-256m"
DEF_OSTEMPLATE="centos-6-x86"
NAMESERVER=inherit # Copy from host system's /etc/resolv.conf
## Filesystem layout for new CTs: either simfs or ploop
VE_LAYOUT=ploop

# User namespace configuration
LOCAL_UID=100000
LOCAL_GID=100000

## Load vzwdog module
VZWDOG="no"

## WARNING: IPTABLES parameter is deprecated,
## use per-container (not global!) NETFILTER instead

## iptables kernel modules to be loaded by init.d/vz script
IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ip6_tables ip6table_filter ip6table_mangle ip6t_REJECT"

## Enable IPv6
IPV6="yes"
SKIP_SYSCTL_SETUP=yes
 
## Defaults for containers
VE_ROOT=/vz/dev/sda3/$VEID
VE_PRIVATE=/vz/dev/sda5/$VEID

Like this?
They are already on folders
 
Hello folks I setted this
## Defaults for containers
VE_ROOT=/vz/home/sda3/$VEID
VE_PRIVATE=/vz/tmp/sda5/$VEID
CONFIGFILE="vswap-256m"
DEF_OSTEMPLATE="centos-6-x86"
NAMESERVER=inherit # Copy from host system's /etc/resolv.conf
## Filesystem layout for new CTs: either simfs or ploop
VE_LAYOUT=ploop

Then I created my first vps and after I didnt see nothing inside this folders
home/sda3
tmp/sda5
What I found was inside root ,the vz folder with the folder named root and there I found my vps in both folders home and tmp but on tmp it had this archives
DiskDescriptor.xml
DiskDescriptor.xml.lck
root.hdd
My question is why this archives didnt appear inside root/home/sda3 and
root/ tmp/sda5 ?
Does this mean that the vps was only created inside vz folder or is it related this vz folder to the mentioned locations?

Well in my opinion if the vps was created in root/tmp/sda5 the mentioned archives would also be there,if they are not there is because the vps was not created on that location,if you can bring some chat to the situation it will be sublimely appreciated
 
Hi,

Please note the OpenVZ recent security updates.

https://openvz.org/News/updates
Kernel RHEL6 042stab094.7 (moved to stable)
Security fix preventing access to the host filesystem from inside a container. Fixes in CPT, net, iptables autoloading, etc. Stability fixes.


Now back to the vz issue. It would be worth trying to rename the current /vz partition to /vz_old and mount the disk partition /dev/sda3 on /vz. Now, you can rsync the contents from /vz_old to /vz. This way, you dont have to change anything in the confirmation, yet you will have all the VPS container on other disk.
 
It would be lovely and very nice if you could please provide an example of what you say.

Do you mean change

## Defaults for containers
VE_ROOT=/vz/home/sda3/$VEID
VE_PRIVATE=/vz/tmp/sda5/$VEID

For this

## Defaults for containers
VE_ROOT=/vz/dev/sda3/$VEID
VE_PRIVATE=/vz/dev/sda5/$VEID


?

Then how I do sync?
 
Back
Top