You are on page 1of 19

AFS Migration Build Guide

SMB / NFS Migration


Copyright 2018 Nutanix, Inc.

Nutanix, Inc.

1740 Technology Drive, Suite 150

San Jose, CA 95110

All rights reserved. This product is protected by U.S. and international


copyright and intellectual property laws.

Nutanix is a trademark of Nutanix, Inc. in the United States and/or other


jurisdictions. All other marks and names mentioned herein may be
trademarks of their respective companies.

AFS Migration - Build Guide | 2


Contents
Executive Summary..................................................................................................................5

Introduction...............................................................................................................................6

Audience...........................................................................................................................................6

Purpose..............................................................................................................................................6

Pre-requisites.....................................................................................................................................6

AFS Server Deployment...........................................................................................................7

SMB Migration Process............................................................................................................8

Preparing a Windows VM to execute commands..............................................................................8

Discover the SMB share configuration..............................................................................................9

File Server Migration Process.........................................................................................................10

SMB Cut Over................................................................................................................................11

(Optional) Share Permissions Migration.........................................................................................11

(Optional) Redirect user accounts...................................................................................................11

NFS Export Migration............................................................................................................12

Preparing a Linux Migration VM....................................................................................................12

Deploy Metro Availability Witness 5.1.5 VM...................................................................................12

https://portal.nutanix.com/#/page/docs/details?targetId=Web-Console-Guide-Prism-v56:sto-metro-
availability-witness-create-t.html....................................................................................................12

Querying exports to migrate............................................................................................................12

Client Side Query..............................................................................................................................12

Server Side Query..............................................................................................................................12

Create NFS mount-targets on AFS Server.......................................................................................13

Preparation for Baseline and Delta Copies......................................................................................14

AFS Migration - Build Guide | 3


Extract Tools.....................................................................................................................................14

Create Mounts...................................................................................................................................15

Modify Wave Files............................................................................................................................15

Schedule Baselines and Deltas...........................................................................................................16

Cutover of NFS Exports..................................................................................................................16

Appendix..................................................................................................................................17

RSYNC switches utilized for migration..........................................................................................17

Troubleshooting..............................................................................................................................17

Command Reference.......................................................................................................................18

Useful Commands.............................................................................................................................18

About Nutanix.........................................................................................................................19

AFS Migration - Build Guide | 4


Executive Summary
Nutanix Acropolis File Services (AFS) provides native SMB/NFS support built into the Nutanix
platform. With this product, customers can migrate their user, group, and application data off legacy
SMB/NFS file server appliance infrastructure. This allows for consolidation into the Nutanix cluster
with no additional cost or licensing for customers that have the Ultimate License.

This document outlines the migration process for SMB/NFS data on to an existing AFS Server,
including creation of mount-targets (shares/exports), copying files to the newly created mount-targets,
preserving file attributes, permissions, and timestamps.

AFS Migration - Build Guide | 5


Introduction
Audience

This document is intended for Nutanix Services Consultants who have some prior file server appliance
experience.

Purpose

This document is meant to provide guidance on how to implement Acropolis File Services on a
Nutanix cluster, create mount targets, and migrate data.

Pre-requisites

The following items are pre-requisites prior to migrating from a SMB/NFS File Server to a Nutanix
AFS Server:

1. AOS 5.1.1. or later for SMB / AOS 5.5 or later for NFS
2. AFS 2.1.1 or later for SMB / AFS 3.0.0 or later for NFS
3. The creation of the AFS file server via the Prism interface.
4. A Windows VM (Windows 2012 R2 recommended) that has access to the SMB source being
migrated and access to the AFS Server. The AFS Migration Services tools will be loaded on
and run from this VM.
5. A Linux VM (CentOS 7 with 4.x kernel recommended) with an IP address that has export
permissions to the NFS filesystems to be migrated, and access to the exports on the AFS
Server.
6. Adequate network connectivity between the SMB/NFS source and the AFS Server for file
transfers
7. Active Directory Account with read permissions across all CIFS shares to be migrated.
8. Active Directory or LDAP Account with read permissions across all NFS exports to be
migrated
9. The Nutanix cluster must have Authentication configured, pointing to a valid Active Directory
server

AFS Migration - Build Guide | 6


AFS Server Deployment
Please refer to the current release of the Acropolis File Services Guide on the Nutanix Portal site.
https://portal.nutanix.com/#/page/docs/list?type=software

AFS Migration - Build Guide | 7


SMB Migration Process

