Step 1: Create an agent
To access your self-managed storage, you first deploy and activate an AWS DataSync agent. The activation process associates your agent with your AWS account. An agent is not required when transferring between AWS storage services within the same AWS account. To set up a data transfer between two AWS services, see Step 2: Create locations.
A DataSync agent can transfer data through public service endpoints, Federal Information Processing Standard (FIPS) endpoints, and VPC endpoints. For more information, see Creating and activating an agent.
When you configure your agent to use VPC endpoints, the data transferred between your agent and the DataSync service doesn't cross the public internet and doesn't require public IP addresses. For end-to-end instructions for this configuration, see Using AWS DataSync in a virtual private cloud.
To create an agent to read from an NFS, SMB, or self-managed object storage source file system
-
Download the current DataSync .ova image or launch the current DataSync Amazon Machine Image (AMI) based on Amazon EC2 from the AWS DataSync Management Console. For information about how to get the .ova image or EC2 AMI, see Create an agent. For information about hardware requirements and recommended EC2 instance types, see Virtual machine requirements.
Important If you are deploying your agent on Amazon EC2, deploy the agent such that it does not require network traffic between Availability Zones (to avoid charges for such traffic).
-
To access your Amazon EFS or Amazon FSx for Windows File Server file system, deploy the agent in an Availability Zone that has a mount target to your file system.
-
For self-managed file systems, deploy the agent in the Availability Zone where your file system resides.
To learn more about data transfer prices for all AWS Regions, see Amazon EC2 On-Demand pricing
. -
-
Make sure that you satisfy the network connectivity requirements for the agent. For information about network requirements, see Network requirements for DataSync.
-
Deploy the .ova image in your hypervisor, power on the hypervisor, and note the
. Make sure that you can reach the agent on port 80. You can use the following command to check.agent-ip-address
$ nc -vz
agent-ip-address
80Note The .ova default credentials are login
admin
, passwordpassword
. You can change the password on the VM local console. You don't need to log in to the VM for basic DataSync functionality. Login is required mainly for troubleshooting, network-specific settings, and so on.You log in to the agent VM local console using your VM's hypervisor client. For information about how to use the VM local console, see Working with your agent on the local console.
-
Send an HTTP/1.1 GET request to the agent to get the activation key. You can do this by using standard Unix tools:
-
To activate an agent using a public service endpoint, use the following command.
$ curl "http://
agent-ip-address
/?gatewayType=SYNC&activationRegion=aws-region
&no_redirect" -
To activate an agent using a virtual private cloud (VPC) endpoint, use the Elastic IP address of the VPC endpoint. Use the following command.
$ curl "http://
agent-ip-address
/?gatewayType=SYNC&activationRegion=aws-region
&privateLinkEndpoint=Elastic IP address of VPC endpoint
&endpointType=PRIVATE_LINK&no_redirect"To find the correct IP address, open the Amazon VPC console at https://console.aws.amazon.com/vpc/
and choose Endpoints from the navigation pane at left. Choose the DataSync endpoint, and check Subnets list to find the private IP address that corresponds to the subnet that you chose for your VPC endpoint setup. For more information about VPC endpoint configuration, see step 5 in Configuring DataSync to use private IP addresses for data transfer.
-
To activate an agent using a Federal Information Processing Standard (FIPS) endpoint, specify
endpointType=FIPS
. Also, theactivationRegion
value must be set to an AWS Region within the United States. To activate a FIPS endpoint, use the following command.$ curl "http://
agent-IP-address
/?gatewayType=SYNC&activationRegion=US-based-aws-region
&endpointType=FIPS&no_redirect"
This command returns an activation key similar to the one following.
F0EFT-7FPPR-GG7MC-3I9R3-27DOH
-
-
After you have the activation key, do one of the following:
-
To activate your agent using a public endpoint or FIPS endpoint, use the following command.
$ aws datasync create-agent --agent-name
agent's name
--activation-keyobtained activation key
-
To activate your agent using a VPC endpoint, use the following command.
$ aws datasync create-agent --agent-name
agent's name
--vpc-endpoint-idvpc endpoint id
--subnet-arnssubnet arns
--security-group-arnssecurity group arns
--activation-keyobtained activation key
In this command, use the following arguments:
-
– The AWS endpoint that the agent connects to. To find the endpoint ID, open the Amazon VPC console at https://console.aws.amazon.com/vpc/vpc endpoint id
, and choose Endpoints from the navigation pane on the left. Copy the Endpoint ID value of the DataSync endpoint. For more information about VPC endpoint configuration, see step 5 in Configuring DataSync to use private IP addresses for data transfer. -
– The Amazon Resource Name (ARN) of the security group to use for the task's endpoint. This is the security group that you created in step 3 of Configuring DataSync to use private IP addresses for data transfer.security group arn
-
– The ARN of the subnet where the task endpoints for the agent are created.task's subnet arn
This is the subnet that you chose in step 1 of Configuring DataSync to use private IP addresses for data transfer.
These commands return the ARN of the agent that you just activated. The ARN is similar to the one following.
{"AgentArn": "arn:aws:datasync:us-east-1:111222333444:agent/agent-0b0addbeef44baca3”}
Note After you choose a service endpoint, you can't change it later.
-
-
After the agent is activated, it closes port 80 and the port is no longer accessible.
If you can't connect to the agent after you have activated it, check whether the
activation was successful by using this command: $ aws datasync
list-agents
.
Make sure that you are using the same AWS credentials throughout the whole process. Don't switch between multiple terminals where you are authenticated with different AWS credentials.