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:

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