Transferring VPS among partitions
We modified the procedure on how to work with disk templates on VDSmanager under FreeBSD 8. Unionfs is no longer used. On FreeBSD 8 we use hard links to the template files. If a user attempts to edit this file, the hard link is removed, and the file template content is copied to the user's private disk. This allows to greatly increase file system efficiency, however some limits appeared. For example, if you wish to use several partitions to store the VPS's private disks (e.g. to distribute load), you will have to install the VPS templates on each partition.
Moving a VPS from one partition to another
Follow the instructions below (the VDS template is supposed to have been installed on two partitions with quota enabled).
- Create a directory for the VPS
- Select the VID (virtual disk id) vdisk alloc
- Set quota for this VID vdisk quota
- Copy the template files into this directory vdisk copypub
- Stop the VPS
- Copy the VPS private files into this directory vdisk copyvds
- Edit the path to the VPS private files in the VDSmanager config (the PrivateDisk parameter)
- Start the VPS
Transfer the VPS from /vs/disk to /vs/disk2
Create a new disk. If it already existsб you can skip this step.
vdisk check /vs/disk2 vdisk enable /vs/disk2
Install the template on the new disk. If the template is already installed, you can skip this step.
mkdir /vs/disk2/pub uptmp -N FreeBSD-8-minimal /vs/disk2/pub/FreeBSD-8-minimal
Copy the VPS 10.10.10.10 into the new disk (1000000 4096000 is the number of inode and quota in KB):
mkdir /vs/disk2/10.10.10.10 vdisk alloc /vs/disk2/10.10.10.10 vdisk quota /vs/disk2/10.10.10.10 1000000 4096000 vdisk copypub /vs/disk2/10.10.10.10 /vs/disk2/pub/FreeBSD-8-minimal vdisk copyvds /vs/disk/10.10.10.10 /vs/disk2/10.10.10.10