nova instance启动中的同步与异步
instance create:
nova/api/servers.create -- self.compute_api.create -- self.compute_task_api.build_instances
-- self.conductor_compute_rpcapi.build_instances(conductorp/api.py) -- cctxt.cast(context, 'build_instances', **kw)
从nova api到conductor的调用为异步
conductor manager 里面:
1. hosts = self._schedule_instances:
-- self.scheduler_client.select_destinations -- self.scheduler_rpcapi.select_destinations -- cctxt.call(ctxt, 'select_destinations'
从conductor调用select_destinations到scheduler采用同步
所以,当FilterScheduler有异常:
reason = _('There are not enough hosts available.')
raise exception.NoValidHost(reason=reason)
scheduler manager 中利用@messaging.expected_exceptions(exception.NoValidHost)
把该异常传回给conductor,conductor在这里捕获该异常并把状态设置为ERROR:
except Exception as exc: updates = {'vm_state': vm_states.ERROR, 'task_state': None} for instance in instances: self._set_vm_state_and_notify( context, instance.uuid, 'build_instances', updates, exc, request_spec) return
出错为:
nova.scheduler.utils [^[[01;36mreq-7ceeb23a-1d2e-401b-bbb7-2d8058715e82 ^[[00;36madmin admin^[[01;33m] ^[[01;35m^[[01;33mFailed to compute_task_build_instances: No valid host was found. There are not enough hosts available. Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 150, in inner return func(*args, **kwargs) File "/opt/stack/nova/nova/scheduler/manager.py", line 71, in select_destinations filter_properties) File "/opt/stack/nova/nova/scheduler/filter_scheduler.py", line 81, in select_destinations raise exception.NoValidHost(reason=reason) NoValidHost: No valid host was found. There are not enough hosts available. ^[[00m 2016-01-07 02:26:32.496 ^[[01;33mWARNING nova.scheduler.utils [^[[01;36mreq-7ceeb23a-1d2e-401b-bbb7-2d8058715e82 ^[[00;36madmin admin^[[01;33m] ^[[01;35m[instance: 47b93a3e-b7d1-428f-9b7c-edd80c0735db] ^[[01;33mSetting instance to ERROR state.^[[00m
2. self.compute_rpcapi.build_and_run_instance:
cctxt.cast(ctxt, 'build_and_run_instance -- utils.spawn_n -- eventlet.spawn_n
从conductor调用到compute为异步调用
其他:
conductor/rpcapi/ComputeTaskAPI中,对conductor的远程调用
migrate_server为同步
其他build_instances/unshelve_instance/rebuild_instance均为异步
- Borg和Kubernetes有什么不同?未来的云需要什么? 4000
- JVM性能调优之生成堆的dump文件
- Android DrawerLayout 高仿QQ5.2双向侧滑菜单
- FBX文件简述
- BZOJ 3236 AHOI 2013 作业 莫队算法
- Myeclipse2013的优化设置
- MySql计数器,如网站点击数,如何实现高性能高并发的计数器功能
- Http 协议
- Eclipse上安装GIT插件EGit
- 修改(My)Eclipse默认的Servlet和jsp代码模板
- 读书笔记之稻盛和夫自传
- 压缩感知的常见稀疏基名称及离散傅里叶变换基
- 文件保存读取
- 大型网站架构演变和知识体系
- 我的测试团队管理之道
- eclipse中导入maven项目出现UNbound classpath variable
- SUSE11开启Xmanager
- java FlowLayout 流式布局演示
- mac下使用github 上传代码
- PHP程序员的技术成长规划【精】