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启动中的同步与异步的更多相关文章

  1. 关于js中的同步和异步

    最近看到前端面试问到js中的同步和异步,这个问题该怎么回答? 梳理一下,js对于异步的处理,很多人的第一反应是ajax,这只能说是对了一半. 1.个人觉得,js中,最基础的异步是setTimeout和 ...

  2. Promise-js中的同步和异步

    js中的同步和异步   自从读了研后,走上了学术之路,每天除了看论文就是做实验,最后发现自己还是喜欢开发呀,于是我又重回前端啦~ 隔了这么久没学前端,好像很多东西都忘了不少,而且不得不说前端的技术更新 ...

  3. .NET通信中的同步和异步处理

    同步与异步的概念: .NET中的通信数据处理有同步和异步之分,我理解的同步过程是接收端接收数据,如果数据没有过来,就一直等着(阻塞过程),直到有数据传送过来可以接收,接下来程序才继续向下进行:异步过程 ...

  4. 让你高效的理解JavaScript中的同步、异步和事件循环

    "同步请求","异步请求"相信这两词在程序猿的世界中频频出现,到底是词性的妖娆,还是撸代码的基础要求,下面直接分享本人学习的好东西,保证让你深入浅出,爽得不要不 ...

  5. JS中的同步和异步

    javascript语言是一门“单线程”的语言,不像java语言,类继承Thread再来个thread.start就可以开辟一个线程,所以,javascript就像一条流水线,仅仅是一条流水线而已,要 ...

  6. 微软BI 之SSIS 系列 - 理解Data Flow Task 中的同步与异步, 阻塞,半阻塞和全阻塞以及Buffer 缓存概念

    开篇介绍 在 SSIS Dataflow 数据流中的组件可以分为 Synchronous 同步和 Asynchronous 异步这两种类型. 同步与异步 Synchronous and Asynchr ...

  7. node.js中对同步,异步,阻塞与非阻塞的理解

    我们都知道javascript是单线程的,node.js是一个基于Chrome V8 引擎的 javascript 运行时环境,注意 node.js 不是一门语言,别搞错了. javascript为什 ...

  8. java交互方式中的同步与异步

    JAVA中交互方式分为同步和异步两种: 1.同步交互:指发送一个请求,需要等待返回,然后才能够发送下一个请求,有个等待过程; 2.异步交互:指发送一个请求,不需要等待返回,随时可以再发送下一个请求,即 ...

  9. 如何理解javascript中的同步和异步

    javascript语言是一门“单线程”的语言,不像java语言,类继承Thread再来个thread.start就可以开辟一个线程,所以,javascript就像一条流水线,仅仅是一条流水线而已,要 ...

随机推荐

  1. EasyNVR摄像机无插件直播如何排查视频广场不在线

    通道配置完成进入视频广场监控通道显示不在线 保证RTSP视频流地址是否可用,推荐用VLC先测试地址是否可用.(注意:软件本身只支持标准的RTSP视频流地址.) 如果是刚配置完需要等大概几秒左右有的网络 ...

  2. 参数Slave_IO_Running和Slave_SQL_Running的状态值解析

     Slave_SQL_Running: No mysql同步故障解决方法 2010-02-21 16:31:30 标签:mysql 双机 同步 数据库 休闲 原创作品,允许转载,转载时请务必以超链接形 ...

  3. Git is fundamentally a content-addressable filesystem with a VCS user interface written on top of it

    w “加一层去解决问题”:计算机解决问题的思路.怎样将其应用到代码中呢?比如亚马逊接口的开发. git加一UI层去实现易用性和降低用户的迁移成本. https://git-scm.com/book/e ...

  4. openvas-tutorial-for-beginners

    https://jonathansblog.co.uk/openvas-tutorial-for-beginners

  5. Vue页面上实时显示当前时间,每秒更新

    有时候我们需要在页面上添加一个类似时钟的东西来实时显示当前时间,这个时候我们可以利用定时器来完成这个功能 <div id="app"> {{date}} </di ...

  6. MySQL中锁问题

    1.脏读 脏页只是在缓冲池中已经修改的页但是没有刷新到磁盘中,即数据库实例内存中的页和磁盘中的页事不一致的,当然在刷新到磁盘之前,日志都已经被写入到了重做日志文件中,而所谓的脏数据是指事务对缓冲池中行 ...

  7. 解决vsftp &quot;上传 553 Could not create file&quot;

    这个问题仅仅要:       1. setsebool -P ftpd_disable_trans 1       2. service vsftpd restart       太纠结了,呵呵

  8. CSS让一个元素一闪一闪的

    .heart{ animation:heart 1s ease infinite; } @keyframes heart { 0% {opacity:0.1;} 100%{;} }

  9. Mac 安装Minikube

    环境信息: guoguo-MacBook-Pro-3:~ guoguo$ docker versionClient: Version:    17.12.0-ce API version:    1. ...

  10. (2)linux未使用eth0,未使用IPV4导致无法连接

    首先ifconfig查看网络IP 看,我这里默认启用了2个网卡,一个是eth0,另一个是lo(基于loopback方式) 1.如果有eth0则做:界面修改 (1)输入命令setup,选择network ...