Skip to content

Commit b74ef5e

Browse files
committed
First commit for: FS#952 - Module for virtual machine management
1 parent f66e40c commit b74ef5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3917
-2
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
--
2+
-- Table structure for table `openvz_ip`
3+
--
4+
5+
CREATE TABLE IF NOT EXISTS `openvz_ip` (
6+
`ip_address_id` bigint(20) NOT NULL AUTO_INCREMENT,
7+
`sys_userid` int(11) NOT NULL DEFAULT '0',
8+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
9+
`sys_perm_user` varchar(5) DEFAULT NULL,
10+
`sys_perm_group` varchar(5) DEFAULT NULL,
11+
`sys_perm_other` varchar(5) DEFAULT NULL,
12+
`server_id` int(11) NOT NULL DEFAULT '0',
13+
`ip_address` varchar(15) DEFAULT NULL,
14+
`vm_id` int(11) NOT NULL DEFAULT '0',
15+
`reserved` varchar(255) NOT NULL DEFAULT 'n',
16+
PRIMARY KEY (`ip_address_id`)
17+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
18+
19+
--
20+
-- Dumping data for table `openvz_ip`
21+
--
22+
23+
-- --------------------------------------------------------
24+
25+
--
26+
-- Table structure for table `openvz_ostemplate`
27+
--
28+
29+
CREATE TABLE IF NOT EXISTS `openvz_ostemplate` (
30+
`ostemplate_id` bigint(20) NOT NULL AUTO_INCREMENT,
31+
`sys_userid` int(11) NOT NULL DEFAULT '0',
32+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
33+
`sys_perm_user` varchar(5) DEFAULT NULL,
34+
`sys_perm_group` varchar(5) DEFAULT NULL,
35+
`sys_perm_other` varchar(5) DEFAULT NULL,
36+
`template_name` varchar(255) DEFAULT NULL,
37+
`template_file` varchar(255) NOT NULL,
38+
`server_id` int(11) NOT NULL DEFAULT '0',
39+
`allservers` varchar(255) NOT NULL DEFAULT 'y',
40+
`active` varchar(255) NOT NULL DEFAULT 'y',
41+
`description` text,
42+
PRIMARY KEY (`ostemplate_id`)
43+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
44+
45+
--
46+
-- Dumping data for table `openvz_ostemplate`
47+
--
48+
49+
INSERT INTO `openvz_ostemplate` (`ostemplate_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `template_file`, `server_id`, `allservers`, `active`, `description`) VALUES(1, 1, 1, 'riud', 'riud', '', 'Debian minimal', 'debian-minimal-x86', 1, 'y', 'y', 'Debain minmal image.');
50+
51+
-- --------------------------------------------------------
52+
53+
--
54+
-- Table structure for table `openvz_template`
55+
--
56+
57+
CREATE TABLE IF NOT EXISTS `openvz_template` (
58+
`template_id` bigint(20) NOT NULL AUTO_INCREMENT,
59+
`sys_userid` int(11) NOT NULL DEFAULT '0',
60+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
61+
`sys_perm_user` varchar(5) DEFAULT NULL,
62+
`sys_perm_group` varchar(5) DEFAULT NULL,
63+
`sys_perm_other` varchar(5) DEFAULT NULL,
64+
`template_name` varchar(255) DEFAULT NULL,
65+
`diskspace` int(11) NOT NULL DEFAULT '0',
66+
`traffic` int(11) NOT NULL DEFAULT '-1',
67+
`bandwidth` int(11) NOT NULL DEFAULT '-1',
68+
`ram` int(11) NOT NULL DEFAULT '0',
69+
`ram_burst` int(11) NOT NULL DEFAULT '0',
70+
`cpu_units` int(11) NOT NULL DEFAULT '1000',
71+
`cpu_num` int(11) NOT NULL DEFAULT '4',
72+
`cpu_limit` int(11) NOT NULL DEFAULT '400',
73+
`io_priority` int(11) NOT NULL DEFAULT '4',
74+
`active` varchar(255) NOT NULL DEFAULT 'y',
75+
`description` text,
76+
`numproc` varchar(255) DEFAULT NULL,
77+
`numtcpsock` varchar(255) DEFAULT NULL,
78+
`numothersock` varchar(255) DEFAULT NULL,
79+
`vmguarpages` varchar(255) DEFAULT NULL,
80+
`kmemsize` varchar(255) DEFAULT NULL,
81+
`tcpsndbuf` varchar(255) DEFAULT NULL,
82+
`tcprcvbuf` varchar(255) DEFAULT NULL,
83+
`othersockbuf` varchar(255) DEFAULT NULL,
84+
`dgramrcvbuf` varchar(255) DEFAULT NULL,
85+
`oomguarpages` varchar(255) DEFAULT NULL,
86+
`privvmpages` varchar(255) DEFAULT NULL,
87+
`lockedpages` varchar(255) DEFAULT NULL,
88+
`shmpages` varchar(255) DEFAULT NULL,
89+
`physpages` varchar(255) DEFAULT NULL,
90+
`numfile` varchar(255) DEFAULT NULL,
91+
`avnumproc` varchar(255) DEFAULT NULL,
92+
`numflock` varchar(255) DEFAULT NULL,
93+
`numpty` varchar(255) DEFAULT NULL,
94+
`numsiginfo` varchar(255) DEFAULT NULL,
95+
`dcachesize` varchar(255) DEFAULT NULL,
96+
`numiptent` varchar(255) DEFAULT NULL,
97+
`swappages` varchar(255) DEFAULT NULL,
98+
`hostname` varchar(255) DEFAULT NULL,
99+
`nameserver` varchar(255) DEFAULT NULL,
100+
`create_dns` varchar(1) NOT NULL DEFAULT 'n',
101+
`capability` varchar(255) DEFAULT NULL,
102+
PRIMARY KEY (`template_id`)
103+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
104+
105+
--
106+
-- Dumping data for table `openvz_template`
107+
--
108+
109+
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`) 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', '');
110+
111+
-- --------------------------------------------------------
112+
113+
--
114+
-- Table structure for table `openvz_traffic`
115+
--
116+
117+
CREATE TABLE IF NOT EXISTS `openvz_traffic` (
118+
`veid` int(11) NOT NULL,
119+
`traffic_date` date NOT NULL,
120+
`traffic_bytes` bigint(32) unsigned NOT NULL DEFAULT '0',
121+
PRIMARY KEY (`veid`,`traffic_date`)
122+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
123+
124+
--
125+
-- Dumping data for table `openvz_traffic`
126+
--
127+
128+
129+
-- --------------------------------------------------------
130+
131+
--
132+
-- Table structure for table `openvz_vm`
133+
--
134+
135+
CREATE TABLE IF NOT EXISTS `openvz_vm` (
136+
`vm_id` bigint(20) NOT NULL AUTO_INCREMENT,
137+
`sys_userid` int(11) NOT NULL DEFAULT '0',
138+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
139+
`sys_perm_user` varchar(5) DEFAULT NULL,
140+
`sys_perm_group` varchar(5) DEFAULT NULL,
141+
`sys_perm_other` varchar(5) DEFAULT NULL,
142+
`server_id` int(11) NOT NULL DEFAULT '0',
143+
`veid` int(10) unsigned NOT NULL,
144+
`ostemplate_id` int(11) NOT NULL DEFAULT '0',
145+
`template_id` int(11) NOT NULL DEFAULT '0',
146+
`ip_address` varchar(255) NOT NULL,
147+
`hostname` varchar(255) DEFAULT NULL,
148+
`vm_password` varchar(255) DEFAULT NULL,
149+
`start_boot` varchar(255) NOT NULL DEFAULT 'y',
150+
`active` varchar(255) NOT NULL DEFAULT 'y',
151+
`active_until_date` date NOT NULL,
152+
`description` text,
153+
`diskspace` int(11) NOT NULL DEFAULT '0',
154+
`traffic` int(11) NOT NULL DEFAULT '-1',
155+
`bandwidth` int(11) NOT NULL DEFAULT '-1',
156+
`ram` int(11) NOT NULL DEFAULT '0',
157+
`ram_burst` int(11) NOT NULL DEFAULT '0',
158+
`cpu_units` int(11) NOT NULL DEFAULT '1000',
159+
`cpu_num` int(11) NOT NULL DEFAULT '4',
160+
`cpu_limit` int(11) NOT NULL DEFAULT '400',
161+
`io_priority` int(11) NOT NULL DEFAULT '4',
162+
`nameserver` varchar(255) NOT NULL DEFAULT '8.8.8.8 8.8.4.4',
163+
`create_dns` varchar(1) NOT NULL DEFAULT 'n',
164+
`capability` text NOT NULL,
165+
`config` mediumtext NOT NULL,
166+
PRIMARY KEY (`vm_id`)
167+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
168+
169+
--
170+
-- Dumping data for table `openvz_vm`
171+
--
172+
173+
-- --------------------------------------------------------

install/sql/ispconfig3.sql

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,180 @@ CREATE TABLE `monitor_data` (
792792

793793
-- --------------------------------------------------------
794794

795+
--
796+
-- Table structure for table `openvz_ip`
797+
--
798+
799+
CREATE TABLE IF NOT EXISTS `openvz_ip` (
800+
`ip_address_id` bigint(20) NOT NULL AUTO_INCREMENT,
801+
`sys_userid` int(11) NOT NULL DEFAULT '0',
802+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
803+
`sys_perm_user` varchar(5) DEFAULT NULL,
804+
`sys_perm_group` varchar(5) DEFAULT NULL,
805+
`sys_perm_other` varchar(5) DEFAULT NULL,
806+
`server_id` int(11) NOT NULL DEFAULT '0',
807+
`ip_address` varchar(15) DEFAULT NULL,
808+
`vm_id` int(11) NOT NULL DEFAULT '0',
809+
`reserved` varchar(255) NOT NULL DEFAULT 'n',
810+
PRIMARY KEY (`ip_address_id`)
811+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
812+
813+
--
814+
-- Dumping data for table `openvz_ip`
815+
--
816+
817+
-- --------------------------------------------------------
818+
819+
--
820+
-- Table structure for table `openvz_ostemplate`
821+
--
822+
823+
CREATE TABLE IF NOT EXISTS `openvz_ostemplate` (
824+
`ostemplate_id` bigint(20) NOT NULL AUTO_INCREMENT,
825+
`sys_userid` int(11) NOT NULL DEFAULT '0',
826+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
827+
`sys_perm_user` varchar(5) DEFAULT NULL,
828+
`sys_perm_group` varchar(5) DEFAULT NULL,
829+
`sys_perm_other` varchar(5) DEFAULT NULL,
830+
`template_name` varchar(255) DEFAULT NULL,
831+
`template_file` varchar(255) NOT NULL,
832+
`server_id` int(11) NOT NULL DEFAULT '0',
833+
`allservers` varchar(255) NOT NULL DEFAULT 'y',
834+
`active` varchar(255) NOT NULL DEFAULT 'y',
835+
`description` text,
836+
PRIMARY KEY (`ostemplate_id`)
837+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
838+
839+
--
840+
-- Dumping data for table `openvz_ostemplate`
841+
--
842+
843+
INSERT INTO `openvz_ostemplate` (`ostemplate_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `template_file`, `server_id`, `allservers`, `active`, `description`) VALUES(1, 1, 1, 'riud', 'riud', '', 'Debian minimal', 'debian-minimal-x86', 1, 'y', 'y', 'Debain minmal image.');
844+
845+
-- --------------------------------------------------------
846+
847+
--
848+
-- Table structure for table `openvz_template`
849+
--
850+
851+
CREATE TABLE IF NOT EXISTS `openvz_template` (
852+
`template_id` bigint(20) NOT NULL AUTO_INCREMENT,
853+
`sys_userid` int(11) NOT NULL DEFAULT '0',
854+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
855+
`sys_perm_user` varchar(5) DEFAULT NULL,
856+
`sys_perm_group` varchar(5) DEFAULT NULL,
857+
`sys_perm_other` varchar(5) DEFAULT NULL,
858+
`template_name` varchar(255) DEFAULT NULL,
859+
`diskspace` int(11) NOT NULL DEFAULT '0',
860+
`traffic` int(11) NOT NULL DEFAULT '-1',
861+
`bandwidth` int(11) NOT NULL DEFAULT '-1',
862+
`ram` int(11) NOT NULL DEFAULT '0',
863+
`ram_burst` int(11) NOT NULL DEFAULT '0',
864+
`cpu_units` int(11) NOT NULL DEFAULT '1000',
865+
`cpu_num` int(11) NOT NULL DEFAULT '4',
866+
`cpu_limit` int(11) NOT NULL DEFAULT '400',
867+
`io_priority` int(11) NOT NULL DEFAULT '4',
868+
`active` varchar(255) NOT NULL DEFAULT 'y',
869+
`description` text,
870+
`numproc` varchar(255) DEFAULT NULL,
871+
`numtcpsock` varchar(255) DEFAULT NULL,
872+
`numothersock` varchar(255) DEFAULT NULL,
873+
`vmguarpages` varchar(255) DEFAULT NULL,
874+
`kmemsize` varchar(255) DEFAULT NULL,
875+
`tcpsndbuf` varchar(255) DEFAULT NULL,
876+
`tcprcvbuf` varchar(255) DEFAULT NULL,
877+
`othersockbuf` varchar(255) DEFAULT NULL,
878+
`dgramrcvbuf` varchar(255) DEFAULT NULL,
879+
`oomguarpages` varchar(255) DEFAULT NULL,
880+
`privvmpages` varchar(255) DEFAULT NULL,
881+
`lockedpages` varchar(255) DEFAULT NULL,
882+
`shmpages` varchar(255) DEFAULT NULL,
883+
`physpages` varchar(255) DEFAULT NULL,
884+
`numfile` varchar(255) DEFAULT NULL,
885+
`avnumproc` varchar(255) DEFAULT NULL,
886+
`numflock` varchar(255) DEFAULT NULL,
887+
`numpty` varchar(255) DEFAULT NULL,
888+
`numsiginfo` varchar(255) DEFAULT NULL,
889+
`dcachesize` varchar(255) DEFAULT NULL,
890+
`numiptent` varchar(255) DEFAULT NULL,
891+
`swappages` varchar(255) DEFAULT NULL,
892+
`hostname` varchar(255) DEFAULT NULL,
893+
`nameserver` varchar(255) DEFAULT NULL,
894+
`create_dns` varchar(1) NOT NULL DEFAULT 'n',
895+
`capability` varchar(255) DEFAULT NULL,
896+
PRIMARY KEY (`template_id`)
897+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
898+
899+
--
900+
-- Dumping data for table `openvz_template`
901+
--
902+
903+
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`) 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', '');
904+
905+
-- --------------------------------------------------------
906+
907+
--
908+
-- Table structure for table `openvz_traffic`
909+
--
910+
911+
CREATE TABLE IF NOT EXISTS `openvz_traffic` (
912+
`veid` int(11) NOT NULL,
913+
`traffic_date` date NOT NULL,
914+
`traffic_bytes` bigint(32) unsigned NOT NULL DEFAULT '0',
915+
PRIMARY KEY (`veid`,`traffic_date`)
916+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
917+
918+
--
919+
-- Dumping data for table `openvz_traffic`
920+
--
921+
922+
923+
-- --------------------------------------------------------
924+
925+
--
926+
-- Table structure for table `openvz_vm`
927+
--
928+
929+
CREATE TABLE IF NOT EXISTS `openvz_vm` (
930+
`vm_id` bigint(20) NOT NULL AUTO_INCREMENT,
931+
`sys_userid` int(11) NOT NULL DEFAULT '0',
932+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
933+
`sys_perm_user` varchar(5) DEFAULT NULL,
934+
`sys_perm_group` varchar(5) DEFAULT NULL,
935+
`sys_perm_other` varchar(5) DEFAULT NULL,
936+
`server_id` int(11) NOT NULL DEFAULT '0',
937+
`veid` int(10) unsigned NOT NULL,
938+
`ostemplate_id` int(11) NOT NULL DEFAULT '0',
939+
`template_id` int(11) NOT NULL DEFAULT '0',
940+
`ip_address` varchar(255) NOT NULL,
941+
`hostname` varchar(255) DEFAULT NULL,
942+
`vm_password` varchar(255) DEFAULT NULL,
943+
`start_boot` varchar(255) NOT NULL DEFAULT 'y',
944+
`active` varchar(255) NOT NULL DEFAULT 'y',
945+
`active_until_date` date NOT NULL,
946+
`description` text,
947+
`diskspace` int(11) NOT NULL DEFAULT '0',
948+
`traffic` int(11) NOT NULL DEFAULT '-1',
949+
`bandwidth` int(11) NOT NULL DEFAULT '-1',
950+
`ram` int(11) NOT NULL DEFAULT '0',
951+
`ram_burst` int(11) NOT NULL DEFAULT '0',
952+
`cpu_units` int(11) NOT NULL DEFAULT '1000',
953+
`cpu_num` int(11) NOT NULL DEFAULT '4',
954+
`cpu_limit` int(11) NOT NULL DEFAULT '400',
955+
`io_priority` int(11) NOT NULL DEFAULT '4',
956+
`nameserver` varchar(255) NOT NULL DEFAULT '8.8.8.8 8.8.4.4',
957+
`create_dns` varchar(1) NOT NULL DEFAULT 'n',
958+
`capability` text NOT NULL,
959+
`config` mediumtext NOT NULL,
960+
PRIMARY KEY (`vm_id`)
961+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
962+
963+
--
964+
-- Dumping data for table `openvz_vm`
965+
--
966+
967+
-- --------------------------------------------------------
968+
795969
--
796970
-- Table structure for table `proxy_reverse`
797971
--

interface/lib/lang/en.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $wb['top_menu_help'] = 'Help';
3636
$wb['top_menu_billing'] = 'Billing';
3737
$wb['top_menu_domain'] = 'Domains';
3838
$wb['top_menu_dashboard'] = 'Home';
39-
$wb['top_menu_vm'] = 'VM';
39+
$wb['top_menu_vm'] = 'VServer';
4040
$wb['toolsarea_head_txt'] = 'Tools';
4141
$wb['latest_news_txt'] = 'Latest news';
4242
?>

interface/web/client/client_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function onAfterInsert() {
161161
// Create the controlpaneluser for the client
162162
//Generate ssh-rsa-keys
163163
exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""');
164-
$app->db->query("UPDATE client SET created_at = ".time().", id_rsa = '".file_get_contents('/tmp/id_rsa')."', ssh_rsa = '".file_get_contents('/tmp/id_rsa.pub')."' WHERE client_id = ".$this->id);
164+
$app->db->query("UPDATE client SET created_at = ".time().", id_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa'))."', ssh_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa.pub'))."' WHERE client_id = ".$this->id);
165165
exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub');
166166

167167
// Create the controlpaneluser for the client
1.06 KB
Loading

0 commit comments

Comments
 (0)