1. Updated: October 21, 2017
1คู่มือติดตั้ง Cloud Computing
ด้วย OpenStack
เรียบเรียงโดย
Dr.Arnut Ruttanatirakul
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology
Rajamangala University of Technology Suvarnabhumi
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
2. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
2
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
OpenStack is a free and open-source software platform for cloud
computing,mostly deployed as infrastructure-as-a-service (IaaS), whereby
virtual servers and other resources are made available to customers. The
software platform consists of interrelated components that control
diverse, multi-vendor hardware pools of processing, storage, and
networking resources throughout a data center. Users either manage it
through a web-based dashboard, through command-line tools, or
through RESTful web services.
(ที่มา: http://docs.openstack.org)
RDO is a community of people using and deploying OpenStack on
CentOS and Red Hat Enterprise Linux.
(ที่มา: https://www.rdoproject.org)
3. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
3
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ OpenStack LAB Software
1. Oracle VirtualBox 5 up (https://www.virtualbox.org)
2. CentOS Linux 7 up (https://www.centos.org)
3. PuTTY (http://www.putty.org)
4. WinSCP (https://winscp.net)
5. OpenStack Ocata (https://www.rdoproject.org)
4. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
4
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ ความหมายของ Cloud Computing
การประมวลผลแบบกลุ่มเมฆบางท่านเรียกว่าการประมวลผลแบบคลาวด์ (Cloud
Computing) เป็นเทคโนโลยีการประมวลผลที่ตอบสนองตามความต้องการของผู้ใช้ถือเป็นแนวคิด
สาหรับการประยุกต์ใช้งานของระบบคอมพิวเตอร์ในยุคใหม่ เพื่อเป็นทางเลือกให้แก่หน่วยงานในด้าน
การลดภาระด้านการลงทุนในเทคโนโลยีสารสนเทศทั้งการใช้งานในระดับองค์กรภาครัฐ องค์กร
ภาคเอกชน และผู้ใช้ระดับส่วนบุคคล โดยเป็นหลักการนาทรัพยากรของระบบไอที ทั้งฮาร์ดแวร์ และ
ซอฟต์แวร์มาแบ่งปันในรูปแบบการให้บริการ (Software as a Service : SaaS) ในระดับการ
ประมวลผลผ่านเครือข่ายอินเทอร์เน็ต โดยผู้ใช้ไม่จาเป็นต้องมีเครื่องคอมพิวเตอร์ประสิทธิภาพสูงหรือ
ติดตั้งซอฟต์แวร์ระบบ ตลอดจนซอฟต์แวร์ประยุกต์ (Application) จานวนมาก ๆ เพื่อการทางานที่
ซับซ้อน แต่สามารถใช้บริการประมวลผลและแอพพลิเคชั่นต่าง ๆ จากผู้ให้บริการการประมวลผลแบบ
กลุ่มเมฆ และชาระค่าบริการตามอัตราการใช้งานที่เกิดขึ้นจริง ดังนั้นในอนาคตบริการด้านไอทีจะมี
ลักษณะเป็นบริการสาธารณูปโภคพื้นฐานเช่นเดียวกับ บริการไฟฟ้า น้าประปา หรือโทรศัพท์ (Utilities
Services) ตัวอย่างเช่นบริการเช่าพื้นที่เพื่อฝากเว็บไซต์ (Web Hosting) ในอดีตจะถูกกาหนดด้วย
ขนาดของพื้นที่ และความสามารถในการรองรับจานวนผู้เข้าชมพร้อมกัน แต่ในสภาพแวดล้อมการ
ให้บริการโฮสต์เว็บไซต์บนกลุ่มเมฆ ขนาดของพื้นที่และความสามารถในการรองรับจานวนผู้เข้าชมจะ
สามารถปรับเพิ่มลด ขนาดได้อย่างอิสระโดยอัตราค่าบริการจะถูกคานวณตามขนาดพื้นที่ที่ใช้งานจริง
และจานวนผู้เข้าชมเว็บไซต์ที่เกิดขึ้นจริง
การนาเครื่องคอมพิวเตอร์จานวนมากมาเชื่อมต่อเข้าด้วยกัน คอมพิวเตอร์ทั้งหมดแบบกลุ่มเมฆ
อาจไม่จาเป็นต้องติดตั้งอยู่ในสถานที่เดียวกัน แต่อาจมีการเชื่อมต่อผ่านเครือข่ายสื่อสารความเร็วสูง
และที่สาคัญก็คือบรรดาคอมพิวเตอร์ที่เชื่อมต่ออาจไม่จาเป็นต้องมีฮาร์ดแวร์และระบบปฏิบัติการ
เหมือนกันไปทั้งหมด ยกตัวอย่างเช่น ในกลุ่มเมฆหนึ่งๆ อาจมีทั้งเครื่องพีซี และเครื่องแอปเปิ้ล หรือมอง
อีกมุมหนึ่ง ระบบปฏิบัติการที่ใช้อาจมีอยู่หลายชนิด เป้าหมายของการนาเครื่องคอมพิวเตอร์มาเชื่อมต่อ
กันเช่นนี้ ก็เพื่อจะดึงพลังในการประมวลผลของคอมพิวเตอร์ทั้งหมดมาประสานกัน เพื่อนาไปใช้จัดการ
งานประมวลผลใหญ่ๆ ที่แต่เดิมอาจต้องใช้เครื่องคอมพิวเตอร์คุณภาพสูง ต้นทุนมหาศาล แต่กับ
เครือข่ายแบบกลุ่มเมฆผู้ลงทุนสามารถลดต้นทุน และหันมาใช้เครื่องคอมพิวเตอร์ราคาประหยัดมา
ทางานร่วมกันแทน
5. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
5
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ที่มา: https://en.wikipedia.org/wiki/Cloud_computing
➧ ชนิดของเครือข่ายกลุ่มเมฆ
☁ แบ่งตามรูปแบบการพัฒนา (Cloud Deployment Models)
Software as a Service (SaaS)
Platform as a Service (PaaS)
Infrastructure as a Service (IaaS)
6. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
6
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
☁ แบ่งตามรูปแบบการบริการ (Cloud Service Models)
Public Cloud (External Cloud)
Private Cloud (Internal Cloud)
Hybrid Cloud
ความสัมพันธ์ของเครือข่ายแบบกลุ่มเมฆทั้ง 3 ประเภท
(ที่มา: http://www.arnut.com/bb/node/754)
7. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
7
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
Infrastructure as a Service (IaaS) เป็นบริการโครงสร้างพื้นฐานคอมพิวเตอร์ที่สามารถ
เข้าถึงได้ผ่านอินเทอร์เน็ต ผู้ให้บริการโครงสร้างพื้นฐาน (Cloud Provider) การจัดทรัพยากรการ
ประมวลผลไม่ว่าจะเป็นส่วนของการจัดเก็บ (Storage) หรือประมวลผลผ่านระบบเสมือนที่ผู้ใช้บริการ
สามารถกาหนดขนาดของทรัพยากรให้ตรงกับความต้องการที่เปลี่ยนแปลงไป ผู้ใช้บริการประเภทนี้เป็น
ผู้ให้บริการทั่วไป และผู้ให้บริการ (Cloud Provider) ผู้ให้บริการ IaaS เช่น Amazon EC2,
OpenStack, CloudStack, OpenNode เป็นต้น
Platform as a Service (PaaS) เป็นบริการที่มีระดับของความเป็นนามธรรมเพิ่มขึ้นจาก
Infrastructure as a Service ผู้ให้บริการได้นาเสนอแพลตฟอร์มสาหรับการดาเนินงานระบบต่างๆ
เพื่อให้ผู้ใช้บริการ ซึ่งก็คือผู้พัฒนาชุดคาสั่งงานสามารถเขียนชุดคาสั่งงาน และอัพโหลดผลงานของตนไป
ไว้ในกลุ่มเมฆที่ชุดคาสั่งงานสามารถดาเนินงานได้ ผู้ใช้บริการสามารถจัดขนาดทรัพยากรที่ต้องใช้ได้
อย่างอัตโนมัติ ตามการเติบโตของการใช้ชุดคาสั่งงาน เช่น ขนาดของหน่วยจัดเก็บ รวมทั้งสามารถ
เลือกใช้บริการ PaaS ได้ทั้งเต็มรูปแบบและบางส่วน ผู้ให้บริการ PaaS เช่น Google Apps Engine,
OpenShift, Heroku, Windows Azure เป็นต้น
Software as a Service (SaaS) เป็นบริการชุดคาสั่งงานประยุกต์พร้อมสรรพที่สมบูรณ์
(Turnkey Application) บนอินเทอร์เน็ตช่วยให้ผู้ใช้บริการไม่ต้องติดตั้งชุดคาสั่งงานประยุกต์ในเครื่อง
คอมพิวเตอร์ของตนเอง ผลที่ตามมาคือผู้ใช้ไม่ต้องจ่ายค่าบารุงรักษา ค่าใช้จ่ายในการดูแลชุดคาสั่งงาน
ประยุกต์ ชุดคาสั่งงานที่มีให้บริการมีตั้งแต่ชุดคาสั่งงานประยุกต์ต่างๆ เช่น ระบบจัดการลูกค้าสัมพันธ์
(Customer Relationship Management : CRM) ระบบวางแผนทรัพยากร (Enterprise Resource
Planning : ERP) เป็นต้น รวมไปถึงชุดคาสั่งงานที่ใช้ในการทางานทั่วไป เช่น โปรแกรมจัดการไฟล์ (File
Manager) โปรแกรมประมวลผลคา (Word Processor) โปรแกรมจัดการตารางคานวณ
(Spreadsheet) เป็นต้น ตัวอย่าง ผู้ให้บริการ SaaS เช่น Gmail, Facebook, Google Apps, Adobe
Creative Cloud, Autodesk 360, Office 365, Salesforce เป็นต้น
8. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
8
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
เครือข่ายกลุ่มเมฆแบ่งตามรูปแบบการพัฒนา (Cloud Deployment Models)
9. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
9
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ Cloud computing will go mainstream
10. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
10
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ รู้จัก OpenStack
Open Stack เป็นแพลตฟอร์มเกิดจากความร่วมมือกันของ NASA และ Rackspace ช่วงปี
2010 เพื่อให้เป็นบริการทางด้าน IaaS หรือ Infrastructure as a Services เป็นซอฟต์แวร์โอเพ่นซอร์ส
ถือลิขสิทธ์แบบ Apache License 2.0 ใช้สาหรับบริหารจัดการเครือข่ายแบบกลุ่มเมฆ (Cloud
Management Software) ในระยะแรกใช้ทา IaaS สามารถทาได้ทั้ง Private Cloud และ Public
Cloud พัฒนาโดยใช้ภาษา Python อาศัยแนวทาง OpenAPI และ RESTful ปัจจุบันมีบริษัทเอกชน
เข้าร่วมโครงการกว่า 500 บริษัท ปัจจุบัน OpenStack บริหารงานโดยทีมงาน OpenStack
Foundation มีบริษัทเอกชนเข้าร่วมโครงการกว่า 500 บริษัท และมีการปรับปรุงระบบทุกๆ 6 เดือน
11. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
11
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ OpenStack Official site (www.openstack.org)
เว็บไซต์ www.openstack.org
➧ 5 เหตุผลที่องค์กรและผู้ดูแลระบบควรเริ่มต้นใช้ OpenStack สร้าง Private
Cloud ภายในองค์กร
1. เรียนรู้และลองผิดลองถูกกับการสร้าง Private Cloud
2. สร้าง Environment สาหรับให้องค์กรได้ลองผิดลองถูก เพื่อสร้างเทคโนโลยีใหม่ๆ ทั้งในแง่
ของเทคโนโลยีและกระบวนการ
3. เริ่มสร้างวัฒนธรรมองค์กรแบบ Self-Service เปลี่ยนแนวคิดในการทางานของผู้ดูแลระบบ
4. เปิดทางเลือกใหม่ๆ สาหรับ IT Infrastructure สาหรับองค์กรในอนาคต
5. รับการมาของเทคโนโลยี Network Functions Virtualization (NFV) และ Software-
Defined Networking (SDN)
ที่มา: Techtalkthai
12. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
12
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ หน่วยงานที่เข้าร่วมโครงการ OpenStack
ที่มา: https://www.openstack.org/community/
➧ OpenStack Distributions
ที่มา: https://www.slideshare.net/mattfarina/bdpa-detroit-oct21-hp-helion-open-stack-ps-v4
13. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
13
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ OpenStack Vendor Ecosystem
ที่มา: http://vega-bi.blogspot.com/2014/11/openstack-as-telecom-platform-for-sdn.html
➧ OpenStack Timeline
ที่มา: https://releases.openstack.org
14. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
14
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ OpenStack main services
➧ องค์ประกอบของ OpenStack
1) Nova (Compute): จัดการ virtual machine
2) Glance (Image): จัดการ virtual machine – image & snapshots
3) Cinder (Volume) จัดการ block storage เอาไว้ผูกกับ vm เพิ่ม disk และเก็บข้อมูล
4) Neutron (network service) จัดการ virtual switch/Router/Network
5) Swift (object) ให้บริการ object storage
6) Keystone (identity) จัดการ authentication
7) Horizon (dashboard) จัดการผ่านเว็บ
8) Ceilometer (metering) วัดการใช้งานทรัพยากร และส่ง Notify ตามเงื่อนไขที่กาหนด
9) Ironic (Bare-metal provisioning service) บริการสร้างและบริหารจัดการเครื่องจริง
10) Heat (Orchestration) จัดการประสานงานระหว่างสิ่งต่างๆ
11) Sahara (Data Processing) ให้บริการ map reduce processing
12) Trove (Database as a Service) ให้บริการ database
13) Magnum ให้บริการ จัดการ Container
14) Manila ให้บริการ share file
15. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
15
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ ความสามารถของ OpenStack
ใช้บริการจัดสรรทรัพยากร เช่น Virtual Machine, Container และเครื่องจริง
ใช้บริการจัดการเครือข่าย Virtual Networks
ใช้บริการจัดการระบบจัดเก็บข้อมูล Virtual Storages
สามารถเพิ่มขยายระบบ IT Infrastructure และคานวณการลงทุนได้ล่วงหน้า
...ต่อไปความคล่องตัวของระบบ IT
จะกลายเป็นหัวใจสาคัญของการแข่งขัน
ในยุคดิจิทัล
16. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
16
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ สถาปัตยกรรมของ OpenStack
ที่มา: https://www.openstack.org/assets/presentation-media/Flat-no-more-Hierarchical-multitenancy-
and-projects-acting-as-domains-in-OpenStack.pdf
17. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
17
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ ความต้องการด้านฮาร์ดแวร์
ที่มา: https://docs.openstack.org/mitaka/install-guide-rdo/
18. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
18
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ Networking Option 1: Provider networks
ที่มา: https://docs.openstack.org/mitaka/install-guide-rdo/
19. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
19
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ Networking Option 2: Self-service networks
ที่มา: https://docs.openstack.org/mitaka/install-guide-rdo/
20. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
20
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ แนวทางการติดตั้ง OpenStack
1) ติดตั้งเองจากแพ็กเกจที่ Linux Distribution มีให้แล้วทาการปรับแต่งไปทีละ Service
2) ใช้งานผ่านจาก Cloud Provider เช่น Rackspace, HP Cloud, Cloudwatt, Z.com
3) ติดตั้งโดยใช้เครื่องมือ DevOps เช่น RDO, Chef, Puppet, Juju, Crowbar, Forman
4) ติดตั้งจากเครื่องมือพัฒนา DevStack เช่น trystack.org
5) ติดตั้งผ่านทูลช่วยพิเศษ Mirantis OpenStack
หมายเหตุ
ในคู่มือเล่มนี้แนะนาการตดตั้ง OpenStack โดยใช้เครื่องมือ DevOps ชื่อ RDO
o https://docs.openstack.org/newton/install-guide-rdo/
o https://www.rdoproject.org/
21. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
21
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
รูปแบบการติดตั้ง OpenStack
ตัวอย่างที่ 1 การติดตั้ง OpenStack แบบ Single Node แยกเครื่อง Controller กับ
Compute
22. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
22
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ตัวอย่างที่ 2 การติดตั้ง OpenStack แบบ Single Node เพิ่มโหนด Compute
23. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
23
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ตัวอย่างที่ 3 การติดตั้ง OpenStack แบบ Multi Node (Controller, Compute,
Network)
24. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
24
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
Install OpenStack
All in one
<< Single node >>
รวมทุกโหนดไว้ในเครื่องเดียวกัน
ติดตั้ง VirtualBox > ปรับแต่ง NAT Network > ติดตั้ง CentOS
> ติดตั้ง OpenStack > เข้าใช้งาน OpenStack
25. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
25
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
รายละเอียดการกาหนด IP
Public network (Floating IP network): 10.0.2.0/24
Internal network (on each node): no IP space, physical connection only (enp0s8)
Public Controller node public IP: 10.0.2.15 (enp0s3)
Public Compute node public IP: 10.0.2.15 (enp0s3)
OS version (each node): CentOS Linux release 7.3.1611 (Core)
☁ Controller Node
Hostname: controller
[NIC01- enp0s3]
IP Address: 10.0.2.15
Subnet mask: 255.255.255.0 (/24)
Gateway: 10.0.2.1
DNS: 8.8.8.8
VirtualBox Network Type: NAT Network
26. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
26
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ความต้องการด้านซอฟต์แวร์
Software Download
1. Oracle VirtualBox 5.1 up https://www.virtualbox.org/wiki/Downloads
2. CentOS Linux 7.x (64 bit) http://isoredirect.centos.org/centos/7/isos/x86_64/
3. PuTTY http://www.putty.org
4. WinSCP https://winscp.net
➧ การปรับแต่ง NAT Network
ขั้นตอน
1.เปิดโปรแกรม Oracle VirtualBox
2.คลิกที่เมนู File > Preference... (Ctrl + G)
คลิกที่เมนู Preference
3. คลิกที่ Network เสร็จแล้วให้คลิกแท็บ NAT Networks > คลิก (Add new NAT)
(หมายเลข 1 – 3)
27. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
27
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
4. ดับเบิ้ลคลิกที่ชื่อ NatNetwork เพื่อเข้าไปกาหนดรายละเอียด
[/] Enable NAT < เพื่อเปิดใช้งาน
Network Name: Management < ชื่อ nat network
Network CIDR: 10.0.2.0.0/24 < หมายเลขไอพีสาหรับทดสอบในวง nat network
Network Options : [ / ] Supports DHCP กาหนดให้จ่ายไอพีอัตโนมัติในวง nat network
[ ] Supports IPv6
* ค่าปกติ gateway จะเป็น 10.0.2.1
กาหนดรายละเอียด
6. คลิกที่ปุ่ม Port Forwarding กาหนดรายละเอียดพอร์ตที่ต้องการฟอร์เวิร์ดไอพี เสร็จแล้วให้คลิกที่
ไอคอน (Add new port forwarding rule) เพื่อกาหนดกฎการใช้งาน
28. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
28
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
Add new port forwarding rule
7. กาหนดรายละเอียดกฎการทา Port forwarding
ตารางที่ 1 รายละเอียดกฎการทา Port forwarding
รายการ คาอธิบาย ตัวอย่าง
Name กาหนดชื่อกฎ Management
Protocol โพรโทคอลที่ใช้ TCP
Host IP กาหนดหมายเลขไอพีฝั่ง Host OS
(ไอพีฝั่ง Windows ที่ใช้งานอยู่)
* ในการทดสอบสามารถกาหนดเป็นหมายเลขโลคอลโฮสต์
127.0.0.1 ได้เช่นเดียวกัน
127.0.0.1
Host Port กาหนดหมายเลขพอร์ตฝั่ง Host OS
(ฝั่ง windows)
2222
Guest IP กาหนดหมายเลขไอพีฝั่ง Guest OS
(ระบบปฏิบัติการที่ติดตั้งภายใน VirtualBox)
10.0.2.15
Guest Port กาหนดหมายเลขพอร์ตฝั่ง Guest OS
(ระบบปฏิบัติการที่ติดตั้งภายใน VirtualBox)
22
29. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
29
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ตัวอย่าง
Name Protocol Host IP Host Port Guest IP Guest Port
Rule 1 TCP 127.0.0.1 2222 10.0.2.15 22
Rule 2 TCP 127.0.0.1 80 10.0.2.15 80
Rule 3 TCP 127.0.0.1 443 10.0.2.15 443
Rule 4 TCP 127.0.0.1 5000 10.0.2.15 5000
Rule 5 TCP 127.0.0.1 8041 10.0.2.15 8041
Rule 6 TCP 127.0.0.1 8042 10.0.2.15 8042
Rule 7 TCP 127.0.0.1 8077 10.0.2.15 8077
Rule 8 TCP 127.0.0.1 8078 10.0.2.15 8078
Rule 9 TCP 127.0.0.1 35357 10.0.2.15 35357
Rule 10 TCP 127.0.0.1 22222 10.0.2.16 22
ตัวอย่างพอร์ตที่ทาการ Forward เสร็จแล้ว
8. คลิกที่แท็บ NAT Network > คลิกเลือกที่ Enable Network เสร็จแล้วทาการสร้าง Interface ชื่อ
Public และไม่ต้องสร้าง Port Forwarding เสร็จแล้วให้คลิกที่ปุ่ม OK
Network Name: Public
Network CIDR: 192.168.1.0/24 (ไอพีที่ออกเน็ตฝั่ง windows ให้กาหนดตามเครือข่าย
ที่ใช้งาน)
30. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
30
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
Network Options: [ ] Supports DHCP
Network Options: [ ] Supports IPv6
31. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
31
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ การติดตั้งลีนุกซ์ CentOS 7.x (64bit)
ขั้นตอน
1. การติดตั้งลีนุกซ์ CentOS 7.x ผู้อ่านสามารถรายละเอียดเพิ่มเติมได้ที่เว็บไซต์ Arnut.com
32. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
32
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ การปรับแต่ง CentOS Linux
ขั้นตอน
1. หลังการติดตั้งให้ปรับแต่งดังนี้
ตรวจสอบ IP Address ก่อนว่าได้รับหรือไม่
ip addr หรือ
ip a
2. กรณีไม่ได้รับ IP Address ให้ทาการปรับแต่งเครือข่ายและทาการสต๊าท Network Card
nmtui
systemctl restart network
หรือ
ifdown enp0s3
ifup enp0s3
3. ทดสอบเชื่อมต่ออินเทอร์เน็ต
ping www.google.co.th
4. ปิด Firewalld
systemctl stop firewalld
systemctl disable firewalld
5. ปิดการใช้งาน SELINUX
# vi /etc/selinux/config
ก่อนปรับ
SELINUX= enforcing
หลังปรับแต่ง
SELINUX=disabled
33. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
33
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ตรวจสอบ SELINUX
# setenforce 0
setenforce: SELinux is disabled
Note.
☁ สามารถสั่งงานปิด SELINUX ผ่านทาง Command
setenforce 0 ; sed -i 's/=enforcing/=disabled/g' /etc/sysconfig/selinux
6. ทาการติดตั้งแพ็กเกจพื้นฐาน (Basic Package)
yum install lynx wget unzip -y
yum install nano mc
yum install epel-release -y
yum install net-tools -y
yum install iotop htop iptraf-ng arp-scan -y
yum erase mariadb-libs -y
7. อัปเดทแพ็กเกจ หลังการติดตั้งแล้วทาการรีบู๊ตระบบใหม่
yum update –y ; reboot
8. ทาการแก้ไขไฟล์ hosts
hostnamectl set-hostname controller.example.com
example = ชื่อโดเมนที่ต้องการ
ตรวจสอบชื่อโฮสต์ด้วยคาสั่งดังนี้
34. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
34
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
hostname –s
hostname –f
ปรับแต่ไฟล์ hostname
9. แก้ไขไฟล์ hosts
# vi /etc/hosts
กาหนดค่าดังนี้
# Controller
10.0.2.15 controller
# Compute1 กรณีแยกเครื่อง Compute
# 10.0.2.16 compute
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10. ติดตั้งและเปิดใช้งาน NTP
yum install ntp -y
11. ปรับแต่ง NTP
# vi /etc/ntp.conf
กาหนดค่าดังนี้
..
# Hosts on local network are less restricted.
35. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
35
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
restrict 10.0.2.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
...
server time1.nimt.or.th iburst
server time2.nimt.or.th iburst
server time1.navy.mi.th iburst
server time2.navy.mi.th iburst
server clock.nectec.or.th iburst
ปรับแต่งไฟล์ NTP
12. ทาการเปิดบริการ NTP
systemctl start ntpd
systemctl enable ntpd
13. ตรวจสอบ NTP
ntpq -p
ntpstat
36. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
36
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ตรวจสอบ NTP
14. ทาการปิดการใช้งาน Network Manager
systemctl stop NetworkManager
systemctl disable NetworkManager
ติดติดตั้งโปรแกรม PuTTY
โปรแกรม PuTTY เป็นโปรแกรมเพื่อใช้ในการแก้คอนฟิกระยะไกล
โปรแกรม PuTTY
37. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
37
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ การติดตั้ง OpenStack
การติดตั้ง OpenStack มีทั้งหมด 6 Step ดังนี้
☁ Step1: ติดตั้ง Software repositories (Openstack Ocata release) โดยใช้ RDO
# yum install -y https://rdoproject.org/repos/rdo-release.rpm
# yum install -y centos-release-openstack-ocata
# yum update -y
☁ Step 2: ติดตั้ง Packstack (Packstack เป็นยูติลิตี้ที่ช่วยในการติดตั้ง OpenStack แบบอัตโนมัติ)
# yum install -y openstack-packstack
ตรวจสอบแพ็กเกจ
# rpm -qa | grep openstack-packstack
openstack-packstack-11.0.0-0.2.0rc1.el7.noarch
openstack-packstack-puppet-11.0.0-0.2.0rc1.el7.noarch
# rpm -qa | grep openstack
puppet-openstacklib-11.3.0-1.el7.noarch
openstack-packstack-11.0.0-0.2.0rc1.el7.noarch
puppet-openstack_extras-11.3.0-1.el7.noarch
openstack-packstack-puppet-11.0.0-0.2.0rc1.el7.noarch
centos-release-openstack-ocata-1-2.el7.noarch
openstack-selinux-0.8.7-1.el7.noarch
☁ Step 3: ติดตั้ง Openstack Cloud Ocata โดยการสร้างไฟล์คอนฟิกด้วยคาสั่ง packstack
รูปแบบ
packstack [options]
packstack --gen-answer-file=<file> [options] / packstack --answer-file=<file>
38. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
38
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ตัวอย่าง การสร้างไฟล์ชื่อ “answer.txt” เก็บไว้ที่ไดเร็กทอรี root เพื่อเก็บค่าคอนฟิกที่ใช้สาหรับติดตั้ง
# packstack --gen-answer-file=/root/answers.txt
# ll
หมายเหตุ
ในกรณีต้องการกาหนดค่าพื้นฐานในการติดตั้ง สามารถเข้าไปแก้ไขไฟล์ในไฟล์ answer.txt
ค่าปกติดระบบตั้งไว้พร้อมใช้งานแล้ว
# vi /root/answer.txt
ตัวอย่าง ค่าคอนฟิก กรณีติดตั้งแบบ Single Node
.................
CONFIG_CONTROLLER_HOST=10.0.2.15
CONFIG_COMPUTE_HOSTS=10.0.2.15
CONFIG_NETWORK_HOSTS=10.0.2.15
CONFIG_PROVISION_DEMO=n < ไม่ติดตั้งไฟล์ตัวอย่าง
CONFIG_CEILOMETER_INSTALL=n
CONFIG_NTP_SERVERS=10.0.2.15 < ไอพีของ time server
CONFIG_KEYSTONE_ADMIN_USERNAME=admin < ชื่อผู้ดูแลระบบ
CONFIG_KEYSTONE_ADMIN_PW=89e7bb48d6c34963 < รหัสผ่าน
CONFIG_NAGIOS_INSTALL=n
.................
☁ Step 4: ติดตั้ง Openstack ด้วยคาสั่ง packstack โดยใช้ไฟล์ answer.txt ที่สร้างไว้
# packstack --answer-file /root/answer.txt
39. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
39
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ติดตั้ง OpenStack ด้วยสคริปต์ packstack
[root@controller ~]# packstack --answer-file /root/answers.txt
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20171022-204549-KqSafP/openstack-
setup.log
Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
40. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
40
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Swift builder entries [ DONE ]
Preparing Swift proxy entries [ DONE ]
Preparing Swift storage entries [ DONE ]
Preparing Gnocchi entries [ DONE ]
Preparing MongoDB entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 10.0.2.15_controller.pp
Testing if puppet apply is finished: 10.0.2.15_controller.pp [ / ]
☁ Step 5: ตรวจสอบรหัสผ่านในไฟล์ keystonerc_admin
หลังการติดตั้งระบบจะทาการสร้างไฟล์รหัสผ่าน “/root/keystonerc_admin”
ตัวอย่าง ไฟล์ keystonerc_admin
# cat /root/keystonerc_admin
[root@controller ~]# cat /root/keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=89e7bb48d6c34963
export OS_AUTH_URL=http://10.0.2.15:5000/v3
export PS1='[u@h W(keystone_admin)]$ '
export OS_PROJECT_NAME=admin
41. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
41
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
หมายเหตุ
ในการติดตั้งจริงสามารถนา Step ที่ 3, 4 มารวมกันได้ โดยระบุค่า allinone ไป
packstack --allinone
หรือ
packstack --allinone --provision-all-in-one-ovs-bridge=n
แต่หากต้องการเรียนรู้ความสามารถ และปรับจูนระบบก่อนการติดตั้งแนะนาให้เลือกสิ่งที่ต้องการ
ตามคาแนะนาในคู่มือนี้
☁ Step 6: ทดสอบเข้าหน้า Dashboard โดยใช้ชื่อเรียกและรหัสผ่านในไฟล์ keystonerc_admin
ผ่านทางโปรแกรมเว็บเบราว์เซอร์ฝั่ง Host OS
รูปแบบ
http://IP_Address/dashboard
ในที่นี้ได้ทาการกาหนด NAT network ไว้เป็น 127.0.0.1 สามารถเข้าใช้งานได้ดังนี้
http://localhost
หรือ
http://127.0.0.1
42. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
42
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
หน้าล็อกอินเข้าระบบ
แสดงหน้าต่างของโปรแกรม OpenStack หลังการล็อกอินสาเร็จ
หน้าต่างของโปรแกรม OpenStack
43. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
43
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ การทาหลังการติดตั้ง OpenStack
OpenStack POST Installation
Configure public network interface and Open vSwitch (OVS) on Network node / Time to create OVS
(openvswitch) bridges and bind them to physical network interfaces on OpenStack nodes.
Note:
we will not perform any modifications on Controller node interfaces, as Controller is not running any
network related Openstack services. We will also not modify Compute node interfaces – this was done by
packstack and appropriate parameters in answer file (answers.txt)
การปรับแต่ง Open vswitch (OVS)
ขั้นตอน
1. ติดตั้งแพ็กเกจ open vswitch (OVS)
# yum install openvswitch -y
2. ทาการสต๊าท openvswitch
# systemctl start openvswitch
# systemctl enable openvswitch
3. ตรวจสอบเวอร์ชั่น openvswitch
[root@controller ~]# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 2.6.1
DB Schema 7.14.0
[root@controller ~]# virsh version
Compiled against library: libvirt 2.0.0
Using library: libvirt 2.0.0
Using API: QEMU 2.0.0
Running hypervisor: QEMU 2.6.0
44. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
44
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
4. ตรวจสอบโมดูลที่ระบบรองรับ
[root@controller ~]# lsmod |grep openvswitch
openvswitch 106775 0
nf_nat_ipv6 14131 1 openvswitch
nf_nat_ipv4 14115 2 openvswitch,iptable_nat
nf_nat 26147 4 openvswitch,nf_nat_ipv4,nf_nat_ipv6,nf_nat_masquerade_ipv4
nf_defrag_ipv6 35104 2 openvswitch,nf_conntrack_ipv6
nf_conntrack 111302 8
openvswitch,nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv
libcrc32c 12644 2 xfs,openvswitch
[root@controller ~]# ovs-vsctl show
d31fe9e0-52f2-46f6-9955-23620150eed6
ovs_version: "2.6.1"
ขั้นตอนการสร้าง physical interface port to OVS Bridge
1.ตรวจสอบอินเตอร์เฟซปัจจุบันด้วยคาสั่ง ip a
[root@controller ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 08:00:27:c4:c2:b3 brd ff:ff:ff:ff:ff:ff
45. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
45
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
inet 10.0.2.15/24 brd 10.0.2.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::3f08:5c28:90b7:2ab3/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 08:00:27:cf:2c:4b brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state
DOWN qlen 1000
link/ether 52:54:00:ae:3a:a6 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state
DOWN qlen 1000
link/ether 52:54:00:ae:3a:a6 brd ff:ff:ff:ff:ff:ff
2.. ทาการสารองอินเตอร์เฟส enp0s3 (ไฟล์คอนฟิกคือ ifcfg-enp0s3)
cd /etc/sysconfig/network-scripts/
cp ifcfg-enp0s3 /root/ifcfg-enp0s3.save
3. ทาการสร้างอินเตอร์เฟส br-ex โดยทาการคัดลอดต้นแบบมาจากอินเตอร์เฟส enp0s3
Cp ifcfg-enp0s3 ifcfg-br-ex
4. แก้ไขอินเตอร์เฟส enp0s3
[root@controller ~]# vi ifcfg-enp0s3
DEVICE=enp0s3
HWADDR="08:00:27:c4:c2:b3" << เปลี่ยนตาม MAC เครื่องที่ใช้งาน
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
46. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
46
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ONBOOT=yes
5. แก้ไขอินเตอร์เฟส br-ex
[root@controller ~]# vi ifcfg-br-ex
DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
NM_CONTROLLED=no
IPADDR=10.0.2.15
PREFIX=24
GATEWAY=10.0.2.1
DNS1=10.0.2.1
ONBOOT=yes
6. ทาการแอดพอร์ตและรีสต๊าทอินเตอร์เฟส
ovs-vsctl add-port br-ex enp0s3
systemctl restart network
7. ตรวจสอบ IP Address
[root@controller ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master
ovs-system state UP qlen 1000
link/ether 08:00:27:c4:c2:b3 brd ff:ff:ff:ff:ff:ff
47. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
47
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 08:00:27:cf:2c:4b brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state
DOWN qlen 1000
link/ether 52:54:00:ae:3a:a6 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state
DOWN qlen 1000
link/ether 52:54:00:ae:3a:a6 brd ff:ff:ff:ff:ff:ff
6: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether de:58:2e:19:49:e9 brd ff:ff:ff:ff:ff:ff
7: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UNKNOWN qlen 1000
link/ether 08:00:27:c4:c2:b3 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global br-ex
valid_lft forever preferred_lft forever
inet6 fe80::f020:80ff:fe9d:e044/64 scope link
valid_lft forever preferred_lft forever
8. ตรวจการเชื่อมโยงของอินเตอร์เฟส enp0s3 (physical network) กับอินเตอร์เฟสภายใน (br-ex) ที่
สร้างด้วย Open vSwitch (OVS)
[root@controller ~]# ovs-vsctl show
d31fe9e0-52f2-46f6-9955-23620150eed6
Bridge br-ex
Port "enp0s3"
Interface "enp0s3"
Port br-ex
Interface br-ex
type: internal
48. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
48
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
ovs_version: "2.6.1"
9. ทาการล็อกอินเข้าหน้า Horizon Dashboard
รูปแบบ
http://$YOURIP/dashboard
ตัวอย่าง
http://localhost/dashboard < หมายเลข IP
User Name: admin < ชื่อผู้ดูแลระบบ
Password: 89e7bb48d6c34963 < รหัสผ่านดูในไฟล์ keystonerc_admin
หน้าต่างแรกของ OpenStack
49. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
49
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
➧ ทาการเปลี่ยนรหัสผ่าน admin
1. คลิกที่ Identity > Users
2. คลิก Edit แก้ไขแอคเคาน์ admin > Change Password
50. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
50
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
สรุป
Open Stack เป็นแพลตฟอร์มเกิดจากความร่วมมือกันของ NASA และ Rackspace ช่วงปี
2010 เพื่อให้เป็นบริการทางด้าน IaaS หรือ Infrastructure as a Services เป็นซอฟต์แวร์โอเพ่นซอร์ส
ถือลิขสิทธ์แบบ Apache License 2.0 ใช้สาหรับบริหารจัดการเครือข่ายแบบกลุ่มเมฆ (Cloud
Management Software) สามารถทาได้ทั้ง Private Cloud และ Public Cloud พัฒนาโดยใช้ภาษา
Python อาศัยแนวทาง OpenAPI และ RESTful ปัจจุบัน OpenStack บริหารงานโดยทีมงาน
OpenStack Foundation มีบริษัทเอกชนเข้าร่วมโครงการกว่า 500 บริษัท และมีการปรับปรุงระบบ
ทุกๆ 6 เดือน หวังว่าผู้อ่านคงได้ทดสอบติดตั้ง OpenStack แบบ Single Node กันแล้ว จะเห็นได้ว่า
การติดตั้งด้วยสคริปต์ packstack มีขั้นตอนการติดตั้งไม่ยากมากเกินไป แนะนาให้ทดลองติดตั้งใช้งานดู
อย่างน้อยจะทาให้เราเรียนรู้ความสามารถทางระบบเครือข่ายอีกหลายๆ อย่างในมิติของระบบสร้าง
เครือข่ายกลุ่มเมฆแบบโครงสร้างพื้นฐาน Infrastructure as a Services เสร็จแล้วให้ลองสร้างโปรเจกต์
(Project) ย่อยโดยการสร้างมีขั้นตอนย่อยๆ 3 ขั้นตอน คือ
1) สร้าง Project และเพิ่ม member เพื่อควบคุม Project
2) สร้าง Image และ Flavor
3) สร้าง Network และ Router สาหรับเชื่อมกับ Project
* ในที่นี้ผู้เขียนจะเขียนบทความแนะนาอีกครั้งหนึ่ง
หลังจากใช้งานแบบ Single Node ระดับหนึ่งแล้วแนะนาให้ทดลองติดตั้ง OpenStack แบบ
Multi Node ในกรณีต้องการกระจายโหนดหลายๆโหนด ซึ่งต้องทาการคอนฟิกแบบแยกกันอย่างน้อย
3 เครื่องคือ Controller Node, Compute Node และ Network Node โปรแกรม OpenStack ถือ
เป็นระบบ Cloud Management Software ที่มีความสามารถสูงมาก สามารถนามาสร้างสรรค์งานได้
อย่างหลากหลาย สามารถทาได้ทั้ง Private Cloud และ Public Cloud Private ทั้งนี้ผู้อ่านสามารถ
ศึกษาเพิ่มเติมได้จาก E-Book, เว็บระบบเปิดแนว MOOCs, YouTube หรือ จากค้นจากเว็บ Google
เพื่อการต่อยอดความรู้
51. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
51
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
แหล่งข้อมูลอ้างอิง
1) http://docs.openstack.org
2) https://www.rdoproject.org
3) http://www.sysadmin.in.th/openstack/
4) http://www.learnitguide.net/2016/08/install-openstack-mitaka-cloud-on-rhel7.html
5) https://www.linuxtechi.com/single-node-openstack-liberty-installation-centos-7/
6) http://www.edumobile.org/linux/best-15-unix-command-line-tools/
7) https://www.linuxtechi.com/launch-instance-from-openstack-dashboard/
8) https://pario.no/2015/05/26/installing-open-vswitch-on-centos-7/
9) https://n40lab.wordpress.com/2015/06/28/centos-7-installing-openvswitch-2-3-2-lts/
10) http://supercomputing.caltech.edu/blog/index.php/2016/05/03/open-vswitch-installation-on-
centos-7-2/
11) http://www.tuxfixer.com/openstack-liberty-all-in-one-installation-on-centos-7/
12) http://www.tuxfixer.com/openstack-newton-vxlan-based-installation-on-3-centos-7-nodes/
13) http://www.tuxfixer.com/create-project-tenant-in-openstack-and-launch-instances/
14) https://www.linuxtechi.com/launch-instance-from-openstack-dashboard/
15) https://docs.openstack.org/liberty/install-guide-ubuntu/launch-instance.html
16) https://docs.openstack.org/mitaka/install-guide-obs/neutron-compute-install.html
17) https://www.server-world.info/en/note?os=CentOS_7&p=openstack_ocata&f=15
18) http://behindtheracks.com/2014/11/openstack-juno-scripted-installation-on-centos7/
19) http://behindtheracks.com/2014/05/openstack-high-availability-nova-and-horizon/
20) https://en.wikipedia.org/wiki/OpenStack
21) https://www.techtalkthai.com/tag/cloud-computing/
22) https://www.mirantis.com/how-to-install-openstack/
23) https://cloudbase.it/rdo-multi-node/
%%%%%%%%%%%%%%%%%%%%%%%%%%
52. Dr.Arnut Ruttanatirakul (arnut.r@rmutsb.ac.th)
Department of Information System and Business Computer, Huntra
Faculty of Business Administration and Information Technology, Rajamangala University of Technology Suvarnabhumi.
♞
52
หมายเหตุ. เอกสารนี้เป็นเอกสารเผยแพร่เท่านั้นห้ามนาไปใช้เพื่อการค้า ในการนาไปใช้กรณีอื่นให้ติดต่อมายังผู้เขียนเพื่อขออนุญาตก่อน
" วิชาคอมพิวเตอร์ เป็นวิทยาการ ที่ต้องอาศัยแบบแผน อันประกอบด้วยขั้นตอน
และหลักเกณฑ์ที่แน่นอน รวมทั้งงานโปรแกรม ก็เป็นกิจกรรมที่ตรงไปตรงมา มีผลแค่ผิด
กับถูก หากโปรแกรมผิด ก็ย่อมไม่ได้ผลตามที่ต้องการ เช่นเดียวกับโปรแกรมชีวิต
หากวางแผนและดาเนินการตามกฎเกณฑ์ที่ถูกต้อง ชีวิตก็จะประสบความสาเร็จ ... "
Dr.Arnut Ruttanatirakul
☺ ติดต่อ
บรรยายพิเศษได้ที่
✈ ✈ ✈
ขอให้เพื่อนๆ HuntraScholar
สนุกกับการบริหารระบบสารสนเทศในยุคดิจิทัล
https://www.facebook.com/HuntraScholar/
Social Media: @HuntraScholar
October 29, 2017