vzdump to stdin over ssh?

ned

Renowned Member
Jan 26, 2015
113
2
83
would something like this be possible?

Code:
vzdump 119 --stdout | ssh root@remote.server.com | pct restore --rootfs 20 119 -
 
  • Like
Reactions: chrone
your syntax is wrong, but apart from that it should work (replace all the stuff in caps):
Code:
vzdump CTID --stdout | ssh root@SERVER -- pct restore CTID - --rootfs SOMESTORAGE:SIZE_IN_GB

note that it will probably take quite some time, and that any interruption means starting over from scratch.
 
  • Like
Reactions: chrone
I am getting closer :) Few more error, hope you can point me to the right direction

Code:
vzdump 100 --stdout | ssh root@SERVER -- pct restore 226 - --rootfs data:20
can't use storage 'local' for backups - wrong content type
command 'tar xpf - --totals --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-xattr-write' -C /var/lib/lxc/226/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2
  Logical volume "vm-226-disk-1" created.
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done                           
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: d78b8d27-0d83-414f-b9b0-fd84e8b6fa8f
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000

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

extracting archive from STDIN
tar: This does not look like a tar archive
Total bytes read: 10240 (10KiB, 13GiB/s)
tar: Exiting with failure status due to previous errors
  Logical volume "vm-226-disk-1" successfully removed