Bug 2151043 - subscription-manager command doesn't work on a Controller node running cinder-volume container
Summary: subscription-manager command doesn't work on a Controller node running cinder...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 17.1 (Wallaby)
Hardware: All
OS: Linux
high
high
Target Milestone: beta
: 17.1
Assignee: Takashi Kajinami
QA Contact: Joe H. Rahme
URL:
Whiteboard:
: 2325431 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-06 00:28 UTC by Takashi Kajinami
Modified: 2024-12-06 12:04 UTC (History)
7 users (show)

Fixed In Version: openstack-tripleo-heat-templates-14.3.1-1.20230224221431.eef23eb.el9ost
Doc Type: Bug Fix
Doc Text:
Before this update, the `openstack-cinder-volume-0` container, which is created by the Pacemaker bundle resource for the Block Storage service (cinder), mounted `/run` from the host. This mount path created the `.containerenv` file in the directory. When the `.containerenv` file exists, `subscription-manager` fails because it evaluates that the command is executed inside a container. With this update, the mount path is updated so that Podman disables the creation of the `.containerenv` file, and `subscription-manager` executes successfully in a host that is running the `openstack-cinder-volume-0` container.
Clone Of: 2138759
Environment:
Last Closed: 2023-08-16 01:12:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1995237 0 None None None 2022-12-06 00:30:29 UTC
OpenStack gerrit 863024 0 None MERGED Fix trailing slashes in bind-mounts and linting 2022-12-06 00:30:29 UTC
Red Hat Issue Tracker OSP-20708 0 None None None 2022-12-06 00:37:56 UTC
Red Hat Product Errata RHEA-2023:4577 0 None None None 2023-08-16 01:13:40 UTC

Description Takashi Kajinami 2022-12-06 00:28:53 UTC
+++ This bug was initially created as a clone of Bug #2138759 +++

Description of problem:

subscription-manager command doesn't work on a Controller node running openstack-cinder-volume-podman-X container.
~~~
[root@overcloud-controller-1 ~]# podman ps |grep cinder-volume
e7c8cee2afde  undercloud.ctlplane.yatanaka.example.com:8787/rhosp-rhel9/openstack-cinder-volume:pcmklatest  /bin/bash /usr/lo...  26 minutes ago  Up 26 minutes ago                    openstack-cinder-volume-podman-0

[root@overcloud-controller-1 ~]# subscription-manager list 
subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.
~~~

The reason subscription-manager doesn't work is existence of /run/.containerenv .
~~~
[root@overcloud-controller-1 ~]# file /run/.containerenv 
/run/.containerenv: empty
~~~

There was a similar discussion in the past, and the following change was merged in order to prevent creating /run/.containerenv if '/run' is bind-mounted into containers.
  - https://github.com/containers/podman/issues/14577
  - https://github.com/gbraad/podman/commit/3d4e9d73d25edc3287263e80ab379f7e3d10e799#diff-3c7c02f50259200df7913b0f622513cd28e3a9488796f89ad2dc7afbb9743663

However, only openstack-cinder-volume-podman-X container bind-mounts '/run/', not '/run'.
That's why /run/.containerenv is created only on a Controller node running openstack-cinder-volume-podman-X container, and subscription-manager command doesn't work.
~~~
[root@overcloud-controller-1 ~]# podman inspect openstack-cinder-volume-podman-0|less
 
  :
 
                {
                    "Type": "bind",
                    "Source": "/run",
                    "Destination": "/run/", <=====================(*)
                    "Driver": "",
                    "Mode": "",
                    "Options": [
                         "nosuid",
                         "nodev",
                         "rbind"
                    ],
                    "RW": true,
                    "Propagation": "rprivate"
               },
 
  :
~~~

This issue has been resolved on master branch by the following change:
  - https://github.com/openstack/tripleo-heat-templates/commit/d0ca9fe631cbdeb9e8857b4e64ad81f2260c7dae#

But it has not backported into Wallaby yet.
  - https://github.com/openstack/tripleo-heat-templates/blob/stable/wallaby/deployment/cinder/cinder-common-container-puppet.yaml#L361



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


How reproducible:

Steps to Reproduce:
1. Deploy overcloud
2. Check on which node cinder-volume is running
3. Run subscription-manager command on the node running cinder-volume


Actual results:
subscription-manager command fails with the following message
  'subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.'

Expected results:
subscription-manager command works

Comment 3 David Rosenfeld 2023-05-05 12:41:32 UTC
Subscription manager does execute on controller node running cinder-volume container:

[tripleo-admin@controller-2 ~]$ sudo podman ps |grep cinder-volume
bec7604add34  cluster.common.tag/cinder-volume:pcmklatest                                                                                     /bin/bash /usr/lo...  16 hours ago  Up 16 hours                        openstack-cinder-volume-podman-0
[tripleo-admin@controller-2 ~]$ sudo subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        9.2 Beta
Arch:           x86_64
Status:         Unknown
Status Details: 
Starts:         
Ends:           

Product Name:   Red Hat Enterprise Linux High Availability Beta
Product ID:     487
Version:        9.2 Beta
Arch:           x86_64
Status:         Unknown
Status Details: 
Starts:         
Ends:           

[tripleo-admin@controller-2 ~]$

Comment 13 errata-xmlrpc 2023-08-16 01:12:55 UTC
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 (Release of components for Red Hat OpenStack Platform 17.1 (Wallaby)), 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/RHEA-2023:4577

Comment 14 Jesse Pretorius 2024-12-06 12:04:24 UTC
*** Bug 2325431 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.