Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 55 | Revision 59 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 55 Revision 56
Zeile 147... Zeile 147...
147
			$this->name=$v_name;
147
			$this->name=$v_name;
148
			$this->dist_id=$v_dist;
148
			$this->dist_id=$v_dist;
149
			unset($out);
149
			unset($out);
150
			$d=new Dist($v_dist);
150
			$d=new Dist($v_dist);
151
			$dist=$d->toArray();
151
			$dist=$d->toArray();
152
			$i=new IP($v_ip);
152
			$ip=IP::getIP($v_ip);
153
			$ip=$i->toArray();
153
			var_dump($ip);
154
			$d_name=$dist["dist_name"];
154
			$d_name=$dist["dist_name"];
155
			$this->dist=$d_name;
155
			$this->dist=$d_name;
156
			$d_template="/vz/template/cache/".$dist["template"].".tar.gz";
156
			$d_template="/vz/template/cache/".$dist["template"].".tar.gz";
157
			$db->beginTransaction();
157
			$db->beginTransaction();
158
			$sql="INSERT into vservers (v_id, hn_id, v_name, v_dist) VALUES ($this->v_id, $this->hn_id, '$this->name', $this->dist_id)";
158
			$sql="INSERT into vservers (v_id, hn_id, v_name, v_dist) VALUES ($this->v_id, $this->hn_id, '$this->name', $this->dist_id)";
159
			$res=$db->query($sql);
159
			$res=$db->query($sql);
160
			if(!PEAR::isError($res))
160
			if(!PEAR::isError($res))
161
			{
161
			{
162
				$cmd="ssh root@mainframe vzctl create $this->v_id --hostname $v_name --ostemplate $d_template --config vps.$d_name --ipadd ".$ip[$v_ip];
162
				$cmd="ssh root@mainframe vzctl create $this->v_id --hostname $v_name --ostemplate $d_template --config vps.$d_name --ipadd ".$ip["ip"];
163
				exec($cmd,$out,$ret);
163
				exec($cmd,$out,$ret);
164
				if(!$ret)
164
				if(!$ret)
165
				{
165
				{
166
					$smarty->assign("meld","vServer erfolgreich angelegt!");
166
					$smarty->assign("meld","vServer erfolgreich angelegt!");
167
					$smarty->assign("error", false);
167
					$smarty->assign("error", false);