Applicable to:
- SolusVM
Question
How to change the default directory for all future OpenVZ containers in SolusVM?
Answer
Not possible through SolusVM interface, however it can be done manually on OpenVZ node.
Warning: the solution below should be applied on your own risk as there are following known limitations of changed container location:
- it is not possible to create custom templates through Create Template function;
- not possible to Migrate containers in not-default location;
- not possible to backup such containers through AutoFTP Backup.
-
Connect to your SolusVM OpenVZ node over SSH.
-
Download and execute script to change default location of all future containers:
# curl -o svmmovevz.sh https://raw.githubusercontent.com/solusvm-support/helpers/master/svmmovevz.sh && sh svmmovevz.sh
-
Connect to your SolusVM OpenVZ node over SSH.
-
Create a backup of the configuration file
/etc/vz/vz.conf
:# cp -a /etc/vz/vz.conf /root/
-
Open the file
/etc/vz/vz.conf
with a text editor and change the following directory path to the required ones:CONFIG_TEXT: LOCKDIR=/vz/lock
DUMPDIR=/vz/dump
VE_ROOT=/vz/root/$VEID
VE_PRIVATE=/vz/private/$VEIDFor example:
CONFIG_TEXT: LOCKDIR=/home/vz/lock
DUMPDIR=/home/vz/dump
VE_ROOT=/home/vz/root/$VEID
VE_PRIVATE=/home/vz/private/$VEIDNote: do not change TEMPLATE location -
/vz/template
is hardcoded in SolusVM. -
Create the necessary directories in the new location and set correct permissions:
# mkdir -p /home/vz/{root,private,dump,lock}
# chmod 700 /home/vz/private/ /home/vz/root/
# ls -l /home/vz/
drwxr-xr-x 2 root root 4096 May 30 06:06 dump
drwxr-xr-x 2 root root 4096 May 30 06:06 lock
drwx------ 2 root root 4096 May 30 06:06 private
drwx------ 2 root root 4096 May 30 06:06 root
Additional Information
How to change the directory of existing OpenVZ containers in SolusVM?
Comments
0 commentsPlease sign in to leave a comment.