Preparing a Windows VM to execute commands

As noted in the pre-requisites, a Windows VM is required to run the requisite executables to create the
AFS shares and migrate the data from the legacy file server shares to the newly created AFS shares.
The Windows VM needs to have the following installed:

1. (Optional) Ensure PowerShell 3.x or above is installed:

2. Unzip the Nutanix_AFS_Windows.zip file that is included in AFS Migration kit.

3. Open a PowerShell or Command prompt and change to the directory where the executables
have been unzipped or copied.

AFS Migration - Build Guide | 8


Discover the SMB share configuration

The fs_probe.exe is a tool to probe file servers for share information that can be used to create
shares on a Nutanix AFS instance. This tool is to be used by Nutanix Services.

fs_probe.exe :

fs_probe.exe -f <file server FQDN or IP>  -w <windows  AD  account>  -d  <domain name>

The script will create a CSV formatted file of share information to pass to the fs_migrate.exe
tool.

The format of the CSV file is as follows:

Share Name Home Path Description

share01 0 The first share

marketing01 0 Marketing's department share

sallym home Sally's home share

jimc home01 Jim's home share

operations02 0 2nd Operation's department share

** Note: The share CSV formatted file that is created using the fs_probe.exe documentation tool
will need to be edited manually to account for user home shares that need to be migrated under
another "HOME" share as a directory.

AFS Migration - Build Guide | 9


File Server Migration Process

The fs_migrate.exe tool can be used to create shares based on the output file from the fs_probe.exe
tool and initiate migration from the source.

ALERT: fs_migrate maps a drive to a source share and a destination share on the AFS Server.
The tool is currently hard-coded to map a drive to “home” on the AFS Server because this default
share was created on AFS 2.x servers. AFS 3.0 does not create this share. Please create a
“home” share on the AFS server before proceeding with the fs_migrate execution. The share can
be either type of share.

Note: The tool is idempotent, i.e. you can rerun it again and it’ll skip the steps that have already been
configured.

1. Gather the following information:


a. Windows User with Domain with Read Permissions to the data
b. A user with access to the Nutanix REST API (can be local or AD user)
c. The Nutanix cluster shared IP or cluster DNS name
d. Active Directory FQDN
e. AFS Server Name *
f. Any shares that will not be migrated

* Note: The creation of the AFS file server via the Prism interface is required before running the
fs_migrate.exe to create shares and/or migrate data.

2. Using the Windows VM, navigate to the directory where the fs_migrate.exe exists
3. Update the CSV file that was the output of the executable to define the appropriate home share
configurations. Please split the file into separate wav-migration based csv’s. This file will be used
as input into the migration tool based on the number of waves.

Note: Please ensure to read all the instructions provided with the README.
4. Execute the following command. (See the README for list of parameters and help)

fs_migrate.exe -P migration_config.yml

The command will prompt for a password to connect to the cluster and then prompt for the
password of the domain account that has rights to join the AFS server to AD.

Nutanix Cluster Password for: <admin>

Password:

Note: The script has full restart capability. If the shares have already been created the script
notifies and skips those components and continues creating the components that do not exist.

AFS Migration - Build Guide | 10


The script will copy the contents of the shares to the Nutanix AFS mout-targets using RoboCopy,
preserving file permissions, timestamps, etc. The first copy could take anywhere between a few
minutes and a few days depending upon:
 The amount of data being copied
 The bandwidth between the Source and the AFS Server
 The change rate of the data on the Source

5. Once the script completes, run through the AFS Migration test cases to validate that shares and
files have been copied correctly

SMB Cut Over

Re-run the fs_migrate.exe script selecting only the options required to migrate shares as a final “sync”
copy before migrating users over to the new AFS shares.

(Optional) Share Permissions Migration

Note: Shares should be configured as Everyone/Full Control and that all security be managed using
NTFS permissions on the file system underneath the share. Door is open for everyone, but they can
only access folders and files that they have access to. In NTFS world, you don't use share permissions.
The share permissions in the MS world are really only around still for the people sharing FAT file
systems that have no native file system permissions.

If the customer insists on retaining the source share permissions, please proceed with this section.

Below is a link to the PoSH script that can be used to migrate share level permissions.

https://gallery.technet.microsoft.com/scriptcenter/Migrate-Share-Permissions-eb9e9ec4

Download the script and run on the Windows VM that was used to migrate the shares.

(Optional) Redirect user accounts

