Example Amazon DataSync task scenarios - Amazon DataSync
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Example Amazon DataSync task scenarios

The following sections walk you through how to create Amazon DataSync tasks for different transfer scenarios.

Creating a task to transfer data between self-managed storage and Amazon

If you have previously created a task and want to create additional tasks, use the following procedure.

To create a task
  1. Open the Amazon DataSync console at https://console.amazonaws.cn/datasync/.

  2. In the left navigation pane, expand Data transfer, then choose Tasks, and then choose Create task.

  3. On the Configure source location page, choose Create new location and configure a new location if you want to use a new location for your source. Provide the configuration settings and choose Next. For instructions on how to create a location, see Where can I transfer my data with Amazon DataSync?.

    If you want to use a source location that you previously created, choose Choose existing location, choose your source location from the list, and then choose Next.

    For step-by-step instruction, see Create a source location for Amazon DataSync.

Creating a task to transfer between in-cloud locations

Use the following instructions to set up the DataSync agent on an Amazon EC2 instance for data transfers. The examples in this section cover these use cases:

Creating a task to transfer from in-cloud NFS to in-cloud NFS or Amazon S3

Use the following instructions to transfer data from an in-cloud NFS file system to Amazon. To perform this transfer, the DataSync agent must be located in the same Amazon Web Services Region and same Amazon Web Services account where the file system is deployed. This type of transfer includes transfers from EFS to EFS, transfers from self-managed NFS to Amazon EFS, and transfers to Amazon S3. For information about how in-cloud NFS to in-cloud NFS or Amazon S3 works, see Transferring data from a cloud file system to another cloud file system or Amazon S3.

Note

Deploy the agent in the Amazon Web Services Region and Amazon Web Services account where the source EFS or self-managed NFS file system resides.

Deploying your DataSync agent as an Amazon EC2 instance to read files from in-cloud

To deploy the DataSync agent as an Amazon EC2 instance
  1. From the Amazon Web Services account where the source EFS resides, launch the agent by using your Amazon Machine Image (AMI) from the Amazon EC2 launch wizard. Use the following URL to launch the AMI.

    https://console.amazonaws.cn/ec2/v2/home?region=source-efs-or-nfs-region#LaunchInstanceWizard:ami=ami-id

    In the URL, replace the source-efs-or-nfs-region and ami-id with your own.

    After the AMI launches, the Choose an Instance Type appears on the Amazon EC2 console. For a list of AMI IDs by Amazon Web Services Region, see Deploy your agent on Amazon EC2.

  2. Choose one of the recommended instance types for your use case, and choose Next: Configure Instance Details. For the recommended instance types, see Amazon EC2 instance requirements.

  3. On the Configure Instance Details page, do the following:

    1. For Network, choose the VPC where your source EFS or NFS is located.

    2. Choose a value for Auto-assign Public IP. If you want your instance to be accessible from the public internet, set Auto-assign Public IP to Enable. Otherwise, set Auto-assign Public IP to Disable. If a public IP address isn't assigned, activate the agent in your VPC using its private IP address.

      When you transfer files from an in-cloud NFS, to increase performance, we recommend that you choose the Placement Group where your NFS server resides.

  4. Choose Next: Add Storage. The agent doesn't require additional storage, so you can skip this step and choose Next: Add tags.

  5. (Optional) On the Add Tags page, you can add tags to your Amazon EC2 instance. When you're finished on the page, choose Next: Configure Security Group.

  6. On the Configure Security Group page, do the following:

    1. Make sure that the selected security group allows inbound access to HTTP port 80 from the web browser that you plan to use to activate the agent.

    2. Make sure that the security group of source EFS or NFS allows inbound traffic from the agent. In addition, make sure that the agent allows outbound traffic to the source EFS or NFS. The traffic goes through the standard NFS port, 2049.

    For the complete set of network requirements for DataSync, see Amazon DataSync network requirements.

  7. Choose Review and Launch to review your configuration, then choose Launch to launch your instance. Remember to use a key pair that's accessible to you. A confirmation page appears and indicates that your instance is launching.

  8. Choose View Instances to close the confirmation page and return to the Amazon EC2 instances screen. When you launch an instance, its initial state is pending. After the instance starts, its state changes to running. At this point, it's assigned a public Domain Name System (DNS) name and IP address, which can be found in the Descriptions tab.

  9. If you set Auto-assign Public IP to Enable, choose your instance and note the public IP address in the Description tab. You use this IP address later to connect to your sync agent.

    If you set Auto-assign Public IP to Disable, launch or use an existing instance in your VPC to activate the agent. In this case, you use the private IP address of the sync agent to activate the agent from this instance in the VPC.

Creating a task to transfer data from Amazon EFS or self-managed storage

Next, you create a task to transfer data.

Note

Create the task in the Amazon Web Services Region and Amazon Web Services account where the destination EFS or Amazon S3 bucket resides.

