Difference between revisions of "VScaler: Thoubleshooting bifrost issues"

From Define Wiki
Jump to navigation Jump to search
(initial commit)
 
(No difference)

Latest revision as of 15:02, 8 December 2017

bifrost-base source image build failure

The current version of kolla in the pip repositories is affected by the following bug:

[1]

Symptoms:

ERROR:kolla.image.build.bifrost-base:The command '/bin/sh -c bash -c './scripts/env-setup.sh && source ./env-vars && ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target /bifrost/playbooks/install.yaml -e @/tmp/build_arg.yml && yum clean all'' returned a non-zero code: 1

Workaround - Apply the following patch to kolla/docker/bifrost/bifrost-base/Dockerfile.j2:

[2]

- RUN bash -c './scripts/env-setup.sh && source ./env-vars && \
+ RUN bash -c 'sed -e "s/\-\-force\-reinstall //g" -i /bifrost/playbooks/roles/bifrost-{ironic,keystone}-install/tasks/install.yml' \
    && bash -c './scripts/env-setup.sh && source ./env-vars && \

Missing rabbitmq-server during bifrost container deploy

TASK [bifrost-ironic-install : Start rabbitmq-server] **************************
task path: /bifrost-base-source/bifrost-4.0.0/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml:55
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145 `" && echo ansible-tmp-1511182013.54-192485478560145="` echo $HOME/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpiFmEMA TO /root/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145/service
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145/ /root/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145/service && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 https_proxy='"'"''"'"' LC_MESSAGES=en_US.UTF-8 no_proxy='"'"''"'"' LC_ALL=en_US.UTF-8 http_proxy='"'"''"'"' /var/lib/kolla/venv/bin/python /root/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145/service; rm -rf "/root/.ansible/tmp/ansible-tmp-1511182013.54-192485478560145/" > /dev/null 2>&1 && sleep 0'
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"arguments": "", "enabled": true, "name": "rabbitmq-server", "pattern": null, "runlevel": "default", "sleep": null, "state": "started"}, "module_name": "service"}, "msg": "Error when trying to enable rabbitmq-server: rc=1 Failed to execute operation: No such file or directory\n"}

Solution: Install rabbitmq-server in the bifrost container

docker exec -it bifrost_deploy bash
yum install rabbitmq-server

"Upgrade ironic DB Schema" fails during bifrost deploy

"Upgrade ironic DB Schema" fails at "ironic-dbsync upgrade --config-file /etc/ironic/ironic.conf" with a file not found error. This is caused by the ironic-dbsync executable not being installed. Solution - Install ironic packages into the container:

yum install openstack-ironic-common openstack-ironic-api openstack-ironic-conductor

PXE/iPXE (pxelinux.0/undionly.kpxe) missing during bifrost deploy

Follow the guide at [3] to install and configure PXE/iPXE.

nginx is missing during bifrost deploy

Install nginx:

yum install nginx

SELinux related tasks failing due to SELinux being disabled in the bifrost deploy container

Symptoms:

TASK [bifrost-ironic-install : Explicitly allow nginx and IPA port (TCP) on selinux] ***
task path: /bifrost-base-source/bifrost-4.0.0/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml:260
fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "The conditional check '(ansible_os_family == 'RedHat' or ansible_os_family == 'Suse') and ansible_selinux.status == 'enabled' and ansible_selinux.mode == \"enforcing\"' failed. The error was: error while evaluating conditional ((ansible_os_family == 'RedHat' or ansible_os_family == 'Suse') and ansible_selinux.status == 'enabled' and ansible_selinux.mode == \"enforcing\"): 'bool object' has no attribute 'status'\n\nThe error appears to have been in '/bifrost-base-source/bifrost-4.0.0/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml': line 259, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    iptables -I INPUT -p tcp --dport 6385 -i {{ network_interface }} -j ACCEPT\n- block:\n  ^ here\n"}

Solution:

Edit

vi /bifrost-base-source/bifrost-4.0.0/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml

Comment out or remove the following block:

