> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/compute/compute-instance/launch-compute-instance.md).

# Launch Compute Instance

## Prerequisite

* ต้องมียอดคงเหลือใน Project มากกว่า 0 บาท หากไม่มีเงินอยู่ใน project ศึกษาวิธีเติมเงินได้ที่ [ขั้นตอนการเติมเงินเข้าสู่ Project](/ncs-documents/nipa-cloud-space-overview/billing-and-wallet/topup-a-project-wallet.md)

## Instructions

### 1. เข้าสู่ Project

เข้าสู่หน้า project detail จากการเลือก project ที่ต้องการที่หน้า projects management

<figure><img src="/files/Y7eb01QsnI7Kp6SSJqq3" alt=""><figcaption><p>Project Overview</p></figcaption></figure>

### 2. เข้าสู่หน้า Compute Instance

ที่แถบเมนูทางซ้าย คลิกเลือกเมนู​ COMPUTE > Compute Instance เพื่อเข้าสู่หน้า Compute Instance list&#x20;

<figure><img src="/files/Z1A9ihYJ8z14sVmsswO8" alt=""><figcaption><p>Compute Instance list</p></figcaption></figure>

### 3. เข้าหน้า Launch Compute Instance

คลิกปุ่ม "Compute Instance(s)" ที่มุมขวาบนของหน้า จะเปิดหน้าต่างสำหรับสร้าง instance ขึ้นมาดังภาพ

<figure><img src="/files/zUfPm9zkaZDKLgrULlFx" alt=""><figcaption><p>launch Compute Instance button</p></figcaption></figure>

### 4. กำหนด Compute Instance detail&#x20;

เลือก option ดังนี้

* **Availability Zone**: เลือก site ที่ต้องการสำหรับ Compute Instance โดยแนะนำว่าให้เลือก Availability Zone ที่อยู่ใกล้กับผู้ใช้ของ application บน Compute Instance นี้มากที่สุด เพื่อให้ได้ latency ที่ต่ำที่สุด
* **Quantity**: จำนวน Compute Instance ที่จะ launch ในครั้งนี้ โดยทุก Compute Instance จะได้ config เดียวกัน และจำเป็นต้องสร้าง component ที่ attach กับ Compute Instance ใหม่ทั้งหมด เช่น Volume (ทำให้ไม่สามารถใช้ Bootable Volume ได้), Network Port และ External IP&#x20;
* **Instance Name**: ชื่อที่จะแสดงใน NCS และ เป็น hostname ของ Compute Instance&#x20;

<figure><img src="/files/UuN94Ua7gKu8Wut6zTB8" alt=""><figcaption><p>launch Compute Instance - Instance detail</p></figcaption></figure>

### 5. เลือก source ของ Compute Instance

ใน step ถัดมา คือการเลือก source หรือข้อมูลตั้งต้นที่จะ OS (Operating System) ของ Compute Instance โดยแบ่งออกเป็น

* **Public Image**: Compute Image ที่ระบบมีให้ โดยจะเป็น OS  พื้นฐานที่นิยมใน version ต่างๆ
* **Custom Image**: Compute Image ที่ถูกสร้างเองโดย user จากการ [upload จาก Volume](/ncs-documents/compute/compute-image/create-image-from-a-bootable-volume.md) หรือ [import จากภายนอก](/ncs-documents/compute/compute-image/importing-your-own-image.md)
* **Bootable Volume**: Volume ที่มีข้อมูล OS อยู่ภายใน อาจได้มาจากการ delete Compute Instance แล้วเก็บ Volume ที่เป็น OS Disk ไว้ หรือสร้าง Volume โดยใช้ source เป็น Compute Image
* **Deployment Script**: launch จาก Compute Image ที่กำหนดไว้เป็น Base Image ของ [Deployment Script](/ncs-documents/compute/deployment-script.md) และ run script หลัง Compute Instance boot เรียบร้อยแล้ว เพื่อติดตั้ง software หรือปรับการตั้งค่าต่างๆ

