# Clone a Deployment Script

การ clone deployment script คือการสร้างโดยอ้างอิงมาจาก script ที่มีอยู่แล้ว ซึ่งทำได้จาก script ที่ระบบ NCS สร้างไว้ หรือ script ที่สร้างไว้เอง

## Prerequisite

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

## Instructions

### 1. เข้าสู่หน้า Deployment Scripts

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

### 2. เลือกเมนู Clone

เลือกรายการ deployment script ที่ต้องการ clone แล้วคลิกปุ่ม MORE > Clone เพื่อเปิดหน้าต่าง clone deployment script

<figure><img src="/files/4r1xpq7gA1dYJfXPOncs" alt=""><figcaption></figcaption></figure>

### 3. กำหนดค่าต่างๆ ของ deployment script

ที่หน้า clone deployment script สามารถแก้ไขรายละเอียดต่าง ๆ ของ deployment script ใหม่ได้ ดังนี้

1. Name : ชื่อของ script ที่จะแสดงใน list และ แสดงในหน้า launch instance
2. Base image : เลือก image ที่จะใช้เป็น base ในการ launch instance ก่อน run script
3. Min disk : ไซส์ต่ำสุดของ volume ที่จะ boot script นี้ได้ โดยค่าเริ่มต้นจะอ้างอิงมาจาก base image แต่สามารถเปลี่ยนแปลงได้
4. Script type : ประเภทของ script แบ่งเป็น 2 ประเภทคือ cloud-config (ศึกษาการเขียนเพิ่มเติมได้จาก <https://cloudinit.readthedocs.io/en/latest/explanation/format.html>) และ x-shellscript (ศึกษาการเขียนเพิ่มเดิมได้จาก <https://www.shellscript.sh/>)
5. Script : script ที่ตาม script type ที่เลือกไว้&#x20;

{% hint style="info" %}
หาก base image ถูกลบออกจากระบบ deployment script นี้ จะไม่แสดงในหน้า launch instance จนกว่าจะมีการ [update](/ncs-documents/compute/deployment-script/edit-a-deployment-script.md) base image เป็น image ที่มีอยู่จริงในระบบ
{% endhint %}

<figure><img src="/files/7EY03q5J5yMry3XuPDUz" alt=""><figcaption></figcaption></figure>

### 4. ตรวจสอบและยืนยันการสร้าง Deployment Script

ตรวจสอบรายละเอียดต่าง ๆ ที่กรอกมาให้เรียบร้อย จากนั้น คลิกปุ่ม 'COMFIRM' เพื่อสร้าง deployment script

Script ที่ถูกสร้าง จะแสดงในรายการของ deployment script และใน source ของหน้า launch instance

<figure><img src="/files/73kNWJ3zq9iORHRBmKsj" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/xY4eXdPngcbK7v7UinTM" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs-epc.gitbook.io/ncs-documents/compute/deployment-script/clone-a-deployment-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
