Skip to content

Commit 69fe1ea

Browse files
author
Marius Burkard
committed
Merge branch 'jnorell/ispconfig3-master'
2 parents 6a00b4e + c067e5e commit 69fe1ea

File tree

6 files changed

+81
-12
lines changed

6 files changed

+81
-12
lines changed

install/sql/incremental/upd_dev_collection.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,6 @@ ALTER TABLE openvz_vm
189189
ADD COLUMN `custom` text;
190190

191191
ALTER TABLE `web_domain` ADD `ssl_letsencrypt` enum('n','y') NOT NULL DEFAULT 'n' AFTER `ssl`;
192+
193+
ALTER TABLE `openvz_template` CHANGE `vmguarpages` `vmguarpages` varchar(255) DEFAULT '65536:unlimited';
194+
ALTER TABLE `openvz_template` CHANGE `privvmpages` `privvmpages` varchar(255) DEFAULT '131072:139264';

install/sql/ispconfig3.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ CREATE TABLE IF NOT EXISTS `openvz_template` (
11121112
-- Dumping data for table `openvz_template`
11131113
--
11141114

1115-
INSERT INTO `openvz_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `diskspace`, `traffic`, `bandwidth`, `ram`, `ram_burst`, `cpu_units`, `cpu_num`, `cpu_limit`, `io_priority`, `active`, `description`, `numproc`, `numtcpsock`, `numothersock`, `vmguarpages`, `kmemsize`, `tcpsndbuf`, `tcprcvbuf`, `othersockbuf`, `dgramrcvbuf`, `oomguarpages`, `privvmpages`, `lockedpages`, `shmpages`, `physpages`, `numfile`, `avnumproc`, `numflock`, `numpty`, `numsiginfo`, `dcachesize`, `numiptent`, `swappages`, `hostname`, `nameserver`, `create_dns`, `capability`, `features`, `iptables`, `custom`) VALUES(1, 1, 1, 'riud', 'riud', '', 'small', 10, -1, -1, 256, 512, 1000, 4, 400, 4, 'y', '', '999999:999999', '7999992:7999992', '7999992:7999992', '65536:65536', '2147483646:2147483646', '214748160:396774400', '214748160:396774400', '214748160:396774400', '214748160:396774400', '65536:65536', '131072:131072', '999999:999999', '65536:65536', '0:2147483647', '23999976:23999976', '180:180', '999999:999999', '500000:500000', '999999:999999', '2147483646:2147483646', '999999:999999', '256000:256000', 'v{VEID}.test.tld', '8.8.8.8 8.8.4.4', 'n', '', '', '', '');
1115+
INSERT INTO `openvz_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `diskspace`, `traffic`, `bandwidth`, `ram`, `ram_burst`, `cpu_units`, `cpu_num`, `cpu_limit`, `io_priority`, `active`, `description`, `numproc`, `numtcpsock`, `numothersock`, `vmguarpages`, `kmemsize`, `tcpsndbuf`, `tcprcvbuf`, `othersockbuf`, `dgramrcvbuf`, `oomguarpages`, `privvmpages`, `lockedpages`, `shmpages`, `physpages`, `numfile`, `avnumproc`, `numflock`, `numpty`, `numsiginfo`, `dcachesize`, `numiptent`, `swappages`, `hostname`, `nameserver`, `create_dns`, `capability`, `features`, `iptables`, `custom`) VALUES(1, 1, 1, 'riud', 'riud', '', 'small', 10, -1, -1, 256, 512, 1000, 4, 400, 4, 'y', '', '999999:999999', '7999992:7999992', '7999992:7999992', '65536:unlimited', '2147483646:2147483646', '214748160:396774400', '214748160:396774400', '214748160:396774400', '214748160:396774400', '65536:65536', '131072:139264', '999999:999999', '65536:65536', '0:2147483647', '23999976:23999976', '180:180', '999999:999999', '500000:500000', '999999:999999', '2147483646:2147483646', '999999:999999', '256000:256000', 'v{VEID}.test.tld', '8.8.8.8 8.8.4.4', 'n', '', '', '', '');
11161116

11171117
-- --------------------------------------------------------
11181118

