Oracle Cloud Infrastructure Documentation

oci-iscsi-config

Description

Lists and configures iSCSI devices attached to a compute instance running in the Oracle Cloud Infrastructure. When run without any command line options, oci-iscsi-config lists devices that need attention.

Usage

oci-iscsi-config [-i|--interactive] [-s|--show] [-a | --attach IQN ]

[-d IQN | --detach IQN ] [--username username] [--password password]

[--help] oci-iscsi-config [-s|--show] [-c | --create-volume size]

[--volume-name name] [--destroy-volume OCID ]

Options

-i | --interactive

Run in interactive mode. This option displays devices that need attention and offers to attach and configure them. Requires root privileges.

-s | --show

List all devices. If ocid is not running then root privileges are required.

-a | --attach target

Attempt to attach the device with the given IQN (a unique ID assigned to a device) or OCID. When using an IQN, the volume must already be attached (assigned) to the instance in the OCI Console. The OCI Python SDK is required for selecting volumes using their OCID. This option can be used multiple times to attach multiple devices at the same time. Requires root privileges.

-d | --detach device

Detach the device with the given IQN (a unique ID assigned to a device). If the volume (or any partition of the volume) is mounted, this option will attempt to unmount it first. This option can be used multiple times to detach multiple devices at the same time. Requires root privileges.

-c | --create-volume size

Create a new volume of SIZE gigabytes and attach it to the current instance. This option requires the OCI Python SDK to be installed and configured.

--destroy-volume OCID

Destroy the block storage volume with the given OCID. The volume must not be attached to any instances.

Warning

This action is irreversible.

--volume-name name

Set the display name for the volume. This is used with the --create-volume option.

--username name

Use the specified user name as the CHAP user name when authentication is needed for attaching a device. Not needed when the OCI Python SDK is available.

--password password

Use the supplied password as the CHAP password when authentication is needed for attaching a device. This is not needed when the OCI Python SDK is available.

--help

Displays a summary of the command line options.

Examples

Displaying iSCSI configuration

The oci-iscsi-config utility works with the ocid daemon to monitor device creation and deletion through the command line, console, or SDK and automatically discover those changes. You can use the --show option to display a list of all of the devices attached to an instance:

# oci-iscsi-config -s
For full functionality of this utility the ocid service must be running
The administrator can start it using this command:
sudo systemctl start ocid.service
ocid already running.
Currently attached iSCSI devices:

Target iqn.2015-02.oracle.boot:uefi
Persistent portal:    169.254.0.2:3260
Current portal:    169.254.0.2:3260
State:    running
Attached device:    sda
Size:    46.6G
Partitions:    Device    Size  Filesystem   Mountpoint
sda1      544M        vfat   /boot/efi
sda2        8G        swap   [SWAP]
sda3       38G         xfs   /

The following example shows the output of the --show option after adding a 50GB block volume using the OCI console:

# oci-iscsi-config --show
Currently attached iSCSI devices:

Target iqn.2015-12.com.oracleiaas:abcdefghijklmnopqrstuvwxyz1234567890
Persistent portal:    169.254.2.2:3260
Current portal:    169.254.2.2:3260
State:    running
Attached device:    sdb
Size:    50G
File system type:    Unknown
Mountpoint:    Not mounted

Target iqn.2015-02.oracle.boot:uefi
Persistent portal:    169.254.0.2:3260
Current portal:    169.254.0.2:3260
State:    running
Attached device:    sda
Size:    46.6G
Partitions:    Device    Size  Filesystem   Mountpoint
sda1      544M        vfat   /boot/efi
sda2        8G        swap   [SWAP]
sda3       38G         xfs   /

Creating a volume

The following example shows how to create a volume:

# oci-iscsi-config --create-volume 50
For full functionality of this utility the ocid service must be running
The administrator can start it using this command:
sudo systemctl start ocid.service
Creating a new 50 GB volume
Volume abcdefghijklmnopqrstuvwxyz1234567890123456789012345678901234 created

Deleting a volume

The following example shows how to destroy a volume:

# oci-iscsi-config --destroy-volume ocid1.volume.oc1.phx.abcdefghijklmnopqrstuvwxyz1234567890123456789012345678901234