2.3 Connect iSCSI Volume

Connect to the EC2 Initiator Instances

  1. From the AWS console, click Services and select EC2.
  2. Select Instances from the menu on the left.
  3. Right-click on the EC2 Initiator Instance and select Connect from the menu.
  4. From the dialog box, select the Session Manager option, as shown below:

  1. Click Connect. A new tab will be opened in your browser with a command line interface (CLI) to the EC2 Initiator Instance.

  2. Use a text editor to uncomment and amend the following lines in /etc/iscsi/iscsid.conf

    sudo nano /etc/iscsi/iscsid.conf

Use the arrow keys to scroll down to the CHAP Settings as shown below:

Delete the # from the values below and update.

node.session.auth.authmethod = CHAP

node.session.auth.username = [initiatorname]

node.session.auth.password = awsreinvent2020

node.session.auth.username_in =[Target Name]

node.session.auth.password_in = awsreinforce2020

You should then have something that looks like this, with your values entered:

  1. Save and exit the nano editor.

  2. Run the following command on the EC2 Initiator Instance to discover iSCSI volumes on the Volume Gateway replacing [GATEWAY_IP] with the Host IP we recorded previously:

    sudo /sbin/iscsiadm --mode discovery --type sendtargets --portal [GATEWAY_IP]:3260

  1. Run the following command on the EC2 Initiator Instance to connect iSCSI volumes on the Volume Gateway replacing [GATEWAY_IP] with the Host IP and [Target] with Target Name recorded previously:

    sudo /sbin/iscsiadm --mode node --targetname [Target] --portal [GATEWAY_IP]:3260,1 --login

  1. Run the following command on the EC2 Initiator Instance to list the attached disks:

ls -l /dev/disk/by-path

It should show an output similar to this where the iSCSI disk has been mounted to sda. Note this down as we will use it in the next module.

Module 2 Summary

In this module you have created a Volume Gateway hosted in EC2 with a cached volume. Then you connected this volume to your EC2 Initiator Instance via iSCSI, using CHAP authentication, making it ready for performance testing.

In the next module you will run performance tests using FIO against this cached volume.

Continue to Module 3