Changed around deploy command to use RAM sizes instead

feature/node-rewrite
Sven Slootweg 12 years ago
parent bf491969c2
commit 05b40ad0b0

@ -76,8 +76,6 @@ class Container extends CPHPDatabaseRecordClass
public function Deploy()
{
$sGuaranteedRamPages = $this->sGuaranteedRam * 256;
$sBurstableRamPages = $this->sBurstableRam * 256;
$sRootPassword = random_string(20);
$this->uRootPassword = $sRootPassword;
@ -107,8 +105,8 @@ class Container extends CPHPDatabaseRecordClass
--nameserver 8.8.8.8
--nameserver 8.8.4.4
--numproc {$this->sCpuCount}
--vmguarpages {$sGuaranteedRamPages}:unlimited
--privvmpages {$sBurstableRamPages}:{$sBurstableRamPages}
--vmguarpages {$this->sGuaranteedRam}M:unlimited
--privvmpages {$this->sBurstableRam}M:{$this->sBurstableRam}M
--quotatime 0
--diskspace {$this->sDiskSpace}M:{$this->sDiskSpace}M
--userpasswd root:{$sRootPassword}

@ -5,27 +5,36 @@ require("includes/include.base.php");
$settings['master_privkey'] = "/etc/cvm/key";
$settings['master_pubkey'] = "/etc/cvm/key.pub";
$sContainer = new Container(1);
if($_GET['action'] == "start")
{
$sContainer->Start();
}
elseif($_GET['action'] == "stop")
{
$sContainer->Stop();
}
elseif($_GET['action'] == "bw")
{
$sContainer->UpdateTraffic();
}
elseif($_GET['action'] == "ip")
if($_GET['action'] == "deploy")
{
$sContainer->AddIp($_GET['ip']);
$sContainer = new Container(2);
$sContainer->Deploy();
}
else
{
echo("idk");
$sContainer = new Container(1);
if($_GET['action'] == "start")
{
$sContainer->Start();
}
elseif($_GET['action'] == "stop")
{
$sContainer->Stop();
}
elseif($_GET['action'] == "bw")
{
$sContainer->UpdateTraffic();
}
elseif($_GET['action'] == "ip")
{
$sContainer->AddIp($_GET['ip']);
}
else
{
echo("idk");
}
}
echo("Done!");

Loading…
Cancel
Save