What's the best method to configure eth0 for a new container? It's easy enough to do this via GUI but I really want to do this by script.
So far I can create nodes using pvesh. Assuming I want a container ID of '101'
pvesh create /nodes/prox_host_1/openvz -vmid 101 -hostname bob (redacted for clarity)
I then add eth0 using vzctl
vzctl set 101 --netif_add eth0,,,,vmbr0 --save
Next IP address ...
vzctl set 101--ipadd 10.10.3.101 --nameserver 8.8.8.8
Issues
This doesn't seem to populate the container's /etc/network/interfaces. Am I supposed to write directly to /var/lib/vz/root/101/etc/network/interfaces?
When I tell it to use parameter --gateway I'm told 'unrecognized option'. So how DO I add a gateway?
I feel like I'm so _close_ to getting this thing understood but I'm missing something obvious.
So far I can create nodes using pvesh. Assuming I want a container ID of '101'
pvesh create /nodes/prox_host_1/openvz -vmid 101 -hostname bob (redacted for clarity)
I then add eth0 using vzctl
vzctl set 101 --netif_add eth0,,,,vmbr0 --save
Next IP address ...
vzctl set 101--ipadd 10.10.3.101 --nameserver 8.8.8.8
Issues
This doesn't seem to populate the container's /etc/network/interfaces. Am I supposed to write directly to /var/lib/vz/root/101/etc/network/interfaces?
When I tell it to use parameter --gateway I'm told 'unrecognized option'. So how DO I add a gateway?
I feel like I'm so _close_ to getting this thing understood but I'm missing something obvious.