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
Expiration of Secure Boot Certificates for vSphere Virtual Machines
mirie_sd
0
660
Making new vExpert badge sticker
mirie_sd
0
440
How to use "VMware"
mirie_sd
0
510
The key to VCP-VCF
mirie_sd
0
2.7k
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
220
Cooking operations with Salt
mirie_sd
0
780
Blog vExperts use
mirie_sd
0
220
Talk about TAS before forgetting
mirie_sd
0
270
Other Decks in Technology
See All in Technology
攻撃者視点で考えるDetection Engineering
cryptopeg
1
1.1k
RAG を使わないという選択肢
tatsutaka
1
180
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
770
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
1
580
Claude Code の Sandbox 機能を Anthropic Sandbox Runtime(srt) で試そう!/lets-play-anthropic-sandbox-runtime
tomoki10
1
530
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
120
手塩にかけりゃいいってもんじゃない
ming_ayami
0
260
非定型業務をAI slackbotで自動化する ~ 社内要望を自動壁打ちするbotを作った ~/automating-ad-hoc-work-with-ai-slackbot
shibayu36
0
600
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
4
1.4k
LLMにもCAP定理があるという話
harukasakihara
0
290
AI駆動開発が変える、大規模開発の前提 ーHuman in the Loop から Human on the Loop へ / AIE2026
visional_engineering_and_design
30
24k
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
19
6.5k
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
420
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Making Projects Easy
brettharned
120
6.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
160
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