SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Downloaden Sie, um offline zu lesen
軽量言語( JRuby )による Xen 管理 API の応
                             用

                  2008年11月20日



                井澤 信悦(いさわしんえつ)
        伊藤忠テクノソリューションズ株式会社( CTC)
       IT エンジニアリング室 プラットフォーム推進部
XenAPI 1.0 概要
• データモデルを標準化
 分散永続オブジェクトを操作
• 標準 XML-RPC
 リモート API コール用標準ワイヤープロトコル
 バインディングで言語非依存
 HTTP/S で通信 , ステイトフルなセッションベース
• レガシーインターフェイスは非推奨
 xend-http-server(8000), xend-tcp-xmlrpc-server(8006)
• 長期安定
 xen-api-server(9363) 新規推奨: Xen-API インターフェ
 イス
 Xen 3.1.0 で公式にリリース
Xen サーバー と その管理
  分散処理 と 集中管理
                                          マ
                                             商用管理
                                          ネ
                                          システム(ツール)
                                          ー
                                          ジ
                                          ャ
                                          ー
           virt-
                         商用
          manager
 xm                     エージェ                         Ruby/JRuby
                         ント
          libvirt
                                                     programming
                                     Java
pyxen        libxen(C/C++)                           RubyGem
                                    library          package
                                     Tool
