Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHEL: How should we handle RHN/RHSM registration? #10

Open
ryran opened this issue Jan 28, 2016 · 3 comments
Open

RHEL: How should we handle RHN/RHSM registration? #10

ryran opened this issue Jan 28, 2016 · 3 comments

Comments

@ryran
Copy link
Owner

ryran commented Jan 28, 2016

Personally, I don't ever register any of my new RHEL VMs up front, since I have them pointing to yum repos on our internal corporate network. That said, I have a script that upvm automatically drops into /root -- this script makes it easy for me to register in the future ... it autodetects RHEL version to use RHN classic or RHSM as needed without prompting for credentials and then uses rhn-channel or subscription-manager repos commands to attach only the repos I want.

I understand some people might instead want upvm to register their machines right off the bat, so I need to decide how best to implement that.

Of course virt-builder has its own options for RHSM. Could use that. Could also just prompt for RHN credentials or activation-keys and optionally save to local user config file... I'll give it some thought.

@ryran
Copy link
Owner Author

ryran commented Feb 25, 2016

Conversation that will provide some details:

<jsantos> hey Ryan, when you have a minute, the guys here are asking me if there's the
possibility of doing something like the subscription-manager plugin that vagrant has
(basically you can indicate to a VM that is about to get instantiated, the
subscription-manager info so you have it already subscribed when available)

<rsaw> yeah it's totally possible. virt-builder has some options for it but
subscription-manager operations are all sooooooo damn slow that I didn't bother to
include it.

<jsantos> interesting.... adding it shouldn't be too hard

<rsaw> there's an undocumented feature of upvm where if it finds a ~/bin/reg file on
your system, it copies that into the VM as "/root/register.sh"; however it doesn't run it.

<jsantos> yeah but since virt-builder already has some thingies, wouldn't it be best to
(if I wished to add it), add it to builder.py?

<rsaw> I have a ~/bin/reg script on my system that includes activation keys for rhsm &
rhn and so all my new vms aren't registered but as soon as I want to register one all I
have to do is run the /root/register.sh

<rsaw> I mean you can pass upvm virt-builder options even if upvm doesn't implement
them. you can do:
upvm -B=--sm-register --B=--sm-credentials=rhnuser:password:MYPASS --B=--sm-attach=auto

<rsaw> but I think it's really dumb ... upvm is all about spinning up VMs quickly. if you
do that, you're going to expect the virt-builder appliance (which only has like 512 M of
ram) to run those rhsm commands ... which take crazy long on normal systems

@ryran ryran changed the title RHEL: Decide how we want to handle RHN/RHSM registration RHEL: How should we handle RHN/RHSM registration? Feb 25, 2016
@OndrejHome
Copy link

What about using ansible to handle registrations after starting the machine? You have SSH key already in place so you need to have only a playbook that will do the registration and I think some playbook for this must already exist.

@ryran
Copy link
Owner Author

ryran commented Mar 9, 2016

What about using ansible to handle registrations after starting the machine? You have SSH key already in place so you need to have only a playbook that will do the registration and I think some playbook for this must already exist.

Thanks for the feedback Ondrej. I agree that ansible's great and of course you can do any of this stuff with ansible .. that's a given .. but I'm not going to force that on anyone as part of the upvm package. The goal is to make this as self-contained and easily-accessible (lowest common denominator) as possible. Right this moment, for choices you could do any of the following:

  • Use virt-builder native options, e.g.: upvm -B=--sm-register --B=--sm-credentials=rhnuser:password:MYPASS --B=--sm-attach=auto
  • Use upvm --run /localpath/script
  • Use upvm --run-command 'subscription-manager register xxxx...'
  • Use upvm --firstboot /localpath/script
  • Use upvm --firstboot-command 'subscription-manager register xxxx...'

So honestly I guess I opened this up as a question, but I clearly have pretty strong feelings about it ... in that I don't think there's really anything else I need to add. (I could of course add the virt-builder --sm... options directly to upvm if people want them so you don't have to do --B=.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants