Create container with bridged mode via php API

Thomesc

New Member
Jul 26, 2016
13
0
1
26
Hi,
I'm currently making a web interface using a the proxmox API to create containers automaticly.
I'd like this containers network to be default bridged mode, my code currently looks like this :
Code:
$new_container_settings = array();
    $new_container_settings['ostemplate'] = "local:vztmpl/" . $template;
    $new_container_settings['vmid'] = $_POST['ID'];
    $new_container_settings['cpus'] = $_POST['CPU'];
    $new_container_settings['description'] = $_POST['description'];
    $new_container_settings['disk'] = $_POST['disk_size'];
    $new_container_settings['hostname'] = $_POST['nom_vm'];
    $new_container_settings['memory'] = $_POST['RAM'];
    $new_container_settings['swap'] = $_POST['swap'];
    $new_container_settings['password'] = $_POST['password'];
    $new_container_settings['storage'] = "NFS";
   
    $task = $pve2->post("/nodes/".$first_node."/openvz", $new_container_settings);
I've searched in the documentation and on the web but couldn't find what variable I had to change to switch to bridged mode.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!