<figure><img src="/files/iVK54gmwRVSDm8VjCGwn" alt=""><figcaption><p>launch Compute Instance - source </p></figcaption></figure>

### 5.1 ปรับแต่ง Deployment Script (กรณีที่เลือก source เป็น Deployment Script)&#x20;

ในกรณีที่เลือก source เป็น Deployment Script ขั้นตอนของการปรับแต่ง Deployment Script จะ enable ให้สามารถเข้าไปปรับแต่ script ได้

โดยการปรับแต่ง script ในขั้นตอนนี้ จะไม่ถูก save เป็นไว้ที่ Deployment Script เหมาะกับการใช้ set variable เฉพาะต่างๆ เช่น password ของ software&#x20;

<figure><img src="/files/tu0X7rF0ECSCEzeyuMix" alt=""><figcaption><p>launch Compute Instance - Deployment Script</p></figcaption></figure>

### 6. เลือก Machine Type

เลือก machine type หรือ ขนาดของ Compute Instance โดยสามารถเลือก Machine Type ขนาดเล็ก เพื่อใช้ในการ setup ก่อน แล้ว resize ในภายหลังได้ &#x20;

<figure><img src="/files/v2Oq9F0ftCAA2FvtvuCj" alt=""><figcaption><p>launch Compute Instance - Machine Type</p></figcaption></figure>

Machine type ของ NIPA Cloud Space แบ่งได้เป็น 3 purposes ดังนี้

* **Compute Intensive** : ย่อว่า **co** เป็น machine type กลุ่มที่เน้นการใช้งาน compute ประมวลผลเยอะ มีปริมาณ vCPU:RAM เป็นอัตราส่วน **1:2**
* **All Purpose** : ย่อว่า **ap** เป็น machine type สำหรับใช้งานทั่วไป มีปริมาณ vCPU:RAM เป็นอัตราส่วน **1:4**
* **Shared-Core** : ย่อว่า **as** เป็น machine type สำหรับใช้งานทั่วไป ที่ไม่ได้ต้องการประสิทธิภาพคงที่ตลอดเวลา เนื่องจากแชร์ resource pool กับผู้ใช้งานอื่น ๆ มีปริมาณ vCPU:RAM เป็นอัตราส่วน **1:2** หรือ **1:4**

### 7. กำหนดการใช้งาน Storages&#x20;

ปรับแต่ง storages สำหรับ Compute Instance โดนแบ่งเป็น

* **OS Disk**: เป็น storage หลักของ Compute Instance ที่จะทำการติดตั้ง OS ลงไป โดยจะไม่สามารถเปลี่ยนแปลงได้ในกรณีที่ใช้ source เป็น Bootable Volume
* **Data Disk**: เป็น storage เสริม ที่จะสามารถเพิ่มได้หลาย Volume รวมถึง detach ออก หรือ attach เพิ่มเมื่อไหร่ก็ได้

<figure><img src="/files/Eoz1a4Dhh7IB4Hhodzg8" alt=""><figcaption><p>launch Compute Instance - Storages</p></figcaption></figure>

{% hint style="info" %}
การ launch Compute Instance มากกว่า 1 instance ในครั้งเดียวจะไม่สามารถเลือก volume ที่มีอยู่แล้วมาเป็น OS Disk (Bootable Volume) หรือ Data Disk ของ Compute Instance ได้ แต่ก็ยังสามารถ attach เพิ่มได้เองภายหลัง
{% endhint %}

### 8. กำหนดการใช้งาน Network

ตั้งค่ารูปแบบเครือข่ายของ Compute Instance ดังนี้

* **Instance Network**: หรือ [VPC network](/ncs-documents/networking/vpc-network.md) ที่ใช้งานได้เฉพาะภายใน Project ปัจจุบัน ไม่สามารถข้าม project หรือออก Internet ได้
* **IP Address**: หรือ Internal IP ที่ใช้เป็นที่อยู่ในการสื่อสารกันภายใน VPC network เช่น ระหว่าง Compute Instance, [Load Balancer](/ncs-documents/load-balancing/load-balancer.md) และ [Database Instance](/ncs-documents/database-as-a-service/sql-database.md) ที่ใช้ VPC Network เดียวกัน
* **External Network**: Network สำหรับติดต่อกับ Internet ภายนอก
* **External IP Address**: หรือ External IP ที่ใช้เป็นที่อยู่ในการสื่อสารกับ Internet ภายนอก หรือแม้กระทั้งกับ resource ใน Project เดียวกัน แต่จะมีค่าใช้จ่าย และ latency ที่สูงกว่าการใช้ Internal IP

