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

VM spin up with invalid/unsubscribed subscription username/password and kubernates,openshift is in stopped state #79

Closed
naina-verma opened this issue May 4, 2016 · 15 comments

Comments

@naina-verma
Copy link

naina-verma commented May 4, 2016

VM spin up(vagrant up) with invalid subscription username/password and kubernates,openshift was in stopped state. No Success message after spinning up vm

There must be a handle to check for valid subscription
Either it should spin up machine with kubernates ,openshift , docker running with success message or throw error of invalid username/password and dont spin up vm

[naina@dhcp35-1 rhel-ose]$ vagrant destroy 
==> default: Unregistering box with vagrant-registration...
==> default: Removing domain...
[naina@dhcp35-1 rhel-ose]$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default:  -- Name:              rhel-ose_default
==> default:  -- Domain type:       kvm
==> default:  -- Cpus:              2
==> default:  -- Memory:            3072M
==> default:  -- Management MAC:    
==> default:  -- Loader:            
==> default:  -- Base box:          cdkv2
==> default:  -- Storage pool:      default
==> default:  -- Image:             /var/lib/libvirt/images/rhel-ose_default.img (41G)
==> default:  -- Volume Cache:      default
==> default:  -- Kernel:            
==> default:  -- Initrd:            
==> default:  -- Graphics Type:     vnc
==> default:  -- Graphics Port:     5900
==> default:  -- Graphics IP:       127.0.0.1
==> default:  -- Graphics Password: Not defined
==> default:  -- Video Type:        cirrus
==> default:  -- Video VRAM:        9216
==> default:  -- Keymap:            en-us
==> default:  -- INPUT:             type=mouse, bus=ps2
==> default:  -- Command line : 
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Configuring and enabling network interfaces...
==> default: Registering box with vagrant-registration...
    default: Would you like to register the system now (default: yes)? [y|n]y
    default: username: ytyyt
    default: password: 
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html
Registering to: subscription.rhn.redhat.com:443/subscription

[naina@dhcp35-1 rhel-ose]$ vagrant ssh

[vagrant@rhel-cdk ~]$ 
[vagrant@rhel-cdk ~]$ exit
logout
Connection to 192.168.121.251 closed.
[naina@dhcp35-1 rhel-ose]$ vagrant service-manager env openshift


# OpenShift service is not running in the vagrant box.

[naina@dhcp35-1 rhel-ose]$ 
[naina@dhcp35-1 rhel-ose]$ 
[naina@dhcp35-1 rhel-ose]$ 
[naina@dhcp35-1 rhel-ose]$ vagrant service-manager env 
Configured services:
docker - running
openshift - stopped
kubernetes - stopped

docker env:
# Copying TLS certificates to /home/naina/Documents/cdk/components/rhel/rhel-ose/.vagrant/machines/default/libvirt/docker
# Set the following environment variables to enable access to the
# docker daemon running inside of the vagrant virtual machine:
export DOCKER_HOST=tcp://10.1.2.2:2376
export DOCKER_CERT_PATH=/home/naina/Documents/cdk/components/rhel/rhel-ose/.vagrant/machines/default/libvirt/docker
export DOCKER_TLS_VERIFY=1
export DOCKER_API_VERSION=1.21
# run following command to configure your shell:
# eval "$(vagrant service-manager env docker)"
[naina@dhcp35-1 rhel-ose]$ vagrant global-status 
id       name    provider state   directory                                                                
-----------------------------------------------------------------------------------------------------------
72a836a  default libvirt running /home/naina/Documents/cdk/components/rhel/misc/rhel-k8s-singlenode-setup 
4b0aa6d  default libvirt running /home/naina/Documents/cdk/components/rhel/rhel-ose              

[naina@dhcp35-1 rhel-ose]$ tail -f /var/log/rhsm/rhsm.log
    <NONE>
Deleted
    <NONE>
2016-05-02 18:24:56,681 [INFO] rhsmcertd-worker:3229 @hwprobe.py:908 - collected virt facts: virt.is_guest=False, virt.host_type=Not Applicable, virt.uuid=Not Set
2016-05-02 18:24:57,715 [INFO] rhsmcertd-worker:3229 @hwprobe.py:908 - collected virt facts: virt.is_guest=False, virt.host_type=Not Applicable, virt.uuid=Not Set
2016-05-02 18:25:00,813 [INFO] rhsmcertd-worker:3229 @factlib.py:103 - Facts have been updated.
2016-05-03 10:21:01,897 [INFO] rhsmd:12700 @rhsmd:235 - rhsmd started
2016-05-03 10:21:01,898 [INFO] rhsmd:12700 @rhsmd:266 - logging subscription status to syslog
2016-05-03 10:21:01,902 [INFO] rhsmd:12700 @connection.py:815 - Connection built: host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ verify=False
2016-05-03 10:21:05,174 [INFO] rhsmd:12700 @cert_sorter.py:205 - Product status: valid_products= partial_products= expired_products= unentitled_producs= future_products= valid_until=None
@praveenkumar
Copy link
Contributor

@naina-verma which Vagrantfile you used when you tried vagrant up after destroy? Also can you please put journalctl logs after vagrant ssh to pastebin or here?

