[SOLVED] Import container with pct and resize multiple disks

mailinglists

Renowned Member
Mar 14, 2012
641
67
93
Hi,

I have a container, hosted with PM on ZFS (compression on) and multiple disks.
I want to import this with pct and define new disk size for each of his disks.

If there is one disk, command would look something like:
pct restore 212 nfsAKlocalDir:backup/vzdump-lxc-xxxx.tar.zst --storage local-lvm --rootfs 39
and it rewrites the rootfs size to 39 GB. How can I rewrite sizes of the other volumes in restore?

What are the --rootfs equivalents of other disks a LXC has?
Maybe I can just fix definitions inside the backup file? Where?
 
Still have no idea how to import this, as there is no option to resize specific disk upon restore.
This might even be a bug, because the backup was taken with PM, to PBS and restored to PM again.
This should work everytime, no matter if the source uses ZFS with compression and destination default ThinLVM.

Code:
Header
Proxmox
Virtual Environment 8.0.4
Storage 'l-censored' on node 'ak'
Search:
Logs
recovering backed-up configuration from 'nfsAKlocalDir:backup/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst'
  Logical volume "vm-213-disk-0" created.
Creating filesystem with 8388608 4k blocks and 2097152 inodes
Filesystem UUID: 5a878c18-3d7f-4aad-aa2d-171d75e171a5
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624
  Logical volume "vm-213-disk-1" created.
Creating filesystem with 1053556736 4k blocks and 263389184 inodes
Filesystem UUID: f05147ab-29da-4336-9c5f-0263b00842e6
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000, 214990848, 512000000, 550731776, 644972544
  Logical volume "vm-213-disk-2" created.
Creating filesystem with 786432000 4k blocks and 196608000 inodes
Filesystem UUID: b14b292c-fce2-44eb-adad-2dd2c4ae2a00
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000, 214990848, 512000000, 550731776, 644972544
restoring 'nfsAKlocalDir:backup/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst' now..
extracting archive '/srv/nfs/dump/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst'
tar: ./srv/storage/CENSORED: Cannot write: No space left on deviceC
...censored files..
tar: ./srv/storage/._.DS_Store: Cannot write: No space left on device
Total bytes read: 6392125102080 (5.9TiB, 161MiB/s)
tar: Exiting with failure status due to previous errors
  Logical volume "vm-213-disk-0" successfully removed.
  Logical volume "vm-213-disk-1" successfully removed.
  Logical volume "vm-213-disk-2" successfully removed.

TASK ERROR: unable to restore CT 213 - command 'tar xpf - --zstd --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/213/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2

Filed a bug report here>
https://bugzilla.proxmox.com/show_bug.cgi?id=4967
 
Last edited:
I am looking at the manual, but failing. Please help with example. Maybe @fabian ?
Code:
root@ak:~# pct restore 213 nfsAKlocalDir:backup/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst  --storage local-lvm  --mp0 mp=/srv/storage,size=5000 --mp1 mp=/srv/striped,size=4000
400 Parameter verification failed.
mp1: invalid format - format error
mp1.volume: property is missing and it is not optional

mp0: invalid format - format error
mp0.volume: property is missing and it is not optional

pct restore <vmid> <ostemplate> [OPTIONS]
 
you need to provide "storage:SIZE_IN_GB", e.g.

Code:
pct restore 213 nfsAKlocalDir:backup/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst  --storage local-lvm  --mp0 local-lvm:5000,mp=/srv/storage --mp1 local-lvm:4000,mp=/srv/striped

(assuming you want those two volumes to be 5000GB/4000GB ;))
 
Tnx, but now I am not sure what should I do with rootfs.. it should just use what is defined in backup. not sure what is is asking for. All i tried did not work.


Code:
pct restore 213 nfsAKlocalDir:backup/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst  --storage local-lvm  --mp0 local-lvm:5000,mp=/srv/storage --mp1 local-lvm:4000,mp=/srv/striped

mount points configured, but 'rootfs' not set - aborting
 
ah sorry, you also need to override --rootfs in this case (same syntax).
 
Seems to work.
For other users, who fail to understand pct manual syntax (like me :), here is a example that should work:

pct restore 213 nfsAKlocalDir:backup/vzdump-lxc-213-2023_09_21-02_51_00.tar.zst --rootfs local-lvm:35 --mp0 local-lvm:5000,mp=/srv/storage --mp1 local-lvm:4000,mp=/srv/striped

Tnx @fabian . And yes, the LXC disks are 4 nd 5 tb.. well were quite a bit less on ZFS with compression enabled.

I will keep the bug open, as import of PM created backup should work if there are enough resources. :)
Maybe save compression ratio and use it when restore it as a factor when creating virtual disks on non compression enabled ZFS.
 

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!