Hi,
I am trying to create a LXC via PHP API but I get a error ...
'HTTP Error - HTTP/1.1 500 can't find file 'debian-8.0-CUSTOM_8.0-1_amd64''.
But I am sure that the template exists.
I guess that my script is not correct, as there are no api examples ...
I hope someone can help me, thanks!
I am trying to create a LXC via PHP API but I get a error ...
'HTTP Error - HTTP/1.1 500 can't find file 'debian-8.0-CUSTOM_8.0-1_amd64''.
But I am sure that the template exists.
I guess that my script is not correct, as there are no api examples ...
PHP:
$sTemplateName = 'debian-8.0-CUSTOM_8.0-1_amd64'; // .tar.gz
$sNodeName = 'ns3302305';
$aServerSpecs = array ( );
// Specs
$aServerSpecs [ 'ostemplate' ] = $sTemplateName;
$aServerSpecs [ 'vmid' ] = $pApi->get_next_vmid ( );
$aServerSpecs [ 'hostname' ] = 'MyServer';
$aServerSpecs [ 'password' ] = 'ByeBye321';
// CPU
$aServerSpecs [ 'arch' ] = 'amd64';
$aServerSpecs [ 'cpulimit' ] = 1;
$aServerSpecs [ 'cpuunits' ] = 1000;
// Memory
$aServerSpecs [ 'memory' ] = '512';
$aServerSpecs [ 'swap' ] = '512';
// HDD
$aServerSpecs [ 'rootfs' ] = 'volume=local:10,format=raw'; // ?
//$aServerSpecs [ 'storage' ] = ''; // ?
// Network
$aServerSpecs [ 'net0' ] = 'bridge=vmbr3,hwaddr=12:34:56:78:90:AB,ip=dhcp,ip6=dhcp,name=eth0,type=veth';
// Create
var_dump ( $pApi->post ( '/nodes/' . $sNodeName . '/lxc', $aServerSpecs ) );
I hope someone can help me, thanks!