Unable to parse directory volume name with pct create

zenny

Member
Jul 7, 2008
71
0
6
Hi,

Tried to create a lxc container over command line:

Code:
# pct create 108 local:vztmpl/debian-9.0-standard_9.7-1_amd64.tar.gz --hostname server1.name.dom --cpulimit 1 --cpuunits 1024 --memory 512 --swap 1024 --ostype debian --onboot 1 --net0 name=eth0,bridge=vmbr0,gw=192.168.63.1,ip=192.168.63.108/24 --rootfs local:vm-108-disk-1.raw,size=12G --password
Enter password: 
Retype password: 
unable to parse directory volume name 'vm-108-disk-1.raw'
[Exit 255]
Same error when trying with 'vm-108-disk-1' and 'vm-108-disk-0'.

PVE is installed to a remote server with LVM (therefore no way to upgrade to v5) without much complexity as evident from:

Code:
# cat /etc/pve/storage.cfg
dir: local
        path /var/lib/vz
        content iso,backup,rootdir,images,vztmpl
        maxfiles 0
        shared 0
Could not figure out any relevant thread in the forum. Thanks in advance for any pointer.

Cheers,
/z
 

zenny

Member
Jul 7, 2008
71
0
6
@sb-jw: Thanks for the pointer.

Appending the part with:

Code:
--storage local --rootfs volume=vm-108-disk-1.raw,size=12G
as well as with:

Code:
--storage local --rootfs volume=vm-108-disk-1,size=12G
fails to create the container with the following error:

unable to parse volume ID 'vm-108-disk-1.raw'
unable to parse volume ID 'vm-108-disk-1'
to comply with what pct manpage states:

-rootfs [volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]
Use volume as container root.
Cheers,
/z
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
4,087
368
88
31
Vienna
if you want to create a new volume, the syntax is

Code:
--rootfs STORAGE:SIZE
the syntax is a little hard to see, but it is in the documentation https://pve.proxmox.com/wiki/Linux_Container

The special option syntax STORAGE_ID:SIZE_IN_GB for storage backed mount point volumes will automatically allocate a volume of the specified size on the specified storage. E.g., calling pct set 100 -mp0 thin1:10,mp=/path/in/container will allocate a 10GB volume on the storage thin1 and replace the volume ID place holder 10 with the allocated volume ID.
 

sb-jw

Active Member
Jan 23, 2018
551
49
28
28
Instead of "--storage local --rootfs volume=vm-108-disk-1,size=12G" you should use: "--rootfs volume=ceph-customer:12". "ceph-customer" is my Storage and "12" is the Size.

root@prox1:~# pct create 999108 nfs-frontend01-media-templates:vztmpl/debian-9.0-standard_9.7-1_amd64.tar.gz --hostname server1.name.dom --cpulimit 1 --cpuunits 1024 --memory 512 --swap 1024 --ostype debian --onboot 1 --net0 name=eth0,bridge=vmbr0,gw=192.168.63.1,ip=192.168.63.108/24 --rootfs volume=ceph-customer:12 --password
Enter new password: *******
Retype new password: *******
/dev/rbd0
mke2fs 1.43.4 (31-Jan-2017)
Discarding device blocks: done
Creating filesystem with 3145728 4k blocks and 786432 inodes
Filesystem UUID: 85a8338b-a14f-459c-93d8-5a672b456eb7
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Multiple mount protection is enabled with update interval 5 seconds.
Writing superblocks and filesystem accounting information: done

extracting archive '/mnt/pve/nfs-frontend01-media-templates/template/cache/debian-9.0-standard_9.7-1_amd64.tar.gz'
Total bytes read: 544542720 (520MiB, 67MiB/s)
Detected container architecture: amd64
Creating SSH host key 'ssh_host_dsa_key' - this may take some time ...
done: SHA256:iBgQucn1J3rdwCNX6lz8hrSqzlc4izjZyHRCUQB6w8A root@server1
Creating SSH host key 'ssh_host_ed25519_key' - this may take some time ...
done: SHA256:Ojox0XqLUJlKuHP0xA8wQX4MfLrcLtIZ95J4e/44r7Y root@server1
Creating SSH host key 'ssh_host_ecdsa_key' - this may take some time ...
done: SHA256:Bs/WME634y7+TrVK11mCthpwNZrR+lkB4XyVnkDXb88 root@server1
Creating SSH host key 'ssh_host_rsa_key' - this may take some time ...
done: SHA256:OQMQSrG4n90HzDCS3KYcvC//d8SLtuuXmnwGzsKp9a0 root@server1
 

zenny

Member
Jul 7, 2008
71
0
6
if you want to create a new volume, the syntax is

Code:
--rootfs STORAGE:SIZE
@dcsapak, thanks for your input.

the syntax is a little hard to see, but it is in the documentation https://pve.proxmox.com/wiki/Linux_Container
In my OP (https://forum.proxmox.com/threads/unable-to-parse-directory-volume-name-with-pct-create.55373/), I guess I specified exactly the same to get the errror:

Code:
--rootfs local:vm-108-disk-1.raw,size=12G
Also tried with:

Code:
--storage local --rootfs local:volume=vm-108-disk-1,size=12G
but got:

rootfs: invalid format - format error
rootfs.local:volume: property is not defined in schema and the schema does not allow additional properties
rootfs.volume: property is missing and it is not optional
That made me to post here in the first count! Parsing errors. What exactly should be the name of the volumes? Just confused.

Cheers
 
Last edited:

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
3,598
554
118
In my OP (https://forum.proxmox.com/threads/unable-to-parse-directory-volume-name-with-pct-create.55373/), I guess I specified exactly the same to get the errror:

Code:
--rootfs local:vm-108-disk-1.raw,size=12G
Also tried with:

Code:
--storage local --rootfs local:volume=vm-108-disk-1,size=12G
but got:



That made me to post here in the first count! Parsing errors. What exactly should be the name of the volumes? Just confused.

Cheers
the volumes are generated for you - you just need to pass in the size, e.g.:
Code:
--rootfs local:12
for a 12G rootfs on the storage called 'local'
 
  • Like
Reactions: zenny

zenny

Member
Jul 7, 2008
71
0
6
@fabian , Thanks for the nifty pointer.

But there appears to be a size mismatch, created 12G:

Code:
# pct config 108
arch: amd64
hostname: hdi.loc
memory: 1024
net0: name=eth0,bridge=vmbr0,gw=192.168.63.1,hwaddr=42:E4:13:94:32:93,ip=192.168.63.108/24,type=veth
onboot: 0
ostype: ubuntu
rootfs: local:108/vm-108-disk-1.raw,size=12G
swap: 2048
And inside the container, it only shows 4G:

Code:
# ip addr show | grep inet
    inet 127.0.0.1/8 scope host lo
    inet 192.168.63.108/24 brd 192.168.63.255 scope global eth0
# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop2      3.9G  2.3G  1.4G  62% /
none            492K     0  492K   0% /dev
tmpfs          1000M     0 1000M   0% /dev/shm
tmpfs          1000M  284K 1000M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1000M     0 1000M   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /run/user/0
tmpfs           200M     0  200M   0% /run/user/118

Hmmm...
 
Last edited:

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
3,598
554
118
the "size" parameter in the mpX/rootfs property string is informational only - changing it won't change the size of the volume, you need to use the "resize" API for that..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!