openstack nova 创建虚机流程
1文件 nova.api.openstack.coumpute.servers
1函数 def create(self, req, body):
1调用 (instances, resv_id) = self.compute_api.create(context,
2文件 nova.compute.api
2函数 def create(self, context, instance_type,
2调用 return self._create_instance(
3文件 nova.compute.api
3函数 def _create_instance(self, context, instance_type,
3调用 self.compute_task_api.build_instances(context,
4文件 nova.conductor.manager
4函数 def build_instances(self, context, instances, image, filter_properties,
5调用 hosts = self.scheduler_client.select_destinations(context,
6调用 self.compute_rpcapi.build_and_run_instance(context,
5文件 nova.scheduler.manager
5函数 def select_destinations(self, context, request_spec, filter_properties):
5调用 dests = self.driver.select_destinations(context, request_spec,
5文件 nova.scheduler.filter_scheduler
5函数 def select_destinations(self, context, request_spec, filter_properties):
6文件 nova.compute.api.manager
6函数 def build_and_run_instance(self, context, instance, image, request_spec,
6调用 self._do_build_and_run_instance(*args, **kwargs)
7文件 nova.compute.api.manager
7函数 def _do_build_and_run_instance(self, context, instance, image,
7调用 _build_and_run_instance
create_port()函数参考以下链接:
https://www.cnblogs.com/goldsunshine/p/7966427.html