Issue While Creating Neutron Database Schema [closed]

asked 2014-06-14 06:50:47 -0500

rahulrajvn gravatar image

updated 2014-06-14 08:35:28 -0500

SamYaple gravatar image

Hi ,

I am trying to Configure neutron as part of Openstack implementation and have got stuck at this point. As per the Docs we used to initialize the database's of different services like keystone , nova etc using openstack-db --init . But for neutron its not mentioned about any initializing.

http://docs.openstack.org/icehouse/in... .

I have tried following two commands to initialize the database but both

openstack-db --init --service neutron --password **********

and

neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head

Error Which I get >

No handlers could be found for logger "neutron.common.legacy"

Traceback (most recent call last):

  File "/usr/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/cli.py", line 169, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/cli.py", line 60, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/alembic/command.py", line 189, in current
    script.run_env()
  File "/usr/lib/python2.6/site-packages/alembic/script.py", line 191, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.6/site-packages/alembic/util.py", line 186, in load_python_file
    module = imp.load_source(module_id, path, open(path, 'rb'))
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/alembic_migrations/env.py", line 42, in <module>
    importutils.import_class(class_path)
  File "/usr/lib/python2.6/site-packages/neutron/openstack/common/importutils.py", line 33, in import_class
    traceback.format_exception(*sys.exc_info())))
ImportError: Class ml2 cannot be found (['Traceback (most recent call last):\n', '  File "/usr/lib/python2.6/site-packages/neutron/openstack/common/importutils.py", line 28, in import_class\n    __import__(mod_str)\n', 'ValueError: Empty module name\n'])
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by rahulrajvn
close date 2014-06-18 04:42:20.581402

Comments

What is value of service_plugins in neutron.conf when you run neutron-db-manage ?

dbaxps gravatar imagedbaxps ( 2014-06-14 07:10:15 -0500 )edit
dbaxps gravatar imagedbaxps ( 2014-06-14 07:35:19 -0500 )edit

Thank you for the update. I have checked those urls..One of my doubt is..Should we initialize the neutron database after creating it.

rahulrajvn gravatar imagerahulrajvn ( 2014-06-14 09:09:54 -0500 )edit
1

I've just done Multi Node IceHouse Neutron ML2&OVS&GRE Setup via packstack:-

[root@icehouse1 ~(keystone_admin)]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1010
Server version: 5.5.36-MariaDB-wsrep MariaDB Server, wsrep_25.9.r3961

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cinder             |
| glance             |
| keystone           |
| mysql              |
| neutron            |
| nova               |
| performance_schema |
| test               |
+--------------------+
9 rows in set (0.00 sec)

MariaDB [(none)]> use neutron;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [neutron]> show tables ;
+------------------------------+
| Tables_in_neutron            |
+------------------------------+
| agents                       |
| alembic_version              |
| allowedaddresspairs          |
| arista_provisioned_nets      |
| arista_provisioned_tenants   |
| arista_provisioned_vms       |
| cisco_ml2_credentials        |
| cisco_ml2_nexusport_bindings |
| consistencyhashes            |
| dnsnameservers               |
| externalnetworks             |
| extradhcpopts                |
| floatingips                  |
| ipallocationpools            |
| ipallocations                |
| ipavailabilityranges         |
| ml2_brocadenetworks          |
| ml2_brocadeports             |
| ml2_flat_allocations         |
| ml2_gre_allocations          |
| ml2_gre_endpoints            |
| ml2_network_segments ...
(more)
dbaxps gravatar imagedbaxps ( 2014-06-14 09:20:38 -0500 )edit

I am not Using Packstack. So I think I need to initialize the database manually. I have tried it with it with openstack-db and neutron-db-manage , both are giving same error which I have mentioned above.

rahulrajvn gravatar imagerahulrajvn ( 2014-06-14 09:44:50 -0500 )edit

Per https://ask.openstack.org/en/question...

neutron-db-manage --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini stamp head

View also text follows by this command

dbaxps gravatar imagedbaxps ( 2014-06-14 10:17:32 -0500 )edit

Above command also gave the same error.

But after a restart of openstack-service I could see following Tables in the neutron database.

Database changed

mysql> show tables;

+-----------------------+

| Tables_in_neutron |

+-----------------------+

| agents |

| externalnetworks |

| ml2_flat_allocations |

| ml2_gre_allocations |

| ml2_gre_endpoints |

| ml2_vlan_allocations |

| ml2_vxlan_allocations |

| ml2_vxlan_endpoints |

| networks |

| ports |

| quotas |

| securitygrouprules |

| securitygroups |

+-----------------------+

13 rows in set (0.00 sec)

But some of the tables are still missing.

rahulrajvn gravatar imagerahulrajvn ( 2014-06-14 10:40:57 -0500 )edit
1

I believe that files

   /usr/share/neutron/neutron-dist.conf 
    /etc/neutron/neutron.conf 
    /etc/neutron/plugin.ini

should be properly tuned to succeed

dbaxps gravatar imagedbaxps ( 2014-06-14 10:59:43 -0500 )edit

Scroll to the bottom for my samples Samples here at the bottom

dbaxps gravatar imagedbaxps ( 2014-06-14 11:11:06 -0500 )edit

Hmm.. Let me try again. Thank you for the updates..:)

rahulrajvn gravatar imagerahulrajvn ( 2014-06-14 11:11:43 -0500 )edit

Hi, I was able to complete the setup once I redid the neutron part Seems there was some mistake in the configuration . Thank you All

rahulrajvn gravatar imagerahulrajvn ( 2014-06-18 04:43:51 -0500 )edit

hi ,

i follow the installation guide : http://docs.openstack.org/icehouse/in... i have three nodes (controller0,network0,compute0) i meet same issue, how do you fix it?

vi /etc/neutron/neutron.conf

[DEFAULT]
verbose = True
debug = True 
auth_strategy = keystone
rpc_backend = neutron.openstack.common.rpc.impl_qpid
qpid_hostname = controller0
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://controller0:8774/v2
nova_admin_username = nova
nova_admin_tenant_id = 756f65748ca34f0689dfea1d03d79da0
nova_admin_password = nova
nova_admin_auth_url = http://controller0:35357/v2.0
core_plugin = ml2 
service_plugins = router
[quotas]
[agent]
[keystone_authtoken]
auth_uri = http://controller0:5000
auth_host = controller0
auth_protocol = http
auth_port = 35357
admin_tenant_name = service
admin_user = neutron
admin_password = neutron
[database]
connection = mysql://neutron:openstack@controller0/neutron
[service_providers]
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default

vi /etc/neutron/plugin.ini

[ml2]
type_drivers = gre
tenant_network_types = gre
mechanism_drivers = openvswitch
[ml2_type_flat]
[ml2_type_vlan]
[ml2_type_gre]
tunnel_id_ranges = 1:1000
[ml2_type_vxlan]
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enable_security_group = True
Yong gravatar imageYong ( 2014-08-05 09:51:11 -0500 )edit