interface/lib/plugins/vm_openvz_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ private function makeOpenVZConfig() {
178178
$tpl->setVar('bootorder', $vm['bootorder']);
179179
$tpl->setVar('kmemsize', $vm_template['kmemsize']);
180180
$tpl->setVar('lockedpages', $vm_template['lockedpages']);
181-
$tpl->setVar('privvmpages', $burst_ram.':'.$burst_ram);
181+
$tpl->setVar('privvmpages', $burst_ram.':'.$burst_ram*1.0625);
182182
$tpl->setVar('shmpages', $guar_ram.':'.$guar_ram);
183183
$tpl->setVar('numproc', $vm_template['numproc']);
184184
$tpl->setVar('physpages', $vm_template['physpages']);
185-
$tpl->setVar('vmguarpages', $guar_ram.':'.$guar_ram);
185+
$tpl->setVar('vmguarpages', $guar_ram.':unlimited');
186186
$tpl->setVar('oomguarpages', $guar_ram.':'.$guar_ram);
187187
$tpl->setVar('numtcpsock', $vm_template['numtcpsock']);
188188
$tpl->setVar('numflock', $vm_template['numflock']);

interface/web/vm/openvz_template_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function onAfterUpdate() {
6363
$guar_ram = $app->functions->intval($this->dataRecord['ram']*256);
6464
$burst_ram = $app->functions->intval($this->dataRecord['ram_burst']*256);
6565
$sql = "UPDATE openvz_template SET shmpages = ?,vmguarpages = ?, oomguarpages = ?,privvmpages = ? WHERE template_id = ?";
66-
$app->db->query($sql, $guar_ram . ':' . $guar_ram, $guar_ram . ':' . $guar_ram, $guar_ram . ':' . $guar_ram, $burst_ram . ':' . $burst_ram, $this->id);
66+
$app->db->query($sql, $guar_ram . ':' . $guar_ram, $guar_ram . ':unlimited', $guar_ram . ':' . $guar_ram, $burst_ram . ':' . $burst_ram*1.0625, $this->id);
6767
}
6868

6969
}

interface/web/vm/templates/openvz.conf.tpl

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,98 @@ VERSION="2"
55
# Parameters
66
ONBOOT="{tmpl_var name='onboot'}"
77
BOOTORDER="{tmpl_var name='bootorder'}"
8+
9+
# VSwap requires RAM and SWAP, all other memory parameters are optional.
10+
<tmpl_if name='physpages'>
11+
# RAM
12+
PHYSPAGES="{tmpl_var name='physpages'}"
13+
</tmpl_if>
14+
<tmpl_if name='swappages'>
15+
# SWAP
16+
SWAPPAGES="{tmpl_var name='swappages'}"
17+
</tmpl_if>
18+
19+
<tmpl_if name='kmemsize'>
820
KMEMSIZE="{tmpl_var name='kmemsize'}"
21+
</tmpl_if>
22+
<tmpl_if name='lockedpages'>
923
LOCKEDPAGES="{tmpl_var name='lockedpages'}"
24+
</tmpl_if>
25+
<tmpl_if name='privvmpages'>
1026
PRIVVMPAGES="{tmpl_var name='privvmpages'}"
27+
</tmpl_if>
28+
<tmpl_if name='shmpages'>
1129
SHMPAGES="{tmpl_var name='shmpages'}"
12-
NUMPROC="{tmpl_var name='numproc'}"
13-
PHYSPAGES="{tmpl_var name='physpages'}"
30+
</tmpl_if>
31+
<tmpl_if name='vmguarpages'>
1432
VMGUARPAGES="{tmpl_var name='vmguarpages'}"
33+
</tmpl_if>
34+
<tmpl_if name='oomguarpages'>
1535
OOMGUARPAGES="{tmpl_var name='oomguarpages'}"
36+
</tmpl_if>
37+
# alternative meminfo: "pages:256000"
38+
MEMINFO="privvmpages:1"
39+
40+
<tmpl_if name='vmguarpages'>
41+
NUMPROC="{tmpl_var name='numproc'}"
42+
</tmpl_if>
43+
<tmpl_if name='numtcpsock'>
1644
NUMTCPSOCK="{tmpl_var name='numtcpsock'}"
45+
</tmpl_if>
46+
<tmpl_if name='numflock'>
1747
NUMFLOCK="{tmpl_var name='numflock'}"
48+
</tmpl_if>
49+
<tmpl_if name='numpty'>
1850
NUMPTY="{tmpl_var name='numpty'}"
51+
</tmpl_if>
52+
<tmpl_if name='numsiginfo'>
1953
NUMSIGINFO="{tmpl_var name='numsiginfo'}"
54+
</tmpl_if>
55+
<tmpl_if name='tcpsndbuf'>
2056
TCPSNDBUF="{tmpl_var name='tcpsndbuf'}"
57+
</tmpl_if>
58+
<tmpl_if name='tcprcvbuf'>
2159
TCPRCVBUF="{tmpl_var name='tcprcvbuf'}"
60+
</tmpl_if>
61+
<tmpl_if name='othersockbuf'>
2262
OTHERSOCKBUF="{tmpl_var name='othersockbuf'}"
63+
</tmpl_if>
64+
<tmpl_if name='dgramrcvbuf'>
2365
DGRAMRCVBUF="{tmpl_var name='dgramrcvbuf'}"
66+
</tmpl_if>
67+
<tmpl_if name='numothersock'>
2468
NUMOTHERSOCK="{tmpl_var name='numothersock'}"
69+
</tmpl_if>
70+
<tmpl_if name='dcachesize'>
2571
DCACHESIZE="{tmpl_var name='dcachesize'}"
72+
</tmpl_if>
73+
<tmpl_if name='numfile'>
2674
NUMFILE="{tmpl_var name='numfile'}"
75+
</tmpl_if>
76+
<tmpl_if name='avnumproc'>
2777
AVNUMPROC="{tmpl_var name='avnumproc'}"
78+
</tmpl_if>
79+
<tmpl_if name='numiptent'>
2880
NUMIPTENT="{tmpl_var name='numiptent'}"
81+
</tmpl_if>
2982

