cidr for share-network is set only if neutron subnet provided via creation operation. If we provide it via update operation then this field stay None.
For the moment this field is used by NetApp Cluster Mode driver and causes following error:
2014-08-15 20:23:58.415 ERROR manila.share.manager [req-dbccb555-c101-4c45-a456-b58399dad450 cc674b8857534ab98e10290f44548b75 c1034c6ff2df458fb528a50260ac8cdb] Failed to get share server for share creation.
2014-08-15 20:23:58.428 ERROR oslo.messaging.rpc.dispatcher [req-dbccb555-c101-4c45-a456-b58399dad450 cc674b8857534ab98e10290f44548b75 c1034c6ff2df458fb528a50260ac8cdb] Exception during message handling: unexpected type <type 'Non
eType'> for addr arg
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 203, in create_share
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher {'status': 'error'})
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/openstack/common/excutils.py", line 82, in __exit__
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 197, in create_share
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher context, share_network_id, share_id)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 154, in _provide_share_server_for_share
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher return _provide_share_server_for_share()
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/openstack/common/lockutils.py", line 325, in inner
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher return f(*args, **kwargs)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 147, in _provide_share_server_for_share
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher share_server = self._setup_server(context, share_server)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 423, in _setup_server
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher self.network_api.deallocate_network(context, share_network)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/openstack/common/excutils.py", line 82, in __exit__
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 411, in _setup_server
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher metadata=metadata)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/drivers/netapp/cluster_mode.py", line 223, in setup_server
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher vserver_name = self._vserver_create_if_not_exists(network_info)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/drivers/netapp/cluster_mode.py", line 385, in _vserver_create_if_not_exists
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher netmask = utils.cidr_to_netmask(network_info['cidr'])
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/utils.py", line 921, in cidr_to_netmask
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher network = netaddr.IPNetwork(cidr)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 931, in __init__
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher implicit_prefix, flags)
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 826, in parse_ip_network
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher raise TypeError('unexpected type %s for addr arg' % type(addr))
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher TypeError: unexpected type <type 'NoneType'> for addr arg
2014-08-15 20:23:58.428 TRACE oslo.messaging.rpc.dispatcher
The similiar exception was thrown when create the first share with a new share network.
The neutron net information is not saved into manila when creating the share network(see below command output). The neutron net information is fetched during the share server creation, a.k.a. creating first share with this share network.
stack@openstack -tangt1- 01:/opt/ stack/logs/ screen$ manila share-network-show manila-demo1 ------- ------+ ------- ------- ------- ------- ------- ---+ ------- ------+ ------- ------- ------- ------- ------- ---+ 21T00:34: 40.000000 | c088-4e2a- bca0-564a577c56 fb | 000d-45ea- ae97-49c5ac99cd 37 | ab98-4ff6- 9dd6-6144a379fb 54 | ca41f54fe0ffbfb e5 | ------- ------+ ------- ------- ------- ------- ------- --
+------
| Property | Value |
+------
| cidr | None |
| created_at | 2014-08-
| description | None |
| id | 88f7c6f7-
| ip_version | None |
| name | manila-demo1 |
| network_type | None |
| neutron_net_id | dbd3d4ab-
| neutron_subnet_id | f7619e24-
| project_id | f8842351bf59472
| segmentation_id | None |
| status | None |
| updated_at | None |
+------
In Manila share manager manila/ share/manager. py
def _setup_server(self, context, share_server, metadata=None):
share_ network = self.db. share_network_ get(
context, share_server[ 'share_ network_ id']) ==> share network is get from DB here
allocation _number = self.driver. get_network_ allocations_ number( )
self. network_ api.allocate_ network( ==> The neutron net information is get and save to DB now
context, share_server, share_network,
count= allocation_ number)
try:
if allocation_number: