how-to-start-ansible-with-vmware

34fc34fbd8b2cc1f892845dfa22694aa?s=47 hirofumihida
February 22, 2017

 how-to-start-ansible-with-vmware

34fc34fbd8b2cc1f892845dfa22694aa?s=128

hirofumihida

February 22, 2017
Tweet

Transcript

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

    @ Think IT
  2. 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
  3. Έͳ͞Μ&49J࢖ͬͯ·͔͢ʁ ▸ ϓϩμΫγϣϯ? ▸ ݕূ؀ڥ? ▸ ࣗ୐? ▸ etc 3

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

    ͬͪ͜ΑΓͷ͓࿩
  5. ΫϥΠΞϯτ͸ԿΛ࢖ͬͯ·͔͢ʁ ▸ vSphere Client (.NET or WEB) ? ▸ PowerCLI

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

    ? ▸ API (python, ruby etc) ? ▸ etc 6 )BWF'VO
  7. (6*ͰΆͪΆͪ͢Δͷ޷͖Ͱ͔͢ ▸ Φϖϛε ▸ εΫϦʔϯγϣοτ෇͖ͷखॱॻ࡞੒ ▸ ࡞ۀূ੻औಘ 7

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

  9. TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕  ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ

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

    ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF &49J ▸ ·ͱΊ 10
  11. 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
  12. TEXT ֤छϞδϡʔϧ͋Γ·͢ ▸ http://docs.ansible.com/ansible/list_of_cloud_modules.html 12

  13. TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕  ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ

    ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF &49J ▸ ·ͱΊ 13
  14. 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
  15. 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
  16. TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ https://github.com/argos83/pysphere ͨͩ͠ɺ͜ͷ͋ͱͰ࿩୊ʹ͢Δ Standalone ESXi (ແঈ൛) Ͱ͸ pysphere

    Ͱͳ͍ͱಈ͔ͳ͍ػೳ΋͋ͬͨΓ͢Δ… 16
  17. TEXT (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕ ▸ https://www.ansible.com/blog/managing-vmware-guests 17

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

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

  20. TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕  ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ

    ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF &49J ▸ ·ͱΊ 20
  21. TEXT 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ ʹ΋࢖͍͍ͨ ▸ vsphere_guest Ͱ͋Ε͹ esxi ύϥϝʔλʔʹ "ha-datacenter

    “ ෇͚Δͱ VM ࡞੒΋Մೳ ▸ vmware_guest ͩͱ Standalone ESXi ʹରͯ͠ͷ VM ࡞੒͸ ࠔ೉ͦ͏… ▸ sshpass ΛೖΕΕ͹ vim-cmd ίϚϯυΛଧͭ͜ͱ΋Մೳ 21
  22. TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕  ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ

    ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF &49J ▸ ·ͱΊ 22
  23. 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
  24. TEXT ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF &49J ▸ https://github.com/hirofumihida/ansible-esxi-sample 24

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

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

  27. TEXT ΞδΣϯμ ▸ ֤छϞδϡʔϧ͋Γ·͢ ▸ (VFTU༻ϞδϡʔϧΆ͍΋ͷ͕ͭ͋Δ͕  ▸ 4UBOEBMPOF&49J ݶఆత͚ͩͲʜ

    ʹ΋࢖͍͍ͨ ▸ ࠓ͙͢ʹͰ΋࢝ΊΒΕΔBOTJCMF &49J ▸ ·ͱΊ 27
  28. TEXT ·ͱΊ ▸ .PEVMFʹ͍ͭͯ ▸ ։ൃ͕׆ൃͳ΋ͷ͸όʔδϣϯ͕มΘΔͱػೳ΋มΘͬͯ ಉ͡1MBZCPPL͕࢖͍·Θͤͳ͍͜ͱ͕͋Δ /PO 3FRVJSF͔Β3FRVJSFύϥϝʔλʹͳͬͨΓ 

    ▸ 3FRVJSFNFOUͷ1ZUIPO"1*ͷ։ൃঢ়گʹ΋ࠨӈ͞Ε ΔͷͰ஫ҙ͕ඞཁ 28
  29. TEXT ·ͱΊ ▸ "OTJCMFͱ&49J͸ϑϨϯζʹͳΕͦ͏͔ 29

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