Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20190705_VMwareDevOpsMeetup.pdf
Search
MasahiroIrie
July 05, 2019
Technology
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20190705_VMwareDevOpsMeetup.pdf
MasahiroIrie
July 05, 2019
More Decks by MasahiroIrie
See All by MasahiroIrie
Is that compatibility... actually OK?
mirie_sd
0
80
Expiration of Secure Boot Certificates for vSphere Virtual Machines
mirie_sd
0
1.3k
Making new vExpert badge sticker
mirie_sd
0
660
How to use "VMware"
mirie_sd
0
750
The key to VCP-VCF
mirie_sd
0
3k
Now is the time to check the vSphere Security Configuration and Hardening Guide
mirie_sd
0
1.3k
Using vROPs API with Swagger
mirie_sd
0
240
Cooking operations with Salt
mirie_sd
0
790
Blog vExperts use
mirie_sd
0
230
Other Decks in Technology
See All in Technology
プロダクト思考 × 基盤思考を AIで実現する Compound Engineering
tkc66buzz
1
260
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
260
PdMをやめて、 "プロダクトビルダー"という 働き方に変えました / PdM to Product Builder
shikichee
2
710
振り返りこそエンジニアの本領
negima
0
290
推論の観測、できていますか? 〜 Google Cloud Gemini Enterprise Agent Platformで 3つの Gemini モデルを実測して踏んだ、評価の罠 〜
shukob
PRO
0
150
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
110
生成AIのテナント制御とシャドーMCP対策 | AIを"止めずに"、情報を守る
yukun
0
120
プロダクトエンジニアに必要な「いい感じ」に作る能力 〜たくさん作れる時代に、どこまで作るかの決め方〜
jnishime_dresscode
2
1.4k
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
240
[RSJ26] AnoleVLA: Lightweight Vision-Language-Action Model with Deep State Space Models for Mobile Manipulation
keio_smilab
PRO
0
120
Genie Code ワークショップ 応用編 / Genie-Code-Workshop-advanced
databricksjapan
PRO
0
330
Hub & Spoke 環境のネットワークルーティングを分解してみる
tsuyataku
1
530
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
A Tale of Four Properties
chriscoyier
163
24k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Believing is Seeing
oripsolob
1
210
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
970
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
320
Designing Experiences People Love
moore
143
24k
The Limits of Empathy - UXLibs8
cassininazir
1
640
Visualization
eitanlees
152
17k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Transcript
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 2019年7月5日
入江 正博 OVF Environment を使って VM デプロイ
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 自己紹介
2 入江 正博 @IrieMasahiro • ヤフー株式会社 プライベートクラウドチーム • VMUG インフラ仮想部会 • vExpert 2019
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 色々なところにVMを立てる
3 • 仮想マシン作成、インストールメディアを接続 して OS インストール → vSphere (Web) Clinet で作業… • デプロイツール (Packer, Ansible etc.) → 導入コスト、学習コスト… • OVA インポート → よさげ → でも NW 設定とかはコンソール?
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. Self-Configuration
and the OVF Environment 4 https://blogs.vmware.com/vapp/2009/07/selfconfi guration-and-the-ovf-environment.html • OVF Environment を使った VM カスタマイズの話 • VM を立てるときに NW 設定やアプリ設定を OVF Environment として VM 外部から渡せる → OVA アプライアンスでよくある • 準備しておくもの • OVF プロパティ定義 • OVF Environment トランスポート設定 • VM 内で設定を行っていく glue code
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 要は
5 vApp オプションから設定 (もしくは OVFファイルを直書き)
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 要は
6 # vmtoolsd --cmd 'info-get guestinfo.ovfenv' <?xml version="1.0" encoding="UTF-8"?> <Environment xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [中略] <PropertySection> <Property oe:key="key1" oe:value="test"/> </PropertySection> <ve:EthernetAdapterSection> <ve:Adapter ve:mac="00:50:56:a7:94:d9" ve:network="VM Network" ve:unitNumber="7"/> </ve:EthernetAdapterSection> vmtoolsd で OVF プロパティが取得できるので、 その値で OS 側の設定を行う glue code を仕込めば良い。 (daemon として起動していなくても OK)
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 実装例
7 vCenter Server Appliance
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. OVF
プロパティ 8
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. vCSA
での流れ 9 • systemd の init script の一つ • /etc/init.d/vaos → /opt/vmware/share/vami/vami_ovf_env を 呼び出し NW 設定などを行う。 → /opt/vmware/bin/ovfenv を呼び出し。 OVF プロパティ周りを扱うラッパー → vmware-rpctool ‘info-get guestinfo.ovfEnv’ (※) を 発行し、 OVF プロパティを取得 → その他でも都度都度 OVF プロパティ取得して設定 ※ open-vm-tools に同梱。 OVF プロパティの RPC 部分のみの実装?
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 試しに
10 Photon OS で 実装してみた
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. Photon
OS で self-configuration 11 • Python で 100行くらい → https://vhoge.hateblo.jp/entry/2019/06/25/020111 • vmtoolsd を実行し、XML 文字列を取得 • Hostname / IP / NW Prefix / GW / DNS を設定 → OVF プロパティとしても定義 • systemd で systemd-networkd の起動前に仕込む • OVA 化は OVF Export で
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. OVF
プロパティ 12
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. 面倒なところ
13 • XML が 面倒な 厳格な形式なので OVF プ ロパティの値の取得に一手間 • key も value も attribute • namespace 指定 <Property oe:key="ip" oe:value="192.168.0.100"/> ↑コレ ↑コレ ET.find("oe:PropertySection/oe:Property[@oe:key='ip']",{'oe': 'http://schemas.dmtf.org/ovf/environment/1'}).attrib["{http:/ /schemas.dmtf.org/ovf/environment/1}value"]) • ElementTree で ↑ の IP を取得すると
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. VM
量産体制 14 • ovftool で CLI から OVF インポート • OVF プロパティは prop オプションで指定 % ovftool -n=‘photon-vm’ ¥ -ds=datastore1 ¥ -dm=thin ¥ --net:’VM Network=VM Network’ ¥ --prop:hostname=photon.test ¥ --prop:ip=192.168.0.100 ¥ --prop:prefix=24 ¥ --prop:gateway=192.168.0.1 ¥ --prop:dns=192.168.0.3 ¥ --noSSLVerify ¥ --powerOn ¥ --allowExtraConfig ¥ --acceptAllEulas ¥ ./photoninit.ova ¥ 'vi://vcsa.test/dc01/host/cluster01/host01'
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. まとめ
15 • Self-configuration な OVA を作るには • OVF プロパティ定義 • OVF Environment トランスポート設定 • OVF Environment をもとに設定するコード • OVF Environment は vmtoolsd コマンド にオプションつけて取得 • XML の Value 取得に一癖 • 量産するなら OVF Tool
Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved. EOP