KVM template scripts
From ISPWiki
When creating a VPS under KVM, VDSmanager runs the scripts in the template. Following is the list of scripts:
- copy-template - defines how to copy a template. This script can be used in case of non-standard behaviour when copying a template into the VPS directory.
Parameters:
1. The path to the template
2. The path to the VPS files
- install - this script executes once the template's content is copied to the VPS directory. Normally it is used to prepare virtual server's file images.
Parameters:
1. The path to the VPS files
2. The VPS disk size
3. The VPS name
- install-disk - this script runs upon initialization of the VPS file system.
Parameters:
1. The path to the template
2. The path to the VPS
3. The path to the virtual disk file of VPS.
After the installation process is finished and the VPS is configured, VDSmanager will read the file post-deploy and will send a message to vdstools of the virtual server. vdstools will try to execute the script inside the VPS. The script's size must not exceed 2 kb.
FreeBSD template files
/etc/rc.conf-isp
The file will be put into /etc/rc.conf, the above fields will be specified automatically
The fields that will be filled out when adding a VPS
- __VDS_IP__
- __NETMASK__
- __GATEWAY__
Example of the file /etc/rc.conf-isp
defaultrouter="__GATEWAY__"
hostname="test.ru"
ifconfig_em0="inet __VDS_IP__ netmask __NETMASK__"
sshd_enable="YES"
