This article describes the use of a standalone script “lvm-free” to determine how many additional free extents are needed on a Linux Server before a migration is attempted.
Background:
The RMM uses LVM and Device Mapper to take snapshots of each partition. Data is then migrated from the snapshot rather than from the live file system. By default, each Linux volume group must have 15% of the Used Space of the volume group available as free extents for LVM snapshots. The "Used Space" in this context is the sum of the used space of all file systems that reside in a volume group.
"Free Space" and "Free Extents" are different concepts. Free space represents the amount of space allocated for a file system that is currently not being used. Free extents represent unallocated space in a volume group.
By default, if the amount of free extents is less than 15% of the sum of the Used Space of the filesystems in a volume group, the migration will fail before data transfer begins with an error such as
As shown above, the RMM error message shows how many additional free extents are needed on each volume group for the migration to proceed.
For some migration environments, it may be more efficient to determine if a server will require additional free extents before a migration is attempted. The “lvm-free” tool can be used to determine if a server will require additional free extents before its migration can proceed. This standalone tool can gather this information even before the RMM is installed.
See https://rackware.freshdesk.com/a/solutions/articles/5000886955 for a discussion of the risks of bypassing the requirement for free extents and for information on adding free extents to a server.
Symptom:<none>
Before you Begin:
Please refer to section 7.2.2of RMM Pre-Reqs - https://rackware.freshdesk.com/a/solutions/articles/5000859681 for additional information about the requirement for free extents
Use case:
Determine if a given server has enough free extents such that a migration will be able to proceed, without performing the migration. This can be done even if the RMM is not yet installed.
Applicable To:
ANY RMM version.
Preparation/Pre-Req:<none>
Steps/Info:
Copy the attached lvm-free script to the Linux server that is being tested for adequate free extents.
cd to the directory where the lvm-free script is and issue “chmod +x lvm-free”.
Run the script by entering “./lvm-free”
Sample output of the script is:
[root@dmz-centos7-01 ~]# ./lvm-free
VG NAME SIZE USED FREE REQD SHORT
centos 68GiB 3GiB 51GiB 1GiB -
vg0115 50GiB 48GiB 2GiB 8GiB 6GiB
-------------------------------------------------------------------
Total Additional Disk Required: 6GiB
The columns of the output are defined as follows:
VG Name - the name of the volume group
SIZE - the Total Size of the volume group, expressed in gibibytes
USED - the amount of Used Space on all the file systems contained on the volume group, expressed in gibibytes
FREE - the number of Free Extents on the volume group, expressed in gibibytes
REQD - the number of Free Extents required, ie 15% of the USED space, rounded up to the nearest gibibyte
SHORT - The number of free extents that need to be added to the volume group (REQD - FREE, when REQD is greater than FREE)
The Total Additional Disk Required is the sum of the values in the SHORT column.
The lvm-free script will show values only for LVM volume groups. If a server has no LVM volume groups, then the output of lvm-free will show no values, for example,
[root@rackware-rmm ~]# ./lvm-free
VG NAME SIZE USED FREE REQD SHORT
-------------------------------------------------------------------
Total Additional Disk Required: 0GiB
Servers which are not using lvm volumes will be migrated using the live file system. This entails the same risks as using the allow-direct-fscopy option as described in https://rackware.freshdesk.com/a/solutions/articles/5000859681
Post Changes: <none>
Important Note(s):
It is possible that some servers that have a high rate of change will need more than 15% of the Used Space of the file systems in a volume group. The only way to determine if more than 15% is needed is to perform the sync, and if an LVM snapshot gets invalidated, then add additional free extents.
Related:
Linux Server Migration - Using "Allow Direct FSCopy" Sync option when FREE EXTENTS are NOT available on the Volume Group (VG)- https://rackware.freshdesk.com/a/solutions/articles/5000886955