To create a task
  1. Open the DataSync console in the Amazon Web Services Region where your destination is located.

    The destination Amazon EFS or Amazon S3 bucket must be in the same Amazon Web Services account.

  2. In the left navigation pane, choose Agents, then choose Create agent.

  3. In the Create agent wizard's Activation section, enter the Amazon EC2 instance's IP address for Agent address, and then choose Get key. This IP address can be private or public. For more details, see step 9 of To deploy the DataSync agent as an Amazon EC2 instance.

    Your browser connects to this IP address to get a unique activation key from your agent. This key securely associates your agent with your Amazon Web Services account. This IP address doesn't need to be accessible from outside your network, but must be accessible from your browser.

  4. Enter an agent name that you can easily identify later, and choose Create agent when done. You can optionally add tags to the agent.

  5. In the left navigation pane, expand Data transfer, then choose Tasks.

  6. Choose On-premises to Amazon, and choose Next to open the Source configuration page.

  7. On the Configure source location page, choose Create a new location and choose Network File System (NFS) or Server Message Block (SMB) for the location type. Fill in the following options:

    • For agent, choose your newly created agent from the list.

    • If you are copying from EFS, do the following:

      • For NFS Server, enter the DNS name of your source EFS.

      • For Mount path, enter / (forward slash) and choose Next.

    • If you are copying from self-managed NFS or SMB, do the following:

      • For NFS Server, enter the private DNS or IP address of your source NFS.

      • For Mount path, enter a path that's exported by your NFS server and choose Next.

  8. Choose Create new location. This is the destination location for your data transfer. Fill in the following options:

    • If you are copying to EFS, do the following:

      • For Location type, choose EFS.

      • Choose your destination EFS.

      • For Mount path, enter / (forward slash).

      • For Subnet and Security groups, use the default settings and choose Next.

    • If you are copying to Amazon S3, do the following:

      • For Location type, choose Amazon S3 bucket.

      • For Amazon S3 bucket, choose your source Amazon S3 bucket.

      • For Folder, choose a folder prefix to use for the transfer, or you can keep it blank.

      • Choose your destination Amazon S3 bucket and an optional folder. DataSync can generate an Amazon Identity and Access Management (IAM) role to access your bucket, or you can create on your own.

  9. Choose Next, and optionally name the task and add tags.

  10. Choose or create an Amazon CloudWatch Logs log group at the bottom of the page, and choose Next. For more information on working with CloudWatch Logs, see Allowing DataSync to upload logs to CloudWatch log groups.

  11. Review the settings on the next page, and choose Create task.

  12. Choose Start to run the task that you just created to start transferring data.

Creating a task to transfer from Amazon S3 to in-cloud NFS

Use the following instructions to transfer data from Amazon S3 to an in-cloud NFS file system that's located in the same Amazon Web Services account and Amazon Web Services Region where the agent is deployed. This approach includes transfers from Amazon S3 to EFS, or from Amazon S3 to self-managed NFS. The following diagram illustrates this type of transfer. For information about how Amazon S3 to in-cloud NFS works, see Transferring data from Amazon S3 to Amazon file systems.

Deploying the DataSync agent on an Amazon EC2 instance to write to your destination location

First, deploy the DataSync agent on an Amazon EC2 instance in the Amazon Web Services Region and Amazon Web Services account where the destination EFS file system or self-managed NFS server resides.

To deploy the agent
  • Launch the agent from the selected AMI by using the Amazon EC2 launch wizard. To do so, use the following URL.

    https://console.amazonaws.cn/ec2/v2/home?region=DESTINATION-EFS-or-NFS-REGION#LaunchInstanceWizard:ami=AMI-ID.

    In the URL, replace the Amazon Web Services Region and AMI ID with your own. You are redirected to the Choose an Instance Type page on the Amazon EC2 console. For a list of AMI IDs by Amazon Web Services Region, see Deploy your agent on Amazon EC2.

Creating a task to transfer data from Amazon S3

Next, you create a task to transfer data.

Note

Create the task in the Amazon Web Services account and Amazon Web Services Region where the source Amazon S3 bucket resides.

To create a task that transfers data from Amazon S3 to EFS or a self-managed NFS or SMB
  1. Open the DataSync console in the Amazon Web Services Region where your source Amazon S3 bucket is located.

  2. Choose Create agent.

  3. If you set Auto-assign Public IP to Enable, choose your instance and note the public IP address in the Description tab. You use this IP address later to connect to your sync agent.

    If you set Auto-assign Public IP to Disable, launch or use an existing instance in your VPC to activate the agent. In this case, you use the private IP address of the sync agent to activate the agent from this instance in the VPC.

  4. In the Create agent wizard, for Agent address enter the Amazon EC2 instance's IP address (private or public, as explained in step 3), and then choose Get key.

    Your browser connects to this IP address to get a unique activation key from your agent. This key securely associates your agent with your Amazon Web Services account. This IP address doesn't need to be accessible from outside your network, but must be accessible from your browser.

  5. Choose an agent name that you can easily identify later. You can optionally add tags. When you're done, choose Create agent.

  6. Choose Amazon to on-premises, and choose Next.

  7. Choose Create new location:

    • For Location type, choose Amazon S3 bucket.

    • For Amazon S3 bucket, choose your source Amazon S3 bucket.

    • For Folder, choose a folder prefix for the transfer, or you can keep it blank.

      DataSync can generate an IAM role to access your bucket, or you can create on your own.

  8. Choose Next. Choose Create new location, choose NFS or SMB for Location type, and choose the agent that you just created from the list.

    1. If you are copying to EFS, do the following:

      • For NFS Server, enter the DNS name of your source EFS.

      • For Mount path, enter / (forward slash) and choose Next.

    2. If you are copying to in-cloud NFS, do the following:

      • For NFS Server, enter the private DNS or IP address of your source NFS.

      • For Mount path, enter a path that is exported by your NFS server. For more information, see Creating an NFS location.

  9. Choose Next, and optionally name the task and add tags.

  10. Choose or create a CloudWatch Logs log group at the bottom of the page, and choose Next. For more information on working with CloudWatch Logs, see Allowing DataSync to upload logs to CloudWatch log groups.

  11. Review the settings on the next page, and choose Create task.

  12. Choose Start to run the task that you just created to transfer data, and then choose Start again on the Start Task page.