← Back to team overview

openstack team mailing list archive

some question with nova schedule

 

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

Follow ups