3083
DISKSPACE="{tmpl_var name='diskspace'}"
3184
DISKINODES="{tmpl_var name='diskinodes'}"
3285
QUOTAUGIDLIMIT="10000"
33-
IOPRIO="{tmpl_var name='io_priority'}"
3486
QUOTATIME="0"
87+
<tmpl_if name='io_priority'>
88+
IOPRIO="{tmpl_var name='io_priority'}"
89+
</tmpl_if>
3590

91+
<tmpl_if name='cpu_num'>
3692
CPUS="{tmpl_var name='cpu_num'}"
93+
</tmpl_if>
94+
<tmpl_if name='cpu_units'>
3795
CPUUNITS="{tmpl_var name='cpu_units'}"
96+
</tmpl_if>
97+
<tmpl_if name='cpu_limit'>
3898
CPULIMIT="{tmpl_var name='cpu_limit'}"
99+
</tmpl_if>
39100

40101
VE_ROOT="/vz/root/$VEID"
41102
VE_PRIVATE="/vz/private/$VEID"
@@ -44,11 +105,16 @@ ORIGIN_SAMPLE="vps.basic"
44105
HOSTNAME="{tmpl_var name='hostname'}"
45106
IP_ADDRESS="{tmpl_var name='ip_address'}"
46107
NAMESERVER="{tmpl_var name='nameserver'}"
47-
# alternative meminfo: "pages:256000"
48-
MEMINFO="privvmpages:1"
49-
# SWAPPAGES="{tmpl_var name='swappages'}"
50108

109+
<tmpl_if name='capability'>
51110
CAPABILITY="{tmpl_var name='capability'}"
111+
</tmpl_if>
112+
<tmpl_if name='features'>
52113
FEATURES="{tmpl_var name='features'}"
114+
</tmpl_if>
115+
<tmpl_if name='iptables'>
53116
IPTABLES="{tmpl_var name='iptables'}"
117+
</tmpl_if>
118+
<tmpl_if name='custom'>
54119
{tmpl_var name='custom'}
120+
</tmpl_if>

remoting_client/examples/openvz_template_add.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
'numproc' => '999999:999999',
3333
'numtcpsock' => '7999992:7999992',
3434
'numothersock' => '7999992:7999992',
35-
'vmguarpages' => '65536:65536',
35+
'vmguarpages' => '65536:unlimited',
3636
'kmemsize' => '2147483646:2147483646',
3737
'tcpsndbuf' => '214748160:396774400',
3838
'tcprcvbuf' => '214748160:396774400',
3939
'othersockbuf' => '214748160:396774400',
4040
'dgramrcvbuf' => '214748160:396774400',
4141
'oomguarpages' => '65536:65536',
42-
'privvmpages' => '131072:131072',
42+
'privvmpages' => '131072:139264',
4343
'lockedpages' => '999999:999999',
4444
'shmpages' => '65536:65536',
4545
'physpages' => '0:2147483647',

0 commit comments

Comments
 (0)