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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
69
Expiration of Secure Boot Certificates for vSphere Virtual Machines
mirie_sd
0
1.1k
Making new vExpert badge sticker
mirie_sd
0
570
How to use "VMware"
mirie_sd
0
660
The key to VCP-VCF
mirie_sd
0
2.9k
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
230
Cooking operations with Salt
mirie_sd
0
790
Blog vExperts use
mirie_sd
0
230
Other Decks in Technology
See All in Technology
テックカンファレンス三大ステークホルダーの文化人類学 ─ 違いを認め合う関係性作り
bash0c7
5
1.6k
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.3k
「待ち時間」の消滅と「自我消耗」の加速:生成AI時代のエンジニアを救うメンタル・リソース管理
poropinai1966
0
400
AIエージェントの知識表現と推論に なぜグラフが使われるのか - 記号的AIの復権とニューラルAIとの統合
yohei1126
1
260
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
8
6.8k
LangfuseによるLLMOps基盤の構築と活用事例
zozotech
PRO
1
250
A Bag-of-Documents Model for Query Specificity
dtunkelang
0
200
AIツールを導入しても生産性はあがらない? カオナビが直面した 3つの壁と乗り越え方。/ Overcoming 3 Barriers to AI-Driven Productivity at kaonavi
kaonavi
0
1.6k
AI エージェント時代のデジタルアイデンティティ
fujie
2
1.3k
13年運用タイトルのサーバーサイドが辿り着いた現在地 ― モンスターストライクにおける技術・組織・AI活用から得た知見
mixi_engineers
PRO
1
400
CloudWatchから始めるAWS監視
butadora
0
310
【CEDEC2026】コードレビュー支援ツール開発から学ぶ:LLMを用いた業務システムの実践的な運用設計と誤出力対策
cygames
PRO
0
240
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Automating Front-end Workflow
addyosmani
1370
210k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
360
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
450
YesSQL, Process and Tooling at Scale
rocio
174
15k
Un-Boring Meetings
codingconduct
0
360
Amusing Abliteration
ianozsvald
1
240
Building Flexible Design Systems
yeseniaperezcruz
330
40k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
280
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
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