When an nvme subsystem has all portals in connecting state and we try
to attach a new volume to that same subsystem it will fail.
We can reproduce it with LVM+nvmet if we configure it to share targets
and then:
- Create instance
- Attach 2 volumes
- Delete instance (this leaves the subsystem in connecting state [1])
- Create instance
- Attach volume <== FAILS
The problem comes from the '_connect_target' method that ignores
subsystems in 'connecting' state, so if they are all in that state it
considers it equivalent to all portals being inaccessible.
This patch changes this behavior and if we cannot connect to a target
but we have portals in 'connecting' state we wait for the next retry of
the nvme linux driver. Specifically we wait 10 more seconds that the
interval between retries.
Reviewed: https:/ /review. opendev. org/c/openstack /os-brick/ +/895193 /opendev. org/openstack/ os-brick/ commit/ ec22c32de682018 4d7737c5af70e57 3c0634cd38
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit ec22c32de682018 4d7737c5af70e57 3c0634cd38
Author: Gorka Eguileor <email address hidden>
Date: Thu Sep 14 12:19:26 2023 +0200
NVMe-oF: Fix attach when reconnecting
When an nvme subsystem has all portals in connecting state and we try
to attach a new volume to that same subsystem it will fail.
We can reproduce it with LVM+nvmet if we configure it to share targets
and then:
- Create instance
- Attach 2 volumes
- Delete instance (this leaves the subsystem in connecting state [1])
- Create instance
- Attach volume <== FAILS
The problem comes from the '_connect_target' method that ignores
subsystems in 'connecting' state, so if they are all in that state it
considers it equivalent to all portals being inaccessible.
This patch changes this behavior and if we cannot connect to a target
but we have portals in 'connecting' state we wait for the next retry of
the nvme linux driver. Specifically we wait 10 more seconds that the
interval between retries.
[1]: https:/ /bugs.launchpad .net/nova/ +bug/2035375
Closes-Bug: #2035695 7f2dcb160c20ad0 d75480a1f48
Change-Id: Ife710f52c339d6