← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1647629] [NEW] auto_allocate_network is not called when external network exists

 

Public bug reported:

When I try to boot an instance with '--nic auto', a network isn't created
automatically.  In neutron side, in order to automatically allocate
network/subnet/router, following network is necessary in advance:

    * router:external is True(it means an external network)
    * is_default is True
    * subnet is associated

However, if I prepared above default network, nova doesn't call
'_can_auto_allocate_network'[1].  As a result, the VM instance is attached that
external network.(not generated a network automatically)

[1]
https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1532

[Steps to reproduce]
1. Delete all network/subnet/port/router in neutron

2. Try to create an instance
  $ nova boot --flavor 1 --image 198384a2-9ece-4d24-a509-4ce02f183b63 vm1 --nic auto

ERROR (BadRequest): Unable to automatically allocate a network for project c8607bb7e4334b43aede76831b91ca03 (HTTP 400) (Request-ID: req-2d4088f6-d9aa-492d-a645-02327a058a47)
In n-api.log, we can see following error message:
Error message: {"NeutronError": {"message": "Deployment error: No default router:external network.", "type": "AutoAllocationFailure", "detail": ""}}

3. I see.  OK, let's create default external network(router:external)
  $ neutron net-create public --is_default --router:external --shared
  $ neutron subnet-create public --subnetpool a811bf33-dacc-42b9-b44a-d424f37023df

4. Try it again 'nova boot'
  $ nova boot --flavor 1 --image 198384a2-9ece-4d24-a509-4ce02f183b63 vm1 --nic auto

5. You can check the result with 'nova list'
  $ nova list
+--------------------------------------+------+--------+------------+-------------+-----------------+
| ID                                   | Name | Status | Task State | Power State | Networks        |
+--------------------------------------+------+--------+------------+-------------+-----------------+
| 4e83f9d0-acbf-4440-8563-17dd6ec0cde5 | vm1  | BUILD  | spawning   | NOSTATE     | public=10.0.0.9 |
+--------------------------------------+------+--------+------------+-------------+-----------------+

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: auto-allocate-topology

** Summary changed:

- auto_allocate_network doesn't call when external network exists
+ auto_allocate_network is not called when external network exists

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1647629

Title:
  auto_allocate_network is not called when external network exists

Status in OpenStack Compute (nova):
  New

Bug description:
  When I try to boot an instance with '--nic auto', a network isn't created
  automatically.  In neutron side, in order to automatically allocate
  network/subnet/router, following network is necessary in advance:

      * router:external is True(it means an external network)
      * is_default is True
      * subnet is associated

  However, if I prepared above default network, nova doesn't call
  '_can_auto_allocate_network'[1].  As a result, the VM instance is attached that
  external network.(not generated a network automatically)

  [1]
  https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1532

  [Steps to reproduce]
  1. Delete all network/subnet/port/router in neutron

  2. Try to create an instance
    $ nova boot --flavor 1 --image 198384a2-9ece-4d24-a509-4ce02f183b63 vm1 --nic auto

  ERROR (BadRequest): Unable to automatically allocate a network for project c8607bb7e4334b43aede76831b91ca03 (HTTP 400) (Request-ID: req-2d4088f6-d9aa-492d-a645-02327a058a47)
  In n-api.log, we can see following error message:
  Error message: {"NeutronError": {"message": "Deployment error: No default router:external network.", "type": "AutoAllocationFailure", "detail": ""}}

  3. I see.  OK, let's create default external network(router:external)
    $ neutron net-create public --is_default --router:external --shared
    $ neutron subnet-create public --subnetpool a811bf33-dacc-42b9-b44a-d424f37023df

  4. Try it again 'nova boot'
    $ nova boot --flavor 1 --image 198384a2-9ece-4d24-a509-4ce02f183b63 vm1 --nic auto

  5. You can check the result with 'nova list'
    $ nova list
  +--------------------------------------+------+--------+------------+-------------+-----------------+
  | ID                                   | Name | Status | Task State | Power State | Networks        |
  +--------------------------------------+------+--------+------------+-------------+-----------------+
  | 4e83f9d0-acbf-4440-8563-17dd6ec0cde5 | vm1  | BUILD  | spawning   | NOSTATE     | public=10.0.0.9 |
  +--------------------------------------+------+--------+------------+-------------+-----------------+

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1647629/+subscriptions


Follow ups