Set the lowest priority:
vzctl set 101 --ioprio 0 --save
Set the highest priority:
vzctl set 101 --ioprio 7 --save
Set the lowest priority:
vzctl set 101 --ioprio 0 --save
Set the highest priority:
vzctl set 101 --ioprio 7 --save
vzctl chkpnt 101 –dumpfile /tmp/Dump.101
mv /etc/vz/conf/101.conf /etc/vz/conf/102.conf
mv /vz/private/101 /vz/private/102
mv /vz/root/101 /vz/root/102
vzctl restore 102 –dumpfile /tmp/Dump.101
veid=1000
vzctl create $veid –ostemplate centos-7-x86_64 –diskspace 20G
vzctl set $veid –features bridge:on –save
vzctl set $veid –netif_add eth0 –save
vzctl set $veid –netfilter full –save
vzctl set $veid –devnodes net/tun:rw –save
vzctl mount $veid
echo “JoinControllers=cpu,cpuacct,cpuset freezer,devices” >> /vz/root/$veid/etc/systemd/system.conf
vzctl start $veid
mount -t tmpfs tmpfs /sys/fs/cgroup
mkdir /sys/fs/cgroup/freezer,devices
mount -t cgroup cgroup /sys/fs/cgroup/freezer,devices -o freezer,devices
mkdir /sys/fs/cgroup/cpu,cpuacct,cpuset
mount -t cgroup cgroup /sys/fs/cgroup/cpu,cpuacct,cpuset/ -o cpu,cpuacct,cpuset
Install docker:
yum -y install docker-io
docker -d -s vfs
for i in `cat /proc/vz/veinfo | awk ‘{print $1}’|egrep -v ‘^0$’`; do echo “Container $i”; vzctl exec $i w ; done
vzctl set CTID --devnodes net/tun:rw --capability net_admin:on --save
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index e66cb81..2989b8d 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -267,7 +267,8 @@ function new_interface ()
is_available ${parent_device} && \
( grep -qswi "up" /sys/class/net/${parent_device}/operstate || grep -qswi "1" /sys/class/net/${parent_device}/carrier ) ; then
echo $"Determining if ip address ${IPADDR} is already in use for device ${parent_device}..."
- if ! /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR} ; then
+ /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR}
+ if [ $? = 1 ]; then
net_log $"Error, some other host already uses address ${IPADDR}."
return 1
fi
wget https://git.fedorahosted.org/cgit/initscripts.git/snapshot/initscripts-55a50ebc591ebd0f4cfbb8ecc204fa20ee6a7368.tar.gz
vzlist | grep VZ_name # Get container ID
cp -v initscripts-55a50ebc591ebd0f4cfbb8ecc204fa20ee6a7368.tar.gz /vz/root/C_ID/root/ # where C_ID is container ID
vzctl enter C_ID
tar xvf initscripts-55a50ebc591ebd0f4cfbb8ecc204fa20ee6a7368.tar.gz sysconfig/network-scripts/ifup-aliases
mv -v /etc/sysconfig/network-scripts/ifup-aliases /etc/sysconfig/network-scripts/ifup-aliases.orig
cp sysconfig/network-scripts/ifup-aliases /etc/sysconfig/network-scripts/ifup-aliases
service network restart
Restarting network (via systemctl): [ OK ]
mount –bind /vz/private/100/share /vz/root/200/share
for CT in $(vzlist -H -o veid); do vzmigrate –remove-area no –keep-dst $1 $CT; done
for CT in $(vzlist -H -o veid); do vzmigrate –remove-area no –keep-dst $1 $CT; done
vzquota show 100
vzquota : (warning) Quota is running, so data reported from quota file may not reflect current values
resource usage softlimit hardlimit grace
1k-blocks 0 4194304 4194304
inodes 25 200000 220000
vzctl stop 100
vzquota init 100 -p /vz/private/100 -b 4194304 -B 4194304 -i 200000 -I 220000 -e 0 -n 0
ls -la /vz/private/*/root.hdd/DiskDescriptor.xml
vzctl stop 100
ploop mount /vz/private/100/root.hdd/DiskDescriptor.xml
fdisk -l /dev/ploop100p1
e2fsck /dev/ploop100p1
ploop umount -d /dev/ploo100p1
vzctl –verbose –verbose –verbose start 100
vzctl console 1234
OLDVE=222 NEWVE=333 # Just an example
vzctl stop $OLDVE
mkdir /vz/root/$NEWVE
cp /etc/vz/conf/$OLDVE.conf /etc/vz/conf/$NEWVE.conf
mkdir /vz/private/$NEWVE
pushd /vz/private/$OLDVE; tar c –numeric-owner * | tar x –numeric-owner -C /vz/private/$NEWVE; popd
vi /etc/vz/conf/$NEWVE.conf # Change the IP_ADDRESS
vzctl start $NEWVE; vzctl start $OLDVE