Oracle Cloud Infrastructure Documentation

Updating the Linux iSCSI Service to Restart Automatically

Oracle Cloud Infrastructure supports iSCSI attached remote boot and block volumes to Compute instances. These iSCSI attached volumes are managed by the Linux iSCSI initiator service, iscsid . In scenarios where this service is stopped for any reason, such as the service crashes or a system administrator inadvertently stops the service, it's important that this service is automatically restarted immediately.

The following platform images distributed by Oracle Cloud Infrastructure are configured so that the iscsid service restarts automatically:

Instances created from earlier versions of CentOS 7.x and Oracle Linux platform images, or any versions of Oracle Cloud Infrastructure CentOS 6.x and Ubuntu platform images do not have this configuration. You should update these existing instances and custom images created from these images so that the iscsid service restarts automatically. You should also check this configuration on your imported paravirtualized custom images and any instances launched from these images and update the configuration as needed.

This topic describes how to update the iscsid service on an instance so that it will restart automatically.

Note

Configuring an instance to automatically restart the iscsid service does not require a reboot and will increase the stability of your infrastructure.

Oracle Linux 7

Run the following command to update the iscsid service on your Oracle 7 Linux instances:

sudo yum update -y iscsi-initiator-utils

After running this command, the version of the iscsid service should be 6.2.0.874 or newer.

Run the following command to check the version:

yum info iscsi-initiator-utils

This update does not require a system reboot and will not make any changes to your instances beyond configuring iscsid to restart automatically.

Oracle Linux 6

Run the following command to update the iscsid service on your Oracle 6 Linux instances:

sudo yum update -y iscsi-initiator-utils

After running this command, the version of the iscsid service should be 6.2.0.873 or newer.

Run the following command to check the version:

yum info iscsi-initiator-utils

This update does not require a system reboot and will not make any changes to your instances beyond configuring iscsid to restart automatically.

CentOS 7.x

Important

Do not directly edit the systemd iscsid.service file. You should instead create an override to ensure that the restart option isn't overwritten the next time the iscsid service is updated.

On your CentOS 7 instances run the following command to create an override file:

sudo systemctl edit iscsid.service

Paste and save the following into the file:

[Service]
Restart=always

Run the following commands to reload systemd and restart the iscsid service:

sudo systemctl daemon-reload
sudo systemctl restart iscsid

CentOS 6.x

On your CentOS 6 instances run the following command to install the monit package:

sudo yum install monit

Create the /etc/monit/conf.d/iscsid.conf file and include the following commands:

check process iscid with pidfile /run/iscsid.pid
start program = "/etc/init.d/open-iscsi start" with timeout 60 seconds
stop program = "/etc/init.d/open-iscsi stop"

Run the following command to start the monit service:

/etc/init.d/monit start

Ubuntu 18

Important

Do not directly edit the systemd iscsid.service file, instead create an override to ensure that the restart option isn't overwritten the next time the iscsid service is updated.

On your Ubuntu 18 instances run the following command to create an override file:

sudo systemctl edit iscsid.service

Paste and save the following into the file:

[Service]
Restart=
Restart=always

Run the following commands to reload systemd and restart the iscsid service:

sudo systemctl daemon-reload
sudo systemctl restart iscsid

Ubuntu 16

Important

Do not directly edit the systemd iscsid.service file, instead create an override to ensure that the restart option isn't overwritten the next time the iscsid service is updated.

On your Ubuntu 16 instances run the following command to create an override file:

sudo systemctl edit iscsid.service

Paste and save the following into the file:

[Service]
Restart=
Restart=always

Run the following commands to reload systemd and restart the iscsid service:

sudo systemctl daemon-reload
sudo systemctl restart iscsid

Ubuntu 14

On your Ubuntu 14 instances run the following command to install the monit package:

sudo apt-get install monit

Create the /etc/monit/conf.d/iscsid.conf file and include the following commands:

check process iscid with pidfile /run/iscsid.pid
start program = "/etc/init.d/open-iscsi start" with timeout 60 seconds
stop program = "/etc/init.d/open-iscsi stop"

Run the following command to start the monit service:

/etc/init.d/monit start

Testing the iscsid Service Update

Perform these steps to verify that the iscsid service has been updated successfully, and that it restarts automatically.

Warning

Do not perform these steps on a production instance. If the iscsid service fails to restart the instance may become unresponsive.

  1. Run the following command to confirm that the iscsid service is running:

    ps -ef | grep iscsid
  2. Run the following command to stop the iscsid service:

    sudo pkill -9 iscsid
  3. Wait 60 seconds and then run the following command to verify that the iscsid service has restarted:

    ps -ef | grep iscsid