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:
CentOS 7 images released February 25, 2019 and later. Refer to the release notes for CentOS-7-2019.02.23-0.
Instances created from earlier versions of CentOS 7.x, CentOS Stream 8, and Oracle Linux
platform images, or any versions of 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
To update the iscsid service on Oracle 7 Linux instances, run the following command:
Copy
sudo yum update -y iscsi-initiator-utils
After running this command, the version of the iscsid service should be 6.2.0.874 or later.
To check the version, run the following command:
Copy
yum info iscsi-initiator-utils
This update does not require a system reboot and will not make any changes to the instances beyond configuring iscsid to restart automatically.
CentOS 7.x 🔗
Important
Do not directly edit the systemdiscsid.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.
To create an override file on CentOS 7 instances, run the following command:
Copy
sudo systemctl edit iscsid.service
Paste and save the following into the file:
Copy
[Service]
Restart=always
To reload systemd and restart the iscsid service, run the following commands:
Do not directly edit the systemdiscsid.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.
To create an override file on CentOS Stream 8 instances, run the following command:
Copy
sudo systemctl edit iscsid.service
Paste and save the following into the file:
Copy
[Service]
Restart=always
To reload systemd and restart the iscsid service, run the following commands:
Do not directly edit the systemdiscsid.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.
To create an override file on Ubuntu 18.04 and Ubuntu 20.04 instances, run the following command:
Copy
sudo systemctl edit iscsid.service
Paste and save the following into the file:
Copy
[Service]
Restart=
Restart=always
To reload systemd and restart the iscsid service, run the following commands: