-
Notifications
You must be signed in to change notification settings - Fork 44
DLPX-73229 iSCSI initiator name should be unique on each engine #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[Unit] | ||
Description=One time IQN configuration for iscsid.service | ||
Before=open-iscsi.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of introducing a dependent service, could this have been done by adding an ExecStartPre
to the open-iscsi.service
unit via override?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that initially but that service doesn't run on first boot.
PATH=/bin | ||
|
||
EIDFILE="/etc/engine-uuid" | ||
BOSMGMT="/opt/delphix/server/bin/bos_mgmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds an implicit dependency on delphix-virtualization, which seems wrong given that delphix-virtualization depends on delphix-platform. Does this indicate that perhaps the UUID logic should live in delphix-platform rather than delphix-virtualization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. The unique-name-check
was designed to only run if an engine id is supplied.
Given that the IQN is now tied to the engine UUID, does it make sense to change to a delphix-iscsi-init
service and move it into dlpx-app-gate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we want to tie the IQN to the engine UUID, then that would make sense to me.
Have you considered putting this logic into cloud-init and have it tied to the instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I observed in cloud init, there isn't an instance-id when running on ESX
I could also decouple this from the engine-uuid and directly use something like dmidecode -s system-uuid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have added some code in cloud-init to the NoCloud DataSource (used by ESX) that checks for the system-uuid to determine if the "instance" has changed.
# | ||
# IBMcloud changes the system-uuid whenever the engine is | ||
# power-cycled but preserves the chassis-asset-tag-uuid. For that | ||
# cloud we use that property to obtain a UUID. | ||
# | ||
if [[ "$(dmidecode -s chassis-asset-tag)" == "ibmcloud" ]]; then | ||
DMI_KEYWORD="baseboard-asset-tag" | ||
fi | ||
|
||
system_uuid=$(dmidecode -s $DMI_KEYWORD | awk '{print tolower($0)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like this bit of code could live in its own script delivered by delphix-platform. Then, the duplicate code in dlpx-app-gate (from where this was copied) could be removed and replaced with an invocation of this script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. I'll add the script and then file a JIRA to track moving app-gate to switch over.
Problem:
On Ubuntu, the Initiator IQN is generated when the
open-iscsi
package is installed. However, we want a unique IQN name to be generated on first boot. We also want the name generation to not be dependent on performing any iSCSI initiator setup (e.g. the unique IQN should be ready before discovery phase).Solution:
Added a new service,
iscsi-name-init.service
, that runs at boot time to generate a unique IQN. This service runs a new script,unique-name-check
, that will generate a unique initiator IQN.This new service is based on the Fedora, First-time Service Setup model.
Testing
ab-pre-push:
http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/appliance-build-orchestrator-pre-push/5270/
pre_checkin:
http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/91842/consoleFull
Manual testing to confirmed that:
Here is expected log output for the new service
Implementation:
Note that the
open-iscsi
service andiscsid
service don't run until iSCSI is configured (i.e. a target is discovered), so we can't use them to run ourunique-name-check
script.The initiator IQN is based on the unique engine UUID. This engine UUID is unique after first boot and after an existing engine is cloned.
An example IQN looks like:
iqn.2008-07.com.delphix:564d7744-7deb-3c35-9882-fb2fd4d01a63
NOTE: since the
/etc/engine-UUID
file is written during the startup ofdelphix-mgmt
service and theiscsi-name-init
service occurs earlier, we use thebos_mgmt
get_system_uuid
command to obtain the engine id sooner.