← Back to team overview

openstack team mailing list archive

Re: some question with nova schedule

 

Thanks gong,

I also noticed that, what is wisdom behind this "delay update"?

I encountered a problem in current openstack. After I installed openstack
with devstack with "multi_host=1", I found newly started instance can not
get a fix ip from dhcp server, since nova-br100.conf didn't hold the
related information. but when I start the second instance, at this point
the mac/fix_ip information for the first instance will then be written to
nova-br100.conf and the first instance work well.

my guest for this problem is like this:
(1)nova-scheduler did not  update the "host" field in database,
(2)so nova-network cann't get the mac/ip information, so nova-br100.conf is
empty and instance can not get its fix ip.
     related code: nova/network/linux_net.py
     def get_dhcp_hosts(context, network_ref):
    """Get network's hosts config in dhcp-host format."""
    hosts = []
    host = None
    if network_ref['multi_host']:
        host = FLAGS.host
    #pdb.set_trace()
    for data in db.network_get_associated_fixed_ips(context,
                                                    network_ref['id'],
                                                    host=host):
        hosts.append(_host_dhcp(data))
    return '\n'.join(hosts)

(3)the second instance is started, at this time, the "host" field for first
instance is already updated by self.compute_rpcapi.run_instance.
(4)nova-network get the mac/ip information correctly and dump to
nova-br100.conf, so the first instance can get its fix ip.

any comments??


-----------------------------------------------------------------
韦远科
中国科学院 计算机网络信息中心
北京市海淀区中关村南四街四号 349信箱(100190)

Yuanke Wei (Wei)
Computer Network Information Center,Chinese Academy of Sciences
4 Zhongguancun Nansijie, Haidian District, Beijing 100190, China
P.O. Box 349
gtalk: weiyuanke123@xxxxxxxxx
msn: weiyuanke123@xxxxxxxxxxx



On Fri, Oct 12, 2012 at 10:14 AM, gong yong sheng <
gongysh@xxxxxxxxxxxxxxxxxx> wrote:

>  read on:
> we will send the host to compute manager:
>
>
>     def _provision_resource(self, context, weighted_host, request_spec,
>             filter_properties, requested_networks, injected_files,
>             admin_password, is_first_time, instance_uuid=None):
>         """Create the requested resource in this Zone."""
>         # Add a retry entry for the selected compute host:
>         self._add_retry_host(filter_properties,
> weighted_host.host_state.host)
>
>         self._add_oversubscription_policy(filter_properties,
>                 weighted_host.host_state)
>
>         payload = dict(request_spec=request_spec,
>                        weighted_host=weighted_host.to_dict(),
>                        instance_id=instance_uuid)
>         notifier.notify(context, notifier.publisher_id("scheduler"),
>                         'scheduler.run_instance.scheduled', notifier.INFO,
>                         payload)
>
>         updated_instance = driver.instance_update_db(context,
> instance_uuid)
>
>         self.compute_rpcapi.run_instance(context,
> instance=updated_instance,
>                 host=weighted_host.host_state.host,
>                 request_spec=request_spec,
> filter_properties=filter_properties,
>                 requested_networks=requested_networks,
>                 injected_files=injected_files,
>                 admin_password=admin_password, is_first_time=is_first_time)
>
> On 10/12/2012 09:54 AM, 韦远科 wrote:
>
> hi,
>
>  I read the following code in nova scheduler and have some questions with
> the code marked in yellow.
> the following code can be found at "
> https://github.com/openstack/nova/blob/master/nova/scheduler/filter_scheduler.py
> "
>
>
>
> def _provision_resource(self, context, weighted_host, request_spec,
>
>
>             filter_properties, requested_networks, injected_files,
>
>
>             admin_password, is_first_time, instance_uuid=None):
>
>
>         """Create the requested resource in this Zone."""
>
>
>         # Add a retry entry for the selected compute host:
>
>
>         self._add_retry_host(filter_properties, weighted_host.host_state.host)
>
>
>
>         self._add_oversubscription_policy(filter_properties,
>
>
>                 weighted_host.host_state)
>
>
>
>
>         payload = dict(request_spec=request_spec,
>
>
>                        weighted_host=weighted_host.to_dict(),
>
>
>                        instance_id=instance_uuid)
>
>
>         notifier.notify(context, notifier.publisher_id("scheduler"),
>
>
>                         'scheduler.run_instance.scheduled', notifier.INFO,
>
>
>                         payload)
>
>
>
>
>         updated_instance = driver.instance_update_db(context, instance_uuid)
>
>
>         #at this point, we already know the host which will provision the instance, that is recorded in variable *weighted_host.*
>
>
> *        *But actually, the *instance_update_db* function only update "values = {'host': None, 'scheduled_at': now}" in database,
>
>
>         So why????
>
>
>
>
>
>
>         can someone give me some help? thanks very much!
>
>
>
>
>  -----------------------------------------------------------------
> 韦远科
> 中国科学院 计算机网络信息中心
> 北京市海淀区中关村南四街四号 349信箱(100190)
>
>  Yuanke Wei (Wei)
> Computer Network Information Center,Chinese Academy of Sciences
> 4 Zhongguancun Nansijie, Haidian District, Beijing 100190, China
> P.O. Box 349
>  gtalk: weiyuanke123@xxxxxxxxx
>  msn: weiyuanke123@xxxxxxxxxxx
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
>
>
>

References