- block:
    - name: "Explicitly allow nginx and IPA port (TCP) on selinux"
      seport:
        ports: "{{ file_url_port }},6385"
        proto: tcp
        setype: http_port_t
        state: present

    - name: "Add proper context on created data for http_boot"
      command: semanage fcontext -a -t httpd_sys_content_t "{{ http_boot_folder }}(/.*)?"

    - name: Copy ironic policy file to temporary directory
      copy:
        src: ironic_policy.te
        dest: /tmp/ironic_policy.te

    - name: Check ironic policy module
      command: checkmodule -M -m -o /tmp/ironic_policy.mod /tmp/ironic_policy.te

    - name: Package ironic policy module
      command: semodule_package -m /tmp/ironic_policy.mod -o /tmp/ironic_policy.pp

    - name: Include ironic policy module
      command: semodule -i /tmp/ironic_policy.pp

    - name: Enable ironic policy module
      command: semodule -e ironic_policy
  when: (ansible_os_family == 'RedHat' or ansible_os_family == 'Suse') and
ansible_selinux.status == 'enabled' and ansible_selinux.mode == "enforcing"

Image-build failing during bitfrost deploy due to missing diskimage-builder

Symptoms:

TASK [bifrost-create-dib-image : Initiate image build] *************************
task path: /bifrost-base-source/bifrost-4.0.0/playbooks/roles/bifrost-create-dib-image/tasks/main.yml:121
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496 `" && echo ansible-tmp-1511265018.75-262833849350496="` echo $HOME/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmprxrYqP TO /root/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496/command
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496/ /root/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496/command && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'LANG=C LC_MESSAGES=C no_proxy='"'"''"'"' http_proxy='"'"''"'"' https_proxy='"'"''"'"' LC_ALL=C DIB_INSTALLTYPE_simple_init=repo /var/lib/kolla/venv/bin/python /root/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496/command; rm -rf "/root/.ansible/tmp/ansible-tmp-1511265018.75-262833849350496/" > /dev/null 2>&1 && sleep 0'
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "disk-image-create -o /httpboot/deployment_image.qcow2 -t qcow2 centos vm enable-serial-console simple-init", "failed": true, "invocation": {"module_args": {"_raw_params": "disk-image-create        -o /httpboot/deployment_image.qcow2 -t qcow2           centos vm enable-serial-console simple-init ", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "msg": "[Errno 2] No such file or directory", "rc": 2}

Solution: Install diskimage-builder

yum install diskimage-builder

Note: Make sure

dib_os_element: centos7

is set in

/etc/bifrost/dib.yml

instead of

dib_os_element: centos

Otherwise the following failure may occur:

TASK [bifrost-create-dib-image : Initiate image build] *************************
task path: /bifrost-base-source/bifrost-4.0.0/playbooks/roles/bifrost-create-dib-image/tasks/main.yml:121
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061 `" && echo ansible-tmp-1511265599.4-237699719654061="` echo $HOME/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpeWn782 TO /root/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061/command
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061/ /root/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061/command && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'LANG=C LC_MESSAGES=C no_proxy='"'"''"'"' http_proxy='"'"''"'"' https_proxy='"'"''"'"' LC_ALL=C DIB_INSTALLTYPE_simple_init=repo /var/lib/kolla/venv/bin/python /root/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061/command; rm -rf "/root/.ansible/tmp/ansible-tmp-1511265599.4-237699719654061/" > /dev/null 2>&1 && sleep 0'
fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ["disk-image-create", "-o", "/httpboot/deployment_image.qcow2", "-t", "qcow2", "centos", "vm", "enable-serial-console", "simple-init"], "delta": "0:00:00.740333", "end": "2017-11-21 12:00:00.311265", "failed": true, "invocation": {"module_args": {"_raw_params": "disk-image-create        -o /httpboot/deployment_image.qcow2 -t qcow2           centos vm enable-serial-console simple-init ", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 1, "start": "2017-11-21 11:59:59.570932", "stderr": "Traceback (most recent call last):\n  File \"/usr/bin/element-info\", line 10, in <module>\n    sys.exit(main())\n  File \"/usr/lib/python2.7/site-packages/diskimage_builder/element_dependencies.py\", line 337, in main\n    elements = _get_elements(args.elements)\n  File \"/usr/lib/python2.7/site-packages/diskimage_builder/element_dependencies.py\", line 248, in _get_elements\n    return _expand_element_dependencies(elements, all_elements)\n  File \"/usr/lib/python2.7/site-packages/diskimage_builder/element_dependencies.py\", line 148, in _expand_element_dependencies\n    raise MissingElementException(\"Element '%s' not found\" % element)\ndiskimage_builder.element_dependencies.MissingElementException: Element 'centos' not found", "stdout": "diskimage-builder version 2.8.0\nBuilding elements: base  centos vm enable-serial-console simple-init", "stdout_lines": ["diskimage-builder version 2.8.0", "Building elements: base  centos vm enable-serial-console simple-init"], "warnings": []}