LXC create how ?

maxicom

Active Member
May 22, 2017
9
0
41
59
Hi please give me example create lxc container in terminal
I do not know what should im use pvesh create ? or ?
 
yes but not understand
witch method
pct create 999 local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz

or

pvesh create /nodes/proxlan/lxc -vmid=302 -ostemplate=/var/lib/vz/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz -storage=local -rootfs=local,size=4G
 
'pvesh' is a tool which exposes the whole REST API while 'pct' is a wrapper around the low-level LXC tools.
 
ok I want to use api, in this case pvesh
but in example im only see old openvz

pvesh create /nodes/{node}/openvz -vmid 100 -hostname test -storage local \
-password supersecret \
-ostemplate local:vztmpl/ubuntu-10.04-standard_10.04-4_i386.tar.gz \
-memory 512 -swap 512 -disk 4 -cpus 1 \
-ip_address 1.2.3.4
 
the example is outdated apparently. i'll try to update it today.

try like this though:

Code:
pvesh create /nodes/{node}/lxc -vmid 10001 -hostname test -storage local \
                                  -password supersecret \
                                  -ostemplate local:vztmpl/archlinux-base_20180906-1_amd64.tar.gz  \  
                                  -memory 512 -swap 512