Adding devel, so that I can link from https://gerrit.ovirt.org/98595 .

On Mon, Mar 18, 2019 at 1:21 PM Sandro Bonazzola <sbonazzo@redhat.com> wrote:


Il dom 17 mar 2019, 11:41 Yedidyah Bar David <didi@redhat.com> ha scritto:
On Fri, Mar 15, 2019 at 7:27 PM Sandro Bonazzola <sbonazzo@redhat.com> wrote:
Hi,
I was trying to setup engine on my systems using ansible

my playbook:
---
- name: Setup oVirt
  hosts: ovirt4.home
  vars_files:
    # Contains encrypted `ovirt_engine_setup_admin_password` variable using ansible-vault
    - password.yml
  vars:
    ovirt_engine_setup_version: '4.3'
    ovirt_engine_setup_product_type: oVirt
  roles:
    - ovirt.engine-setup

I think this happens when you run engine-setup and supply an ovn user but no password.

The bottom-of-the-stack failure reason is calling .decode on None, which was done for supporting also python3. Fixing this can be done e.g. by https://gerrit.ovirt.org/98595 . Didn't test and not sure that's enough.

We might decide to fix by changing the logic upper in the stack, though, or by fixing the role/playbook to supply also a password.

At a minimum, someone needs to decide what we want the role to do wrt to ovn. Do we want it to be set up automatically? Using engine admin user/password? If so, please open a bug on the role.
 


I will open the bug. in the meantime I confirm that adding ovn password to the vault fixes the problem 

OK. Did you?
 







Using 1.1.9



