Use Amazon Elastic File System for the Image Depot
Reference Number: AA-00407 Views: 202 Created: 02-09-2017 13:18 Last Updated: 02-09-2017 13:58

Applies To:

DynaCenter 6.0 and later

Background: 

In addition to supporting the use of Amazon Simple Storage Service (Amazon S3) and Amazon Elastic Block Store (Amazon EBS) for the DynaCenter image depot, DynaCenter also supports Amazon Elastic File System (Amazon EFS) as a storage option.

More Information: 

Resolution: 

Prerequisite

Create the Amazon EFS and add a “mount target” in the same subnet as the DynaCenter instance. Assign a security group to the DynaCenter instance that allows access to the Amazon EFS. See the Amazon Elastic File System documentation for details.

(Optional) To preserve any existing images stored on the DynaCenter instance: 

1. Log in to the DynaCenter instance via SSH.

2. Create a temporary mount point:

sudo mkdir /tmp/efs_tmp

3. Mount the Amazon EFS on the temporary mount point. 

Example:

sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-7d955139.efs.us-east-1.amazonaws.com://tmp/efs_tmp

Reference: For additional information, in the Amazon Management Console, click Services->EFS, select the appropriate EFS and click the Amazon EC2 mount instructions link. 

4. Copy the images from /repo/images to the temporary mount point:

sudo rsync -av --exclude=lost+found /repo/images/ /tmp/efs_tmp/

5. Unmount EFS from the temporary mount point

sudo umount /tmp/efs_tmp

6. Remove the temporary mount point:

sudo rmdir /tmp/efs_tmp



To use EFS as the default DynaCenter image depot:

1. In the Amazon Management Console, click Services->EFS, select the appropriate EFS and then, in the File system access section, note the DNS name of the EFS. 

Example:

fs-7d955139.efs.us-east-1.amazonaws.com

2. Log in to the DynaCenter instance via SSH.

3. Add a line to the /etc/fstab so that the EFS will be mounted automatically at boot time.

Example:

fs-7d955139.efs.us-east-1.amazonaws.com:/ /repo/images nfs defaults 0 0

4. Stop the DynaCenter services:

dcctl stop

5. Mount the new file system

mount -a

6. Verify that the new file system is listed in the following command output:

mount

7. Start the DynaCenter services:

dcctl start