@naina-verma
Copy link
Author

naina-verma commented May 4, 2016

I have used ~/cdk/components/rhel/rhel-ose/Vagrantfile file .

[naina@dhcp35-1 rhel-ose]$ vagrant ssh
Last login: Wed May  4 00:05:34 2016 from 192.168.121.1
[vagrant@rhel-cdk ~]$ journalctl -u openshift
No journal files were found.
[vagrant@rhel-cdk ~]$ journalctl -u kubernetes
No journal files were found.
[vagrant@rhel-cdk ~]$ journalctl -u docker
No journal files were found.

@praveenkumar
Copy link
Contributor

@naina-verma you have to be superuser to get journalctl logs also check systemctl status openshift .

@naina-verma
Copy link
Author

naina-verma commented May 4, 2016

[vagrant@rhel-cdk ~]$ sudo systemctl status openshift 
● openshift.service - Docker Application Container for OpenShift
   Loaded: loaded (/usr/lib/systemd/system/openshift.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.openshift.org/
[vagrant@rhel-cdk ~]$ sudo systemctl status kubernates
● kubernates.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

@naina-verma naina-verma changed the title VM spin up with invalid subscription username/password and kubernates,openshift is in stopped state VM spin up with invalid/unsubscribed subscription username/password and kubernates,openshift is in stopped state May 4, 2016
@coolbrg
Copy link
Contributor

coolbrg commented May 4, 2016

@praveenkumar @LalatenduMohanty : What is the expected behavior in this scenario?
If user input invalid user name/password, vagrant up process exit with error message?
or
vagrant up continues provisioning openshift/docker/kubernetes?
or
vagrant up continues without provisioning any services?

@praveenkumar
Copy link
Contributor

@naina-verma So I am able to reproduce it and looks like we got a meaningful message below

Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html
Registering to: subscription.rhn.redhat.com:443/subscription

And return status of vagrant also non-zero

# echo $?
1

Now since it's already exited as expected so it didn't execute any provision script which comes after registration which is why required service in not active/running. (And as I said it's expected).

@praveenkumar
Copy link
Contributor

If user input invalid user name/password, vagrant up process exit with error message?

Yes, this is expected.

@LalatenduMohanty
Copy link
Contributor

But if you skip the registration process, you should be able to get a working openshift or K8s.

@coolbrg
Copy link
Contributor

coolbrg commented May 4, 2016

@praveenkumar @navidshaikh @LalatenduMohanty @hferentschik @bexelbie : This I feel we need to change the behavior of this scenario.

This proposal is for scenario when user chooses to go for Registration Process.

I propose following (for CDK only):

  1. vagrant up
  2. User entered invalid username/password
  3. Vagrant stopped with message as in the issue description:
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html
Registering to: subscription.rhn.redhat.com:443/subscription

However,

  1. User could able to do vagrant ssh since Its a default behavior of Vagrant.
  2. vagrant service-manager env should ouput as:
Configured services:
docker - stopped
openshift - stopped
kubernetes - stopped

Note: If registration failed, no service should be running.

Please any feedback on this?

@praveenkumar
Copy link
Contributor

Please any feedback on this?

This is already current behavior except docker service which enable by default and it should be that way.

@naina-verma
Copy link
Author

@praveenkumar
my opinion is if user entered invalid username/password , it should throw message that "Invalid username/password ,
Press Enter to continue without Subscription : "
What i feel rather than giving user a stopped openshift+kubernates handle this event .

In current scenario , user got the Spin VM but , did not get the notification message on console that vagrant process is completed . It just prompted to error message
Which makes feels like vagrant up process is completed with errors.
"Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html
Registering to: subscription.rhn.redhat.com:443/subscription"

@coolbrg
Copy link
Contributor

coolbrg commented May 4, 2016

my opinion is if user entered invalid username/password , it should throw message that "Invalid username/password ,
Press Enter to continue without Subscription : "
What i feel rather than giving user a stopped openshift+kubernates handle this event .

I would like to check this behavior if vagrant supports it or we can do it through vagrant-registration.

@LalatenduMohanty
Copy link
Contributor

I would like to check this behavior if vagrant supports it or we can do it through vagrant-registration.

+1, I think vagrant-registration is responsible for the error output to the user.

@praveenkumar
Copy link
Contributor

my opinion is if user entered invalid username/password , it should throw message that "Invalid username/password ,
Press Enter to continue without Subscription : "
What i feel rather than giving user a stopped openshift+kubernates handle this event .

@naina-verma I better go with ssh concept where it ask 3 times about username/password and if that went wrong then we should be prompt for Enter to continue without Subscription

I would like to check this behavior if vagrant supports it or we can do it through vagrant-registration.

@budhrg Ack, but again it would be nice if we give 3 chance to user for provide correct username/password that would be nice.

I think vagrant-registration is responsible for the error output to the user

@LalatenduMohanty Yes, It is.

@coolbrg
Copy link
Contributor

coolbrg commented May 4, 2016

Closing this issue as we are tracking it in issue #80

@coolbrg coolbrg closed this as completed May 4, 2016
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

4 participants