Bug 2246456

Summary: Ceph preflight fails due to "not a valid repository ID" errors for ceph 6.0
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Mohammad <mahmad>
Component: Ceph-AnsibleAssignee: Teoman ONAY <tonay>
Status: CLOSED DUPLICATE QA Contact: Manisha Saini <msaini>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0CC: ceph-eng-bugs, cephqe-warriors, gmeno
Target Milestone: ---   
Target Release: 7.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-27 12:27:10 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 Mohammad 2023-10-27 01:44:30 UTC
Description of problem:
Ceph preflight for ceph6 fails with two problems:
1- Trying to disable repositories that don't exist (at least from my experience)
2- Tries to enable rhceph-7-tools-for-rhel-9-x86_64-rpms instead of rhceph-6-tools-for-rhel-9-x86_64-rpms, for a ceph 6.0 installation

Version-Release number of selected component (if applicable):

$ rpm -qa |grep  ansible
ansible-core-2.14.2-5.el9_2.x86_64
ansible-collection-community-general-4.0.0-1.1.el9ost.noarch
ansible-collection-ansible-posix-1.2.0-1.3.el9ost.noarch
cephadm-ansible-3.0.0-1.el9cp.noarch

$ sudo subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/appstream/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/baseos/os
Enabled:   1

Repo ID:   rhceph-6-tools-for-rhel-9-x86_64-rpms
Repo Name: Red Hat Ceph Storage Tools 6 for RHEL 9 x86_64 (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/layered/rhel9/x86_64/rhceph-tools/6/os
Enabled:   1

How reproducible:
Attempt ceph ansible preflight for ceph 6.0 on RHEL 9.2 host

Steps to Reproduce:
1. Enable repos above, install ceph-ansible, setup inventory and ensure all hosts are reachable
2. Run preflight with option:
cd /usr/share/cephadm-ansible
ansible-playbook  cephadm-preflight.yml --extra-vars "ceph_origin=rhcs"


Actual results:

TASK [disable older rhceph repositories if any] ********************************************************************************************************************
Thursday 26 October 2023  16:52:08 -0400 (0:01:01.545)       0:01:03.349 ****** 
fatal: [ceph-02]: FAILED! => changed=false 
  msg: rhceph-4-osd-for-rhel-9-x86_64-rpms is not a valid repository ID
  results:
  - rhceph-4-osd-for-rhel-9-x86_64-rpms is not a valid repository ID
fatal: [ceph-03]: FAILED! => changed=false 
  msg: rhceph-4-mon-for-rhel-9-x86_64-rpms is not a valid repository ID
  results:
  - rhceph-4-mon-for-rhel-9-x86_64-rpms is not a valid repository ID
fatal: [ceph-01]: FAILED! => changed=false 
  msg: rhceph-4-mon-for-rhel-9-x86_64-rpms is not a valid repository ID
  results:
  - rhceph-4-mon-for-rhel-9-x86_64-rpms is not a valid repository ID
fatal: [cephadmin]: FAILED! => changed=false 
  msg: rhceph-4-mon-for-rhel-9-x86_64-rpms is not a valid repository ID
  results:
  - rhceph-4-mon-for-rhel-9-x86_64-rpms is not a valid repository ID


Expected results:

Installation complete.

Additional info:

I can work around this by:

1- Commenting out the problematic repositories:

# cat ./cephadm-preflight.yml |grep -A 4 repos_to_disable
    repos_to_disable:
#      - rhceph-4-tools-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
#      - rhceph-4-mon-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
#      - rhceph-4-osd-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
      - rhceph-5-tools-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
--

2- I need to change ceph_rhcs_version from 7 to 6:

# cat ceph_defaults/defaults/main.yml |grep ceph_rhcs_version
ceph_rhcs_version: 6 # By default it seems to be 7

Comment 1 Teoman ONAY 2023-10-27 12:27:10 UTC

*** This bug has been marked as a duplicate of bug 2244978 ***