ERROR: NetworkHostNotSet boot with --nic option

Bug #953426 reported by Nachi Ueno
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya
Essex
Won't Fix
Undecided
Unassigned

Bug Description

ERROR: NetworkHostNotSet boot with --nic option

nova boot --image c11aec73-355b-4186-86fb-934bf6567e27 --flavor 4 --nic net-id=800e54c5-edf0-4e35-8b7e-271a724dacd5,v4-fixed-ip=192.168.21.3 test_instance

ERROR: NetworkHostNotSet: Host is not set to the network (9). (HTTP 400)

As Error message says, this is because Network host didn't set.
Same command will be success after instance creation without nic paramaters.

Tags: network
Revision history for this message
Mark McLoughlin (markmc) wrote :

Ok, I'm looking at NetworkManager.allocate_for_instance()

 networks = self._get_networks_for_instance(admin_context,
                                        instance_id, project_id,
                                        requested_networks=requested_networks)
        ...
        self._allocate_fixed_ips(admin_context, instance_id,
                                 host, networks, vpn=vpn,
                                 requested_networks=requested_networks)

get_networks_for_instance() looks up the networks using network_get_all_by_uuids() and this is what throws NetworkHostNotSet if the network isn't associated with a host

However, it looks to me like the network will only be associated with a host by the set_network_host() in RPCAllocateFixedIP._allocate_fixed_ips()

i.e. we're requiring the network to be associated with a host before actually doing the association

Marking Confirmed, something looks wrong here

Nachi - could you provide some more details on exactly what version you're using, whether you can still reproduce, what network manager you're using, whether you have enabled multi_host etc.? Also the exact steps to reproduce - e.g. I think this would only happen if the user requests a specific network when that network was never used before

tags: added: network
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Yovko Yovkov (yyovkov) wrote :

Hi Mark,

I'm facing the same issue on CentOS 6 and the packages are:
openstack-dashboard-2012.1-4.el6.noarch
openstack-utils-2012.1-2.el6.noarch
openstack-keystone-2012.1-8.el6.noarch
openstack-glance-2012.1.1-1.el6.noarch
openstack-nova-2012.1.1-3.el6.noarch

Regards,
Yovko Yovkov

Revision history for this message
melanie witt (melwitt) wrote :

@markmc,

I have seen this happen in Essex using FlatManager and networks created with --multi_host=T.

I compared the code you mentioned:

Essex: https://github.com/openstack/nova/blob/stable/essex/nova/db/sqlalchemy/api.py#L1951

Folsom: https://github.com/openstack/nova/blob/stable/folsom/nova/db/sqlalchemy/api.py#L2164

so it seems this shouldn't be a problem anymore in Folsom.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

I believe the code from this patch will fix it:

https://github.com/openstack/nova/commit/7937144fce54570b2da543663e6ee5e64b1c3cdb

It might be a little tricky to backport it to essex and is probably out of scope for stable/essex.

Revision history for this message
Vish Ishaya (vishvananda) wrote :
Revision history for this message
Vish Ishaya (vishvananda) wrote :
Changed in nova:
status: Confirmed → Fix Released
assignee: nobody → Vish Ishaya (vishvananda)
Thierry Carrez (ttx)
no longer affects: nova/folsom
Changed in nova:
milestone: none → 2012.2
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.