"pct create" command with "--timezone host" option fails to create a container

Oct 6, 2021
3
1
8
Hello,

Last week I installed a new Proxmox VE v7.0.1, and found that "pct create" command fails if "--timezone host" option is added.
However, this worked fine with VE v6.4...

Code:
# pveversion
pve-manager/7.0-11/63d82f4e (running kernel: 5.11.22-5-pve)

# pct create 101 local:vztmpl/debian-11-standard_11.0-1_amd64.tar.gz --arch amd64 --cores 12 --hostname debtest --memory 16384 --mp0 /data_vol_02,mp=/export,acl=1 --ostype debian --password for@testrt --rootfs local-lvm:20 --timezone host
  Logical volume "vm-101-disk-0" created.
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: 6c755cc5-f9ac-4770-ac45-6ba7f0c3ded9
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
extracting archive '/var/lib/vz/template/cache/debian-11-standard_11.0-1_amd64.tar.gz'
Total bytes read: 684820480 (654MiB, 97MiB/s)
Insecure dependency in symlink while running with -T switch at /usr/share/perl5/PVE/LXC/Setup/Base.pm line 660.
  Logical volume "vm-101-disk-0" successfully removed
unable to create CT 101 - error in setup task PVE::LXC::Setup::post_create_hook

Without "--timezone host" option pct command creates containers as expected.

In addition, if I create a container without "--timezone host" option first, and then run " pct set 101 --timezone host" on the same container,
an appropriate "timezone: host" line is added to the bottom of "/etc/pve/nodes/<node_name>/lxc/101.conf" file, but the container timezone sticks with the default one,
and not of the host node as was expected - ever after the container reboot.
Again, that worked fine with v6.4...

Code:
# pct create 101 local:vztmpl/debian-11-standard_11.0-1_amd64.tar.gz --arch amd64 --cores 12 --hostname debtest --memory 16384 --mp0 /data_vol_02,mp=/export,acl=1 --ostype debian --password for@testrt --rootfs local-lvm:20
# pct set 101 --timezone host

# cat /etc/pve/nodes/p7m1/lxc/101.conf
arch: amd64
cores: 12
features: nesting=1
hostname: debtest
memory: 16384
mp0: /data_vol_02,mp=/export,acl=1
onboot: 1
ostype: debian
rootfs: local-lvm:vm-100-disk-0,acl=1,size=20G
startup: order=2,up=60,down=60
swap: 1024
timezone: host

Timezone of the host:
Code:
# cat /etc/timezone
Asia/Jerusalem

And in the container:
Code:
# cat /etc/timezone
Etc/UTC

Please could you help with this issue?
 
Hi,
Hello,

Last week I installed a new Proxmox VE v7.0.1, and found that "pct create" command fails if "--timezone host" option is added.
However, this worked fine with VE v6.4...

Code:
# pveversion
pve-manager/7.0-11/63d82f4e (running kernel: 5.11.22-5-pve)

# pct create 101 local:vztmpl/debian-11-standard_11.0-1_amd64.tar.gz --arch amd64 --cores 12 --hostname debtest --memory 16384 --mp0 /data_vol_02,mp=/export,acl=1 --ostype debian --password for@testrt --rootfs local-lvm:20 --timezone host
  Logical volume "vm-101-disk-0" created.
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: 6c755cc5-f9ac-4770-ac45-6ba7f0c3ded9
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
extracting archive '/var/lib/vz/template/cache/debian-11-standard_11.0-1_amd64.tar.gz'
Total bytes read: 684820480 (654MiB, 97MiB/s)
Insecure dependency in symlink while running with -T switch at /usr/share/perl5/PVE/LXC/Setup/Base.pm line 660.
  Logical volume "vm-101-disk-0" successfully removed
unable to create CT 101 - error in setup task PVE::LXC::Setup::post_create_hook

Without "--timezone host" option pct command creates containers as expected.
thanks for the report! I can reproduce this here, and will look into this. But it also fails on latest 6.4 for me.

In addition, if I create a container without "--timezone host" option first, and then run " pct set 101 --timezone host" on the same container,
an appropriate "timezone: host" line is added to the bottom of "/etc/pve/nodes/<node_name>/lxc/101.conf" file, but the container timezone sticks with the default one,
and not of the host node as was expected - ever after the container reboot.
Again, that worked fine with v6.4...

Code:
# pct create 101 local:vztmpl/debian-11-standard_11.0-1_amd64.tar.gz --arch amd64 --cores 12 --hostname debtest --memory 16384 --mp0 /data_vol_02,mp=/export,acl=1 --ostype debian --password for@testrt --rootfs local-lvm:20
# pct set 101 --timezone host

# cat /etc/pve/nodes/p7m1/lxc/101.conf
arch: amd64
cores: 12
features: nesting=1
hostname: debtest
memory: 16384
mp0: /data_vol_02,mp=/export,acl=1
onboot: 1
ostype: debian
rootfs: local-lvm:vm-100-disk-0,acl=1,size=20G
startup: order=2,up=60,down=60
swap: 1024
timezone: host

Timezone of the host:
Code:
# cat /etc/timezone
Asia/Jerusalem

And in the container:
Code:
# cat /etc/timezone
Etc/UTC

Please could you help with this issue?
Our tooling only updates the symbolic link /etc/localtime AFAICT, but doesn't look at /etc/timezone. But since some programs seem to rely on that, it's probably best to start updating that too.

EDIT: Preliminary patches are available here (not yet reviewed!).
 
Last edited:
Hi Fabian,

Thank you for addressing this issue!

As for "pct set <CT_NUM> --timezone host" - you're right, that works and set container timezone the same as of the host, and properly reported by "date" command. Of course, it would be best to update "/etc/timezone" as well.
 
Hi Fabian,

The issue is fully resolved in the last proxmox7 update:
"pct create ... --timezone host" works as expected; "/etc/timezone" file in a container is updated now as well.

Many thanks!
 
  • Like
Reactions: fiona