# Tạo Virtual Service (VS) trên Load Balancing

## <mark style="color:green;">Quy trình</mark> <a href="#id-2.-guidance" id="id-2.-guidance"></a>

Đăng nhập vào HI GIO portal với quyền **Organization Administrator** và điều hướng đến:

**Networking > Edge Gateway > Load Balancer >** **Virtual Services.**

Nhấn **ADD.**

{% stepper %}
{% step %}
**Bước 1: Tạo Virtual Service Layer 4**

**Virtual Service** có thể được tạo với các thuộc tính yêu cầu:

·       **Name:** Tên Virtual Service

·       **Service-Engine-Group:** Chọn SEG được gán cho mỗi Tenant

·       **Load Balancer Pool:** Chọn Loadbalancer Pool (ví dụ chọn App-587-Pool)

·       **Virtual IP:** Chọn 01 IP public cho VIP

·       **Service Type:** L4

·       **Port:** Cổng ứng dụng (ví dụ 587)

<figure><img src="/files/thJpwyyb7lan8MCRwS5L" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Bước 2: Tạo Virtual** **Service Layer 7**

**Virtual Service** có thể được tạo với các thuộc tính yêu cầu:

·       **Name:** Tên Virtual Service

·       **Service-Engine-Group:** Chọn SEG được gán cho mỗi Tenant

·       **Load Balancer Pool:**&#x20;

o   Nếu Server Pool đang chạy cổng **80** không mã hóa (ví dụ: chọn IIS-Web-Pool)

o   Nếu Server Pool đang chạy cổng **443** mã hóa (ví dụ chọn IIS-Web-443-Pool)

·       **Virtual IP:** Địa chỉ IP của Virtual Service (VIP)

·       **Service Type:** HTTPS

·       **Certificate:** Chọn chứng chỉ của bạn

·       **Port:** Cổng ứng dụng (443 SSL và 80 không SSL)

***\*Lưu ý*****:** Chúng ta thêm cổng 80 không SSL để **tự động chuyển hướng** yêu cầu HTTP sang HTTPS. *N*gười dùng cuối thường thích nhập tên miền hơn là nhập <https://domain-name>.

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

Nhấn **SAVE** để tạo Virtual Service. Khi đây là Virtual Service đầu tiên, quá trình này có thể mất một chút thời gian vì các Máy ảo Service Engine cần được triển khai. Các Virtual Service sau sẽ nhanh hơn vì chỉ yêu cầu thêm routing. Sau vài phút, bạn sẽ có thể truy cập Virtual Service.

Trong một số trường hợp, trạng thái **Virtual Service** có thể là **DOWN** (Health). Chúng ta cần kiểm tra trạng thái của Server Pool để xử lý tình huống này. Ví dụ: IIS-Web-443-VS bị DOWN.

<figure><img src="/files/29QK5PseJavqdN1K8FdU" alt=""><figcaption></figcaption></figure>

Kiểm tra Server Pool. Chúng ta thấy rằng IIS-Web-443-VS đang ánh xạ tới IIS-Web-443-Pool.

Pool này chỉ có 01 Server.

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

Tiếp tục kiểm tra máy chủ, chúng ta thấy Server 10.1.20.10:443 bị **DOWN**.

Thông thường có 2 tình huống:

* Máy chủ bị tắt, cần bật lại.
* Hoặc Disable Firewall Rule Server port 443.

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

Sau khi bật máy ảo, Pool Server sẽ **UP** lại.

Do đó, Virtual Service IIS-Web-443-VS sẽ **UP** và hoạt động.

<figure><img src="/files/AM9h9hQeWetGEwobG3iJ" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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.higiocloud.vn/hi-gio-user-guide-vn/network/3.-load-balancer/tao-virtual-service-vs-tren-load-balancing.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.