Below is an example PowerShell script that can be used to change Active Directory user’s home
directory to a new location (such as when changing the hostname of the legacy file server to the AFS
Server name):

Get-ADUser -Filter * -SearchBase $targetou | Foreach-Object{


$sam = $_.SamAccountName
Set-ADuser -Identity $_ -HomeDrive "H:" –HomeDirectory "\\NutanixAFS01.domain.com\HOMES\$sam"

AFS Migration - Build Guide | 11


NFS Export Migration
Preparing a Linux Migration VM

Deploy Metro Availability Witness 5.1.5* VM

https://portal.nutanix.com/#/page/docs/details?targetId=Web-Console-Guide-Prism-v56:sto-metro-
availability-witness-create-t.html

 *NOTE – 5.1.5 Witness VM must be utilized as it is a CentOS 6.x kernel. The CentOS 7.x
kernel currently has issues creating Top Level Directories on sharded home shares.
 The Witness VM will deploy with a DHCP address
 Follow step 5 of the deployment documentation to apply a static IP address if needed

Querying exports to migrate

Client Side Query

 Collect NFS Mount Data from each of the NFS Clients

ssh userid@hostname nfsstat -m

 Combine nfsstat -m output from all clients to create a table of exports to migrate.
 Table should include the source hostname/IP, export path, NFS Version, security style.

Server Side Query

 Access the NFS Server


 Collect the /etc/exports file

 Combine exports from multiple NFS Servers, if needed, to create a table of exports to migrate.
 Table should include the source hostname/IP, export path, NFS Version, security style
 Note – this method makes it difficult to identify what NFS Clients have the filesystem
mounted, if as in the example, the exports are broad to a subnet or just wide-open.

AFS Migration - Build Guide | 12


 On some NAS appliances, NFS client stats can be enabled and monitored to see what clients
are connecting to the server. This is not detailed, but can provide some insight into what NFS
Clients to investigate.

Create NFS mount-targets on AFS Server

 Login to Prism and Jump to the File Server Page


 Click on + Mount Target (this will be repeated for each export to be migrated).

 Give the mount-target


o Name
o Description (Optional)
o Maximum Size (Optional)
o Select the appropriate File Server
o Set the protocol option to NFS
o Chose the appropriate usage type based on the AFS File Server Design.
o Click Next

AFS Migration - Build Guide | 13


 Access and Authentication - Select the appropriate Authentication method, based on the AFS
File Server Design, and the source file system security style.
 Default Access - It is recommended to set the Default Access (For All Clients) to No Access.
 Click Add Exception Rules - Add exception rules based on source file systems current export
rules (In the example, a RW rule has been opened for an entire subnet).
 Check the box for Show Advanced Settings – Set the Squash to None. This allows the root
user to mount and access the filesystems for migration purposes. This can be modified post-
migration.
 Click Create to finish the Mount-Target Creation.

Preparation for Baseline and Delta Copies

Extract Tools

 Copy afs_nfs_migrate.tar to the VM using SFTP/SCP etc.


 Untar the afs_nfs_migrate.tar file using the absolute path switch

AFS Migration - Build Guide | 14


tar -xvf afs_nfs_migrate.tar -C /

Create Mounts

 Create /src mount folders based on source exports


 Create /dst mount folders based on destination mount-targets

 Add entries to /etc/fstab using VI (or install your favorite editor)


 NFSv3 filesystems will be mounted with ostype nfs
 NFSv4 filesystems (inlucing AFS mount-targets) will be mounted with ostype nfs4.
 Below are some examples based on an NFSv3 source and an AFS NFSv4 destination.

#ADD Source filesystems to /src/source1


10.1.174.201:/vol/ntapnfs1 /src/ntapnfs1 nfs
10.1.174.201:/vol/ntapnfs2 /src/ntapnfs2 nfs
10.1.174.201:/vol/ntapnfs3 /src/ntapnfs3 nfs

#ADD Destination filesystems to /dst/dest1


afs-cinderella.gso.lab:/afsnfs1 /dst/afsnfs1 nfs4
afs-cinderella.gso.lab:/afsnfs2 /dst/afsnfs2 nfs4
afs-cinderella.gso.lab:/afsnfs3 /dst/afsnfs3 nfs4

 Mount all filesystems from the newly updated /etc/fstab

mount -a

Modify Wave Files

 Edit the /home/nutanix/wave1.sh and wave2.sh files to split up the migration file systems
between waves.
 Add an entry for each src/dst pair to be migrated.
 The recommended syntax is documented in the comments of the wave scripts. See the appendix
for detailed breakdown of the switches utilized.

nohup rsync -avhltgoxvAHP --delete --stats --log-file=/home/nutanix/source1-`date +"%Y%m%d_%H%M%S"`.log --


exclude-from '/home/nutanix/exclude.txt' /src/source1/ /dst/dest1/ &

Schedule Baselines and Deltas

 Edit /etc/crontab to modify the schedule of the baselines and the updates.

AFS Migration - Build Guide | 15


 It is recommended to schedule the baselines to start after hours and to monitor the impact on
the performance of the source and destination systems during the baseline.
 When the baselines are completed, the schedule can be updated to enable daily updates of the
waves.
 It is recommended to stagger the waves in the crontab, to ensure stability of the performance
on the source, destination, and migration VM.

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:


# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
#| | | | |
# * * * * * user-name command to be executed
# 25 * * * * root /home/nutanix/wave1.sh > /dev/null 2>&1
# 35 * * * * root /home/nutanix/wave2.sh > /dev/null 2>&1

Cutover of NFS Exports

Once all NFS Exports in a single wave are running with delta updates, they can be scheduled for
cutover.

The cutover requires unmounting the filesystem from the NFS Clients, updating the filesystems for
one last sync, and finally mounting the AFS mount-targets on the NFS client. This is done by editing
the associated clients mount file (fstab, vfstab, mounts, etc.) to reflect the AFS Server as the mount
target. When transitioning from NFSv3 to NFSv4, it is also necessary to modify the ostype in the
mount file.

AFS Migration - Build Guide | 16


Appendix
RSYNC switches utilized for migration

rsync -avhltgoxAHP --delete --stats --log-file=/home/nutanix/source1-`date +"%Y%m%d_%H


%M%S"`.log --exclude-from '/home/nutanix/exclude.txt' /src/source1/ /dst/dest1/

-a recurse into directories


-v verbose
-h displays progress in human-readable format
-l copy symlinks as symlinks
-t preserve modification times
-g preserve group
-o preserve owner
-x don't cross filesystem boundaries
-A preserve ACLs
-H preserve Hard-links
-P displays progress and allows partial file transfer and resume
--delete - removes files in the destination not currently in source
--stats - logs stats on bandwidth utilized
--log-file - logs to a log file
--exclude - from - file for file/directory exclusions

Troubleshooting

I Symptom Suggestion Resolution


D

1 File Server fails to join domain Click on the file server in Prism, select “Join
Domain” and re-enter AD credentials

2 Cannot access newly Confirm the cluster shared IP address is configured


provisioned AFS File Shares correctly and is not a duplicate IP address

3 File Server Create fails with Ensure the internal network has at least 4 IPs
error: “Error: Not enough IP available in the defined ip address pool and the
addresses available in the external network has at least 3 IPs available in the
network selected with uuid defined ip address ippool
14636129-3d47-4d7d-92d1-
cf2b66cdfb00.”

4 2016/11/08 05:35:36 ERROR Ensure that a share to be migrated from the legacy
1326 (0x0000052E) Accessing file server is mapped using credentials that have

AFS Migration - Build Guide | 17


Destination Directory \\afs-test- access to read all shares to be migrated and that a
01\profiles\The user name or share on the AFS Server has been mapped using
password is incorrect. credentials that have write access.

Command Reference

Useful Commands

Force Delete an AFS Server (from CVM) afs infra.force_fileserver_delete


(note: only use this when all other methods <file_server_name> ???? May not work
fail. Ensure there is no data on the AFS currently in EA
Server mount-targets!)

Collect information necessary for manual afs ad.manual_join_domain_info <domain


join to domain (from FSVM) fqdn>

List AFS Servers in a cluster (from CVM) ncli fs ls or

afs info.fileservers

Show specific AFS Server info (from afs fs.info


FSVM)

AFS Migration - Build Guide | 18


About Nutanix
Nutanix makes infrastructure invisible, elevating IT to focus on the applications and services that
power their business. The Nutanix enterprise cloud platform leverages web-scale engineering and
consumer-grade design to natively converge compute, virtualization, and storage into a resilient,
software-defined solution with rich machine intelligence. The result is predictable performance, cloud-
like infrastructure consumption, robust security, and seamless application mobility for a broad range
of enterprise applications. Learn more at www.nutanix.com or follow up on Twitter @nutanix.

AFS Migration - Build Guide | 19

You might also like