Slide 1

Slide 1 text

&49Jͱ࢝ΊΔBOTJCMF ansible & vmware are 1 2017-02-23 Ansible Practice Meetup @ Think IT

Slide 2

Slide 2 text

TEXT ࣗݾ঺հ ▸ Name: Hirofumi Hida ▸ Job: Ops / ΠϯϑϥΤϯδχΞ ▸ BackGround: ▸ Technical Support Engineer ▸ Si ▸ Lang: Python, Node.js etc ▸ Twitter: @gekko_qv ▸ Qiita: http://qiita.com/hirofumihida 2

Slide 3

Slide 3 text

Έͳ͞Μ&49J࢖ͬͯ·͔͢ʁ ▸ ϓϩμΫγϣϯ? ▸ ݕূ؀ڥ? ▸ ࣗ୐? ▸ etc 3

Slide 4

Slide 4 text

Έͳ͞Μ&49J࢖ͬͯ·͔͢ʁ ▸ ϓϩμΫγϣϯ? ▸ ݕূ؀ڥ? ▸ ࣗ୐? ▸ etc 4 ͬͪ͜ΑΓͷ͓࿩

Slide 5

Slide 5 text

ΫϥΠΞϯτ͸ԿΛ࢖ͬͯ·͔͢ʁ ▸ vSphere Client (.NET or WEB) ? ▸ PowerCLI ? ▸ API (python, ruby etc) ? ▸ etc 5

Slide 6

Slide 6 text

ΫϥΠΞϯτ͸ԿΛ࢖ͬͯ·͔͢ʁ ▸ vSphere Client (.NET or WEB) ? ▸ PowerCLI ? ▸ API (python, ruby etc) ? ▸ etc 6 )BWF'VO

Slide 7

Slide 7 text

(6*ͰΆͪΆͪ͢Δͷ޷͖Ͱ͔͢ ▸ Φϖϛε ▸ εΫϦʔϯγϣοτ෇͖ͷखॱॻ࡞੒ ▸ ࡞ۀূ੻औಘ 7

Slide 8

Slide 8 text

(6*ͰΆͪΆͪ͢Δͷ޷͖Ͱ͔͢ ▸ Φϖϛε ▸ εΫϦʔϯγϣοτ෇͖ͷखॱॻ࡞੒ ▸ ࡞ۀূ੻औಘ 8

Slide 9

Slide 9 text

TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ·ͱΊ 9

Slide 10

Slide 10 text

TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ·ͱΊ 10

Slide 11

Slide 11 text

TEXT ֤छϞδϡʔϧ͋Γ·͢ ▸ http://docs.ansible.com/ansible/list_of_cloud_modules.html ▸ ※ ߋ৽͕සൟͰͳ͍΋ͷ΋ؚΉ Target Modules Amazon 98 Azure 18 Docker 7 Google 14 OpenStack 54 Virt(KVM) 3 Vmware 28 2017/02/22 ݱࡏ 11

Slide 12

Slide 12 text

TEXT ֤छϞδϡʔϧ͋Γ·͢ ▸ http://docs.ansible.com/ansible/list_of_cloud_modules.html 12

Slide 13

Slide 13 text

TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ·ͱΊ 13

Slide 14

Slide 14 text

TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ http://docs.ansible.com/ansible/vmware_guest_module.html ▸ http://docs.ansible.com/ansible/vsphere_guest_module.html module Requirement vmware_guest PyVmomi vsphere_guest pysphere 14

Slide 15

Slide 15 text

TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ http://docs.ansible.com/ansible/vmware_guest_module.html ▸ http://docs.ansible.com/ansible/vsphere_guest_module.html module Requirement vmware_guest PyVmomi Ͱ͖Δ͚ͩ ͬͪ͜Λ࢖͏! vsphere_guest pysphere QZTQIFSF ϝϯςऴྃ 15

Slide 16

Slide 16 text

TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ https://github.com/argos83/pysphere ͨͩ͠ɺ͜ͷ͋ͱͰ࿩୊ʹ͢Δ Standalone ESXi (ແঈ൛) Ͱ͸ pysphere Ͱͳ͍ͱಈ͔ͳ͍ػೳ΋͋ͬͨΓ͢Δ… 16

Slide 17

Slide 17 text

TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ https://www.ansible.com/blog/managing-vmware-guests 17

Slide 18

Slide 18 text

TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ https://www.ansible.com/blog/managing-vmware-guests 18

Slide 19

Slide 19 text

TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ https://github.com/vmware/pyvmomi ESXi όʔδϣϯͱ߹Θͤ·͠ΐ͏ 19

Slide 20

Slide 20 text

TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ·ͱΊ 20

Slide 21

Slide 21 text

TEXT 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ vsphere_guest Ͱ͋Ε͹ esxi ύϥϝʔλʔʹ "ha-datacenter “ ෇͚Δͱ VM ࡞੒΋Մೳ ▸ vmware_guest ͩͱ Standalone ESXi ʹରͯ͠ͷ VM ࡞੒͸ ࠔ೉ͦ͏… ▸ sshpass ΛೖΕΕ͹ vim-cmd ίϚϯυΛଧͭ͜ͱ΋Մೳ 21

Slide 22

Slide 22 text

TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ·ͱΊ 22

Slide 23

Slide 23 text

TEXT ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ESXi on VirtualBox ▸ ESXi on KVM ▸ Installation How to: Nested ESXi on KVM ▸ http://qiita.com/hirofumihida/items/ 3bc59a3094efa33ac79c ▸ ※ VM ͷ CPU ੍ݶͷͨΊ 64 bit GuestOS ͕࡞Εͳ͍ͳͲͷ ੍ݶ͸͋ΓಘΔ 23

Slide 24

Slide 24 text

TEXT ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ https://github.com/hirofumihida/ansible-esxi-sample 24

Slide 25

Slide 25 text

TEXT ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J 25

Slide 26

Slide 26 text

TEXT ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J 26

Slide 27

Slide 27 text

TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF&49J ▸ ·ͱΊ 27

Slide 28

Slide 28 text

TEXT ·ͱΊ ▸ .PEVMFʹ͍ͭͯ ▸ ։ൃ͕׆ൃͳ΋ͷ͸όʔδϣϯ͕มΘΔͱػೳ΋มΘͬͯ ಉ͡1MBZCPPL͕࢖͍·Θͤͳ͍͜ͱ͕͋Δ /PO 3FRVJSF͔Β3FRVJSFύϥϝʔλʹͳͬͨΓ ▸ 3FRVJSFNFOUͷ1ZUIPO"1*ͷ։ൃঢ়گʹ΋ࠨӈ͞Ε ΔͷͰ஫ҙ͕ඞཁ 28

Slide 29

Slide 29 text

TEXT ·ͱΊ ▸ "OTJCMFͱ&49J͸ϑϨϯζʹͳΕͦ͏͔ 29

Slide 30

Slide 30 text

TEXT ·ͱΊ ▸ "OTJCMFͱ&49J͸ϑϨϯζʹͳΕͦ͏͔ ▸ ͨͿΜʜ 30 ▸ ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