<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Backups on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/backups/</link><description>Recent content in Backups on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Thu, 21 Dec 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/backups/index.xml" rel="self" type="application/rss+xml"/><item><title>Practice your restore strategy</title><link>https://blog.iankulin.com/practice-your-restore-strategy/</link><pubDate>Thu, 21 Dec 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/practice-your-restore-strategy/</guid><description>&lt;img src="https://blog.iankulin.com/images/img_7342.jpg" width="1000" alt=""&gt;
&lt;p&gt;My homelab set up is a production node, (pve-prod1) a backup production node (pve-prod2) and a development machine (pve-dev1). They are all G2 800 minis, but pve-prod1 has a i7 6700T and 32GB RAM, where as the other two are i5 6500T with 16GB. My thinking is that the older two can easily share the workload of the main production machine for disaster recovery. Everything is virtualised on top of Proxmox, so sharing up the VM&amp;rsquo;s and containers is trivial.&lt;/p&gt;
&lt;p&gt;Every three or four months, I run the nightly backups, turn off the production machine and restore back on to pve-prod2 and boot everything up. That was today&amp;rsquo;s job, and in the process I discovered a couple of things to address.&lt;/p&gt;
&lt;h3 id="issues"&gt;Issues&lt;/h3&gt;
&lt;p&gt;Issues were minor - everything was up again quite quickly, but they were:&lt;/p&gt;
&lt;h4 id="vm-disk-storage"&gt;VM disk storage&lt;/h4&gt;
&lt;p&gt;VM disk storage - I ran out on pve-prod2. Quite often when pve-prod1 is offline, it gets a new SSD, or most recently and 512GB of NMVE. So there&amp;rsquo;s oodles of room for the VM disks. As a result, I&amp;rsquo;m never mean with the sizes when I&amp;rsquo;m guessing what an application might need. I hate not allocating enough because expanding them is hard.&lt;/p&gt;
&lt;p&gt;Also, I&amp;rsquo;ve been moving docker workloads off the big docker VM and into their own LXC&amp;rsquo;s. But I&amp;rsquo;m still running the VM since it still has a couple of containers. All this adds up to there wasn&amp;rsquo;t enough room on the pve-prod2 SSD for all the VM disks. This is not the end of the world, I can leave the VM disks on the NAS and work over the network - but it&amp;rsquo;s a reminder to me to not let the backup hardware get to far behind the production hardware.&lt;/p&gt;
&lt;p&gt;Of course I could have moved some of these onto pve-dev1 (which is massively overspec&amp;rsquo;d) but I don&amp;rsquo;t really want to power two machines if I can get by with one. I have asked Father Christmas for another 512GB NMVE M2, so I&amp;rsquo;m optimistic this will be solved shortly.&lt;/p&gt;
&lt;h4 id="versions"&gt;Versions&lt;/h4&gt;
&lt;p&gt;After I moved all the VMs and LXCs, I realised I that pve-prod2 is running an old version of Proxmox - it&amp;rsquo;s on 7.4 and the others are on 8.1. Everything works (unless you need dark mode) but it was a mistake on my part, when I&amp;rsquo;d upgraded pve-prod1 I deliberately left prod2 on the old, known good, version but with the intention I&amp;rsquo;d upgrade it in a month or so, then never did.&lt;/p&gt;
&lt;h4 id="lxc-backup-to-nas"&gt;LXC Backup to NAS&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/problems-backing-up-lxc-to-nfs-in-proxmox/"&gt;I&amp;rsquo;ve previously discussed this issue&lt;/a&gt;, where an LXC apparently does not have the require permissions for it&amp;rsquo;s temporary files on an NFS share but does have them for the finished backup. It&amp;rsquo;s a simple config change, but one that I hadn&amp;rsquo;t made to prod2. This is a good case for maintaining a post-proxmox-install Ansible playbook.&lt;/p&gt;
&lt;h3 id="bouquets"&gt;Bouquets&lt;/h3&gt;
&lt;h4 id="proxmox"&gt;Proxmox&lt;/h4&gt;
&lt;p&gt;I&amp;rsquo;ve been pondering if I should move away from Proxmox. I imagine I can achieve something similar with some combination of KVM, QEMU, Virt-Manager or Cockpit. I&amp;rsquo;d be learning some new things and be closer to a generic solution. On the other hand, I&amp;rsquo;m still learning about Proxmox, especially the command line stuff as I convert more of the homelab to infrastructure as code.&lt;/p&gt;
&lt;p&gt;Also, it&amp;rsquo;s just worked flawlessly. I was reminded today as I did this now routine task of the first time I moved a VM between two computers how exciting it was - and I was doing that as a noob using the web interface. Proxmox certainly meets all my current needs so I&amp;rsquo;ll be sticking with it. If I&amp;rsquo;m eBay tempted by more iron, I might have a play with some of the other options, but for the moment, I&amp;rsquo;m sticking with it.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also conscious that the NAS is filling up (although slowly) and a future improvement would be to start to use the &lt;a href="https://www.proxmox.com/en/proxmox-backup-server/overview"&gt;Proxmox Backup Server&lt;/a&gt;. This delta&amp;rsquo;s your backups to allow a more comprehensive history to be kept while reducing the disk space being used. This will lock me into the Proxmox ecosystem a little more.&lt;/p&gt;
&lt;h4 id="synology"&gt;Synology&lt;/h4&gt;
&lt;p&gt;Also I need to shoutout Synology NAS&amp;rsquo;s. Just super reliable. I yearn for a ZFS solution, but if you just want reliable, gets things done storage for your homelab, they are an excellent choice for most situations. They are not sexy.&lt;/p&gt;
&lt;h4 id="monitoring"&gt;Monitoring&lt;/h4&gt;
&lt;img src="https://blog.iankulin.com/images/img_b42eca952bee-1.jpeg" width="577" alt=""&gt;
&lt;p&gt;A lot of the time I don&amp;rsquo;t really think about my monitoring - which consists or Uptime Kuma hooked up to Ntfy for phone notifications, and a &lt;a href="https://blog.iankulin.com/simple-api-endpoint-in-go/"&gt;custom Go program&lt;/a&gt; that exposes the RAM and disk use on each container and VM.&lt;/p&gt;
&lt;p&gt;But when you power down your production server, and your phone lights up in red, followed by green messages as each service comes back up, that&amp;rsquo;s a good feeling.&lt;/p&gt;
&lt;p&gt;Anyway, here&amp;rsquo;s your reminder to test your backup strategy if you haven&amp;rsquo;t done that for a while. Like me, you might learn something to your advantage.&lt;/p&gt;</description></item><item><title>Docker volume backup is more complicated than it should be</title><link>https://blog.iankulin.com/docker-volume-backup-is-more-complicated-than-it-should-be/</link><pubDate>Fri, 17 Nov 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/docker-volume-backup-is-more-complicated-than-it-should-be/</guid><description>&lt;p&gt;&lt;a href="https://unccelearn.org/course/view.php?id=128&amp;page=overview&amp;lang=en"&gt;&lt;img src="https://blog.iankulin.com/images/big.jpg" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When I set up my first Docker container (I think for &lt;a href="https://blog.iankulin.com/uptime-kuma-nfty/"&gt;Uptime Kuma&lt;/a&gt;), I had read around and understood there were two choices for persistent; &lt;em&gt;bind mounts&lt;/em&gt; (where the data inside the container is effectively a symlink to a location on the local file system) or &lt;em&gt;name volumes&lt;/em&gt; where Docker abstracted that away a bit, so you didn&amp;rsquo;t have to worry where it was - I sort of understood Docker &amp;lsquo;managed&amp;rsquo; it.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been lazily doing my &amp;lsquo;backups&amp;rsquo; by just saving snapshots of entire VM&amp;rsquo;s - which works really well, Proxmox handles the scheduling of them, I regularly test them (every month I run off the backup production server for a couple of days from the backups). I don&amp;rsquo;t mind that backing up up an entire VM for a couple of Dockerised apps is expensive in disk because local disk is cheap and it&amp;rsquo;s super convenient.&lt;/p&gt;
&lt;p&gt;However, I&amp;rsquo;ve got a couple of projects on the list where I&amp;rsquo;d like to move a container and it&amp;rsquo;s data between VM&amp;rsquo;s. One is trying out Jellyfin in Docker in an LXC, and another is moving the containers on my general utility dockerhost to a new VM with a bit larger disk since that seems easier than expanding the disk.&lt;/p&gt;
&lt;p&gt;I assumed I&amp;rsquo;d be stoping the container and doing something like &lt;code&gt;docker export portainer_data somebackupfile.name&lt;/code&gt; then moving that file over to the new system and running &lt;code&gt;docker import portainer_data somebackupfile.name&lt;/code&gt; to re-create it.&lt;/p&gt;
&lt;p&gt;But no, that&amp;rsquo;s not how it works. According to the Docker people, I need to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use inspect to find out the internal data directories of the container&lt;/li&gt;
&lt;li&gt;Stop the container&lt;/li&gt;
&lt;li&gt;Create a new generic linux container&lt;/li&gt;
&lt;li&gt;Have it mount the docker volumes&lt;/li&gt;
&lt;li&gt;Also have it bind mount to the current directory&lt;/li&gt;
&lt;li&gt;Run a command inside the container to tar ball the internal data directory and save it to the bind mount&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The only real concession to usability along the way is that there&amp;rsquo;s a &lt;code&gt;--volumes_from&lt;/code&gt; flag that saves you from extracting all the volume names from a &lt;code&gt;docker inspect&lt;/code&gt; of the container whose data you want to back up.&lt;/p&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s run through those steps with an example. I&amp;rsquo;m going to set up &lt;a href="https://uptime.kuma.pet/"&gt;Uptime Kuma&lt;/a&gt; in Docker. I&amp;rsquo;ll use the &lt;a href="https://github.com/louislam/uptime-kuma/blob/master/docker/docker-compose.yml"&gt;suggested compose file&lt;/a&gt; which creates a named volume &lt;code&gt;uptime-kuma&lt;/code&gt;. I tested that&amp;rsquo;s up and running on port 3001 - when I visited there, it wanted me to create an admin account.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-9.55.47-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-9.55.47-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For demo purposes, I created the admin user &lt;code&gt;ian&lt;/code&gt; and set up Uptime Kuma to monitor Google for us.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-10.39.40-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-10.39.40-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you started the app from a docker compose file, you can just look in there to see what the internal data directories that are being mounted to are:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;version: &amp;#39;3.8&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;services:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; uptime-kuma:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image: louislam/uptime-kuma:1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; container_name: uptime-kuma
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; volumes:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - uptime-kuma:/app/data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ports:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &amp;#34;3001:3001&amp;#34; # &amp;lt;Host Port&amp;gt;:&amp;lt;Container Port&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; restart: always
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;volumes:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; uptime-kuma:
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or alternatively use the &lt;code&gt;docker inspect &amp;lt;container name&amp;gt;&lt;/code&gt; command. You&amp;rsquo;ll get back a barrage of Json - somewhere in there will be the mount details:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#34;Mounts&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#eceff4"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#eceff4"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Type&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;volume&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Name&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;uptimekuma_uptime-kuma&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Source&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;/var/lib/docker/volumes/uptimekuma_uptime-kuma/_data&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Destination&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;/app/data&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Driver&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;local&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Mode&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;z&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;RW&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;true&lt;/span&gt;&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;Propagation&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#eceff4"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Either way, we now know that the internal directory for data is &lt;code&gt;/app/data&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Next stop the container with &lt;code&gt;docker stop uptime-kuma&lt;/code&gt;, then type in this bad boy based on the one in the docs.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo docker run --rm --volumes-from uptime-kuma -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /app/data
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The highlighted bits are the pieces I changed for our demo - the name of our container and the internal data directory for it that we found in the steps above. Pulling down an entire &lt;a href="https://hub.docker.com/_/ubuntu"&gt;Ubuntu container&lt;/a&gt; seemed overkill - we&amp;rsquo;re just running a tar command so perhaps &lt;a href="https://hub.docker.com/_/alpine"&gt;Alpine&lt;/a&gt; or &lt;a href="https://hub.docker.com/_/busybox"&gt;Busybox&lt;/a&gt; would be fine, however, it pulled down quite quickly so it&amp;rsquo;s either smaller that I imagined or I already had the main layers locally.&lt;/p&gt;
&lt;p&gt;Now if we look in the directory where we ran that command, there should be a &lt;code&gt;backup.tar&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-10.34.38-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-10.34.38-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, for the purposes of this demo, I&amp;rsquo;ll copy the backup.tar (and my compose file) over to another VM and we&amp;rsquo;ll see if we can recreate this install.&lt;/p&gt;
&lt;p&gt;Once I&amp;rsquo;d copied them over and &lt;a href="https://docs.docker.com/engine/install/debian/"&gt;installed Docker&lt;/a&gt;, I ran &lt;code&gt;docker compose up&lt;/code&gt; to start a new, empty Uptime Kuma. As expected, when I tried to visit the main page, it wanted me to create an admin user. Then I stopped the container. Note that you don&amp;rsquo;t want to &lt;code&gt;docker compose down&lt;/code&gt; to stop the container since that also removed it. If it&amp;rsquo;s removed, the next command won&amp;rsquo;t be able to find the name volumes it uses.&lt;/p&gt;
&lt;p&gt;Now we need copy the backed up data (which is just sitting in the current directory) into the named volume. Once again, this will be achieved by creating a new container, mounting the named volume and and current external working directory.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo docker run --rm --volumes-from uptime-kuma -v $(pwd):/backup ubuntu bash -c &amp;#34;cd /app &amp;amp;&amp;amp; tar xvf /backup/backup.tar --strip 1&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once again, I&amp;rsquo;ve highlighted the bits I&amp;rsquo;ve changed from the &lt;a href="https://docs.docker.com/storage/volumes/#back-up-restore-or-migrate-data-volumes"&gt;instructions&lt;/a&gt;. It&amp;rsquo;s important to note I&amp;rsquo;ve changed the destination directory. We backed up from &lt;code&gt;/app/data&lt;/code&gt; but we&amp;rsquo;re just restoring to &lt;code&gt;/app&lt;/code&gt; - the un-taring will copy the backed up data into the existing data directory. That&amp;rsquo;s a trick for young players - when I blindly followed the official instructions, I ended up with an &lt;code&gt;/app/data/data&lt;/code&gt; directory with the backed info which was, or course, ignored, and only discoverable buy &lt;code&gt;exec&lt;/code&gt;-ing into the container to see what was happening.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-11.34.08-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-28-at-11.34.08-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="why-not-just-copy-the-local-file-system-version"&gt;Why not just copy the local file system version?&lt;/h3&gt;
&lt;p&gt;The named docker volume is just stored on our local file system, usually at &lt;code&gt;/var/lib/docker/volumes&lt;/code&gt; so it would be reasonable to wonder why we don&amp;rsquo;t just copy that. I don&amp;rsquo;t have a great explanation for why not. I assume since the &lt;a href="https://docs.docker.com/storage/volumes/#back-up-restore-or-migrate-data-volumes"&gt;official docs&lt;/a&gt; suggest something different and more complex that there must be a reason. Possibly there&amp;rsquo;s some extra Docker magic (file locks, caching, etc) going on we don&amp;rsquo;t know about, or there&amp;rsquo;s some planned for the future.&lt;/p&gt;</description></item><item><title>Proxmox LXC backup to NFS share failing</title><link>https://blog.iankulin.com/proxmox-lxc-backup-to-nfs-share-failing/</link><pubDate>Wed, 12 Apr 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-lxc-backup-to-nfs-share-failing/</guid><description>&lt;p&gt;I was doing updates on all my nodes and VM&amp;rsquo;s today, and backing up the VMs that aren&amp;rsquo;t already on a backup schedule. On my dev machine I have a Debian LXC container that I mostly just use for trying out Linux commands and playing around. I used to have a backup of it that I used a lot - after playing around I like to set it back to a fresh install plus my ssh keys - but I lost it somehow when moving the VM to new metal.&lt;/p&gt;
&lt;p&gt;When I tried to back it up today, I got this drama.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting new backup job&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vzdump &lt;span style="color:#b48ead"&gt;200&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;node pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;dev1 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;mode snapshot &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;remove &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;notes&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;template &lt;span style="color:#a3be8c"&gt;&amp;#39;{{vmid}}-{{guestname}} ({{node}}) - after timezone fix&amp;#39;&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;storage NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;compress zstd
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Starting Backup of VM &lt;span style="color:#b48ead"&gt;200&lt;/span&gt; &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;lxc&lt;span style="color:#eceff4"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup started at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;17&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;11&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;08&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; status &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; running
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; CT Name&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; babydeb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; including mount point rootfs &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; backup mode&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; snapshot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; ionice priority&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; create storage snapshot &lt;span style="color:#a3be8c"&gt;&amp;#39;vzdump&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Logical volume &lt;span style="color:#a3be8c"&gt;&amp;#34;snap_vm-200-disk-0_vzdump&amp;#34;&lt;/span&gt; created&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; creating vzdump archive &lt;span style="color:#a3be8c"&gt;&amp;#39;/mnt/pve/NAS-DS2/dump/vzdump-lxc-200-2023_04_07-17_11_08.tar.zst&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;200&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;17&lt;/span&gt;_11_08&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Cannot open&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Permission denied
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Error is &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; recoverable&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exiting now
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; cleanup temporary &lt;span style="color:#a3be8c"&gt;&amp;#39;vzdump&amp;#39;&lt;/span&gt; snapshot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Logical volume &lt;span style="color:#a3be8c"&gt;&amp;#34;snap_vm-200-disk-0_vzdump&amp;#34;&lt;/span&gt; successfully removed
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup of VM &lt;span style="color:#b48ead"&gt;200&lt;/span&gt; failed &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; command &lt;span style="color:#a3be8c"&gt;&amp;#39;set -o pipefail &amp;amp;&amp;amp; lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;user&lt;span style="color:#81a1c1"&gt;.*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;capability&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;xattr&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;write&lt;span style="color:#a3be8c"&gt;&amp;#39; --one-file-system &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;200&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;17&lt;/span&gt;_11_08&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#a3be8c"&gt;&amp;#39; ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzsnap0&lt;span style="color:#a3be8c"&gt;&amp;#39; --no-anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;lost&lt;span style="color:#81a1c1"&gt;+&lt;/span&gt;found&lt;span style="color:#a3be8c"&gt;&amp;#39; --anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;run&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*.&lt;/span&gt;pid&lt;span style="color:#a3be8c"&gt;&amp;#39; ./ | zstd --rsyncable &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;threads&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;gt;/mnt/pve/NAS-DS2/dump/vzdump-lxc-200-2023_04_07-17_11_08.tar.dat&amp;#39;&lt;/span&gt; failed&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exit code &lt;span style="color:#b48ead"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;17&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;11&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;09&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup job finished with errors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TASK ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; job errors
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="https://blog.iankulin.com/could-it-be-a-permissions-problem/"&gt;Permissions&lt;/a&gt;! I was puzzled - the line before (creating the backup file) is working, but not creating the temp file on the same share and directory? Very odd. Backing up a real VM on the same node and to the same share was working fine. Luckily it&amp;rsquo;s a simple, and fast, matter to create a heap of LXCs with different settings and see if the error can be reproduced, so I was soon confidently able to say the problem only existed for unprivileged LXC containers backing up to the share - I didn&amp;rsquo;t have the problem if I used the local disk.&lt;/p&gt;
&lt;p&gt;If I dropped to the console for the node, I could create an identically named file in the same directory with no problems.&lt;/p&gt;
&lt;p&gt;During all that testing, I saw some output that led to more helpful thinking.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting new backup job&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vzdump &lt;span style="color:#b48ead"&gt;303&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;storage NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;compress zstd &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;notes&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;template &lt;span style="color:#a3be8c"&gt;&amp;#39;{{guestname}}&amp;#39;&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;remove &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;node pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;dev1 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;mode snapshot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Starting Backup of VM &lt;span style="color:#b48ead"&gt;303&lt;/span&gt; &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;lxc&lt;span style="color:#eceff4"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup started at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;18&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;43&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;44&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; status &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; running
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; CT Name&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; apline&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;unpriv
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; including mount point rootfs &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; mode failure &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; some volumes &lt;span style="color:#81a1c1;font-weight:bold"&gt;do&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; support snapshots
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; trying &lt;span style="color:#a3be8c"&gt;&amp;#39;suspend&amp;#39;&lt;/span&gt; mode instead
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; backup mode&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; suspend
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; ionice priority&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; CT Name&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; apline&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;unpriv
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; including mount point rootfs &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; temporary directory is on NFS&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; disabling xattr &lt;span style="color:#81a1c1;font-weight:bold"&gt;and&lt;/span&gt; acl support&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; consider configuring a local tmpdir via &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;etc&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting first sync &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;proc&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#b48ead"&gt;39778&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;root&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt; to &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; first sync finished &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; transferred &lt;span style="color:#b48ead"&gt;9.35&lt;/span&gt;M bytes &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; &lt;span style="color:#b48ead"&gt;2&lt;/span&gt;s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; suspending guest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting final sync &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;proc&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#b48ead"&gt;39778&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;root&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt; to &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; final sync finished &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; transferred &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; bytes &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; &lt;span style="color:#b48ead"&gt;0&lt;/span&gt;s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; resuming guest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; guest is online again after &lt;span style="color:#81a1c1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt; seconds
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; creating vzdump archive &lt;span style="color:#a3be8c"&gt;&amp;#39;/mnt/pve/NAS-DS2/dump/vzdump-lxc-303-2023_04_07-18_43_44.tar.zst&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Cannot open&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Permission denied
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Error is &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; recoverable&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exiting now
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup of VM &lt;span style="color:#b48ead"&gt;303&lt;/span&gt; failed &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; command &lt;span style="color:#a3be8c"&gt;&amp;#39;set -o pipefail &amp;amp;&amp;amp; lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;user&lt;span style="color:#81a1c1"&gt;.*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;capability&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;xattr&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;write&lt;span style="color:#a3be8c"&gt;&amp;#39; --one-file-system &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#a3be8c"&gt;&amp;#39; ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#a3be8c"&gt;&amp;#39; --no-anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;lost&lt;span style="color:#81a1c1"&gt;+&lt;/span&gt;found&lt;span style="color:#a3be8c"&gt;&amp;#39; --anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;run&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*.&lt;/span&gt;pid&lt;span style="color:#a3be8c"&gt;&amp;#39; . | zstd --rsyncable &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;threads&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;gt;/mnt/pve/NAS-DS2/dump/vzdump-lxc-303-2023_04_07-18_43_44.tar.dat&amp;#39;&lt;/span&gt; failed&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exit code &lt;span style="color:#b48ead"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;18&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;43&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;47&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup job finished with errors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TASK ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; job errors
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And sure enough, there is a helpful &lt;code&gt;/etc/vzdump.conf&lt;/code&gt; file. Uncommenting the &lt;code&gt;tmpdir&lt;/code&gt; line and pointing it to &lt;code&gt;/tmp&lt;/code&gt; fixed all my problems.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-6.50.45-pm-copy.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So what&amp;rsquo;s going on? I did some googling and found some discussions &lt;a href="https://forum.proxmox.com/threads/cannot-backup-only-lxc-to-nfs-vm-works.90797/"&gt;1&lt;/a&gt;/&lt;a href="https://forum.proxmox.com/threads/in-7-0-i-cant-backup-a-container-to-a-nfs-that-worked-in-6-0.97808/"&gt;2&lt;/a&gt;/&lt;a href="https://forum.proxmox.com/threads/backup-of-lxc-containers-to-nfs-mount-fail.95146/"&gt;3&lt;/a&gt; in the &lt;a href="https://forum.proxmox.com/"&gt;Proxmox forums&lt;/a&gt;. They are saying it&amp;rsquo;s because the unprivileged containers (they don&amp;rsquo;t run as root, which seems like good practice) don&amp;rsquo;t have permissions for the NFS share directory. I feel there&amp;rsquo;s a few problems with this theory:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It seems to do fine creating the other files&lt;/li&gt;
&lt;li&gt;Why would the LXC container be doing this work? Surely the process is being run at the Proxmox level.&lt;/li&gt;
&lt;li&gt;Actually the LXC container should not have access to the NAS at all, even if it&amp;rsquo;s privileged - it&amp;rsquo;s not mounted in there, the LXC knows nothing about it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nevertheless, I&amp;rsquo;m sure they know better than me. If I was shipping this product, I&amp;rsquo;d probably engineer around this problem. Maybe by detecting it and switching to &lt;code&gt;/var/tmp&lt;/code&gt; or even just by making that the default in the config file.&lt;/p&gt;</description></item><item><title>Using NAS for Proxmox backups</title><link>https://blog.iankulin.com/using-nas-for-proxmox-backups/</link><pubDate>Mon, 10 Apr 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/using-nas-for-proxmox-backups/</guid><description>&lt;p&gt;&lt;a href="https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/"&gt;A few weeks ago&lt;/a&gt;, I was very excited to be able to take a snapshot of a virtual machine, copy it across the network from that Proxmox node, copy it back across the network to a different Proxmox node, start it there, and have it up and running, without it noticing it was actually on different hardware.&lt;/p&gt;
&lt;p&gt;Backing up a VM is pretty simple, you just click on the node, choose &lt;em&gt;Backup&lt;/em&gt; and click the &lt;em&gt;Backup Now&lt;/em&gt; button. The ease, and completeness of backing up a VM is one of the main reasons I&amp;rsquo;m using Proxmox for my systems.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-12.02.59-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-12.02.59-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By default, VM backups are saved to the &amp;ldquo;local drive&amp;rdquo; - actually the &lt;code&gt;/var/lib/vz&lt;/code&gt; directory. This would not be useful if the physical machine dies, but also it&amp;rsquo;s not convenient to restore to a different machine. Ideally you&amp;rsquo;d have a central place to store these files that was accessible to all the Proxmox nodes.&lt;/p&gt;
&lt;p&gt;This is exactly the situation I&amp;rsquo;ve setup with my lab, the NAS is the storage for the VM backups. Each of the Proxmox nodes uses the same directory for backups, so moving a machine from one node to another is a simple as backing it up on one node, stopping the VM, and restoring it on another node just by choosing the backup file to restore in the web GUI.&lt;/p&gt;
&lt;h3 id="steps"&gt;Steps&lt;/h3&gt;
&lt;p&gt;Proxmox can use all sorts of shares as a location for backups (and other files such as the ISO&amp;rsquo;s used to boot new machines), but the simplest is probably &lt;a href="https://en.wikipedia.org/wiki/Network_File_System"&gt;NFS&lt;/a&gt;. This is also straightforward to do from the Synology NAS.&lt;/p&gt;
&lt;p&gt;In the web interface for the NAS, go into &lt;em&gt;Control Panel&lt;/em&gt;, &lt;em&gt;Shared Folder&lt;/em&gt; and create a new shared folder. I called mine Proxmox. One of the tabs there is for NFS permissions - just add the IP address of the Proxmox node that you&amp;rsquo;d life to access the folder.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-1.46.02-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not much harder from the Proxmox end. Although the storage you add will appear at the node level in the &lt;em&gt;Server View&lt;/em&gt; of the web GUI, it is added at the &lt;em&gt;Datacenter&lt;/em&gt; level.&lt;/p&gt;
&lt;p&gt;Go into &lt;em&gt;Storage&lt;/em&gt;, select &lt;em&gt;Add&lt;/em&gt; and choose &lt;em&gt;NFS&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.00.04-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.00.04-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then enter an ID (this will be the name of the storage in Proxmox) and the IP address. If you wait half a second, then you can click the dropdown for all the folders that are shared from that IP address.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.06.19-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The last field is content - this refers the the type of Proxmox stuff you want to keep in there - for backups, you just need VZDumps, but I usually click on everything since I&amp;rsquo;ll also use it for ISOs for new VMs and templates for LXCs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.11.03-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added that, the storage will appear in the server view, but also as an option when you go into &lt;em&gt;Backup&lt;/em&gt; for a VM and select &lt;em&gt;Backup Now&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.15.53-pm.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>Proxmox Backup Files</title><link>https://blog.iankulin.com/proxmox-backup-files/</link><pubDate>Fri, 31 Mar 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-backup-files/</guid><description>&lt;p&gt;I&amp;rsquo;ve got some extra RAM to drop into the HP 800 G2 mini that I use as my production server. I feel like that&amp;rsquo;s a low risk change, but since it&amp;rsquo;s easy to take VM snapshots I shutdown the VM&amp;rsquo;s and did that, and wanted to just copy them off the local storage.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m moving towards having these backups (and the ISOs) on the NAS rather than locally, but have not implemented that. So to get my backups I need to SSH in and find them.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://pve.proxmox.com/wiki/Storage:_Directory"&gt;Proxmox documentation for storage&lt;/a&gt; says to have a look in &lt;code&gt;/etc/pve/storage.cfg&lt;/code&gt; to see what&amp;rsquo;s up. Mine looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dir&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; local
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	path &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;lib&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vz
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	content iso&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;vztmpl&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;lvmthin&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; local&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lvm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	thinpool data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	vgname pve
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	content rootdir&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;images
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And sure enough, if I look in &lt;code&gt;/var/lib/vz/dump&lt;/code&gt; (dump is the backup location mentioned in the docs):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-03-26-at-11.59.10-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-26-at-11.59.10-am.png" width="1000" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I ain&amp;rsquo;t messing around this morning, so I&amp;rsquo;ll just grab these onto my laptop with scp.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;scp root&lt;span style="color:#bf616a"&gt;@&lt;/span&gt;&lt;span style="color:#b48ead"&gt;192.168&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;&lt;span style="color:#b48ead"&gt;100.23&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;lib&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vz&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;\&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt; Downloads
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You may notice in the command above that I&amp;rsquo;ve got a backslash in front of the wildcard. This was a little gotcha that is specific to using zsh/OhMyZsh that I had to escape the wildcard. I found I could specify the whole filename and it worked okay, but the wildcards needed escaping. Thanks again &lt;a href="https://superuser.com/questions/420525/scp-with-zsh-no-matches-found"&gt;StackExchange&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-26-at-12.15.35-pm.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>Moving a VM between two Proxmox hosts</title><link>https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/</link><pubDate>Thu, 16 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/</guid><description>&lt;img src="https://blog.iankulin.com/images/s-l640.jpg" width="264" alt=""&gt;
&lt;p&gt;So, the very small datacentre has undergone a major hardware upgrade today. The HP 800 G1 is joined by an HP 800 G2. Four core i7 vs the old two core i5. Double the RAM to 16GB, four times the disk. The old machine will become a dev/play machine - still virtualised, and the new machine will run the production apps, mostly in Docker containers.&lt;/p&gt;
&lt;p&gt;Since everything is containerised, I did consider running Unbuntu Server on the bare metal of the new machine, but running it on Proxmox will give me some flexibility, and since we&amp;rsquo;ve stepped up the underlying hardware resource so substantially, performance will be well in front anyway. Plus it will give me some flexibility if needed in the future.&lt;/p&gt;
&lt;p&gt;Another massive benefit of virtualisation is the ability to backup a VM to a single file.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve invested several hours in the old server - downloading ISOs, updating everything, installing Docker, adding my containers, reserving the IP addresses in DNS and so on. Wouldn&amp;rsquo;t it be amazing if I could stop my main VM, back it up, copy the backup to the new server, then boot it there and have every thing just work.&lt;/p&gt;
&lt;p&gt;In theory this should be entirely possible. So let&amp;rsquo;s give it a go.&lt;/p&gt;
&lt;p&gt;In the Proxmox web interface, you can execute a backup on a VM. There&amp;rsquo;s three flavours with &lt;code&gt;STOP&lt;/code&gt; being the most reliable as it actually stops the VM to grab it&amp;rsquo;s copy. On this system I can easily afford to stop everything for ten minutes so I&amp;rsquo;ll actually be shutting down my VM and doing this sort of back up. We do this by clicking on the VM, then selecting backup. At the top is a backup button.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-8.35.38-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-8.35.38-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve done your backup it appears in a couple of places in the web interface - in this backup screen associated with the VM, but also if you select the &lt;code&gt;local&lt;/code&gt; disk then backup.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-8.41.43-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So that&amp;rsquo;s my VM nicely backed up into a single tarball, now I want to download it. I really feel the Proxmox interface should have buttons for Download and Upload on this screen - that would make this operation even easier. But it does not.&lt;/p&gt;
&lt;p&gt;The first problem is to find where these files are stored. Thanks to u/walalauw&amp;rsquo;s answer in &lt;a href="https://old.reddit.com/r/Proxmox/comments/jj6eqz/downloading_backups/"&gt;this reddit thread&lt;/a&gt;, it sounds like they are at &lt;code&gt;/var/lib/vz/dump&lt;/code&gt; I head there in FileZilla, and find:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-7.54.09-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-7.54.09-pm.png" width="826" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You only need the &lt;code&gt;.zst&lt;/code&gt; file, but neat freaks can grab the the &lt;code&gt;.notes&lt;/code&gt; as well. It contains the text you wrote for the backup - in the previous screenshot you can see I&amp;rsquo;d written &amp;ldquo;Ready to move&amp;rdquo; for this one.&lt;/p&gt;
&lt;p&gt;Copy this file somewhere - I copied it one to my local machine, then from there to the new Proxmox (same &lt;code&gt;/var/lib/vz/dump&lt;/code&gt; directory) since I was using FileZilla, but a hardcore scp user would have gone direct between the two servers and saved a bit of time.&lt;/p&gt;
&lt;p&gt;Now on the new server, I can see my backup! All you do then is select it and hit the &lt;code&gt;Restore&lt;/code&gt; button.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-7.58.49-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;A minute or two later, the VM &amp;ldquo;dockhost&amp;rdquo; is in the list. I press &lt;code&gt;Start&lt;/code&gt;, and it boots, my containers all start. And magically, amazingly it all works perfectly.&lt;/p&gt;
&lt;p&gt;If I wasn&amp;rsquo;t already sold on virtualization, this would definitely sell me on it. I understand there are other ways of moving VM&amp;rsquo;s between hosts, but this is hard to beat for simplicity if you can afford the downtime. This was the first time I&amp;rsquo;d ever done this, and I was stopping to screenshot things along the way. From the time I stopped the VM, to the time my last container went green was only nine minutes.&lt;/p&gt;</description></item></channel></rss>