Subscriptions for temporary systems

Latest response

We perform automated package install testing for our product on RHEL. As our packages prereq a number of other packages, we have to subscribe the temporary tests systems (we use docker), run the installation tests, then unsubscribe.

subscription-manager register --username={XXX} --password={YYY} --force --name=tmp-{rhel-version}-packagetest --auto-attach
We then unregister at the end of the test with:
subscription-manager unregister

We recently discovered over 100 of these subscriptions lying around - I'm guessing because of some infrastructure failures that caused the 'unregister' not to happen.

I had hoped that the --name and --force options would make the subscription manager overwrite/replace an existing subscription with the same name, but that does not seem to be the case.

Can anyone suggest how to make the subscription manager overwrite an existing 'named' subscription, make subscriptions that auto-self delete after 1 hour (the tests only take a few minutes), or some other way in which our docker containers can register, install some packages, but then definitely not hang around once the container has been deleted?

Responses

Hi Martin,

Names are not the key that Red Hat uses, it is the UUID of the docker instance.

You need to do a subscriptìon-manager unregister before destroying the container.

Regards,

Jan Gerrit

Hi Martin,

In addition to what Jan Gerrit told you : You can delete destroyed (container) systems manually on the Customer portal
as well - just go to https://access.redhat.com/management/systems ... there you can remove already deleted systems. :)

Regards,
Christian

Hello both, thanks for the replies. Unfortunately neither of them really answer my question.

We do try to unregister every time, but on the occasions something goes wrong and the container is deleted before we can unregister, we are left with the 'dangling' subscription, and that's the scenario I'm trying to address here.

We can (and have) manually deleted these, and them all having a similar name made it fairly simple to do through the web UI (enter a filter to just show up these automated subscriptions, then delete all), but this is an automated test system, and I would really like not to have to do anything manual at all.

Hi Martin,

You ask a group of customers, we can only share what we know.

Maybe there is an API for the Customer Portal, that you could use to cleanup the subs.

You should open a support case for that: support

Regards,

Jan Gerrit

Hi Martin,

Jan Gerrit is right ... might be a good idea to check with the Red Hat engineers via support ticket, as this is a rare scenario. :)

Regards,
Christian

Awesome - many thanks for your time! I'll give that a go!

You're welcome, Martin ! I wish you good luck. :)

Regards,
Christian