Connecting to a Volume

For volumes attached with Paravirtualized as the volume attachment type, you do not need to perform any additional steps after Attaching a Volume, the volumes are connected automatically. However, for Linux-based images, if you want to mount these volumes on instance boot, you need to perform additional configuration steps. If you specified a device path when you attached the volume, see fstab Options for Block Volumes Using Consistent Device Paths. If you did not specify a device path or if your instance was created from an image that does not support device paths, see Traditional fstab Options.

For volumes attached with iSCSI as the volume attachment type, you need to connect and mount the volume from the instance for the volume to be usable. For more information about attachment type options, see Volume Attachment Types. In order to connect the volume, you must first attach  the volume to the instance, see Attaching a Volume.

Connecting to iSCSI-Attached Volumes

Required IAM Policy

Connecting a volume to an instance does not require a specific IAM policy. However, you may need permission to run the necessary commands on the instance's guest OS. Contact your system administrator for more information.

Prerequisites

You must attach the volume to the instance before you can connect the volume to the instance's guest OS. For details, see Attaching a Volume.

To connect the volume, you need the following information:

  • iSCSI IP Address
  • iSCSI Port numbers
  • CHAP  credentials (if you enabled CHAP)
  • IQN 

The Console provides the commands required to configure, authenticate, and log on to iSCSI.

Connecting to a Volume on a Linux Instance
  1. Use the Console to obtain the iSCSI data you need to connect the volume:

    1. Log on to Oracle Cloud Infrastructure.
    2. Open the navigation menu. Under Core Infrastructure, go to Compute and click Instances.
    3. Click the name of the instance to display the instance details.
    4. In the Resources section on the Instance Details page, click Attached Block Volumes to view the attached block volume.

    5. Click the Actions icon (three dots) next to the volume you're interested in, and then click iSCSI Commands and Information.

      The iSCSI Commands and Information dialog box displays specific identifying information about your volume and the iSCSI commands you'll need. The commands are ready to use with the appropriate information included. You can copy and paste the commands into your instance session window for each of the following steps.

  2. Log on to your instance's guest OS.
  3. Register the volume with the iscsiadm tool.

    iscsiadm -m node -o new -T <volume IQN> -p <iSCSI IP address>:<iSCSI port>

    A successful registration response resembles the following:

    New iSCSI node [tcp:[hw=,ip=,net_if=,iscsi_if=default] 169.254.0.2,3260,-1 iqn.2015-12.us.oracle.com:c6acda73-90b4-4bbb-9a75-faux09015418] added
  4. Configure iSCSI  to automatically connect to the authenticated block storage volumes after a reboot:

    iscsiadm -m node -T <volume IQN> -o update -n node.startup -v automatic

    Note: All command arguments are essential. Success returns no response.

  5. Skip this step if CHAP is not enabled. If you enabled CHAP when you attached the volume, authenticate the iSCSI connection by providing the volume's CHAP credentials as follows:

    iscsiadm -m node -T <volume IQN> -p <iSCSI IP address>:<iSCSI port> -o update -n node.session.auth.authmethod -v CHAP
    iscsiadm -m node -T <volume IQN> -p <iSCSI IP address>:<iSCSI port> -o update -n node.session.auth.username -v <CHAP user name>
    iscsiadm -m node -T <volume's IQN> -p <iSCSI IP address>:<iSCSI port> -o update -n node.session.auth.password -v <CHAP password>

    Success returns no response.

  6. Log in to iSCSI:

    iscsiadm -m node -T <volume's IQN> -p <iSCSI IP Address>:<iSCSI port> -l

    A successful login response resembles the following:

    Logging in to [iface: default, target: iqn.2015-12.us.oracle.com:c6acda73-90b4-4bbb-9a75-faux09015418, portal: 169.254.0.2,3260] (multiple)
    Login to [iface: default, target: iqn.2015-12.us.oracle.com:c6acda73-90b4-4bbb-9a75-faux09015418, portal: 169.254.0.2,3260] successful.
  7. You can now format (if needed) and mount the volume. To get a list of mountable iSCSI devices on the instance, run the following command:

    fdisk -l

    The connected volume listing resembles the following:

    Disk /dev/sdb: 274.9 GB, 274877906944 bytes, 536870912 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
Tip

If you have multiple volumes that do not have CHAP enabled, you can log in to them all at once by using the following commands:

iscsiadm -m discovery -t sendtargets -p <iSCSI IP address>:<iSCSI port>
iscsiadm -m node –l
iscsiadm -m node –l
Connecting to a Volume on a Windows Instance
Caution

When connecting to a Windows boot volume as a data volume from a second instance, you need to append -IsMultipathEnabled $True to the Connect-IscsiTarget command. See Attaching a Windows boot volume as a data volume to another instance fails for more information.
  1. Use the Console to obtain the iSCSI data you need to connect the volume:

    1. Log on to Oracle Cloud Infrastructure.
    2. Open the navigation menu. Under Core Infrastructure, go to Compute and click Instances.
    3. Click your instance's name to display the instance details.
    4. In the Resources section on the Instance Details page, click Attached Block Volumes to view the attached block volume.
    5. Click the Actions icon (three dots) next to the volume you're interested in, and then click iSCSI Commands and Information.

      The iSCSI Commands and Information dialog box displays your volume’s IP address and port, which you’ll need to know later in this procedure.

  2. Log in to your instance using a Remote Desktop client.
  3. On your Windows instance, open the iSCSI Initiator. The steps to open the iSCSI Initiator may vary depending on the version of Windows.

    For example: Open Server Manager, click Tools, and then select iSCSI Initiator.

  4. In the iSCSI Initiator Properties dialog box, click the Discovery tab, and then click Discover Portal.
  5. Enter the block volume IP Address and Port, and then click OK.
  6. Click the Targets tab.
  7. Under Discovered targets, select the volume IQN.
  8. Click Connect.
  9. Make sure that the Add this connection to the list of favorite targets check box is selected, and then click OK.
  10. You can now format (if needed) and mount the volume. To view a list of mountable iSCSI devices on your instance, in Server Manager, click File and Storage Services, and then click Disks.

    The disk is displayed in the list.