Fab Install of Openstack fails if cfgm node not defined

Bug #1567084 reported by Nitish Krishna Kaveri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Invalid
Wishlist
Nagendra Prasath
Trunk
Invalid
Wishlist
Nagendra Prasath

Bug Description

Trying to use Fab to Provision a node with only openstack and another node with contrail without openstack.

Testbed.py has the following env.roledefs:

env.roledefs = {
    'all': [host1],
    'openstack': [host1],
   'build': [host_build],
}

But this gives me and error when I run:
fab setup_rabbitmq_cluster
Or even fab pre_check:

root@server13:/opt/contrail/utils# fab setup_rabbitmq_cluster
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/fabric/main.py", line 658, in main
    docstring, callables, default = load_fabfile(fabfile)
  File "/usr/local/lib/python2.7/dist-packages/fabric/main.py", line 165, in load_fabfile
    imported = importer(os.path.splitext(fabfile)[0])
  File "/opt/contrail/utils/fabfile/__init__.py", line 15, in <module>
    from config import *
  File "/opt/contrail/utils/fabfile/config.py", line 31, in <module>
    env.roledefs['rabbit'] = env.roledefs['cfgm']
KeyError: ‘cfgm'

The error originates in this line:
https://github.com/Juniper/contrail-fabric-utils/blob/master/fabfile/config.py#L31

Tags: provisioning
Revision history for this message
Ignatious Johnson Christopher (ijohnson-x) wrote :
Download full text (3.1 KiB)

Ignatious,

    This didn’t worked for me, I have tried this earlier and ran into multiple problems (while doing this, contrail-cluster didn't exists):
Along with the change you mentioned, need to change amqp_roles = ['cfgm’] to [] in setup_rabbitmq_cluster task.
Set manage_amqp=yes in env.openstack in testbed.py.
With the above change, it fails with error referring to cfgm in create_default_secgrp_rules
File "/home/sudheendra/contrail-packages/networking/contrail-tools/contrail-fabric-utils/fabfile/tasks/services.py", line 3, in <module>
from misc import zoolink
File "/home/sudheendra/contrail-packages/networking/contrail-tools/contrail-fabric-utils/fabfile/tasks/misc.py", line 147, in <module>
@hosts(*env.roledefs['cfgm'][:1])
KeyError: 'cfgm'
To work around the problem I enabled the other roles under roledefs but keeping all to only openstack in testbed.py
env.roledefs = {
    'all': [host3], <<<<<<<<
    'cfgm': [host1, host2],
    'webui': [host1],
    'openstack': [host3],
    'control': [host1, host2],
    'collector': [host1],
    'database': [host2],
    'compute': [host4, host5, host6],
    'build': [host_build]
}
With the above change it fails to copy the rabbitmq-env.conf to the target node as /etc/rabbitmq folder doesn’t exists.
After adding the code to create this folder on the target it fails in verify_cluster_status with error:
RabbitMQ cluster doesnt list root@10.204.216.111 in running_nodes
By skipping the setup_rabbitmq_cluster for openstack node, I continued with install_orchestrator and setup_orchestrator.
I think install_orchestrator also expects the cfgm and collector roles to be present as part of roledefs otherwise it fails.
setup_orchestor also expects cfgm node to be present, this happens when ceilometer is enabled in testbed.py
The code path is under setup_openstack function:
if env.host_string == env.roledefs['openstack'][0]:
    execute("setup_ceilometer_node", env.host_string)
    execute("setup_network_service") #Provisions in cfgm node <<<<<<<<
By disabling the ceilometer, I could able to complete installation of contrail-openstack on the node.
The other problems that am observing are:
After installing contrail-opensatck on different node, I tried to bringup contrail-cluster using contrail-networking package.
While doing this, I used upgrade_kernel_without_openstack fab task and it failed, but I don’t remember what was the problem.
I will check this again and get back to you.
Tried contrail-cloud package to install contrail-openstack and ran into package dependency issue for nova-novncproxy
Nagendra is checking this.
Thanks,
Sudhee.

From: Ignatious Johnson <email address hidden>
Date: Thursday, April 7, 2016 at 2:47 AM
To: Nagendra Prasath Maynattamai Prem Chandran <email address hidden>
Cc: Abhay Joshi <email address hidden>, Sudheendra Rao <email address hidden>, Nitish Krishna Kaveri Poompatnam <email address hidden>
Subject: Re: Bug in Fab Install of node with ONLY OPENSTACK

Ok we need to set the env.roledefs['rabbit’]
 to empty list as we do in the line
https://github.com/Juniper/contrail-fabric-utils/blob/master/fabfile/config.py#L36 for openstack.

Nitish,
Can you try the fix

env.roledefs['rabbit']...

Read more...

Revision history for this message
Nagendra Prasath (npchandran) wrote :

Reopen if it still affects. Closing

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.