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 [^[[;36mreq-7ceeb23a-1d2e-401b-bbb7-2d8058715e82 ^[[;36madmin admin^[[;33m] ^[[;35m^[[;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 , in inner
return func(*args, **kwargs) File "/opt/stack/nova/nova/scheduler/manager.py", line , in select_destinations
filter_properties) File "/opt/stack/nova/nova/scheduler/filter_scheduler.py", line , in select_destinations
raise exception.NoValidHost(reason=reason) NoValidHost: No valid host was found. There are not enough hosts available.
^[[00m
-- ::32.496 ^[[;33mWARNING nova.scheduler.utils [^[[;36mreq-7ceeb23a-1d2e-401b-bbb7-2d8058715e82 ^[[;36madmin admin^[[;33m] ^[[;35m[instance: 47b93a3e-b7d1-428f-9b7c-edd80c0735db] ^[[;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均为异步
nova instance启动中的同步与异步的更多相关文章
- 关于js中的同步和异步
最近看到前端面试问到js中的同步和异步,这个问题该怎么回答? 梳理一下,js对于异步的处理,很多人的第一反应是ajax,这只能说是对了一半. 1.个人觉得,js中,最基础的异步是setTimeout和 ...
- Promise-js中的同步和异步
js中的同步和异步 自从读了研后,走上了学术之路,每天除了看论文就是做实验,最后发现自己还是喜欢开发呀,于是我又重回前端啦~ 隔了这么久没学前端,好像很多东西都忘了不少,而且不得不说前端的技术更新 ...
- .NET通信中的同步和异步处理
同步与异步的概念: .NET中的通信数据处理有同步和异步之分,我理解的同步过程是接收端接收数据,如果数据没有过来,就一直等着(阻塞过程),直到有数据传送过来可以接收,接下来程序才继续向下进行:异步过程 ...
- 让你高效的理解JavaScript中的同步、异步和事件循环
"同步请求","异步请求"相信这两词在程序猿的世界中频频出现,到底是词性的妖娆,还是撸代码的基础要求,下面直接分享本人学习的好东西,保证让你深入浅出,爽得不要不 ...
- JS中的同步和异步
javascript语言是一门“单线程”的语言,不像java语言,类继承Thread再来个thread.start就可以开辟一个线程,所以,javascript就像一条流水线,仅仅是一条流水线而已,要 ...
- 微软BI 之SSIS 系列 - 理解Data Flow Task 中的同步与异步, 阻塞,半阻塞和全阻塞以及Buffer 缓存概念
开篇介绍 在 SSIS Dataflow 数据流中的组件可以分为 Synchronous 同步和 Asynchronous 异步这两种类型. 同步与异步 Synchronous and Asynchr ...
- node.js中对同步,异步,阻塞与非阻塞的理解
我们都知道javascript是单线程的,node.js是一个基于Chrome V8 引擎的 javascript 运行时环境,注意 node.js 不是一门语言,别搞错了. javascript为什 ...
- java交互方式中的同步与异步
JAVA中交互方式分为同步和异步两种: 1.同步交互:指发送一个请求,需要等待返回,然后才能够发送下一个请求,有个等待过程; 2.异步交互:指发送一个请求,不需要等待返回,随时可以再发送下一个请求,即 ...
- 如何理解javascript中的同步和异步
javascript语言是一门“单线程”的语言,不像java语言,类继承Thread再来个thread.start就可以开辟一个线程,所以,javascript就像一条流水线,仅仅是一条流水线而已,要 ...
随机推荐
- AngularJS定时器任务
由于项目需要监测用户在线时长,所以用定时器来实现. /*计算在线时长,一分钟执行一次*/ var stopEvent = $interval(function(){ //每分钟执行一次定时任务 $sc ...
- 大型软件公司.net面试题
1:a=10,b=15,在不用第三方变量的前提下,把a,b的值互换 2:已知数组int[] max={6,5,2,9,7,4,0};用快速排序算法按降序对其进行排列,并返回数组 3:请简述面向 ...
- TFS二次开发-基线文件管理器(5)-源码文件的读取
在上一节中,我们在保存标签之前,已经将勾选的文件路径保存到了Listbox中,这里只需要将保存的数据输出去为txt文档就可以做版本控制了. 版本文件比较复杂的是如何读取,也就是如何通过文件路径 ...
- a database of all existing files
mlocate.db(5): mlocate database - Linux man page https://linux.die.net/man/5/mlocate.db Name mlocat ...
- What are DESC and ASC Keywords?
What are DESC and ASC Keywords? ASC is the short form for ascending DESC is the short form for desce ...
- linux c编程:System V消息队列一
消息队列可以认为是一个消息链表,System V 消息队列使用消息队列标识符标识.具有足 够特权的任何进程都可以往一个队列放置一个消息,具有足够特权的任何进程都可以从一个给定队列读出一个消息.在某个进 ...
- App的开发过程
不同的项目管理模式或许会有完全不同的流程步骤.但是专业性几乎是保证产品质量的唯一准则. App的开发过程主要分为以下阶段,本文会按顺序为大家简单地说明: 1.需求梳理.分析 2.产品原型图绘制 3.U ...
- brew和brew cask安装
brew 是从下载源码解压然后 ./configure && make install ,同时会包含相关依存库.并自动配置好各种环境变量,而且易于卸载. 这个对程序员来说简直是福音,简 ...
- Nginx和php-fpm部署到不同的服务器
Nginx安装滤过,基本上nginx上的配置很少,只要添加个server就可以了,主要安装php-fpm服务 php7.1.3安装 1.安装依赖的软件包yum -y install gcc gcc-c ...
- Hibernate学习---缓存机制
前言:这些天学习效率比较慢,可能是手头的事情比较多,所以学习进度比较慢. 在之前的Hibernate学习中,我们无论是CURD,对单表查询还是检索优化,我们好像都离不开session,session我 ...