Using OpenStack Client Tool

ใช้งาน Python SDK สำหรับ OpenStack เพื่อใช้งาน NCS Public API

Prerequisite

  • มี account ใช้งานบน NIPA Cloud Space

  • มี access เข้า project ที่มี wallet status เป็น Normal

  • ดาวน์โหลด RC file (วิธีการ download RC file)

Instructions

1. เตรียม dependency สำหรับใช้งาน

สำหรับ Ubuntu

update package cache

sudo apt update && sudo apt upgrade -y

ติดตั้ง Python3

sudo apt install python3-dev python3-pip

ติดตั้ง OpenStack Client

sudo apt install python3-openstackclient 

ตรวจสอบความพร้อม

openstack --help

ผลที่ควรจะเป็น

2. Setup RC File

ตั้งค่า RC file โดยใช้ command source

ผลที่ควรจะเป็น

กรอก password ที่ใช้ในการ login เข้า NIPA Cloud Space

3. ดูรายการ command ที่ใช้งานได้

ดูรายการ command ที่ใช้งานได้ โดยการใช้ command ดังนี้

ผลที่ควรจะได้รับ

หรือสามารถ filter command ที่ต้องการได้ โดยการระบุ group

ผลที่ควรจะได้รับ

หรือใช้ help เพื่อดู command เพิ่มเติม เช่น


ตัวอย่างการสร้าง Compute Instance โดยใช้ OpenStack Client

สร้าง Compute Instance ที่มี specification ดังนี้

  • Name: Instance-2001

  • Machine Type: csa.large.v2

  • Volume: Standard-SSD 40 GB

  • VPC : default

1. ดูรายการของ Machine Type

list รายการ Machine Type (Flavor) โดยใช้ command

ผลที่ได้ควรจะเป็น

2. ดูรายการของ VPC Network และ Subnet

list รายการ VPC Network (Network) โดยใช้ command

ผลที่ได้ควรจะเป็น

list รายการ Subnet โดยใช้ command

ผลที่ได้ควรจะเป็น

3. ดูรายการของ Security Group

list รายการ Security Group โดยใช้ command

ผลที่ได้ควรจะเป็น

4. สั่ง launch Compute Instance

สั่ง launch Compute Instance (Server) โดยใช้ข้อมูลที่ list ไว้ก่อนหน้า

ตัวอย่าง

ผลที่ได้ควรจะเป็น

ตรวจสอบ Compute Instance ที่ถูกสร้างผ่าน command

ผลที่ได้ควรจะเป็น

Last updated

Was this helpful?