If you’re not familiar with what XCP is, I covered it in a previous blog post, Migrating to ONTAP – Ludicrous speed! as well as in the XCP podcast. Basically, it’s a super-fast way to scan and migrate data.
One of the downsides of the tool was the fact that it only supported NFSv3 migrations, which also meant it couldn’t handle NTFS style ACLs. Doing that would require a SMB/CIFS supported version of XCP. Today, we get that with XCP SMB/CIFS 1.0:
XCP for SMB/CIFS supports the following:
“show” Displays information about the CIFS shares of a system “scan” Reads all files and directories found on a CIFS share and build assessment reports “copy” Recursively copies everything from source to destination “sync” Performs multiple incremental syncs from source to target “verify” Verifies that the target state matches the source, including attributes and NTFS ACLs “activate” Activates the XCP license on Windows hosts “help” Displays detailed information about XCP commands and options
Right now, it’s CLI only, but be on the lookout for a GUI version.
“Installing” XCP on Windows
XCP in Windows is a simple executable file that runs via the cmd or a PowerShell window. One of the pre-requisites for the software includes Microsoft Visual C++ Redistributable for Visual Studio 2017. If you don’t install this, trying to run the program will result in an error that calls out a specific DLL that isn’t registered.
When I copied the file to my Windows host, I created a new directory called “C:\XCP.” You can put that directory anywhere. To run the utility in CMD, you can either navigate to the directory and run “xcp” or add the directory to your system paths to run from anywhere.
For example:
Once that’s done, run XCP from any location:
Licensing XCP
XCP is a licensed feature. That doesn’t mean you have to pay for it; the license is only used for tracking purposes. But you do have to apply a license. In Windows, that’s pretty easy.
- Download a license from xcp.netapp.com
- Copy the license into the C:\NetApp\XCP folder
- Run “xcp activate”
XCP show
The command “xcp show \\server” can give some useful information for an ONTAP SMB/CIFS server, such as:
- Available shares
- Capacity (used and available)
- Current connections
- Folder path
- Share attributes and permissions
This output is a good way to get an overall look at what is available on a server.
XCP scan
XCP has a number of useful scanning features. These include:
PS C:\XCP> xcp help scan usage: xcp scan [-h] [-v] [-parallel <n>] [-match <filter>] [-preserve-atime] [-depth <n>] [-stats] [-l] [-ownership] [-du] [-fmt <expression>] source positional arguments: source optional arguments: -h, --help show this help message and exit -v increase debug verbosity -parallel <n> number of concurrent processes (default: <cpu-count>) -match <filter> only process files and directories that match the filter (see `xcp help -match` for details) -preserve-atime restore last accessed date on source -depth <n> limit the search depth -stats print tree statistics report -l detailed file listing output -ownership retrieve ownership information -du summarize space usage of each directory including subdirectories -fmt <expression> format file listing according to the python expression (see `xcp help -fmt` for details)
I scanned my “shared” directory with the -stats option and it was able to scan over 60,000 files in 31 seconds and gave me the following stats:
== Maximum Values == Size Depth Namelen Dirsize 2.02KiB 5 15 100 == Average Values == Size Depth Namelen Dirsize 25.6 5 6 6 == Top File Extensions == .py 50003 1 == Number of files == empty <8KiB 8-64KiB 64KiB-1MiB 1-10MiB 10-100MiB >100MiB 3 50001 == Space used == empty <8KiB 8-64KiB 64KiB-1MiB 1-10MiB 10-100MiB >100MiB 0 1.22MiB 0 0 0 0 0 == Directory entries == empty 1-10 10-100 100-1K 1K-10K >10k 2 10004 101 == Depth == 0-5 6-10 11-15 16-20 21-100 >100 60111 == Modified == >1 year >1 month 1-31 days 1-24 hrs <1 hour <15 mins future 60111 == Created == >1 year >1 month 1-31 days 1-24 hrs <1 hour <15 mins future 60111 Total count: 60111 Directories: 10107 Regular files: 50004 Symbolic links: Junctions: Special files: Total space for regular files: 1.22MiB Total space for directories: 0 Total space used: 1.22MiB 60,111 scanned, 0 errors, 31s
When I increased the parallel threads to 8, it finished in 18 seconds:
PS C:\XCP> xcp scan -stats -parallel 8 \\demo\shared Total count: 60111 Directories: 10107 Regular files: 50004 Symbolic links: Junctions: Special files: Total space for regular files: 1.22MiB Total space for directories: 0 Total space used: 1.22MiB 60,111 scanned, 0 errors, 18s
XCP copy
With xcp copy, I can copy SMB/CIFS data with or without ACLs at a much faster rate than simple robocopy. Keep in mind that with this version of XCP, it doesn’t have BACKUP OPERATOR rights, so you’d need to run the utility as an admin user on both source and destination.
In the following example, I used robocopy to copy the same dataset as XCP to a NetApp FlexGroup volume.
Robocopy to FlexGroup results (~20-30 minutes)
Total Copied Skipped Mismatch FAILED Extras Dirs : 10107 10106 1 0 0 0 Files : 50004 50004 0 0 0 0 Bytes : 1.21m 1.21m 0 0 0 0 Times : 0:19:01 0:13:11 0:00:00 0:05:50 Speed : 1615 Bytes/sec. Speed : 0.092 MegaBytes/min.
UPDATE: Someone asked if the above robocopy run was done with the /MT flag, which would be a more fair apples to apples comparison, since XCP does multithreading. It wasn’t. The syntax used was:
PS C:\XCP> robocopy /S /COPYALL source destination
So, I re-ran it using MT:8 and with an empty FlexGroup after restoring the base snapshot and converting the security style to NTFS to ensure the ACLs come over as well. The multithreading of robocopy cut the time to completion roughly in half.
Robocopy /MT to FlexGroup results (~8-9 minutes)
PS C:\XCP> robocopy /S /COPYALL /MT:8 \\demo\shared \\demo\flexgroup\robocopyMT ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Tue Aug 22 20:32:54 2017 Source : \\demo\shared\ Dest : \\demo\flexgroup\robocopyMT\ Files : *.* Options : *.* /S /COPYALL /MT:8 /R:1000000 /W:30 ------------------------------------------------------------------------------ Total Copied Skipped Mismatch FAILED Extras Dirs : 10107 10106 1 0 0 0 Files : 50004 50004 0 0 0 0 Bytes : 1.21 m 1.21 m 0 0 0 0 Times : 0:35:21 0:06:23 0:00:00 0:01:59 Ended : Tue Aug 22 20:41:18 2017
Then I re-ran the XCP to FlexGroup by restoring the baseline snapshot and then making sure the security style of the volume was NTFS. (It was UNIX before, which would have affected ACLs and overall speed). But, the run still held within 4 minutes. So, we’re looking at 2x as fast as robocopy with a small 60k file and folder workload. In addition, the host I’m using is a Windows 7 client VM with a 1GB network connection and not a ton of power behind it. XCP works best with more robust hardware.
XCP to FlexGroup results – NTFS security style (~4 minutes!)
PS C:\XCP> xcp copy -parallel 8 \\demo\shared \\demo\flexgroup\XCP 1,436 scanned, 0 errors, 0 skipped, 0 copied, 0 (0/s), 5s 4,381 scanned, 0 errors, 0 skipped, 507 copied, 12.4KiB (2.48KiB/s), 10s 5,426 scanned, 0 errors, 0 skipped, 1,882 copied, 40.5KiB (5.64KiB/s), 15s 7,431 scanned, 0 errors, 0 skipped, 3,189 copied, 67.4KiB (5.37KiB/s), 20s 8,451 scanned, 0 errors, 0 skipped, 4,537 copied, 96.1KiB (5.75KiB/s), 25s 9,651 scanned, 0 errors, 0 skipped, 5,867 copied, 123KiB (5.31KiB/s), 30s 10,751 scanned, 0 errors, 0 skipped, 7,184 copied, 150KiB (5.58KiB/s), 35s 12,681 scanned, 0 errors, 0 skipped, 8,507 copied, 178KiB (5.44KiB/s), 40s 13,891 scanned, 0 errors, 0 skipped, 9,796 copied, 204KiB (5.26KiB/s), 45s 14,861 scanned, 0 errors, 0 skipped, 11,136 copied, 232KiB (5.70KiB/s), 50s 15,966 scanned, 0 errors, 0 skipped, 12,464 copied, 259KiB (5.43KiB/s), 55s 18,031 scanned, 0 errors, 0 skipped, 13,784 copied, 287KiB (5.52KiB/s), 1m0s 19,056 scanned, 0 errors, 0 skipped, 15,136 copied, 316KiB (5.80KiB/s), 1m5s 20,261 scanned, 0 errors, 0 skipped, 16,436 copied, 342KiB (5.21KiB/s), 1m10s 21,386 scanned, 0 errors, 0 skipped, 17,775 copied, 370KiB (5.65KiB/s), 1m15s 23,286 scanned, 0 errors, 0 skipped, 19,068 copied, 397KiB (5.36KiB/s), 1m20s 24,481 scanned, 0 errors, 0 skipped, 20,380 copied, 424KiB (5.44KiB/s), 1m25s 25,526 scanned, 0 errors, 0 skipped, 21,683 copied, 451KiB (5.35KiB/s), 1m30s 26,581 scanned, 0 errors, 0 skipped, 23,026 copied, 479KiB (5.62KiB/s), 1m35s 28,421 scanned, 0 errors, 0 skipped, 24,364 copied, 507KiB (5.63KiB/s), 1m40s 29,701 scanned, 0 errors, 0 skipped, 25,713 copied, 536KiB (5.70KiB/s), 1m45s 30,896 scanned, 0 errors, 0 skipped, 26,996 copied, 561KiB (5.15KiB/s), 1m50s 31,911 scanned, 0 errors, 0 skipped, 28,334 copied, 590KiB (5.63KiB/s), 1m55s 33,706 scanned, 0 errors, 0 skipped, 29,669 copied, 617KiB (5.52KiB/s), 2m0s 35,081 scanned, 0 errors, 0 skipped, 30,972 copied, 644KiB (5.44KiB/s), 2m5s 36,116 scanned, 0 errors, 0 skipped, 32,263 copied, 671KiB (5.30KiB/s), 2m10s 37,201 scanned, 0 errors, 0 skipped, 33,579 copied, 698KiB (5.48KiB/s), 2m15s 38,531 scanned, 0 errors, 0 skipped, 34,898 copied, 726KiB (5.65KiB/s), 2m20s 40,206 scanned, 0 errors, 0 skipped, 36,199 copied, 753KiB (5.36KiB/s), 2m25s 41,371 scanned, 0 errors, 0 skipped, 37,507 copied, 780KiB (5.39KiB/s), 2m30s 42,441 scanned, 0 errors, 0 skipped, 38,834 copied, 808KiB (5.63KiB/s), 2m35s 43,591 scanned, 0 errors, 0 skipped, 40,161 copied, 835KiB (5.47KiB/s), 2m40s 45,536 scanned, 0 errors, 0 skipped, 41,445 copied, 862KiB (5.31KiB/s), 2m45s 46,646 scanned, 0 errors, 0 skipped, 42,762 copied, 890KiB (5.56KiB/s), 2m50s 47,691 scanned, 0 errors, 0 skipped, 44,052 copied, 916KiB (5.30KiB/s), 2m55s 48,606 scanned, 0 errors, 0 skipped, 45,371 copied, 943KiB (5.45KiB/s), 3m0s 50,611 scanned, 0 errors, 0 skipped, 46,518 copied, 967KiB (4.84KiB/s), 3m5s 51,721 scanned, 0 errors, 0 skipped, 47,847 copied, 995KiB (5.54KiB/s), 3m10s 52,846 scanned, 0 errors, 0 skipped, 49,138 copied, 1022KiB (5.32KiB/s), 3m15s 53,876 scanned, 0 errors, 0 skipped, 50,448 copied, 1.02MiB (5.53KiB/s), 3m20s 55,871 scanned, 0 errors, 0 skipped, 51,757 copied, 1.05MiB (5.42KiB/s), 3m25s 57,011 scanned, 0 errors, 0 skipped, 53,080 copied, 1.08MiB (5.52KiB/s), 3m30s 58,101 scanned, 0 errors, 0 skipped, 54,384 copied, 1.10MiB (5.39KiB/s), 3m35s 59,156 scanned, 0 errors, 0 skipped, 55,714 copied, 1.13MiB (5.57KiB/s), 3m40s 60,111 scanned, 0 errors, 0 skipped, 57,049 copied, 1.16MiB (5.52KiB/s), 3m45s 60,111 scanned, 0 errors, 0 skipped, 58,483 copied, 1.19MiB (6.02KiB/s), 3m50s 60,111 scanned, 0 errors, 0 skipped, 59,907 copied, 1.22MiB (5.79KiB/s), 3m55s 60,111 scanned, 0 errors, 0 skipped, 60,110 copied, 1.22MiB (5.29KiB/s), 3m56s
XCP sync and verify
Sync and verify can be used during data migrations to ensure the source and target match up before cutting over. These use the same multi-processing capabilities as copy, so this should also be fast. Keep in mind that sync could also potentially be used to do incremental backups using XCP!
What was the robocopy command syntax you used? Did you include the /MT for multithread copy also?
LikeLiked by 1 person
Good point re:MT. Will try that and update.
LikeLike
How many syncs do we get? When I last used it on nfs, it was limited.
LikeLike
Do you have any documentation regarding NFS limits on sync? I have not heard of limits on that before.
LikeLike
The version we used was limited to a single sync, I think. About a year ago.
LikeLike
I’m attempting to transfer files from a Windows Server 2012 R2 file server to a CIFS share on a V3220 (OnTap 8.2.4P6). I’m having trouble with the -acl switch. It’s returning a “failed to get security principal” error no matter whether I specify a domain admin or a local SVM admin account in the -fallback-user section. I’ve engaged the XCP support team by email but it’s been a very slow process. Can you provide some syntax examples?
LikeLike
This syntax worked fine for me (outside of the desktop.ini file):
C:\Users\administrator>xcp copy -fallback-user administrator -fallback-group group1 -acl C:\Users\administrator\Documents X:
XCP CIFS 1.0-b4db577; (c) 2017 NetApp, Inc.; Licensed to Justin Parisi [NetApp Inc] until Mon Nov 20 11:10:45 2017
WARNING skipping junction: “My Music”
WARNING skipping junction: “My Pictures”
WARNING skipping junction: “My Videos”
ERROR failed to copy “desktop.ini”: [Errno 13] Permission denied: ‘\\\\?\\X:\\desktop.ini’
6 scanned, 1 errors, 3 skipped, 1 copied, 0 (0/s), 1s
ontap9-tme-8040::*> vserver security file-directory show -vserver DEMO -path /flexgroup_16/test.txt
Vserver: DEMO
File Path: /flexgroup_16/test.txt
File Inode Number: 78027
Security Style: ntfs
Effective Style: ntfs
DOS Attributes: 20
DOS Attributes in Text: —A—-
Expanded Dos Attributes: –
UNIX User Id: 0
UNIX Group Id: 1
UNIX Mode Bits: 777
UNIX Mode Bits in Text: rwxrwxrwx
ACLs: NTFS Security Descriptor
Control:0x8504
Owner:BUILTIN\Administrators
Group:NTAP\DomainUsers
DACL – ACEs
ALLOW-NTAP\student1-0x1200a9
ALLOW-Everyone-0x1f01ff-(Inherited)
A couple things to check:
– is the security style of the ONTAP destination volume/qtree NTFS?
– Does the user/group specified resolve from ONTAP? (diag secd authentication translate from diag priv)
LikeLike
Hi Drew,
I have come into same issue “failed to get security principal”” and working on it since yesterday in order to find the solution. Could you solve the problem? I want to ask you before contacting xcp team.
LikeLike
I’d suggest pinging the XCP team.
LikeLike
did you get a response on this? im having the same issue
LikeLike
Hi Steve,
I solved the problem on my own. SVM name should be added to DNS records and SVM data ip (not need to be svm management role) should be match with SVM name in DNS. Why it is not mentioned in XCP user guide, I don’t know.
LikeLike
Hi will this XCP tool copy the files with its windows level user permissions.
LikeLike
It should, yes, via the -acl option. If you run into issues or have questions, feel free to email ng-xcp-support@netapp.com.
LikeLike
Xcp is not copying the file permissions
LikeLike
Have you opened a query with ng-xcp-support@netapp.com?
I’ve also heard of people using XCP to copy the data and then robocopy to copy the ACLs after the fact.
LikeLike
Hi Justin,
I noticed that the sync option is basically a terrible way to do an incremental update for the SMB version. It does a compare, reading both the source and destination. So let’s say there are 10,000 files, it does a full scan on both source and destination (20,000+ scanned). So I have found in my experience that can take as long or longer to do a sync than to do the initial copy. This is a terrible situation for a very large amount of files. I instead used robocopy to do the update, and it is significantly faster, like minutes vs. hours/days.
I spoke to support about this (they now cover XCP issues), and the support engineer told me that this is the current expected behavior and that he would let the XCP team know my feedback.
I think haven’t done on UNIX/NFS side, with new version, but I think the SMB version needs a lot of work. It is also giving me some issues where if I loop a list of directories in powershell, it will get stuck on empty directories, and I need to break into debug (ctrl-break) and type “exit” to make it continue.
LikeLike
Are you using the latest SMB XCP (1.5)? I’d say give the NFS version a shot on the data and then retroactively apply ACLs using something like Robocopy.
LikeLike
Hi,
I start copying data from file share . Source have 5T of data ,. at the moment copying is still in progress and 7T are copied . I’m not sure how that is possible?
LikeLike
Not sure. But the tool is officially supported by NetApp support now, so I’d recommend opening up a case for that issue.
LikeLike
deduplication…:(
LikeLike
Ah. Well ONTAP should dedupe it again…
LikeLike
Hi,
How can I copy specific file using XCP copy. Exemplo: xcp copy “\\source\folder\file.PDF” “\\destination\folder”.
Many thanks,.
Ronaldo Kiy
LikeLike
That command should work. For NFS, it works like this:
# xcp copy sourceSVM:/volume/folder/file.dat destSVM:/volume/
LikeLike
Hi Justin, I´m using SMB, and this comand it not working.
LikeLike
Can you post the exact syntax you are using and the error you are getting?
LikeLike
Hi Justin this is the syntax i trying to use and migrate specif file in SMB. C:\NetApp\XCP>xcp copy -parallel 2 \\LA13W12.LA13.CHEROX.NET\SHARE\COPI\Lu\PG\Administrative\Buget \FIN0000_Fince\Budgets\Other\emails\PG\Filome\TEST.PDF \\00.00.00.00\data_sa_ar\SA\archive\CA\Data\COPI-Lu-PG\Administrative\Buget \FIN0000_Fince\Budgets\Other\emails\PG\Filome
LikeLike
Ok, I tried this in my lab and am getting errors on individual file copies.
PS C:\Users\Administrator> xcp copy -parallel 2 ‘\\x.x.x.x\scripts\XCP\NETAPP_XCP_1.5.tgz’ ‘\\y.y.y.y\fg2’
failed to scan path “\\x.x.x.x\scripts\XCP\NETAPP_XCP_1.5.tgz”: [WinError 267] The directory name is invalid: ‘\\\\?\\UNC\\x.x.x.x\\scripts\\XCP\\NETAPP_XCP_1.5.tgz’
failed to copy “”: (1, ‘WriteFile’, ‘Incorrect function.’)
C:\Program Files\NETAPP_XCP\xcp\windows\xcp.exe copy -parallel 2 \\x.x.x.x\scripts\XCP\NETAPP_XCP_1.5.tgz \\y.y.y.y\fg2
1 scanned, 0 matched, 0 skipped, 0 copied, 0 (0/s), 2 errors
Total Time : 2s
STATUS : FAILED
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File “xcp\stats.py”, line 214, in call_home
File “xcp\histograms.py”, line 377, in calculate_averages
ZeroDivisionError: division by zero
Same command with just folders specified works fine:
PS C:\Users\Administrator> xcp copy -parallel 2 ‘\\x.x.x.x\scripts\XCP’ ‘\\y.y.y.y\fg2’
XCP SMB 1.9.1; (c) 2022 NetApp, Inc.; Licensed to Justin Parisi [NetApp Inc] until Sun Mar 12 11:59:56 2023
3 scanned, 0 matched, 0 skipped, 1 copied, 7.47MiB (1.35MiB/s), 0 errors, 5s
C:\Program Files\NETAPP_XCP\xcp\windows\xcp.exe copy -parallel 2 \\10.193.67.219\scripts\XCP \\10.193.67.201\fg2
3 scanned, 0 matched, 0 skipped, 2 copied, 26.2MiB (3.29MiB/s), 0 errors
Total Time : 7s
STATUS : PASSED
I’ll ask around and see what might be the issue but it feels like an XCP bug you should open up a support case for.
LikeLike
Ok, word I got is that XCP in general isn’t designed for single file copies (but it should work).
That said, you can either copy at a folder level or open up a support case to get a bug filed.
LikeLike
Hi,
Thanks I will contact the support so see, because a really need to migrate a single file, there any other tool I can use?
LikeLike
You’d be looking at robocopy or a simple copy/paste. Not a ton of performance benefit in single file copy using a tool tho.
LikeLike