Restoring a LXC container from Proxmox to another server

skn666

New Member
Dec 2, 2023
5
0
1
Hi, I need help please...

I have a LXC debian12 container on my Proxmox server.
Works fine !

Now, for testing, I want to reload this container on my local machine...
I proceed like this;
  1. I shutdown my lxc container on Proxmox
  2. I do a "backup" of the container
  3. I get back the .zst on my local machine
  4. On this same local machine, I recreate a debian container ($ lxc launch images:debian12 same-name-than-proxmox-cnt)
But If I try

Bash:
$ sudo lxc image import <my .zst> ...
Error: Metadata tarball is missing metadata.yaml


I also tried:
Bash:
$ sudo lxc import <my .zst> ...
Importing instance: 100% (275.21MB/s)Error: Backup is missing index.yaml

What am I doing wrong ?

Thanks for your help
 
Hi, I need help please...

I have a LXC debian12 container on my Proxmox server.
Works fine !

Now, for testing, I want to reload this container on my local machine...
I proceed like this;
  1. I shutdown my lxc container on Proxmox
  2. I do a "backup" of the container
  3. I get back the .zst on my local machine
  4. On this same local machine, I recreate a debian container ($ lxc launch images:debian12 same-name-than-proxmox-cnt)
But If I try

Bash:
$ sudo lxc image import <my .zst> ...
Error: Metadata tarball is missing metadata.yaml


I also tried:
Bash:
$ sudo lxc import <my .zst> ...
Importing instance: 100% (275.21MB/s)Error: Backup is missing index.yaml

What am I doing wrong ?

Thanks for your help
Hi,
as far as I can tell you are trying to run a LXC container created and backed up with Proxmox VE on a machine using LXD? Is that correct? Note this is not supported out of the box.

Without having tested this, the following could be a way to approach the conversion:
  • Extract the zstd compressed tar archive to the rootfs folder in a folder structure as required to generate an LXD image [0].
  • Create the required content of the metadata.yml [1].
  • Add the template content if required.
  • Create the image via the already mentioned lxc image import command [2].
  • Generate the new container from the new image.
There might be more steps/adaptions required, depending on what LXD requires for networking, ecc. Happy hacking!

[0] https://documentation.ubuntu.com/lxd/en/latest/reference/image_format/
[1] https://documentation.ubuntu.com/lxd/en/latest/reference/image_format/#metadata
[2] https://documentation.ubuntu.com/lxd/en/latest/howto/images_copy/#import-from-the-local-file-system
 
Last edited:
  • Like
Reactions: skn666