Got this error:
TASK [ovirt.engine-setup : Run engine-setup with answerfile] ******************************************************************************************************************************************************
fatal: [ovirt4.home]: FAILED! => {"changed": true, "cmd": ["engine-setup", "--accept-defaults", "--config-append=/tmp/answerfile-20190315180843Z.txt"], "delta": "0:09:54.716435", "end": "2019-03-15 18:18:44.658774", "msg": "non-zero return code", "rc": 1, "start": "2019-03-15 18:08:49.942339", "stderr": "", "stderr_lines": [], "stdout": "[ INFO  ] Stage: Initializing\n[ INFO  ] Stage: Environment setup\n          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/tmp/answerfile-20190315180843Z.txt']\n          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log\n          Version: otopi-1.8.1 (otopi-1.8.1-1.el7)\n[ INFO  ] Stage: Environment packages setup\n[ INFO  ] Stage: Programs detection\n[ INFO  ] Stage: Environment setup (late)\n[ INFO  ] Stage: Environment customization\n         \n          --== PRODUCT OPTIONS ==--\n         \n          Set up Cinderlib integration\n          (Currently in tech preview)\n          (Yes, No) [No]: \n          Configure Engine on this host (Yes, No) [Yes]: \n          Configure Image I/O Proxy on this host (Yes, No) [Yes]: \n          Configure WebSocket Proxy on this host (Yes, No) [Yes]: \n          Configure VM Console Proxy on this host (Yes, No) [Yes]: \n         \n          --== PACKAGES ==--\n         \n[ INFO  ] Checking for product updates...\n[ INFO  ] No product updates found\n         \n          --== NETWORK CONFIGURATION ==--\n         \n          Host fully qualified DNS name of this server [ovirt4.home]: \n[WARNING] Failed to resolve ovirt4.home using DNS, it can be resolved only locally\n[ INFO  ] firewalld will be configured as firewall manager.\n         \n          --== DATABASE CONFIGURATION ==--\n         \n          Where is the Engine database located? (Local, Remote) [Local]: \n          Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.\n          Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: \n         \n          --== OVIRT ENGINE CONFIGURATION ==--\n         \n          Application mode (Virt, Gluster, Both) [Both]: \n         \n          --== STORAGE CONFIGURATION ==--\n         \n          Default SAN wipe after delete (Yes, No) [No]: \n         \n          --== PKI CONFIGURATION ==--\n         \n          Organization name for certificate [home]: \n         \n          --== APACHE CONFIGURATION ==--\n         \n          Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.\n          Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]: \n          Setup can configure apache to use SSL using a certificate issued from the internal CA.\n          Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]: \n         \n          --== SYSTEM CONFIGURATION ==--\n         \n         \n          --== MISC CONFIGURATION ==--\n         \n          Please choose Data Warehouse sampling scale:\n          (1) Basic\n          (2) Full\n          (1, 2)[1]: \n         \n          --== END OF CONFIGURATION ==--\n         \n[ INFO  ] Stage: Setup validation\n[WARNING] Less than 16384MB of memory is available\n         \n          --== CONFIGURATION PREVIEW ==--\n         \n          Application mode                        : both\n          Default SAN wipe after delete           : False\n          Firewall manager                        : firewalld\n          Update Firewall                         : True\n          Host FQDN                               : ovirt4.home\n          Set up Cinderlib integration            : False\n          Configure local Engine database         : True\n          Set application as default page         : True\n          Configure Apache SSL                    : True\n          Engine database secured connection      : False\n          Engine database user name               : engine\n          Engine database name                    : engine\n          Engine database host                    : localhost\n          Engine database port                    : 5432\n          Engine database host name validation    : False\n          Engine installation                     : True\n          PKI organization                        : home\n          Set up ovirt-provider-ovn               : True\n          Configure WebSocket Proxy               : True\n          DWH installation                        : True\n          DWH database secured connection         : False\n          DWH database host                       : localhost\n          DWH database user name                  : ovirt_engine_history\n          DWH database name                       : ovirt_engine_history\n          DWH database port                       : 5432\n          DWH database host name validation       : False\n          Configure local DWH database            : True\n          Configure Image I/O Proxy               : True\n          Configure VMConsole Proxy               : True\n         \n          Please confirm installation settings (OK, Cancel) [OK]: \n[ INFO  ] Stage: Transaction setup\n[ INFO  ] Stopping engine service\n[ INFO  ] Stopping ovirt-fence-kdump-listener service\n[ INFO  ] Stopping dwh service\n[ INFO  ] Stopping Image I/O Proxy service\n[ INFO  ] Stopping vmconsole-proxy service\n[ INFO  ] Stopping websocket-proxy service\n[ INFO  ] Stage: Misc configuration (early)\n[ INFO  ] Stage: Package installation\n[ INFO  ] Stage: Misc configuration\n[ INFO  ] Upgrading CA\n[ INFO  ] Initializing PostgreSQL\n[ INFO  ] Creating PostgreSQL 'engine' database\n[ INFO  ] Configuring PostgreSQL\n[ INFO  ] Creating PostgreSQL 'ovirt_engine_history' database\n[ INFO  ] Configuring PostgreSQL\n[ INFO  ] Creating CA\n[ INFO  ] Creating/refreshing DWH database schema\n[ INFO  ] Configuring Image I/O Proxy\n[ INFO  ] Setting up ovirt-vmconsole proxy helper PKI artifacts\n[ INFO  ] Setting up ovirt-vmconsole SSH PKI artifacts\n[ INFO  ] Configuring WebSocket Proxy\n[ INFO  ] Creating/refreshing Engine database schema\n[ INFO  ] Creating/refreshing Engine 'internal' domain database schema\n[ INFO  ] Creating default mac pool range\n[ INFO  ] Adding default OVN provider to database\n[ ERROR ] Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'decode'\n[ INFO  ] Yum Performing yum transaction rollback\n[ INFO  ] Rolling back DWH database schema\n[ INFO  ] Clearing DWH database ovirt_engine_history\n[ INFO  ] Rolling back database schema\n[ INFO  ] Clearing Engine database engine\n[ INFO  ] Stage: Clean up\n          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log\n[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20190315181844-setup.conf'\n[ INFO  ] Stage: Pre-termination\n[ INFO  ] Stage: Termination\n[ ERROR ] Execution of setup failed", "stdout_lines": ["[ INFO  ] Stage: Initializing", "[ INFO  ] Stage: Environment setup", "          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/tmp/answerfile-20190315180843Z.txt']", "          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log", "          Version: otopi-1.8.1 (otopi-1.8.1-1.el7)", "[ INFO  ] Stage: Environment packages setup", "[ INFO  ] Stage: Programs detection", "[ INFO  ] Stage: Environment setup (late)", "[ INFO  ] Stage: Environment customization", "         ", "          --== PRODUCT OPTIONS ==--", "         ", "          Set up Cinderlib integration", "          (Currently in tech preview)", "          (Yes, No) [No]: ", "          Configure Engine on this host (Yes, No) [Yes]: ", "          Configure Image I/O Proxy on this host (Yes, No) [Yes]: ", "          Configure WebSocket Proxy on this host (Yes, No) [Yes]: ", "          Configure VM Console Proxy on this host (Yes, No) [Yes]: ", "         ", "          --== PACKAGES ==--", "         ", "[ INFO  ] Checking for product updates...", "[ INFO  ] No product updates found", "         ", "          --== NETWORK CONFIGURATION ==--", "         ", "          Host fully qualified DNS name of this server [ovirt4.home]: ", "[WARNING] Failed to resolve ovirt4.home using DNS, it can be resolved only locally", "[ INFO  ] firewalld will be configured as firewall manager.", "         ", "          --== DATABASE CONFIGURATION ==--", "         ", "          Where is the Engine database located? (Local, Remote) [Local]: ", "          Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.", "          Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ", "         ", "          --== OVIRT ENGINE CONFIGURATION ==--", "         ", "          Application mode (Virt, Gluster, Both) [Both]: ", "         ", "          --== STORAGE CONFIGURATION ==--", "         ", "          Default SAN wipe after delete (Yes, No) [No]: ", "         ", "          --== PKI CONFIGURATION ==--", "         ", "          Organization name for certificate [home]: ", "         ", "          --== APACHE CONFIGURATION ==--", "         ", "          Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.", "          Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]: ", "          Setup can configure apache to use SSL using a certificate issued from the internal CA.", "          Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]: ", "         ", "          --== SYSTEM CONFIGURATION ==--", "         ", "         ", "          --== MISC CONFIGURATION ==--", "         ", "          Please choose Data Warehouse sampling scale:", "          (1) Basic", "          (2) Full", "          (1, 2)[1]: ", "         ", "          --== END OF CONFIGURATION ==--", "         ", "[ INFO  ] Stage: Setup validation", "[WARNING] Less than 16384MB of memory is available", "         ", "          --== CONFIGURATION PREVIEW ==--", "         ", "          Application mode                        : both", "          Default SAN wipe after delete           : False", "          Firewall manager                        : firewalld", "          Update Firewall                         : True", "          Host FQDN                               : ovirt4.home", "          Set up Cinderlib integration            : False", "          Configure local Engine database         : True", "          Set application as default page         : True", "          Configure Apache SSL                    : True", "          Engine database secured connection      : False", "          Engine database user name               : engine", "          Engine database name                    : engine", "          Engine database host                    : localhost", "          Engine database port                    : 5432", "          Engine database host name validation    : False", "          Engine installation                     : True", "          PKI organization                        : home", "          Set up ovirt-provider-ovn               : True", "          Configure WebSocket Proxy               : True", "          DWH installation                        : True", "          DWH database secured connection         : False", "          DWH database host                       : localhost", "          DWH database user name                  : ovirt_engine_history", "          DWH database name                       : ovirt_engine_history", "          DWH database port                       : 5432", "          DWH database host name validation       : False", "          Configure local DWH database            : True", "          Configure Image I/O Proxy               : True", "          Configure VMConsole Proxy               : True", "         ", "          Please confirm installation settings (OK, Cancel) [OK]: ", "[ INFO  ] Stage: Transaction setup", "[ INFO  ] Stopping engine service", "[ INFO  ] Stopping ovirt-fence-kdump-listener service", "[ INFO  ] Stopping dwh service", "[ INFO  ] Stopping Image I/O Proxy service", "[ INFO  ] Stopping vmconsole-proxy service", "[ INFO  ] Stopping websocket-proxy service", "[ INFO  ] Stage: Misc configuration (early)", "[ INFO  ] Stage: Package installation", "[ INFO  ] Stage: Misc configuration", "[ INFO  ] Upgrading CA", "[ INFO  ] Initializing PostgreSQL", "[ INFO  ] Creating PostgreSQL 'engine' database", "[ INFO  ] Configuring PostgreSQL", "[ INFO  ] Creating PostgreSQL 'ovirt_engine_history' database", "[ INFO  ] Configuring PostgreSQL", "[ INFO  ] Creating CA", "[ INFO  ] Creating/refreshing DWH database schema", "[ INFO  ] Configuring Image I/O Proxy", "[ INFO  ] Setting up ovirt-vmconsole proxy helper PKI artifacts", "[ INFO  ] Setting up ovirt-vmconsole SSH PKI artifacts", "[ INFO  ] Configuring WebSocket Proxy", "[ INFO  ] Creating/refreshing Engine database schema", "[ INFO  ] Creating/refreshing Engine 'internal' domain database schema", "[ INFO  ] Creating default mac pool range", "[ INFO  ] Adding default OVN provider to database", "[ ERROR ] Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'decode'", "[ INFO  ] Yum Performing yum transaction rollback", "[ INFO  ] Rolling back DWH database schema", "[ INFO  ] Clearing DWH database ovirt_engine_history", "[ INFO  ] Rolling back database schema", "[ INFO  ] Clearing Engine database engine", "[ INFO  ] Stage: Clean up", "          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20190315180850-ufar83.log", "[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20190315181844-setup.conf'", "[ INFO  ] Stage: Pre-termination", "[ INFO  ] Stage: Termination", "[ ERROR ] Execution of setup failed"]}

Attaching engine-setup logs

I was running the playbook from my laptop, the engine host is a vm on the same network.

--

SANDRO BONAZZOLA

MANAGER, SOFTWARE ENGINEERING, EMEA R&D RHV

Red Hat EMEA

sbonazzo@redhat.com   



--
Didi


--
Didi