Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 923918

Summary: nova client "network-create" command is missing
Product: Red Hat OpenStack Reporter: Jakub Ruzicka <jruzicka>
Component: python-novaclientAssignee: Jakub Ruzicka <jruzicka>
Status: CLOSED ERRATA QA Contact: Ofer Blaut <oblaut>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: ajeain, jhenner, ndipanov, ykaul
Target Milestone: async   
Target Release: 2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-novaclient-2.10.0-11.el6ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-09 13:55:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 948938    
Bug Blocks: 920282    

Description Jakub Ruzicka 2013-03-20 17:49:02 UTC
Description of problem:
"network-create" command is required in nova client as described in bug #920282

Version-Release number of selected component (if applicable):
python-novaclient-2.10.0-7.el6

How reproducible:
$ nova network-create
...
error: argument <subcommand>: invalid choice: 'network-create'
Try `nova' for more information.


Steps to Reproduce:
1. nova network-creat
  
Additional info:
Bug #920282 has all the required information.

Comment 2 Jakub Ruzicka 2013-03-20 17:55:08 UTC
This can be fixed by backporting

https://github.com/openstack/python-novaclient/commit/e68b834f

from master.

Comment 4 Jakub Ruzicka 2013-03-20 18:37:11 UTC
I've made this backport in hurry to make it to snap5, testing is required.

Note the note in original commit:

This patch depends on https://review.openstack.org/#/c/15491/

Comment 10 Jakub Ruzicka 2013-03-26 14:00:43 UTC
I've tested 'nova-create' only part of https://review.openstack.org/#/c/16871/ but now I'm getting:

$ nova network-create --fixed-range-v4 10.0.0.0/2 test_network

ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-e2349f75-0c26-4ee0-af54-0833d5ff3f03)

2013-03-26 14:50:38 25165 ERROR nova.openstack.common.rpc.common [-] Returning exception Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 511, in dispatch
    self.engine.dispatch()
  File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 815, in dispatch
    self.process(ssn)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 1050, in process
    self.send(snd, msg)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 1261, in send
    body = enc(msg.content)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/message.py", line 28, in encode
    sc.write_primitive(type, x)
  File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 73, in write_primitive
    getattr(self, "write_%s" % type.NAME)(v)
  File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 257, in write_map
    sc.write(string.joinfields(map(self._write_map_elem, m.keys(), m.values()), ""))
  File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 250, in _write_map_elem
    sc.write_primitive(type, v)
  File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 73, in write_primitive
    getattr(self, "write_%s" % type.NAME)(v)
  File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 300, in write_list
    type = self.encoding(o)
  File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 59, in encoding
    raise CodecException("no encoding for %r" % obj)
CodecException: no encoding for <nova.db.sqlalchemy.models.Network object at 0x3590450>
 to caller

Also, something seems to be put into DB as on subsequent identical call, 500 is returned with different error:

  File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 1570, in _do_create_networks
    raise ValueError(_('cidr already in use'))
ValueError: cidr already in use


Investigating further, tips from nova devs appreciated.

Comment 11 Jakub Ruzicka 2013-04-09 16:19:27 UTC
I've backported only the network-create part of the upstream patch:

https://code.engineering.redhat.com/gerrit/#/c/4819/

Note this requires following nova fix in order to work:

https://bugzilla.redhat.com/show_bug.cgi?id=948938

Comment 13 Ofer Blaut 2013-04-28 13:58:47 UTC
Tested 

root@puma34 ~(keystone_admin)]$ nova network-create net1 --fixed-range-v4 22.22.22.0/24

[root@puma34 ~(keystone_admin)]$ nova network-list
+--------------------------------------+-------------+-----------------+
| ID                                   | Label       | Cidr            |
+--------------------------------------+-------------+-----------------+
| ba220cbf-b6c1-41f2-9cc2-14ac28713a25 | net1        | 22.22.22.0/24   |
| f2310fb2-c590-4ffb-a702-5b8b32edd87e | novanetwork | 192.168.32.0/22 |
+--------------------------------------+-------------+-----------------+

openstack-nova-network-2012.2.4-2.el6ost.noarch

Comment 15 errata-xmlrpc 2013-05-09 13:55:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0797.html