Adding rhev-tech
Something I found interesting from the -vvvv ansible logs was the difference in connect options between SSH and SFTP.  I see the SSH connect option "-o StrictHostKeyChecking=no" that was added to the new host, but I don't see those options on the subsequent SFTP command.  I'm assuming the SFTP command is uploading the ping module (maybe because of the SSH proxy command logic linked above...)  It seems to me that the logic of the playbook link above is wrong.  There is a conditional check that determines whether or not the new HE will be subjected to key checking.  Because this is a brand new HE VM, nobody will know the host_key, and so host_key_checking must not be done.

A few select lines from the ansible -vvvv logs:
<rhvm.home.lab> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="root"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o 'ProxyCommand=ssh -W %h:%p -q  root@rhhi1.home.lab' -o ControlPath=/root/.ansible/cp/9de9431b6b rhvm.home.lab '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
...
wait_for_connection: attempting ping module test
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/ping.py
<rhvm.home.lab> PUT /root/.ansible/tmp/ansible-local-31228wLAFQf/tmpnNJbIE TO /root/.ansible/tmp/ansible-tmp-1578434044.88-51347511337777/AnsiballZ_ping.py
<rhvm.home.lab> SSH: EXEC sshpass -d258 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/9de9431b6b '[rhvm.home.lab]'


Thank you,
John Call
Red Hat - Storage Domain Architect
jcall@redhat.com
(714) 267-8802


On Tue, Jan 7, 2020 at 11:42 AM John Call <jcall@redhat.com> wrote:
Simone, ovirt-users,

I'm running into an issue with the ovirt.hosted_engine_setup role.  I can't decide if my problem is 1) that the SSH connection to the HostedEngineLocal VM repeatedly fails due to that new VM not having an entry in ~/.ssh/known_hosts or 2) that I don't have some variable defined correctly.  I can force my way past #1 by setting host_key_checking=false in ansible.cfg, but if I do that, I immediately get an error about an undefined hostvar variable...  Can you point me in the right direction to debug this?  I would really like to be able to rebuild my RHHI/RHV cluster using these gluster+ovirt roles.

Here is the undefined variable error, and the variable files I'm including via the "ansible-playbook -e..." syntax:

TASK [ovirt.hosted_engine_setup : Wait for the local VM] *****************************************************************************************
ok: [localhost -> rhvm.home.lab]

TASK [ovirt.hosted_engine_setup : Add an entry for this host on /etc/hosts on the local VM] ******************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: u\"hostvars['rhhi1.home.lab']\" is undefined\n\nThe error appears to be in '/usr/share/ansible/roles/ovirt.hosted_engine_setup/tasks/bootstrap_local_vm/03_engine_initial_tasks.yml': line 8, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n      timeout: 180\n  - name: Add an entry for this host on /etc/hosts on the local VM\n    ^ here\n"}



Thank you,
John Call
Red Hat - Storage Domain Architect
jcall@redhat.com
(714) 267-8802


On Tue, Jan 7, 2020 at 12:27 AM Gobinda Das <godas@redhat.com> wrote:
Hi John,
 Sorry misunderstood, I thought you are using cockpit based deployment.
Your gluster_inventory is correct for end to end deployment.

On Tue, Jan 7, 2020 at 12:43 PM Gobinda Das <godas@redhat.com> wrote:
Hi John,
 I am seeing error:
TASK [ovirt.hosted_engine_setup : Get local VM dir path] *****************************************************************************************
task path: /usr/share/ansible/roles/ovirt.hosted_engine_setup/tasks/bootstrap_local_vm/03_engine_initial_tasks.yml:57
fatal: [localhost]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'he_local_vm_dir'\n\nThe error appears to be in '/usr/share/ansible/roles/ovirt.hosted_engine_setup/tasks/bootstrap_local_vm/03_engine_initial_tasks.yml': line 57, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n      delegate_to: \"{{ he_ansible_host_name }}\"\n    - name: Get local VM dir path\n      ^ here\n"
}
Simone do we need to explicitly specify he_local_vm_dir ?
In gluster_inventory you can't mention other hosts and SD informations to auto add. For that you need to create separate file under:
/usr/share/ovirt-hosted-engine-setup/gdeploy-inventory.yml
and add entries there like:

gluster:
 hosts:
  host2:
  host3:
 vars:
  storage_domains: [{"name":"data","host":"host1","address":"host1","path":"/data","mount_options":"backup-volfile-servers=host2:host3"},{"name":"vmstore","host":"host1","address":"host1","path":"/vmstore","mount_options":"backup-volfile-servers=host2:host3"}]

Then hook will automatically read this file and perform action accordingly.

On Tue, Jan 7, 2020 at 11:53 AM John Call <jcall@redhat.com> wrote:
Hi Gobinda, ovirt-users,

I think I'm close, but I'm running into a timeout/error when the ovirt.hosted-engine-setup tasks try to connect to the new "HostedEngineLocal" VM.  It seems to complain about host_key_checking.  I disabled that via ansible.cfg, but it fails on the next task (see short logs.)  Do you see anything obviously wrong in my inventory and json files?  I've attached the verbose playbook logs when I run this from the first HCI host...

[root@rhhi1 hc-ansible-deployment]# pwd
/etc/ansible/roles/gluster.ansible/playbooks/hc-ansible-deployment

[root@rhhi1 hc-ansible-deployment]# ansible-playbook -b -vvv -i gluster_inventory.yml hc_deployment.yml --extra-vars='@he_gluster_vars.json' | tee playbook.logs


Thank you,
John Call
Red Hat - Storage Domain Architect
jcall@redhat.com
(714) 267-8802


On Wed, Dec 11, 2019 at 11:09 PM Gobinda Das <godas@redhat.com> wrote:
Hi John,
  You need to specify storage-fqdn(Which should mapped to storage network) and ovirtmgmt-fqdn (Which should mapped to frontend network)  like this:
hc_nodes:
  hosts:
    host1-STORAGE-fqdn:
    host2-STORAGE-fqdn:
    host3-STORAGE-fqdn:
  vars:
    cluster_nodes:
       - host1-STORAGE-fqdn
       - host2-STORAGE-fqdn
       - host3-STORAGE-fqdn
    gluster_features_hci_cluster: "{{ cluster_nodes }}"

gluster:
  host2-ovirtmgmt-fqdn:
  host3-ovirtmgmt-fqdn:
  storage_domains: [{"name":"data","host":"host1-STORAGE-fqdn","address":"host1-STORAGE-fqdn","path":"/data","mount_options":"backup-volfile-servers=host2-STORAGE-fqdn:host3-STORAGE-fqdn"},{"name":"vmstore","host":"host1-STORAGE-fqdn","address":"host1-STORAGE-fqdn","path":"/vmstore","mount_options":"backup-volfile-servers=host2-STORAGE-fqdn:host3-STORAGE-fqdn"}]


On Thu, Dec 12, 2019 at 2:47 AM John Call <jcall@redhat.com> wrote:
Hi ovirt-users,

I'm trying to automate my HCI deployment, but can't figure out how to specify multiple network interfaces in gluster_inventory.yml.  My servers have two NICs, one for ovirtmgmt (and everything else), and the other is just for Gluster.  How should I populate the inventory/vars file?  Is this correct?

[root@rhhi1 hc-ansible-deployment]# pwd
/etc/ansible/roles/gluster.ansible/playbooks/hc-ansible-deployment

[root@rhhi1 hc-ansible-deployment]# cat gluster_inventory.yml
--lots of stuff omitted--
hc_nodes:
  hosts:
    host1-STORAGE-fqdn:
    host2-STORAGE-fqdn:
    host3-STORAGE-fqdn:
  vars:
    cluster_nodes:
       - host1-ovirtmgmt-fqdn
       - host2-ovirtmgmt-fqdn
       - host3-ovirtmgmt-fqdn
    gluster_features_hci_cluster: "{{ cluster_nodes }}"

gluster:
  host2-STORAGE-fqdn:
  host3-STORAGE-fqdn:
  storage_domains: [{"name":"data","host":"host1-STORAGE-fqdn","address":"host1-STORAGE-fqdn","path":"/data","mount_options":"backup-volfile-servers=host2-STORAGE-fqdn:host3-STORAGE-fqdn"},{"name":"vmstore","host":"host1-STORAGE-fqdn","address":"host1-STORAGE-fqdn","path":"/vmstore","mount_options":"backup-volfile-servers=host2-STORAGE-fqdn:host3-STORAGE-fqdn"}]
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/TEAHUX6LSPM5YQ7SYBN2L7H6VUGUDNMI/


--


Thanks,
Gobinda


--


Thanks,
Gobinda


--


Thanks,
Gobinda