PVE Adopt a Native LXD/LXC: Difference between revisions
From WikiMLT
Line 6: | Line 6: | ||
<syntaxhighlight lang="shell" line="1" class="root-prompt mlw-continue mlw-shell-gray"> | <syntaxhighlight lang="shell" line="1" class="root-prompt mlw-continue mlw-shell-gray"> | ||
lxc config show --expanded webserver | grep 'privileged' | lxc config show --expanded webserver | grep 'privileged' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="bash" class="root-prompt mlw-continue"> | ||
security.privileged: "false" | security.privileged: "false" | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 18:21, 23 September 2022
Converting an LXD/LXC to a ProxmoxVE/LXC is pretty easy, because the are (almost) the same thing.
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.
lxc config show --expanded webserver | grep 'privileged'
security.privileged: "false"
cd /var/snap/lxd/common/lxd/storage-pools/default/containers/webserver/rootfs
tar --exclude=dev --exclude=sys --exclude=proc --exclude=tmp/* \
-czvf /home/backups/lxc-webserver.tar.gz ./
Note in the commands above:
webserver
is the name of the container.lxc-webserver.tar.gz
is the name of the archive file of that container.
References
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.
rsync --progress \
remote.host:/mnt/backups/lxc-webserver-backup-2022-09-23.tar.gz \
/mnt/pve/ssd-1TB/template/cache/
3.A. After that you can use