SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
A FIRST STEP INTO NOVA
         by can.
NOVA 2011.3 DIABLO/


• setup.py:安装脚本

• bin:可执行程序,
 比如nova-manage等

• nova:核心文件
/SETUP.PY
try:
    from DistUtilsExtra.auto import setup
except ImportError:
    from setuptools import setup
...

setup(name='nova',
      version=version.canonical_version_string(),
      description='cloud computing fabric controller',
      author='OpenStack',
      author_email='nova@lists.launchpad.net',
      url='http://www.openstack.org/',
      cmdclass=nova_cmdclass,
      packages=find_packages(exclude=['bin', 'smoketests']),
      include_package_data=True,
      test_suite='nose.collector',
      data_files=find_data_files('share/nova', 'tools'),
      scripts=['bin/nova-ajax-console-proxy',
               'bin/nova-api',
               'bin/nova-compute',
...
/BIN

• 其实都是python脚本

• nova-api/compute/
 network/scheduler等
 是服务的启动程序

• nova-manage是给管
 理员的命令行程序
...
               /BIN/NOVA-API
        for api in flags.FLAGS.enabled_apis:
            servers.append(service.WSGIService(api))
        service.serve(*servers)
        service.wait()

  ...



       /BIN/NOVA-COMPUTE
...

      server = service.Service.create(binary='nova-compute')
      service.serve(server)
      service.wait()

...
NOVA的SERVICE


• 分为两种,Service和WSGIService

• 前者供内部调用,通过RPC(remote       procedure call)模块

• 后者对外提供API,通过http
神奇的FLAGS
• 整个项目统⼀一采用flags模块处理可由用户定义的参数,
 包括配置文件、通过命令行传入的参数等

• 基于开源代码python-gflags

• 可以分布式地定义参数,即每个模块只需定义自己需要
 的,通过”import”引入其它模块定义的参数。有利于模块
 化
# from /nova/service.py
flags.DEFINE_string('ec2_listen', "0.0.0.0",
                    'IP address for EC2 API to listen')
flags.DEFINE_integer('ec2_listen_port', 8773, 'port for ec2 api to listen')
flags.DEFINE_string('osapi_listen', "0.0.0.0",
                    'IP address for OpenStack API to listen')
flags.DEFINE_integer('osapi_listen_port', 8774, 'port for os api to listen')
/NOVA/SCHEDULER

• 目录下面
 有”__init__.py”说
 明这是⼀一个模块

• manager统⼀一对外
 的接口

• 通过dirver兼容不
 同的底层结构
SCHEDULERS
nova.scheduler.driver.Scheduler
   ChanceScheduler
       SimpleScheduler
          VsaScheduler
             VsaSchedulerLeastUsedHost
             VsaSchedulerMostAvailCapacity
   AbstractScheduler
       BaseScheduler
          LeastCostScheduler
   MultiScheduler
   ZoneScheduler
自定义调度算法
# from /nova/scheduler/chance.py
class ChanceScheduler(driver.Scheduler):
    """Implements Scheduler as a random node selector."""

   def schedule(self, context, topic, *_args, **_kwargs):
       """Picks a host that is up at random."""

       hosts = self.hosts_up(context, topic)
       if not hosts:
           raise driver.NoValidHost(_("Scheduler was unable to locate a host"
                                      " for this request. Is the appropriate"
                                      " service running?"))
       return hosts[int(random.random() * len(hosts))]



   外界通过manager调用schedule_**()方法,若所
   需方法不存在,使用schedule()
nova-compute nova-network
nova-schedule



                逻辑结构
“物理”结构?
                    user

                  nova-api

 nova-compute   nova-network        nova-***

FLAGS     db       RPC         context    LOG

Más contenido relacionado

La actualidad más candente

Vancouver presentation
Vancouver presentationVancouver presentation
Vancouver presentationColleen_Murphy
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Satoshi Asano
 
Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Ryosuke IWANAGA
 
Introduction to Ansible - Peter Halligan
Introduction to Ansible - Peter HalliganIntroduction to Ansible - Peter Halligan
Introduction to Ansible - Peter HalliganCorkOpenTech
 
Ansible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaAnsible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaTetiana Saputo
 
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerLAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerJan-Christoph Küster
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...mCloud
 
Web scraping with nutch solr part 2
Web scraping with nutch solr part 2Web scraping with nutch solr part 2
Web scraping with nutch solr part 2Mike Frampton
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentZane Williamson
 
To Hire, or to train, that is the question (Percona Live 2014)
To Hire, or to train, that is the question (Percona Live 2014)To Hire, or to train, that is the question (Percona Live 2014)
To Hire, or to train, that is the question (Percona Live 2014)Geoffrey Anderson
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법Open Source Consulting
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4琛琳 饶
 
Terraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateTerraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateZane Williamson
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesBram Vogelaar
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupGreg DeKoenigsberg
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricksbcoca
 

La actualidad más candente (20)

Vancouver presentation
Vancouver presentationVancouver presentation
Vancouver presentation
 
Configuration Management in Ansible
Configuration Management in Ansible Configuration Management in Ansible
Configuration Management in Ansible
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意
 
Introduction to Ansible - Peter Halligan
Introduction to Ansible - Peter HalliganIntroduction to Ansible - Peter Halligan
Introduction to Ansible - Peter Halligan
 
Ansible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaAnsible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy Mykhailiuta
 
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerLAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
 
Web scraping with nutch solr part 2
Web scraping with nutch solr part 2Web scraping with nutch solr part 2
Web scraping with nutch solr part 2
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous Deployment
 
To Hire, or to train, that is the question (Percona Live 2014)
To Hire, or to train, that is the question (Percona Live 2014)To Hire, or to train, that is the question (Percona Live 2014)
To Hire, or to train, that is the question (Percona Live 2014)
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Ansible
AnsibleAnsible
Ansible
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4
 
Terraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateTerraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-Template
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet Profiles
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Jk rubyslava 25
Jk rubyslava 25Jk rubyslava 25
Jk rubyslava 25
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 

Destacado

FOSS4G 2010. Keynote: "Beyond Open Source".
FOSS4G 2010. Keynote: "Beyond Open Source".FOSS4G 2010. Keynote: "Beyond Open Source".
FOSS4G 2010. Keynote: "Beyond Open Source".Miguel Montesinos
 
Abc Conveyorbook1 080100
Abc Conveyorbook1 080100Abc Conveyorbook1 080100
Abc Conveyorbook1 080100guerreroluis
 
Sustainable Drink Presentation
Sustainable Drink PresentationSustainable Drink Presentation
Sustainable Drink PresentationWageningen
 
gvSIG Mobile and gvSIG Mini as SDI & LBS clients
gvSIG Mobile and gvSIG Mini as SDI & LBS clientsgvSIG Mobile and gvSIG Mini as SDI & LBS clients
gvSIG Mobile and gvSIG Mini as SDI & LBS clientsMiguel Montesinos
 
Mid Term Presentation
Mid Term PresentationMid Term Presentation
Mid Term PresentationStephendid
 
ASOLIVAL. La apuesta empresarial por el software libre
ASOLIVAL. La apuesta empresarial por el software libreASOLIVAL. La apuesta empresarial por el software libre
ASOLIVAL. La apuesta empresarial por el software libreMiguel Montesinos
 
Breach of privacy in australia
Breach of privacy in australiaBreach of privacy in australia
Breach of privacy in australiaAtul
 
Definitive Consulting E Brochure
Definitive Consulting E BrochureDefinitive Consulting E Brochure
Definitive Consulting E Brochureracheltaylor
 
Tobacco Sponsorship In F1
Tobacco Sponsorship In F1Tobacco Sponsorship In F1
Tobacco Sponsorship In F1JohnnyQ86
 
Mritunjay Axon Network Solution
Mritunjay Axon Network SolutionMritunjay Axon Network Solution
Mritunjay Axon Network SolutionMritunjay Kumar
 
Sales Strategy For Cool headS(Acadmic Case Study)
Sales Strategy For Cool headS(Acadmic Case Study)Sales Strategy For Cool headS(Acadmic Case Study)
Sales Strategy For Cool headS(Acadmic Case Study)Mritunjay Kumar
 
National geographic
National geographicNational geographic
National geographicOMD
 
Fiduciary obligations and breach of confidence examining the high court’s g...
Fiduciary obligations and breach of confidence   examining the high court’s g...Fiduciary obligations and breach of confidence   examining the high court’s g...
Fiduciary obligations and breach of confidence examining the high court’s g...Atul
 
The importance of risk analysis and management, and corporate governance
The importance of risk analysis and management, and corporate governanceThe importance of risk analysis and management, and corporate governance
The importance of risk analysis and management, and corporate governanceAtul
 
Comparison of Mobile GIS applications
Comparison of Mobile GIS applicationsComparison of Mobile GIS applications
Comparison of Mobile GIS applicationsMiguel Montesinos
 
Building Organisational Resilience
Building Organisational ResilienceBuilding Organisational Resilience
Building Organisational ResilienceAtul
 

Destacado (18)

FOSS4G 2010. Keynote: "Beyond Open Source".
FOSS4G 2010. Keynote: "Beyond Open Source".FOSS4G 2010. Keynote: "Beyond Open Source".
FOSS4G 2010. Keynote: "Beyond Open Source".
 
Abc Conveyorbook1 080100
Abc Conveyorbook1 080100Abc Conveyorbook1 080100
Abc Conveyorbook1 080100
 
Sustainable Drink Presentation
Sustainable Drink PresentationSustainable Drink Presentation
Sustainable Drink Presentation
 
gvSIG Mobile and gvSIG Mini as SDI & LBS clients
gvSIG Mobile and gvSIG Mini as SDI & LBS clientsgvSIG Mobile and gvSIG Mini as SDI & LBS clients
gvSIG Mobile and gvSIG Mini as SDI & LBS clients
 
Pension Plan
Pension PlanPension Plan
Pension Plan
 
Mid Term Presentation
Mid Term PresentationMid Term Presentation
Mid Term Presentation
 
ASOLIVAL. La apuesta empresarial por el software libre
ASOLIVAL. La apuesta empresarial por el software libreASOLIVAL. La apuesta empresarial por el software libre
ASOLIVAL. La apuesta empresarial por el software libre
 
Breach of privacy in australia
Breach of privacy in australiaBreach of privacy in australia
Breach of privacy in australia
 
Definitive Consulting E Brochure
Definitive Consulting E BrochureDefinitive Consulting E Brochure
Definitive Consulting E Brochure
 
Tobacco Sponsorship In F1
Tobacco Sponsorship In F1Tobacco Sponsorship In F1
Tobacco Sponsorship In F1
 
Mritunjay Axon Network Solution
Mritunjay Axon Network SolutionMritunjay Axon Network Solution
Mritunjay Axon Network Solution
 
Sales Strategy For Cool headS(Acadmic Case Study)
Sales Strategy For Cool headS(Acadmic Case Study)Sales Strategy For Cool headS(Acadmic Case Study)
Sales Strategy For Cool headS(Acadmic Case Study)
 
National geographic
National geographicNational geographic
National geographic
 
Fiduciary obligations and breach of confidence examining the high court’s g...
Fiduciary obligations and breach of confidence   examining the high court’s g...Fiduciary obligations and breach of confidence   examining the high court’s g...
Fiduciary obligations and breach of confidence examining the high court’s g...
 
The importance of risk analysis and management, and corporate governance
The importance of risk analysis and management, and corporate governanceThe importance of risk analysis and management, and corporate governance
The importance of risk analysis and management, and corporate governance
 
Comparison of Mobile GIS applications
Comparison of Mobile GIS applicationsComparison of Mobile GIS applications
Comparison of Mobile GIS applications
 
Building Organisational Resilience
Building Organisational ResilienceBuilding Organisational Resilience
Building Organisational Resilience
 
Chivalry
ChivalryChivalry
Chivalry
 

Similar a openstack源码分析(1)

Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorStanislav Tiurikov
 
Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!Trygve Vea
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerGaryCoady
 
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache MesosJoe Stein
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraTomislav Plavcic
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpNathan Handler
 
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over NagiosOSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over NagiosNETWAYS
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for ussickill
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppSmartLogic
 
Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010Puppet
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonMyNOG
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Prajal Kulkarni
 
Why favour Icinga over Nagios @ FrOSCon 2015
Why favour Icinga over Nagios @ FrOSCon 2015Why favour Icinga over Nagios @ FrOSCon 2015
Why favour Icinga over Nagios @ FrOSCon 2015Icinga
 
Osic tech talk presentation on ironic inspector
Osic tech talk presentation on ironic inspectorOsic tech talk presentation on ironic inspector
Osic tech talk presentation on ironic inspectorAnnie Lezil
 
Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015Icinga
 

Similar a openstack源码分析(1) (20)

Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
 
Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packager
 
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache Mesos
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfra
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
 
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over NagiosOSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for us
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails App
 
Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 
Why favour Icinga over Nagios @ FrOSCon 2015
Why favour Icinga over Nagios @ FrOSCon 2015Why favour Icinga over Nagios @ FrOSCon 2015
Why favour Icinga over Nagios @ FrOSCon 2015
 
Osic tech talk presentation on ironic inspector
Osic tech talk presentation on ironic inspectorOsic tech talk presentation on ironic inspector
Osic tech talk presentation on ironic inspector
 
Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015
 

Último

Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxGregory DeShields
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.moritzmieg
 
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)Escort Service
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodKasia Chojecki
 
question 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationquestion 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationcaminantesdaauga
 
Haitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptxHaitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptxhxhlixia
 
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsxHoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsxChung Yen Chang
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Updatejoymorrison10
 
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelTime for Sicily
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersMakena Coast Charters
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)Mazie Garcia
 
Moroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptxMoroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptxOmarOuazzani1
 
Italia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue muraItalia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue murasandamichaela *
 
Where to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdWhere to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdusmanghaniwixpatriot
 
Aeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change PolicyAeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change PolicyFlyFairTravels
 

Último (17)

Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
 
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptx
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.
 
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and Food
 
question 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationquestion 2: airplane vocabulary presentation
question 2: airplane vocabulary presentation
 
Haitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptxHaitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptx
 
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsxHoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Update
 
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s Waters
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
Moroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptxMoroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptx
 
Italia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue muraItalia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue mura
 
Where to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdWhere to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasd
 
Aeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change PolicyAeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change Policy
 

openstack源码分析(1)

  • 1. A FIRST STEP INTO NOVA by can.
  • 2. NOVA 2011.3 DIABLO/ • setup.py:安装脚本 • bin:可执行程序, 比如nova-manage等 • nova:核心文件
  • 3. /SETUP.PY try: from DistUtilsExtra.auto import setup except ImportError: from setuptools import setup ... setup(name='nova', version=version.canonical_version_string(), description='cloud computing fabric controller', author='OpenStack', author_email='nova@lists.launchpad.net', url='http://www.openstack.org/', cmdclass=nova_cmdclass, packages=find_packages(exclude=['bin', 'smoketests']), include_package_data=True, test_suite='nose.collector', data_files=find_data_files('share/nova', 'tools'), scripts=['bin/nova-ajax-console-proxy', 'bin/nova-api', 'bin/nova-compute', ...
  • 4. /BIN • 其实都是python脚本 • nova-api/compute/ network/scheduler等 是服务的启动程序 • nova-manage是给管 理员的命令行程序
  • 5. ... /BIN/NOVA-API for api in flags.FLAGS.enabled_apis: servers.append(service.WSGIService(api)) service.serve(*servers) service.wait() ... /BIN/NOVA-COMPUTE ... server = service.Service.create(binary='nova-compute') service.serve(server) service.wait() ...
  • 7. 神奇的FLAGS • 整个项目统⼀一采用flags模块处理可由用户定义的参数, 包括配置文件、通过命令行传入的参数等 • 基于开源代码python-gflags • 可以分布式地定义参数,即每个模块只需定义自己需要 的,通过”import”引入其它模块定义的参数。有利于模块 化 # from /nova/service.py flags.DEFINE_string('ec2_listen', "0.0.0.0", 'IP address for EC2 API to listen') flags.DEFINE_integer('ec2_listen_port', 8773, 'port for ec2 api to listen') flags.DEFINE_string('osapi_listen', "0.0.0.0", 'IP address for OpenStack API to listen') flags.DEFINE_integer('osapi_listen_port', 8774, 'port for os api to listen')
  • 8. /NOVA/SCHEDULER • 目录下面 有”__init__.py”说 明这是⼀一个模块 • manager统⼀一对外 的接口 • 通过dirver兼容不 同的底层结构
  • 9. SCHEDULERS nova.scheduler.driver.Scheduler ChanceScheduler SimpleScheduler VsaScheduler VsaSchedulerLeastUsedHost VsaSchedulerMostAvailCapacity AbstractScheduler BaseScheduler LeastCostScheduler MultiScheduler ZoneScheduler
  • 10. 自定义调度算法 # from /nova/scheduler/chance.py class ChanceScheduler(driver.Scheduler): """Implements Scheduler as a random node selector.""" def schedule(self, context, topic, *_args, **_kwargs): """Picks a host that is up at random.""" hosts = self.hosts_up(context, topic) if not hosts: raise driver.NoValidHost(_("Scheduler was unable to locate a host" " for this request. Is the appropriate" " service running?")) return hosts[int(random.random() * len(hosts))] 外界通过manager调用schedule_**()方法,若所 需方法不存在,使用schedule()
  • 12. “物理”结构? user nova-api nova-compute nova-network nova-*** FLAGS db RPC context LOG