PVE Adopt a Native LXD/LXC: Difference between revisions

From WikiMLT
mNo edit summary
mNo edit summary
Line 2: Line 2:
Converting an LXD/LXC to a ProxmoxVE/LXC is pretty easy, because the are (almost) the same thing.
Converting an LXD/LXC to a ProxmoxVE/LXC is pretty easy, because the are (almost) the same thing.


'''1.''' Create a backup of the LXD/LXC container. For details read the relevant section [[LXD/LXC Basic Setup#Backup LXC Containers|"Backup LXC Containers" from the guide "LXC Basic Setup"]].
== Export the Container ==
Go into the instance where the LXD is installed and create a backup of the LXC you want to clone. If the container is installed within LVM you need to mount the root filesystem somewhere and create the archive from inside the mount point. I will going to play the other scenario where the LXC is installed within a directory on Ubuntu 22.04.<syntaxhighlight lang="shell" line="1">
cd /var/snap/lxd/common/lxd/storage-pools/default/containers/webserver/rootfs
</syntaxhighlight>
 
 
For details read the relevant section [[LXD/LXC Basic Setup#Backup LXC Containers|"Backup LXC Containers" from the guide "LXC Basic Setup"]].


'''2.''' Copy the backup of an LXD/LXC container to a ProxmoxVM's template directory within its storage. In my case I'm using a command as the shown below.<syntaxhighlight lang="shell" line="1">
'''2.''' Copy the backup of an LXD/LXC container to a ProxmoxVM's template directory within its storage. In my case I'm using a command as the shown below.<syntaxhighlight lang="shell" line="1">

Revision as of 18:58, 23 September 2022

Con­vert­ing an LXD/LXC to a ProxmoxVE/​​​LXC is pret­ty easy, be­cause the are (al­most) the same thing.

Ex­port the Con­tain­er

Go in­to the in­stance where the LXD is in­stalled and cre­ate a back­up of the LXC you want to clone. If the con­tain­er is in­stalled with­in LVM you need to mount the root filesys­tem some­where and cre­ate the archive from in­side the mount point. I will go­ing to play the oth­er sce­nario where the LXC is in­stalled with­in a di­rec­to­ry on Ubun­tu 22.04.

cd /var/snap/lxd/common/lxd/storage-pools/default/containers/webserver/rootfs


For de­tails read the rel­e­vant sec­tion "Back­up LXC Con­tain­ers" from the guide "LXC Ba­sic Set­up".

2. Copy the back­up of an LXD/LXC con­tain­er to a ProxmoxVM's tem­plate di­rec­to­ry with­in its stor­age. In my case I'm us­ing a com­mand as the shown be­low.

rsync --progress \
remote.host:/mnt/backups/lxc-webserver-backup-2022-09-23.tar.gz \
/mnt/pve/ssd-1TB/template/cache/

3.A. Af­ter that you can use