↑   XML-RPC(sockets)  ↓                                Xen
                                                                C#
                                                                Python
                          9363
           xen d
                                                                C/C++
                                                      Ruby
                                   Apache
           /dev/xen/*
                                                                Other
                                                      xml-rpc
                                 xmlrpc-client.jar
        Kernel(Dom0)
  ↑   Hyper Call  ↓              http(s) クライアントモジュー
                                                      ル
 Xen ハイパーバイザー
クラス関係図
network
VIF 仮想ネットワークインターフェ
イス
PIF 物理ネットワークインターフェ
イス




                     VDI 仮想ディスクイメージ
                     VBD 仮想ブロックデバイス
                     PBD 物理ブロックデバイス
                     SR ストレージリポジトリ
クラスメソッド例
• ゲッターとセッター
  プロパティ
 uuid,label,state,other_config(stringMap type), など
 reference to related objects( 例 : metrics)
 MAC,MTU,qos,device_config,status_code
• VM (ゲスト OS )
 start,(un)pause,(hard/clean)_shutdown,
 (hard/clean)_reboot,suspend,resume,clone,etc…
• メトリックス
 memory/total/actual/free,VCPUs/number,last_updated,etc…
• その他
 create,destory,plug,unplug,get_all,location
プログラミング
• 参照 と UUID
 参照 : XML-RPC 上のエンコードされた文字列 ( オペーク )
 サーバーが生成し , サーバーだけが理解 ( セッション上のみで有効 )
 UUID : 永続的なオブジェクト ID 名 (OSF DCD フォーマット )
 相互変換メソッド : get_by_uuid, get_uuid
• XML-RPC ライブラリ
 session.login_with_password(string uname, string pwd)
 入力パラメータを用意し , 実行して、結果を得る
 結果は HashMap のような複雑なデーター構造の場合がある
 値を取り出すには、特別に操作が必要な場合が多い
• High-level Class Library
 ホストオブジェクトの生成 (xen ホストへログイン ) してハンドルを
 得る
 目的オブジェクトへの参照を得て、そのメソッドを呼び出す
 ( プロパティから得たり , 新規に作成したり , 名前、 UUID などで検
 索する )
設定準備
• Xen サーバー側での構成
 ポート , インターフェイス , 及び アクセス制御 の構成
 /etc/xen/xend-config.sxp
 (xen-api-server ((0.0.0.0:9363)))
 そして xend を再起動
• 管理する側でのセットアップ
 JDK セットアップ (1.5 以降 )
 JRuby ダウンロード http://dist.codehaus.org/jruby/
 tar zxf jruby-bin-1.1.3.tar.gz -C /usr
 PATH 追加 (usr/jruby-1.1.3/bin)
 jruby –S gem install xen
サンプルプログラム
require quot;rubygemsquot;
gem 'xen'
require 'xen‘

xh = Xen::Host.new('192.168.11.3', 9363)

xh.vms.each do |vm|
 puts quot;VM UUID: quot; + vm.uuid + quot; Name-label: quot; + vm.name unless vm.is_dom0?
end



    puts quot;Enter Guest OS name for rebootquot;
    vmin = gets.chomp
    xh.find_vm(vmin).clean_reboot!



                     エラーハンドリングは簡素化するために省きました
                     参照 : lib/ruby/gems/1.8/gems/xen-0.1.2.1/README
“xm create” コマンド と API
RubyGem パッケージを編集
lib/ruby/gems/1.8/gems/xen-0.1.2.1/lib/xen/vm.rb
:actions_after_shutdown => 'destroy'
                                                 kernel = quot;/boot/vmlinuz-2.6.18-xenquot;
:PV_kernel => '/boot/vmlinuz-2.6.18-xen'
:PV_args => 'root=/dev/sda1 ro 3'                memory = 128
                                                     name = quot;ttyquot;
Ruby プログラムを作成
                                                       vif = [ '' ]
require quot;rubygemsquot;
                                                       dhcp = quot;dhcpquot;
gem 'xen'
                                                       disk = ['file:/xen/tty/rootfs,sda1,w']
require 'xen'
                                                       root = quot;/dev/sda1 roquot;
h = Xen::Host.new('192.168.11.3', 9363 )
network =Xen::Network.find_by_name quot;eth0quot;, h
vm = h.create_vm “ttyquot;, 128*1024*1024
vdi_sda1 = h.create_vdi quot;vdi1quot;, quot;file:/xen/tty/rootfsquot;
vbd1 = h.create_vbd quot;sda1quot;, vm, vdi_sda1
vif = h.create_vif vm, network, quot;00:30:48:88:81:07quot;
vm.start!
参考情報
• Xen 管理 API プロジェクト
 http://wiki.xensource.com/xenwiki/XenApi

• Xen サミット 2007 年4月
 http://www.xen.org/files/xensummit_4/XenSummit_API_Slides_2007-04-
 18_Ewan.pdf

• 英文マニュアル
 http://wiki.xensource.com/xenwiki/XenApi?
 action=AttachFile&do=get&target=xenapi-1.0.6.pdf
• 日本語マニュアル
 http://gisawa.googlepages.com/XenAPIJ.pdf

Weitere ähnliche Inhalte

Was ist angesagt?

shibuya_pm_tt07_mogilefs_with_catalyst
shibuya_pm_tt07_mogilefs_with_catalystshibuya_pm_tt07_mogilefs_with_catalyst
shibuya_pm_tt07_mogilefs_with_catalyst
Hiroshi Ono
 
Token Based Authentication Systems
Token Based Authentication SystemsToken Based Authentication Systems
Token Based Authentication Systems
Hüseyin BABAL
 

Was ist angesagt? (13)

shibuya_pm_tt07_mogilefs_with_catalyst
shibuya_pm_tt07_mogilefs_with_catalystshibuya_pm_tt07_mogilefs_with_catalyst
shibuya_pm_tt07_mogilefs_with_catalyst
 
Basics of html5, data_storage, css3
Basics of html5, data_storage, css3Basics of html5, data_storage, css3
Basics of html5, data_storage, css3
 
FUNCIONES DE EXCEL
FUNCIONES DE EXCEL FUNCIONES DE EXCEL
FUNCIONES DE EXCEL
 
dRuby
dRubydRuby
dRuby
 
5 issues
5 issues5 issues
5 issues
 
Varnish Cache and Django (Falcon, Flask etc)
Varnish Cache and Django (Falcon, Flask etc)Varnish Cache and Django (Falcon, Flask etc)
Varnish Cache and Django (Falcon, Flask etc)
 
HTTP For the Good or the Bad - FSEC Edition
HTTP For the Good or the Bad - FSEC EditionHTTP For the Good or the Bad - FSEC Edition
HTTP For the Good or the Bad - FSEC Edition
 
Hadoop指标
Hadoop指标Hadoop指标
Hadoop指标
 
Nginx + PHP
Nginx + PHPNginx + PHP
Nginx + PHP
 
Token Based Authentication Systems
Token Based Authentication SystemsToken Based Authentication Systems
Token Based Authentication Systems
 
Mitigating CSRF with two lines of codes
Mitigating CSRF with two lines of codesMitigating CSRF with two lines of codes
Mitigating CSRF with two lines of codes
 
StHack 2013 - Florian "@agixid" Gaultier No SQL injection but NoSQL injection
StHack 2013 - Florian "@agixid" Gaultier No SQL injection but NoSQL injectionStHack 2013 - Florian "@agixid" Gaultier No SQL injection but NoSQL injection
StHack 2013 - Florian "@agixid" Gaultier No SQL injection but NoSQL injection
 
Ultra fast web development with sinatra
Ultra fast web development with sinatraUltra fast web development with sinatra
Ultra fast web development with sinatra
 

Andere mochten auch

Current Technology Experience Letter
Current Technology Experience LetterCurrent Technology Experience Letter
Current Technology Experience Letter
Namrata Pawar
 
Xcapes Presentation
Xcapes PresentationXcapes Presentation
Xcapes Presentation
Martin Brito
 
utckeynote-090518182831-phpapp01
utckeynote-090518182831-phpapp01utckeynote-090518182831-phpapp01
utckeynote-090518182831-phpapp01
Thomas Cooke
 
Ute proceso de construccion del plan nacional para el buen vivir1
Ute proceso de construccion del plan nacional para el buen vivir1Ute proceso de construccion del plan nacional para el buen vivir1
Ute proceso de construccion del plan nacional para el buen vivir1
evelyn17carolina
 

Andere mochten auch (17)

UTDANNING_Andrius Vidugiris
UTDANNING_Andrius VidugirisUTDANNING_Andrius Vidugiris
UTDANNING_Andrius Vidugiris
 
Quick Start Guide to Editing Wikipedia - #WikiHumanOrigins Presentation
Quick Start Guide to Editing Wikipedia - #WikiHumanOrigins PresentationQuick Start Guide to Editing Wikipedia - #WikiHumanOrigins Presentation
Quick Start Guide to Editing Wikipedia - #WikiHumanOrigins Presentation
 
Quick time
Quick timeQuick time
Quick time
 
Evolution of the 20+ year old upper salt fork watershed
Evolution of the 20+ year old upper salt fork watershedEvolution of the 20+ year old upper salt fork watershed
Evolution of the 20+ year old upper salt fork watershed
 
Current Technology Experience Letter
Current Technology Experience LetterCurrent Technology Experience Letter
Current Technology Experience Letter
 
Xcapes Presentation
Xcapes PresentationXcapes Presentation
Xcapes Presentation
 
utckeynote-090518182831-phpapp01
utckeynote-090518182831-phpapp01utckeynote-090518182831-phpapp01
utckeynote-090518182831-phpapp01
 
EX H-Compensation
EX H-CompensationEX H-Compensation
EX H-Compensation
 
Syllabus of cybershiksha 2
Syllabus of cybershiksha 2Syllabus of cybershiksha 2
Syllabus of cybershiksha 2
 
Ingenieria y Sociedad
 Ingenieria y Sociedad Ingenieria y Sociedad
Ingenieria y Sociedad
 
RIS Media Cover Story
RIS Media Cover StoryRIS Media Cover Story
RIS Media Cover Story
 
Quis asam basa 1
Quis asam basa 1Quis asam basa 1
Quis asam basa 1
 
Volantino 4 Inquadramenti
Volantino 4 InquadramentiVolantino 4 Inquadramenti
Volantino 4 Inquadramenti
 
Business charter as a tool
Business charter as a toolBusiness charter as a tool
Business charter as a tool
 
Fratelo
FrateloFratelo
Fratelo
 
Ute proceso de construccion del plan nacional para el buen vivir1
Ute proceso de construccion del plan nacional para el buen vivir1Ute proceso de construccion del plan nacional para el buen vivir1
Ute proceso de construccion del plan nacional para el buen vivir1
 
Lectio Divina Dominical de Pentecostés Ciclo A
Lectio Divina Dominical de Pentecostés Ciclo ALectio Divina Dominical de Pentecostés Ciclo A
Lectio Divina Dominical de Pentecostés Ciclo A
 

Ähnlich wie XS Japan 2008 Xen Mgmt Japanese

How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
Atsuhiro Kubo
 
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionRuby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
Libin Pan
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 Phpstudy
Yusuke Ando
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For Rails
Koichi ITO
 
企业级搜索引擎Solr交流
企业级搜索引擎Solr交流企业级搜索引擎Solr交流
企业级搜索引擎Solr交流
chuan liang
 

Ähnlich wie XS Japan 2008 Xen Mgmt Japanese (20)

What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
 
Grails紹介
Grails紹介Grails紹介
Grails紹介
 
20090410 Gree Opentech Main
20090410 Gree Opentech Main20090410 Gree Opentech Main
20090410 Gree Opentech Main
 
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionRuby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
 
Transfer to kubernetes data platform from EMR
Transfer to kubernetes data platform from EMRTransfer to kubernetes data platform from EMR
Transfer to kubernetes data platform from EMR
 
Shibuya.abc - Gnashで遊ぼう
Shibuya.abc - Gnashで遊ぼうShibuya.abc - Gnashで遊ぼう
Shibuya.abc - Gnashで遊ぼう
 
Ruby on Rails Tutorial Part I
Ruby on Rails Tutorial Part IRuby on Rails Tutorial Part I
Ruby on Rails Tutorial Part I
 
20090323 Phpstudy
20090323 Phpstudy20090323 Phpstudy
20090323 Phpstudy
 
Chinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 ZhChinaonrails Rubyonrails21 Zh
Chinaonrails Rubyonrails21 Zh
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For Rails
 
20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編
 
Windows PowerShell V2 の新機能
Windows PowerShell V2 の新機能Windows PowerShell V2 の新機能
Windows PowerShell V2 の新機能
 
Seize The Cloud
Seize The CloudSeize The Cloud
Seize The Cloud
 
優雅與摩登的使用docker container和資料庫建立部落格.
優雅與摩登的使用docker container和資料庫建立部落格.優雅與摩登的使用docker container和資料庫建立部落格.
優雅與摩登的使用docker container和資料庫建立部落格.
 
企业级搜索引擎Solr交流
企业级搜索引擎Solr交流企业级搜索引擎Solr交流
企业级搜索引擎Solr交流
 
HA+DRBD+Postgres - PostgresWest '08
HA+DRBD+Postgres - PostgresWest '08HA+DRBD+Postgres - PostgresWest '08
HA+DRBD+Postgres - PostgresWest '08
 
MySQL Clusterで高性能システムを構築する際のポイント
MySQL Clusterで高性能システムを構築する際のポイントMySQL Clusterで高性能システムを構築する際のポイント
MySQL Clusterで高性能システムを構築する際のポイント
 
オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Ruby
 
Ruby off Rails (japanese)
Ruby off Rails (japanese)Ruby off Rails (japanese)
Ruby off Rails (japanese)
 

Mehr von The Linux Foundation

Mehr von The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

XS Japan 2008 Xen Mgmt Japanese

  • 1. 軽量言語( JRuby )による Xen 管理 API の応 用 2008年11月20日 井澤 信悦(いさわしんえつ) 伊藤忠テクノソリューションズ株式会社( CTC) IT エンジニアリング室 プラットフォーム推進部
  • 2. XenAPI 1.0 概要 • データモデルを標準化 分散永続オブジェクトを操作 • 標準 XML-RPC リモート API コール用標準ワイヤープロトコル バインディングで言語非依存 HTTP/S で通信 , ステイトフルなセッションベース • レガシーインターフェイスは非推奨 xend-http-server(8000), xend-tcp-xmlrpc-server(8006) • 長期安定 xen-api-server(9363) 新規推奨: Xen-API インターフェ イス Xen 3.1.0 で公式にリリース
  • 3. Xen サーバー と その管理 分散処理 と 集中管理 マ 商用管理 ネ システム(ツール) ー ジ ャ ー virt- 商用 manager xm エージェ Ruby/JRuby ント libvirt programming Java pyxen libxen(C/C++) RubyGem library package Tool ↑   XML-RPC(sockets)  ↓ Xen C# Python 9363 xen d C/C++ Ruby Apache /dev/xen/* Other xml-rpc xmlrpc-client.jar Kernel(Dom0) ↑   Hyper Call  ↓ http(s) クライアントモジュー ル Xen ハイパーバイザー
  • 4. クラス関係図 network VIF 仮想ネットワークインターフェ イス PIF 物理ネットワークインターフェ イス VDI 仮想ディスクイメージ VBD 仮想ブロックデバイス PBD 物理ブロックデバイス SR ストレージリポジトリ
  • 5. クラスメソッド例 • ゲッターとセッター プロパティ uuid,label,state,other_config(stringMap type), など reference to related objects( 例 : metrics) MAC,MTU,qos,device_config,status_code • VM (ゲスト OS ) start,(un)pause,(hard/clean)_shutdown, (hard/clean)_reboot,suspend,resume,clone,etc… • メトリックス memory/total/actual/free,VCPUs/number,last_updated,etc… • その他 create,destory,plug,unplug,get_all,location
  • 6. プログラミング • 参照 と UUID 参照 : XML-RPC 上のエンコードされた文字列 ( オペーク ) サーバーが生成し , サーバーだけが理解 ( セッション上のみで有効 ) UUID : 永続的なオブジェクト ID 名 (OSF DCD フォーマット ) 相互変換メソッド : get_by_uuid, get_uuid • XML-RPC ライブラリ session.login_with_password(string uname, string pwd) 入力パラメータを用意し , 実行して、結果を得る 結果は HashMap のような複雑なデーター構造の場合がある 値を取り出すには、特別に操作が必要な場合が多い • High-level Class Library ホストオブジェクトの生成 (xen ホストへログイン ) してハンドルを 得る 目的オブジェクトへの参照を得て、そのメソッドを呼び出す ( プロパティから得たり , 新規に作成したり , 名前、 UUID などで検 索する )
  • 7. 設定準備 • Xen サーバー側での構成 ポート , インターフェイス , 及び アクセス制御 の構成 /etc/xen/xend-config.sxp (xen-api-server ((0.0.0.0:9363))) そして xend を再起動 • 管理する側でのセットアップ JDK セットアップ (1.5 以降 ) JRuby ダウンロード http://dist.codehaus.org/jruby/ tar zxf jruby-bin-1.1.3.tar.gz -C /usr PATH 追加 (usr/jruby-1.1.3/bin) jruby –S gem install xen
  • 8. サンプルプログラム require quot;rubygemsquot; gem 'xen' require 'xen‘ xh = Xen::Host.new('192.168.11.3', 9363) xh.vms.each do |vm| puts quot;VM UUID: quot; + vm.uuid + quot; Name-label: quot; + vm.name unless vm.is_dom0? end puts quot;Enter Guest OS name for rebootquot; vmin = gets.chomp xh.find_vm(vmin).clean_reboot! エラーハンドリングは簡素化するために省きました 参照 : lib/ruby/gems/1.8/gems/xen-0.1.2.1/README
  • 9. “xm create” コマンド と API RubyGem パッケージを編集 lib/ruby/gems/1.8/gems/xen-0.1.2.1/lib/xen/vm.rb :actions_after_shutdown => 'destroy' kernel = quot;/boot/vmlinuz-2.6.18-xenquot; :PV_kernel => '/boot/vmlinuz-2.6.18-xen' :PV_args => 'root=/dev/sda1 ro 3' memory = 128 name = quot;ttyquot; Ruby プログラムを作成 vif = [ '' ] require quot;rubygemsquot; dhcp = quot;dhcpquot; gem 'xen' disk = ['file:/xen/tty/rootfs,sda1,w'] require 'xen' root = quot;/dev/sda1 roquot; h = Xen::Host.new('192.168.11.3', 9363 ) network =Xen::Network.find_by_name quot;eth0quot;, h vm = h.create_vm “ttyquot;, 128*1024*1024 vdi_sda1 = h.create_vdi quot;vdi1quot;, quot;file:/xen/tty/rootfsquot; vbd1 = h.create_vbd quot;sda1quot;, vm, vdi_sda1 vif = h.create_vif vm, network, quot;00:30:48:88:81:07quot; vm.start!
  • 10. 参考情報 • Xen 管理 API プロジェクト http://wiki.xensource.com/xenwiki/XenApi • Xen サミット 2007 年4月 http://www.xen.org/files/xensummit_4/XenSummit_API_Slides_2007-04- 18_Ewan.pdf • 英文マニュアル http://wiki.xensource.com/xenwiki/XenApi? action=AttachFile&do=get&target=xenapi-1.0.6.pdf • 日本語マニュアル http://gisawa.googlepages.com/XenAPIJ.pdf