[PVE-User] pve2_api.class.php - create vz container - 500 can't find file / can't parse directory

Robert Anderson randerson at lbsd.net
Thu Oct 18 11:04:59 CEST 2012

I'm using the script available at 

My problem is that I can't seem to get the ostemplate parameter 
directory path right.

The result I'm getting is as follows:

This API Request Failed.
HTTP Response - 500
HTTP Error - HTTP/1.1 500 can't find file 

The part of the script making the call is as follows:

# Get first node name.
$nodes = $pve2->get_node_list();
$first_node = $nodes[0];

# Create a VZ container on the first node in the cluster.
$new_container_settings = array();
$new_container_settings['ostemplate'] = 
$new_container_settings['vmid'] = "131231";
$new_container_settings['cpus'] = "2";
$new_container_settings['description'] = "Test VM using Proxmox 2.0 API";
$new_container_settings['disk'] = "8";
$new_container_settings['hostname'] = "pve2api-test-host";
$new_container_settings['memory'] = "1024";
#$new_container_settings['nameserver'] = "";

// print_r($new_container_settings);


On the machine I'm connecting to I've used the following command to list 

root at vserver-host1:~# pvesm list local --content vztmpl
local:vztmpl/centos-6-x86_64-20120114.tar.gz              tgz  181180617
local:vztmpl/debian-6.0-x86_64.tar.gz                     tgz  158084534

Other ostemplate strings I've tried are:


What am I doing wrong?

More information about the pve-user mailing list