This article outlines the procedures to take in order to resolve the problem of not having enough free extents to begin a migration or DR sync on Linux workloads. The error message shown in this case is:
Background:
The RMM uses LVM and Device Mapper to take snapshots of each partition/file system. While the sync is in progress, changes to the file system are written to its snapshot.
Please note that "free extents" in a volume group is different from "free space" in a file system. Simply removing files from a disk will not increase the number of free extents.
As described in section 7.2.2 of RMM Prerequisites and Operational Requirements, each Linux volume group must by default have at least 15% of the sum of the Used Space on each partition on a volume group available as free extents for LVM snapshots. With the 'vgs' command, you can see the amount of free extents in each volume group by looking at the VFree value.
The sync will fail before data transfer even starts, if the amount of free extents is, by default, less than 15% of the sum of the Used Space on all the file systems on a Volume Group.
A server may require more than the default number of free extents if the update rate of one of its file systems is very high. In such a case the sync may fail during data transfer if the snapshot of a file system becomes invalidated during the sync. Adding free extents and increasing the size of the LVM snapshots will be necessary to prevent these failures.
Note - if you are logged in to the Linux server as a user other than root, then each LVM-related command, such as "vgs", "vgextend", and "pvcreate" must be preceded by "sudo". For example "sudo vgs". Otherwise you may get a 'permission denied' error.
Before you Begin:
If a sync fails, please open the log of the failed sync, go to the end of the file, and look for lines that resemble the one below:
From the log in this example, we can deduce that vg - "centos" does not have sufficient free extents to take LVM snapshots of LV "root". To get past this part of the sync, we would require a minimum of an additional 416 MB of free extents on the centos volume group.
Steps:
1. Please do an 'fdisk -l'. Then do a pvcreate for one of the disks that shows up in the 'fdisk -l' output that is not being used for anything.
It is likely that there are not currently any disks shown in 'fdisk -l' output that are not being used for anything. If that is the case, you need to create a disk and attach it to the source server such that it will show up in the 'fdisk -l' output.
The steps to do this are dependent on the source environment. If the source environment were OCI, one could create a Block Volume, and then attach the block volume to source VM as a paravirtualized attachment type. Then you would see the new disk in the 'fdisk -l' output.
For this example, lets suppose that a new disk /dev/sdb has been added to the server, and is not being used for anything. We must create a physical volume of that disk with the pvcreate command.
[root@centos7-01 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created
2. Now extend the Size of the Volume Group using vgextend:
[root@centos7-01 ~]# vgextend centos /dev/sdb
Volume group "centos" successfully extended
3. Now rerun the vgs command. The space in /dev/sdb will now show up as free extents.
[root@centos7-01 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 2 2 0 wz--n- 20.50g 5.00g
Since 416 MB additional free extents were needed and 5 GB of free extents were added, the sync will now get past this error.
Conclusion:
By following these steps, you should be able to add additional free extents if you hit the "INSUFFICIENT_ORIGIN_FREE_EXTENTS" error.
Additional information about free extents:
By default, the number of free extents needed is 15% of the sum of the Used Space of all the partitions on a volume group. The sum of the Used Space of all the partitions on a volume group may be non-trivial to calculate. The RMM performs the calculations when it prints the error message saying how many additional free extents are needed. If you would like to determine how many additional free extents will be needed A script can be executed on an origin host to determine how many, if any, free extents need to be added before the initial sync can be performed. https://rackware.freshdesk.com/a/solutions/articles/5000887037 describes this script.
Performing Migrations without LVM Snapshots describes a method of performing a sync that does not require free extents. Please note there are significant risks to using this method, and RackWare does not recommend doing this.
In some cases, the rate of change of a file system is so high that the snapshot (which by default is sized at 15% of the Used Space of the file system) will become invalidated before the sync is complete, which will cause the sync to fail. For cases like this you may need to use the snapalloc parameter to increase the size of the LVM snapshot to, for example, 25% of the Used Space of a partition. Using snapalloc of 25% means that all volume groups on the origin server need to have a number of free extents equal to the sum of 25% of the Used Space of all the partitions on a volume group. The snapalloc parameter is described in Appendix 1 of the GUI Operations Guide