coreos / fedora-coreos-tracker

Issue tracker for Fedora CoreOS
https://fedoraproject.org/coreos/
264 stars 59 forks source link

iscsi initiatorname is always the same #596

Closed kimausloos closed 1 year ago

kimausloos commented 4 years ago

Hi there,

When using fedora coreos we noticed the iscsi initiatorname in /etc/iscsi/initiatorname.iscsi was always the same. This is odd, since it should be unique. We had a look and couldn't really discover what process would generate this file, so we downloaded the raw image, mounted it and discovered it's value hardcoded, ie. the file is there in the raw.xz already. We downloaded an older release and it has a different value, but the file is also there.

Probably this is a leftover from installing the rpm iscsi-initiator-utils, since that one will generate the initiator when the file doesn't exist already:

$ rpm --scripts -q iscsi-initiator-utils
postinstall scriptlet (using /bin/sh):
/sbin/ldconfig
if [ $1 -eq 1 ] ; then
        # Initial installation
        systemctl --no-reload preset iscsi.service iscsi-onboot.service iscsi-shutdown.service iscsid.service iscsid.socket &>/dev/null || :
fi
if [ $1 -eq 1 ]; then
    if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
        echo "InitiatorName=`/usr/sbin/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi
    fi
    # enable socket activation and persistant session startup by default
    /bin/systemctl enable iscsi.service >/dev/null 2>&1 || :
    /bin/systemctl enable iscsi-onboot.service >/dev/null 2>&1 || :
    /bin/systemctl enable iscsid.socket >/dev/null 2>&1 || :crossed_fingers::skin-tone-3: 

We couldn't really find documentation stating what should be done, only an old PR from 2016 where there was a service to generate one: https://github.com/coreos/coreos-overlay/pull/1890/files#diff-648eea9d262e8cc17a7dc7048354fd8cR10

If this isn't a real issue, can you point me to the documentation on what to do to generate an unique one? We'd like to avoid logging in on all machines to generate one ;-)

Thanks!

rpm-ostree status:

State: idle
Deployments:
● pivot://quay.io/openshift/okd-content@sha256:8cf7e06dd4095f2cd54e13fdb6fd313abbeb6e03d568f17956d97433623093c2
              CustomOrigin: Managed by machine-config-operator
                 Timestamp: 2020-07-27T13:06:27Z
  ostree://fedora:fedora/x86_64/coreos/stable
                   Version: 32.20200629.3.0 (2020-07-10T17:58:03Z)
                    Commit: 6df95bdb2fe2d36e091d4d18e3844fa84ce4b80ea3bd0947db5d7a286ff41890
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
LorbusChris commented 4 years ago

This should be fixed in the iscsi v2.1.2 release by running an init service instead of hardcoding it into the rpm-ostree commit, see: https://github.com/open-iscsi/open-iscsi/pull/207

It will require this adaption of the RPM spec to include the init service unit file: https://src.fedoraproject.org/rpms/iscsi-initiator-utils/pull-request/8

kimausloos commented 4 years ago

Yup, that's basically the same service as the old coreos PR. Good catch!

Do you have an idea on the timeframe of the fix? Don't want to pressure you or anyone; just wondering if we should invest in a workaround if this takes some time or if this is a 'its automated, it will be fine tomorrow' kind of thing as I have no clue.

LorbusChris commented 4 years ago

Once that version lands in Fedora 32, it'll be included in the next composes and subsequent releases. Needs a bit of time to percolate through, but you could bug the RPM maintainers to do the first step rather sooner than later :)

lucab commented 4 years ago

This landed in upstream release https://github.com/open-iscsi/open-iscsi/releases/tag/2.1.2.

LorbusChris commented 4 years ago

PR for updating the downstream RPM is here: https://src.fedoraproject.org/rpms/iscsi-initiator-utils/pull-request/9

travier commented 1 year ago

Closing as this should be fixed now as the parent PR has been merged for a while. Feel free to re-open or file a new issue if that's not the case.