Bug 1979449
| Summary: | iSCSI: Getting the error "The first gateway defined must be the local machine" while adding gateways | ||
|---|---|---|---|
| Product: | [Red Hat Storage] Red Hat Ceph Storage | Reporter: | Gopi <gpatta> |
| Component: | Cephadm | Assignee: | Sebastian Wagner <sewagner> |
| Status: | CLOSED ERRATA | QA Contact: | Gopi <gpatta> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 5.0 | CC: | adking, bniver, ceph-eng-bugs, ceph-qe-bugs, dsavinea, idryomov, mmurthy, sewagner, sostapov, tserlin, vereddy, xiubli |
| Target Milestone: | --- | Keywords: | Regression |
| Target Release: | 5.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | ceph-16.2.0-108.el8cp | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-08-30 08:31:32 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Gopi
2021-07-06 05:43:54 UTC
I have tried same scenario on VMs which were deployed from ceph-ci and facing same issue. [root@ceph-tier0-amar-1625543163452-node5-osd-mds ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ac00780dae18 registry-proxy.engineering.redhat.com/rh-osbs/rhceph@sha256:3a6c7a67b12fdf6df99754409983f580ed6436a6feb9f0af9b74bfb75cd2810e -n mds.cephfs.cep... 2 hours ago Up 2 hours ago ceph-89ba48ec-de10-11eb-911d-fa163e74e674-mds.cephfs.ceph-tier0-amar-1625543163452-node5-osd-mds.ntpofh 69a09a2264c9 registry-proxy.engineering.redhat.com/rh-osbs/rhceph@sha256:3a6c7a67b12fdf6df99754409983f580ed6436a6feb9f0af9b74bfb75cd2810e 25 seconds ago Up 25 seconds ago ceph-89ba48ec-de10-11eb-911d-fa163e74e674-iscsi.iscsi.ceph-tier0-amar-1625543163452-node5-osd-mds.uynepq-tcmu 1e39e69b4d32 registry-proxy.engineering.redhat.com/rh-osbs/rhceph@sha256:3a6c7a67b12fdf6df99754409983f580ed6436a6feb9f0af9b74bfb75cd2810e 25 seconds ago Up 25 seconds ago ceph-89ba48ec-de10-11eb-911d-fa163e74e674-iscsi.iscsi.ceph-tier0-amar-1625543163452-node5-osd-mds.uynepq [root@ceph-tier0-amar-1625543163452-node5-osd-mds ~]# podman exec -it 69a09a2264c9 sh sh-4.4# gwcli Warning: Could not load preferences file /root/.gwcli/prefs.bin. /> cd iscsi-targets /iscsi-targets> create iqn.2003-01.com.redhat.iscsi-gw:ceph-igw ok /iscsi-targets> goto gateways /iscsi-target...-igw/gateways> create ceph-tier0-amar-1625543163452-node5-osd-mds 10.0.209.135 The first gateway defined must be the local machine /iscsi-target...-igw/gateways> ls o- gateways .................................................................................................. [Up: 0/0, Portals: 0] /iscsi-target...-igw/gateways> This is a regression as this worked in previous builds. Hi Brett, we are not creating/changing them and we are getting after deploy from cephadm tool and we filed a bz for it https://bugzilla.redhat.com/show_bug.cgi?id=1979445. This was working in the previous builds. Maybe someone from cephadm team can look into the /etc/hosts issue https://bugzilla.redhat.com/show_bug.cgi?id=1958236 ? This sounds like an FQDN issue to me. ceph-iscsi uses the FQDN to verify the host name matches. Particularly, ceph-iscsi runs: > python -c 'import socket; print(socket.getfqdn())' to verify the host name. If this returns an FQDN, you also have to insert the gateway as an FQDN. See Ricardo's answer here: https://www.spinics.net/lists/ceph-users/msg61572.html Ilya, It's unfortunately not that simply. Passing --no-hosts will make it impossible for users to use the /etc/hosts to do internal name resolution, thus we had to remove that argument it again. In addition, there are a number of subtle and non-trivial differences between docker vs podman, FQDNs vs bare names, $(hostname) vs python -c 'socket.getfqdn()' and there is unfortunately no easy solution. Maybe https://github.com/ceph/ceph/pull/42242 is a possible mitigation. We're going to discuss this in today's cephadm standup. Hi Xiubo, Any updates on this bug as we are blocked with iscsi testing? Can we continue with non-tcmu container by modifying /etc/hosts file in case we don't see any further issues with it? Thanks, Gopi Yes, please move this to POST Working as expected. So moving this bug to verified state.
sh-4.4# cat /etc/hosts
10.8.128.83 magna083 magna083
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.1.1 magna083 magna083 ceph-f9faa6b2-ee9e-11eb-9821-002590fc2536-iscsi-iscsi-magna083-zainbl-tcmu
sh-4.4# gwcli
Warning: Could not load preferences file /root/.gwcli/prefs.bin.
/> cd iscsi-targets
/iscsi-targets> create iqn.2003-01.com.redhat.iscsi-gw:ceph-igw
ok
/iscsi-targets> goto gateways
/iscsi-target...-igw/gateways> create magna083 10.8.128.83
Adding gateway, sync'ing 0 disk(s) and 0 client(s)
ok
/iscsi-target...-igw/gateways> delete confirm=true gateway_name=magna083
Deleting gateway, magna083
/iscsi-target...-igw/gateways> ls
o- gateways .................................................................................................. [Up: 0/0, Portals: 0]
/iscsi-target...-igw/gateways> create magna083.ceph.redhat.com 10.8.128.83
The first gateway defined must be the local machine
/iscsi-target...-igw/gateways> create ceph-f9faa6b2-ee9e-11eb-9821-002590fc2536-iscsi-iscsi-magna083-zainbl-tcmu 10.8.128.83
The first gateway defined must be the local machine
/iscsi-target...-igw/gateways> create magna083 10.8.128.83
Adding gateway, sync'ing 0 disk(s) and 0 client(s)
ok
/iscsi-target...-igw/gateways> create magna084 10.8.128.84
Adding gateway, sync'ing 0 disk(s) and 0 client(s)
ok
/iscsi-target...-igw/gateways> ls
o- gateways .................................................................................................. [Up: 2/2, Portals: 2]
o- magna083 ................................................................................................... [10.8.128.83 (UP)]
o- magna084 ................................................................................................... [10.8.128.84 (UP)]
/iscsi-target...-igw/gateways> cd /disks
/disks> create iscsi_pool image=iscsi_image size=50g
ok
/disks> goto hosts
/iscsi-target...eph-igw/hosts> create iqn.1994-05.com.redhat:rh7-client
ok
/iscsi-target...at:rh7-client> disk add iscsi_pool/iscsi_image
ok
/iscsi-target...at:rh7-client> cd
/iscsi-targets> ls
o- iscsi-targets ................................................................................. [DiscoveryAuth: None, Targets: 1]
o- iqn.2003-01.com.redhat.iscsi-gw:ceph-igw ............................................................ [Auth: None, Gateways: 2]
o- disks ............................................................................................................ [Disks: 1]
| o- iscsi_pool/iscsi_image .......................................................................... [Owner: magna083, Lun: 0]
o- gateways .............................................................................................. [Up: 2/2, Portals: 2]
| o- magna083 ............................................................................................... [10.8.128.83 (UP)]
| o- magna084 ............................................................................................... [10.8.128.84 (UP)]
o- host-groups .................................................................................................... [Groups : 0]
o- hosts ......................................................................................... [Auth: ACL_ENABLED, Hosts: 1]
o- iqn.1994-05.com.redhat:rh7-client ............................................................. [Auth: None, Disks: 1(50G)]
o- lun 0 .................................................................... [iscsi_pool/iscsi_image(50G), Owner: magna083]
/iscsi-targets>
Tested with non-tcmu container and working fine with that as well.
[root@magna083 ubuntu]# podman exec -it 728acb34e85d sh
sh-4.4# gwcli
Warning: Could not load preferences file /root/.gwcli/prefs.bin.
/> cd iscsi-targets
/iscsi-targets> create target_iqn=iqn.2003-01.com.redhat.iscsi-gw:ceph-igw
ok
/iscsi-targets> goto gateways
/iscsi-target...-igw/gateways> create magna083 10.8.128.83
Adding gateway, sync'ing 0 disk(s) and 0 client(s)
ok
/iscsi-target...-igw/gateways> create magna084 10.8.128.84
Adding gateway, sync'ing 0 disk(s) and 0 client(s)
ok
/iscsi-target...-igw/gateways> ls
o- gateways .................................................................................................. [Up: 2/2, Portals: 2]
o- magna083 ................................................................................................... [10.8.128.83 (UP)]
o- magna084 ................................................................................................... [10.8.128.84 (UP)]
/iscsi-target...-igw/gateways>
*** Bug 1980808 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat Ceph Storage 5.0 bug fix and enhancement), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:3294 |