<figure><img src="/files/L2MGr1e50CKxlMlU02oF" alt=""><figcaption><p>launch Compute Instance - Network</p></figcaption></figure>

{% hint style="info" %}
การ launch Compute Instance มากกว่า 1 instance ในครั้งเดียว จะไม่สามารถเลือก Internal IP หรือ External IP ที่มีอยู่แล้วมาใช้ได้ แต่ก็ยังสามารถ attach เพิ่มได้เองภายหลัง
{% endhint %}

### 9. กำหนดรูปแบบความปลอดภัยของ Compute Instance

ตั้งค่าความปลอดภัยของ Compute Instance ดังนี้

* [**Security Group**](/ncs-documents/networking/security-group.md): กำหนด firewall ของ Compute Instance ที่จะ allow เฉพาะ protocol และ port ที่ต้องการ&#x20;
* **Authentication**:&#x20;
  * **User/Password**: เข้าใช้งาน Compute Instance โดยการใช้รหัสผ่าน สำหรับ [Windows](/ncs-documents/compute/compute-instance/remote-desktop-to-windows-instance.md) และ [Linux](/ncs-documents/compute/compute-instance/ssh-to-linux-compute-instance.md)
  * **Key Pairs**: เข้าใช้งาน Compute Instance โดยการใช้ Key Pairs สำหรับ [Linux](/ncs-documents/compute/compute-instance/ssh-to-linux-compute-instance.md) based OS เท่านั้น
  * **Key Pairs & User/Password**: เข้าใช้งาน Compute Instance โดยการใช้ Key Pairs หรือรหัสผ่าน สำหรับ [Linux](/ncs-documents/compute/compute-instance/ssh-to-linux-compute-instance.md) based OS เท่านั้น
  * **Image** **Preference**: สำหรับ Custom Image ที่ import เข้ามาในระบบเอง

<figure><img src="/files/1E4GPOXHIyu0s65ololi" alt=""><figcaption><p>launch Compute Instance - Security</p></figcaption></figure>

### 10. Review การตั้งค่า Compute Instance

review การตั้งค่าต่าง ๆ ของการ launch Compute Instance โดยสามารถย้อนกลับไปแก้ไขได้ หากมีการตั้งค่าใดไม่ถูกต้อง

โดยเมื่อ review เรียบร้อยแล้วให้คลิกปุ่ม "LAUNCH" เพื่อเริ่มต้นการ launch

<figure><img src="/files/Z6DZASlazjiHkbeT9wE5" alt=""><figcaption><p>launch Compute Instance - launch summary</p></figcaption></figure>

<figure><img src="/files/XSYVAstNlIkO0n1qeow1" alt=""><figcaption><p>launch Compute Instance - success</p></figcaption></figure>

### 11. รอให้ Compute Instance status เปลี่ยนเป็น active

หลัง Compute Instance status กลายเป็น HEALTHY active จึงสามารถ [SSH](/ncs-documents/compute/compute-instance/ssh-to-linux-compute-instance.md) หรือ [RDP](/ncs-documents/compute/compute-instance/remote-desktop-to-windows-instance.md) เข้าใช้งาน Compute Instance ได้

<figure><img src="/files/TlpFWiLzkHBaNyCsAXU7" alt=""><figcaption><p>Compute Instance list - launch completed</p></figcaption></figure>

{% hint style="info" %}
เวลาที่ใช้ในการ launch ขึ้นอยู่กับประเภทและขนาดของ Compute Image
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-epc.gitbook.io/ncs-documents/compute/compute-instance/launch-compute-instance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
