-
Notifications
You must be signed in to change notification settings - Fork 6
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
The role fails if the iSCSI client has a session opened with another iSCSI target #8
Comments
Hi @jesusserranost, and thank you for very detailed description of the issue! Looking into code the first obvious problem is that I can see is that next task depends on previous one failing to work in some situations - the However the above is "not a great solution(tm)" and I will be looking into this further when there is time. At present the role really just assumes that all sessions will be related to server towards which you are trying to discover and login. The multiple iscsi targets use case was not considered when this role was made in past and code reflects that - there is no checking that target name is for the target you are trying to get into, so if there is other target with same target name it will just assume that is okay - which is wrong. It will take me some time to figure out how to address this situation, but at least I have a good example use case from you on which I can test. Will keep you updated on progress once there is some. |
tl;dr;
When running the role against an iSCSI client which is already connected to a different target than we want to connect now, it fails consistently unless you log out from the session with the other iSCSI target.
Long version:
When there is an already configured cluster with shared storage coming from an iSCSI
targeta
and you want to re-run the role in order to present a new shared storage from another iSCSItargetb
, the role fails with the following (verbose) error message:I think the error comes from this line - shouldn't the role rather evaluate the output (because the
grep
uses-c
) rather than the return code?:ansible.iscsiadm/tasks/connect_to_target.yml
Line 24 in 5687c77
Taking
node1
as example, we can see that there is a session opened but with another target (targeta
) different than the one we want to define now (targetb
), yet the output of the command returns1
:If I manually logout from that session on
node1
and re-run the playbook, it works and the task only fails for the other node (where there is still a session opened with a different iSCSI targettargeta
):The (non-verbose) output this time after re-running the role is the following:
And we can confirm that the
node1
is now logged intotargetb
(because of this role) and not totargeta
(because we manually logged out from that):The text was updated successfully, but these errors were encountered: