Applicable to:
- SolusVM
Question
How to create a template from a OpenVZ container with the ploop layout? The current implementation of Create Template feature works only for the containers with simfs layout.
Answer
Since RHEL6-based OpenVZ kernel, i.e. 042stabXXX OpenVZ starts support container-in-a-file technology (ploop). It can be enabled on the node settings page Dashboard > Nodes > node_name > click icon:
If such option is enabled, OpenVZ creates an image file inside of the container private directory - /vz/private/CTID/root.hdd/ in order to store the data. In that case, feature is not available and template should be created manually as per steps below:
- Connect via SSH to the OpenVZ server where the source template container is running
- Stop the source template container via SolusVM
- Create a directory for mountpoint, e.g.:
# mkdir /templatemnt
- Mount the image of the source container CTID:
# mount -t ploop /vz/private/CTID/root.hdd/DiskDescriptor.xml /templatemnt
Note: CTID should be replaced with the actual ID of the source container
- Change directory location and create a template as per command below, e.g. for CentOS 7:
# cd /templatemnt
# tar --numeric-owner --ignore-failed-read -czpf /vz/template/cache/centos-7-x86_64-custom.tar.gz ./*Note: The template file name should be as per the following syntax: distributive-version-arch-specs.tar.gz
- Unmount the ploop device:
# cd ~
# umount /templatemnt - Upload the template file on the Master server and configure the template
Comments
0 comments
Please sign in to leave a comment.