XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Delta Backups & Continous Replication of Empty Drives

    Scheduled Pinned Locked Moved Xen Orchestra
    14 Posts 3 Posters 1.1k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      stevewest15
      last edited by

      Hi,

      I'm running into an issue where the backup jobs are taking longer than 24 hrs and failing. I understand this is a limitation with xenserver (per this post).

      However after further investigation I'm seeing that the initial Delta & Replication are copying the entire drive even though they are on thin provisioning.

      For example, on a VM, I have a 500GB drive that is barely used (1.3 GB):

      /dev/xvdg1               500G  1.3G  499G   1% /Backups
      

      The above drive is provisioned from a FreeNas which is provisioned as "thin":
      57a19d2c-7b41-415d-96bc-f12324bf97c2-image.png
      c4c73120-788f-4e7b-91c5-e77a9f92d3b1-image.png

      But when XO is running the backup job (Delta & Continous), it's moving 500 GB of data across the network and storing the entire 500 GB of the Delta Backup and Continuous Replication as part of the initial full backup.

      I thought with thin provisioning, the backups would only be of actual used data (in my example above) that would be 1.3 GB instead of 500GB of empty data.

      Am I doing something wrong?

      The backup job has been running for almost 22 hrs and appears to be copying the entire 500GB drive even though it's mostly blank:
      fa88a355-21c6-422b-a200-f00e5bd3c0ef-image.png

      On the target remote for the Delta Backup, I see it still copying data:

      root@freenas25[~]# ls -alh /mnt/Tank/VMs/Backups/xo-vm-backups/3f9a9ffe-3952-c9fb-4481-8aa017c
      708a3/vdis/ef24e62c-8829-4956-9aa6-10ebb3dd0e8f/55a93b7d-1e2e-4903-961b-c3df8b73fee3
      total 325168553
      drwxr-xr-x  2 4294967294  wheel     3B Nov  5 13:32 .
      drwxr-xr-x  8 4294967294  wheel     8B Nov  5 13:32 ..
      -rw-r--r--  1 4294967294  wheel   310G Nov  6 10:41 .20201105T183221Z.vhd
      

      f4a489e5-b45a-4d42-a09a-99d68aeb8fc9-image.png

      backup-job-log.txt

      S 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        We can't help without knowing:

        1. XO version you are using
        2. XCP-ng or XenServer version you are using

        Also, it can sounds blank from the filesystem perspective, but not from the blocks.

        1 Reply Last reply Reply Quote 0
        • S Offline
          stevewest15 @stevewest15
          last edited by stevewest15

          @olivierlambert Thanks for your help:

          • xo-server 5.70.0

          • xo-web 5.74.0

          • XCP-ng 8.0

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            Check the size of the VHD on the SR itself. I think it might be because the VHD hasn't freed blocks on the filesystem.

            1 Reply Last reply Reply Quote 0
            • S Offline
              stevewest15
              last edited by stevewest15

              EDIT: @olivierlambert Thank you, I checked the SR and it's showing much larger size (421 GB) while the VM OS shows only 1.3 GB:

              root@freenas25[/mnt/Tank/VMs]# du -hs 6e07202c-38f0-dece-52d6-d81743635645/55a93b7d-1e2e-4903-961b-c3df8b73fee3
              .vhd
              421G    6e07202c-38f0-dece-52d6-d81743635645/55a93b7d-1e2e-4903-961b-c3df8b73fee3.vhd
              

              VM OS

              [root@server420 ~]# du -hs /Backups/
              1.3G    /Backups/
              
              nraynaudN 1 Reply Last reply Reply Quote 0
              • olivierlambertO Offline
                olivierlambert Vates 🪐 Co-Founder CEO
                last edited by

                Ping @julien-f

                1 Reply Last reply Reply Quote 0
                • S Offline
                  stevewest15
                  last edited by

                  Hi @olivierlambert , sorry the VHD path I provided above was wrong.

                  It appears the SR is showing it's using 421 GB while the VM OS shows 1.4 GB.

                  How long does it take for "VHD to free blocks on the filesystem"? This is NFS SR.

                  Thx,

                  SW

                  1 Reply Last reply Reply Quote 0
                  • olivierlambertO Offline
                    olivierlambert Vates 🪐 Co-Founder CEO
                    last edited by

                    So it's logical then. XOA is just pulling all the VHD blocks exposed by the host.

                    What you can do: try to reclaim on the VM FS (eg trim? I don't remember, maybe @nraynaud knows more).

                    Alternatively, you can use xe vdi-copy to create a new cleaner VHD with only what's used.

                    1 Reply Last reply Reply Quote 0
                    • nraynaudN Offline
                      nraynaud XCP-ng Team @stevewest15
                      last edited by

                      @stevewest15 Hello, can you tell us the list of partitions and what FS are inside the VHD please?

                      thanks,

                      Nicolas.

                      nraynaudN 1 Reply Last reply Reply Quote 0
                      • nraynaudN Offline
                        nraynaud XCP-ng Team @nraynaud
                        last edited by

                        Here are a few of the operations I have in mind:
                        https://unix.stackexchange.com/questions/44234/clear-unused-space-with-zeros-ext3-ext4

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          stevewest15
                          last edited by

                          @nraynaud Hi, Thank you for your assistance. Here is /etc/fstab from the VM which is CentOS 7.x:

                          UUID=ef4eef1c-dea6-452e-9fb4-20948465f484 /boot                xfs    defaults        0 0
                          /dev/mapper/centos-root /                                      xfs    defaults        0 0
                          /dev/xvdh1  /emails                                            xfs    defaults        0 0
                          /dev/mapper/databases-var_lib /var/lib                         xfs    defaults        0 0
                          /dev/mapper/sas10k-var_log /var/log                            xfs    defaults        0 0
                          /dev/mapper/websites-var_www /var/www                          xfs    defaults        0 0
                          /dev/mapper/centos-swap swap                                   swap   defaults        0 0
                          
                          UUID=20706a6e-bda3-4277-abf1-c74c4619a1d8 /Backups/      xfs    defaults        0 0
                          

                          And this is from XO:
                          f3b14e07-82bd-470f-9bbb-0001be7dfe6d-image.png

                          nraynaudN 1 Reply Last reply Reply Quote 0
                          • nraynaudN Offline
                            nraynaud XCP-ng Team @stevewest15
                            last edited by

                            @stevewest15 Thanks, I'm not really familiar with XFS. there might be a way to reclaim (trim) or zero the unused place on the disk.

                            1 Reply Last reply Reply Quote 0
                            • olivierlambertO Offline
                              olivierlambert Vates 🪐 Co-Founder CEO
                              last edited by

                              It should: xfs.org/index.php/FITRIM/discard

                              A fstrim /mountpoint should work.

                              1 Reply Last reply Reply Quote 0
                              • S Offline
                                stevewest15
                                last edited by stevewest15

                                @olivierlambert Thanks, I tried running fstrim but it returned "the discard operation is not supported" on this NFS SR mount. I also tried running on SSD mounts which do support TRIM and they all returned the same message about "discard...not supported."

                                The VM OS (CentOS 7.8) does support TRIM in kernel so not sure if xcp-ng or xenserver is the reason why the VM can't issue fstrim on the NFS SR mount or the SSD SR mounts.

                                85b94dd0-b129-45ec-9ee2-bc4b7dd92b5e-image.png

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post