RedHat VDC Subscription, virt-who and katello 3.14

Hello,
this is my status quo:
We have RedHat Virtual Datacenter Subscriptions and a virt-who instance running, which reports our ESXi hosts to RedHat Network. In RedHat Network all of the available VDC Subscriptions are in use (so far so good). RedHat VMs running on those hosts can successfully subscribe to RHN and receive updates.

Now I want to manage my VDC Subscriptions with my local katello installation so I was trying to create a Subscription Allocation in RHN and attach Subscriptions to it which does not work for my VDC subscriptions since they are all in use already.

So my question is, how do I realize that my RedHat VMs can subscribe to my local katello and receive a valid VDC subscription and how do I integrate my existing virt-who instance ?
As far as I can see right now, one option is to release the VDC subscriptions from my ESXi hosts so I can use them in my Subscription Allocation so that I can export the manifest and import it to katello. Where do I go from there?

Thank you in advance!

Hi,

afaik, you definitely have to release the VDC subscriptions in RHN first.
After you built your manifest and imported it in Katello, you have to update your virt-who config. The default config is at /etc/virt-who.conf and and additional config files can be placed under /etc/virt-who.d (see also man virt-who and man virt-who-config for more info).
As a sample config you can use this “template” (derived from our current production config):

[vcenter.example.com]
type=esx
server=vcenter.example.com
username=vcenter-username
encrypted_password=passwordhash-from-virtwho-password
owner=foreman_organization
env=ENV
hypervisor_id=hostname

The values for owner and env fields can be acquired by running subscription-manager identity on the host running virt-who. owner is the value of “org ID” from the output and env is the value of “environment name”.
This is assuming the system running virt-who is in the same organization that the hypervisors should be registered to. If you want to add the hypervisors to a different organization, you have to set the owner field accordingly and supply the additional values rhsm_username and rhsm_encrypted_password in the config, where the username should be a user with the permissions to add hosts (at least, don’t know if more permissions are required) and rhsm_encrypted_password is the virt-who-password output for the user’s password.
Then, when running virt-who, your hypervisors and hypervisor/VM-mappings should be imported into your Foreman. If auto-attach is enabled, they should automatically attach the VDC subscriptions after a while (can take up to 24 hours iirc, but can be fastened by manually auto-attaching via the content hosts in Foreman). Be careful if you have different types of VDC/per-hypervisor subscriptions (like RHEL and OpenShift ones) and make sure the correct subscription is assigned to the correct hypervisors. Auto-attach by default always uses the “biggest” subscription available, which is usually not desired.
After that you can start setting up your content in Foreman and then register your systems.

I hope this helps. If you have further questions, feel free to ask :slight_smile:

Hello,

thank you for your detailed answer!

So I tested this by releasing one of my subscriptions and adding it to subscription allocation and exported the manifest for use in foreman/katello and I got valid subscriptions shown in foreman, so this worked pretty fine.
Since we already report our repos to RHN via virt-who we already have some config files for our vCenters. So I guess, there is no further change needed?

Next step would be re-registering existing hosts to my local katello instead of RHN, am I right?

Thanks in advance!

I’m pretty sure this should work out of the box as soon as you register your virt-who running server to katello. If you encounter any problems on the way, feel free to ask :slight_smile:

Yes, that should be the next step.

Regards