Bug 1324520

Summary: [RFE] Allow to skip tty check to allow for unattended install via Ansible
Product: [oVirt] ovirt-hosted-engine-setup Reporter: Sahina Bose <sabose>
Component: GeneralAssignee: Lev Veyde <lveyde>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: high    
Version: 1.3.5.0CC: bugs, dcaroest, mgoldboi, pstehlik, sbonazzo, surs, ylavi
Target Milestone: ovirt-3.6.6Keywords: FutureFeature, Triaged
Target Release: 1.3.6.1Flags: rule-engine: ovirt-3.6.z+
mgoldboi: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: Option was added to skip tty availability. Reason: We want to support automated installations by Ansible. Result: It's now possible to provide option to skip tty check.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-30 10:52:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1258386, 1330523    

Description Sahina Bose 2016-04-06 14:12:50 UTC
Description of problem:

In order to allow setup of host via Ansible, hosted-engine deploy command is called via Ansible shell.
This is stuck due to below error:

stdout: [ INFO  ] Stage: Initializing
[ INFO  ] Generating a temporary VNC password.
[ INFO  ] Stage: Environment setup
          Configuration files: ['/tmp/hosted-engine-answer-file.conf']
          Log file: /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20160406050029-0syzjx.log
          Version: otopi-1.4.1 (otopi-1.4.1-1.el7.centos)
[ ERROR ] It has been detected that this program is executed through an SSH connection without pseudo-tty allocation. Please run again ssh adding -t option 
[WARNING] Aborted
[ INFO  ] Stage: Clean up
[ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-20160406050029.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Hosted Engine deployment failed: this system is not reliable, please check the issue, fix and redeploy
          Log file is located at /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20160406050029-0syzjx.log




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

How reproducible:


Steps to Reproduce:
Run via ansible

Comment 1 Sandro Bonazzola 2016-04-06 14:21:33 UTC
Lev, see also mailing list discussion starting at http://lists.ovirt.org/pipermail/users/2016-April/038842.html

In particular:
http://lists.ovirt.org/pipermail/users/2016-April/038882.html

relevant plugin is ovirt-hosted-engine-setup/core/shell.py

Comment 2 Yaniv Kaul 2016-04-07 12:32:30 UTC
Fixed flags and target milestone - this should go first to 4.0, then backported to 3.6.6.

Comment 3 Sandro Bonazzola 2016-04-08 05:23:37 UTC
(In reply to Yaniv Kaul from comment #2)
> Fixed flags and target milestone - this should go first to 4.0, then
> backported to 3.6.6.

In oVirt if you want a bug fixed in 3.6.6 you have 2 ways:
1) set target milestone 3.6.6 and set both 3.6.z and 4.0.0 flags:
 - the bug will be fixed in 4.0.0 and then cloned to 3.6.6 once in modified state for 4.0.0
 - the bug will be verified both in 4.0.0 and in 3.6.6

2) set target milestone to 3.6.6 and set only 3.6.z flag
 - the bug will be fixed in 4.0.0 first, then in 3.6.6
 - the bug will be verified in 3.6.6 only assuming it works also on 4.0.0.

with current settings, this bug will be fixed in 4.0.0 only and bugzilla complains 3.6.z flag has been set with wrong milestone.

According to your comment, I'm resetting target milestone to 3.6.6 and require QE to test both 4.0.0 and 3.6.6.

Comment 4 Artyom 2016-05-08 08:21:20 UTC
Verified on ovirt-hosted-engine-setup-1.3.6.1-1.el7ev.noarch

Run without config and pseudo-tty:
[ INFO  ] Stage: Initializing
[ INFO  ] Generating a temporary VNC password.
[ INFO  ] Stage: Environment setup
          Continuing will configure this host for serving as hypervisor and create a VM where you have to install the engine afterwards.
          Are you sure you want to continue? (Yes, No)[Yes]: 
          Configuration files: []
          Log file: /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20160508111718-9sg3a1.log
          Version: otopi-1.4.1 (otopi-1.4.1-1.el7ev)
[ ERROR ] It has been detected that this program is executed through an SSH connection without pseudo-tty allocation. Please run again ssh adding -t option 
[WARNING] Aborted
[ INFO  ] Stage: Clean up
[ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-20160508111723.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Hosted Engine deployment failed: this system is not reliable, please check the issue, fix and redeploy
          Log file is located at /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20160508111718-9sg3a1.log



run without pseudo-tty but with answer file
[environment:default]
OVEHOSTED_CORE/skipTTYCheck=bool:True

[ INFO  ] Stage: Initializing
[ INFO  ] Generating a temporary VNC password.
[ INFO  ] Stage: Environment setup
          Continuing will configure this host for serving as hypervisor and create a VM where you have to install the engine afterwards.
          Are you sure you want to continue? (Yes, No)[Yes]: 
          Configuration files: ['/tmp/answers']
          Log file: /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20160508111856-vl1ysg.log
          Version: otopi-1.4.1 (otopi-1.4.1-1.el7ev)
          It has been detected that this program is executed through an SSH connection without using screen.
          Continuing with the installation may lead to broken installation if the network connection fails.
          It is highly recommended to abort the installation and run it inside a screen session using command "screen".
          Do you want to continue anyway? (Yes, No)[No]:

Comment 5 Yedidyah Bar David 2016-06-01 06:01:33 UTC
*** Bug 1341322 has been marked as a duplicate of this bug. ***