How to create a container from command-line (pct create) ?

francoisd

Renowned Member
Sep 10, 2009
49
3
73
Hi,

I'm blocking on this. Why does it not create the volume ?

Code:
root@pve1:~# pct create 117 /mnt/pve/cephfs/template/cache/jammy-minimal-cloudimg-amd64-root.tar.xz --hostname gal1 --memory 1024 --net0 name=eth0,bridge=vmbr0,firewall=1,gw=192.168.10.1,ip=192.168.10.71/24,tag=10,type=veth --storage localblock --rootfs volume=localblock:vm-117-disk-0,mountoptions=noatime,size=8G --unprivileged 1 --pool Containers
unable to create CT 117 - no such logical volume pve/vm-117-disk-0

Of course, the volume does not exist, since I gave a size for it to be created ?!

My storage:
Code:
root@pve1:~# pvesm status | grep -E '^(Name|localblock)'
Name                   Type     Status           Total            Used       Available        %
localblock          lvmthin     active       146800640        69965185        76835454   47.66%
 
Last edited:
Great, thanks. I works.

Working command line:

Code:
pct create 117 /mnt/pve/cephfs/template/cache/jammy-minimal-cloudimg-amd64-root.tar.xz --hostname gal1 --memory 1024 --net0 name=eth0,bridge=vmbr0,firewall=1,gw=192.168.10.1,ip=192.168.10.71/24,tag=10,type=veth --storage localb
lock --rootfs localblock:8 --unprivileged 1 --pool Containers --ignore-unpack-errors --ssh-public-keys /root/.ssh/authorized_keys --ostype ubuntu --password="$ROOTPASS" --start 1

(Trying the future ubuntu-server 22.04)
 
  • Like
Reactions: panchuz

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!