Привет, у меня проблема с созданием LXC-контейнера через PHP. API корректно подключается к pve, потому что я могу запускать и останавливать существующий контейнер, могу просматривать узлы и проверять, какой VIM следующий. Но при создании LXC я получаю значение bool(false). Мой код выглядит так: PHP: <?php
require ('pve-1/pve2_api.class.php');
$pve2 = new PVE2_API("SERVER_ADRESS", "USERNAME", "pam", "PASSWORD");
$pve2->login();
if ($pve2->login()) {
# Получить имя первого узла.
$nodes = $pve2->get_node_list();
$first_node = $nodes[0];
unset($nodes);
$nextVMID = $pve2->get_next_vmid();
$new_container_settings = array();
$new_container_settings['ostemplate'] = "local:vztmpl/ubuntu-16.04-standard_16.04-1_amd64.tar.gz";
$new_container_settings['vmid'] = $nextVMID;
$new_container_settings['cpus'] = "2";
$new_container_settings['description'] = "Тестовая ВМ с использованием Proxmox 2.0 API";
$new_container_settings['disk'] = "8";
$new_container_settings['hostname'] = "testapi.domain.tld";
$new_container_settings['memory'] = "1024";
$new_container_settings['nameserver'] = "10.11.12.252";
// print_r($new_container_settings);
print("---------------------------\n");
var_dump($pve2->post("/nodes/".$first_node."/lxc/", $new_container_settings));
print("\n\n");
// print_r($pve2->post("/nodes/".$first_node."/lxc/107/status/start", array())); // запуск lxc
// print_r($pve2->post("/nodes/".$first_node."/lxc/107/status/stop", array())); // остановка lxc
} else {
print("Не удалось войти на хост Proxmox.\n");
exit;
} Есть идеи, что я мог сделать не так?
require ('pve-1/pve2_api.class.php');
$pve2 = new PVE2_API("SERVER_ADRESS", "USERNAME", "pam", "PASSWORD");
$pve2->login();
if ($pve2->login()) {
# Получить имя первого узла.
$nodes = $pve2->get_node_list();
$first_node = $nodes[0];
unset($nodes);
$nextVMID = $pve2->get_next_vmid();
$new_container_settings = array();
$new_container_settings['ostemplate'] = "local:vztmpl/ubuntu-16.04-standard_16.04-1_amd64.tar.gz";
$new_container_settings['vmid'] = $nextVMID;
$new_container_settings['cpus'] = "2";
$new_container_settings['description'] = "Тестовая ВМ с использованием Proxmox 2.0 API";
$new_container_settings['disk'] = "8";
$new_container_settings['hostname'] = "testapi.domain.tld";
$new_container_settings['memory'] = "1024";
$new_container_settings['nameserver'] = "10.11.12.252";
// print_r($new_container_settings);
print("---------------------------\n");
var_dump($pve2->post("/nodes/".$first_node."/lxc/", $new_container_settings));
print("\n\n");
// print_r($pve2->post("/nodes/".$first_node."/lxc/107/status/start", array())); // запуск lxc
// print_r($pve2->post("/nodes/".$first_node."/lxc/107/status/stop", array())); // остановка lxc
} else {
print("Не удалось войти на хост Proxmox.\n");
exit;
} Есть идеи, что я мог сделать не так?
