LogoLogo
Main WebsiteCloud Console
VN
VN
  • FPT Cloud Portal
  • Release note
    • Tháng 10 - 2022
    • Tháng 9 - 2022
    • Tháng 8 - 2022
    • Tháng 7 - 2022
    • Tháng 6 - 2022
    • Tháng 5 - 2022
    • Tháng 4 - 2022
  • Elastic Compute
    • Overview
    • Virtual Instance
      • 1. Tạo instance
      • 2. Tắt và khởi động instance
      • 3. Xóa Instance
      • 4. Thay đổi dòng máy Instance Type
      • 5. Khởi tạo instance snapshot
      • 6. Xóa instance snapshot
      • 7. Khôi phục instance từ snapshot
      • 8. Xem chi tiết instance details
      • 9. Quản lý instance storage
      • 10. Cấu hình floating IP cho instance
      • 11. Theo dõi instance monitoring
      • 12. Tạo Profile SSH Key
      • 13. Cấu hình Remote Desktop cho instance
      • 14. Gắn thêm card mạng cho máy ảo
    • Virtual Private Cloud
      • 1. Theo dõi tài nguyên của VPC
      • 2. Di chuyển giữa các VPC khác nhau
    • Custom Image
      • 1. Upload Custom Image
      • 2. Tạo instance từ custom image
      • 3. Quản lý Custom Images
    • High Capacity Storage
      • 1. Tạo storage disk
      • 2. Gắn storage disk vào instance
      • 3. Tách storage disk ra khỏi instance
      • 4. Xóa storage disk
      • 5. Resize storage disk
  • Networking Service
    • Overview
    • Floating IP
      • 1. Cấu hình Floating IP hiện có cho instance
      • 2. Gỡ bỏ Floating IP khỏi instance
      • 3. Kiểm tra IP Outbound address
    • Security Group & Firewall
      • 1. Tạo security group
      • 2. Tạo thêm firewall rules
      • 3. Xóa firewall rules
      • 4. Thêm instance vào security group
      • 5. Gỡ instance ra khỏi security group
    • Load Balancer
      • 1. Tạo load balancer
      • 2. Xem chi tiết load balancer
      • 3. Thay đổi rules và settings Load Balancer
      • 4. Xóa Load Balancer
    • Subnet
      • 1. Tạo subnet
  • Backup & Recovery
    • Overview
    • Tutorials
      • 1. Tạo backup job cho instance
      • 2. Restore instance từ restore point
      • 3. Kiểm tra thông tin backup và restore của instance
      • 4. Xóa backup job
  • Command Line Interface
    • Overview
    • Command Reference
      • fci account
        • get
      • fci auth
        • init
        • list
        • remove
        • switch
      • fci compute
        • image
          • list
        • instance
          • create
          • list
        • instance-action
          • start
          • stop
          • terminate
        • size
          • list
        • ssh-key
          • list
        • storage-policy
          • list
      • fci network
        • floating-ip
          • list
        • floating-ip-action
          • allocate
        • rule-port
          • list
        • security-group
          • create
          • list
        • security-group-action
          • add-rule
          • apply
        • subnet
          • list
  • Autoscale
    • Overview
    • Autoscale Profile
      • 1. Tạo Autoscale Profile từ Custom Image
      • 2. Tạo Autoscale Profile từ Cloud-init script
      • 3. Xóa Autoscale Profile
    • Autoscale Group
      • 1. Tạo Autoscale Group
      • 2. Manual mở rộng theo yêu cầu
      • 3. Xóa Autoscale Group
      • 4. Manual Resize Autoscale Group
      • 5. Tạo Autoscale Schedule
      • 6. Xóa Autoscale Schedule
      • 7. Update Profile của Autoscale Group
    • Autoscale Policy
      • 1. Tạo Autoscale Load balancer Policy
      • 2. Tạo Autoscale Scaling Policy
      • 3. Tạo Autoscale Health Policy
      • 4. Attach Autoscale Policy
      • 5. Detach Autoscale Policy
      • 6. Xóa Autoscale Policy
  • Database Service
    • Overview
    • Tutorials
      • 1. Khởi tạo một Database
      • 2. Xem chi tiết Database
      • 3. Quản lý danh sách Database
  • Kubenetes Engine
    • Overview
    • Tutorials
      • 1. Khởi tạo Kubernetes cluster
      • 2. Truy cập thông tin chi tiết của cluster
      • 3. Truy cập bảng điều khiển cluster
      • 4. Xóa cluster
      • 5. Thay đổi cấu hình K8s Cluster
      • 6. Bật, tắt K8s cluster
      • 7. Autoscale
  • Container Registry
    • Overview
    • Tutorials
      • 1. Kích hoạt dịch vụ container registry
      • 2. Docker Login
      • 3. Tag và Push image lên FPT Container Registry
      • 4. Pull docker image từ FPT Container Registry về local
  • Object Storage
    • Overview
    • Object Storage
      • 1. Khởi tạo object bucket
      • 2. Xem objects bên trong bucket
      • 3. Upload objects lên bucket
      • 4. Khởi tạo folders để quản lý object
      • 5. Thay đổi permissions cho object
      • 6. Xóa objects trong bucket
      • 7. Xóa object bucket
    • Access Key
      • 1. Khởi tạo access key
      • 2. Xóa access key
      • 3. Xem thông tin chi tiết S3 endpoint
    • S3 Clients
      • 1. Cấu hình S3 Browser
    • S3 API SDK Documentation
  • Identity & Access
    • Overview
    • Roles & Permission
      • 1. Khởi tạo role và phân quyền cho role
      • 2. Xem và quản lý danh sách role
      • 3. Xem chi tiết role
      • 4. Chỉnh sửa role và permission
      • 5. Xóa role và permission
    • User Group
      • 1. Khởi tạo nhóm người dùng để phân quyền trên hệ thống
      • 2. Xem và quản lý danh sách nhóm người dùng.
      • 3. Xem chi tiết nhóm người dùng
      • 4. Chỉnh sửa nhóm người dùng
      • 5. Xóa nhóm người dùng
    • User Account
      • 1. Đăng nhập tài khoản
      • 2. Thay đổi mật khẩu
      • 3. Cấu hình 2FA
      • 4. Invite user mới
      • 5. Khởi tạo account và truy cập vào VPC đã được mời
      • 6. Xóa quyền truy cập của tài khoản
  • Cloud Guard - Alert
    • Overview
    • Tutorials
      • Quản lý Recipient
        • 1. Thêm mới Recipient
        • 2. Chỉnh sửa Recipient
        • 3. Xóa Recipient
      • Quản lý Alert
        • 1. Tạo Alert cho các Virtual Machine
        • 2. Tạo Alert cho các Autoscaling Group
        • 3. Xem trạng thái của Alert
        • 3. Bật/Tắt Alert
        • 4. Chỉnh sửa Alert
        • 5. Xóa Alert
  • Activity Log
    • Overview
    • Tutorials
      • 1. Truy cập VPC Activity Log
      • 2. Filter VPC Activity Log
      • 3. Instance Activity Log
  • Glossary
    • Elastic Compute
    • Activity Log
  • Cloud WAF
    • Tổng quan
    • Initial Setup
    • Hướng dẫn nhanh (Quick Starts)
    • Hướng dẫn chi tiết (Tutorials)
      • Thêm mới máy chủ WAF
      • Chỉnh sửa máy chủ WAF
      • Xóa máy chủ WAF
      • Quản trị máy chủ WAF với WAF Dashboard
        • Đăng nhập WAF Dashboard
        • Monitor WAF với Dashboard Overview
        • Quản lý Proxy Host
        • Quản lý Redirection Host
        • Thêm mới Stream Host
        • Quản lý 404 Host
        • Quản lý Access List
        • Quản lý SSL Certificates
        • Quản lý Security Rule Sets
        • Quản lý người dùng của WAF Dashboard
        • Kiểm tra Audit Log của WAF Dashboard
        • Kiểm tra Security Logs
        • Cài đặt chung
    • Các câu hỏi thường gặp (FAQs)
    • Một số gợi ý mẫu (Samples)
Powered by GitBook
On this page

Was this helpful?

  1. Autoscale
  2. Autoscale Profile

2. Tạo Autoscale Profile từ Cloud-init script

Previous1. Tạo Autoscale Profile từ Custom ImageNext3. Xóa Autoscale Profile

Last updated 2 years ago

Was this helpful?

Mục đích: Việc dùng cloud-init script giúp người dùng có thể tự do thay đổi các thông số, tự động hóa quá trình setup network, storage,... một cách linh hoạt. Đoạn script này nên được thử nghiệm trên các Virtual Instances đảm bảo hoạt động tốt trước khi dùng cho việc tạo Autocale Profile.

Điều kiện cần thiết (Có thể bỏ qua nếu VPC đã có sẵn):

  • 1. Tạo subnet

  • 1. Tạo security group

Bước 1: Truy cập trang Autoscale Profile > Chọn Create profile.

Bước 2: Cấu hình các thông tin sau:

Section
Field
Description

Credentials

Name

Nhập tên profile hoặc mặc định hệ thống sẽ tự đặt cho người dùng.

Authentication

  • Đối với Openstack Platform, người dùng sẽ có tùy chọn SSH. (Yêu cầu VPC đã có sẵn SSH Key)

  • Đối với VMware Platform, người dùng sẽ có tùy chọn Password.

  • Ngoài ra, nếu người dùng không có nhu cầu sử dụng thì có thể chọn None để không áp dụng tùy chọn nào.

Configuration

Image

Mỗi nhóm OS sẽ gồm nhiều phiên bản khác nhau, mặc định là phiên bản mới nhất trên hệ thống. Ở đây ta sẽ chọn Custom và lựa chọn Custom Image phù hợp trong danh sách.

Resource type

Mỗi dòng máy sẽ cấu hình CPU, RAM khác nhau. Hoặc người dùng có thể tự tạo một dòng máy phù hợp nhất với nhu cầu.

Storage

Policy

Chọn policy ổ đĩa phù hợp với nhu cầu. Mặc định sẽ là Premium-SSD.

Size (GB)

Tăng giảm dung lượng hoặc để dung lượng mặc định, mặc định tối thiểu sẽ là 40GB.default size will be 40GB.

Network

Subnet

Sẽ được tự động chọn dựa trên network của VPC, có thể thay đổi nếu muốn.

Security Group

Tương tự như Subnet, Security Group cũng sẽ được tự động lựa chọn, và người dùng cũng có thể thay đổi theo nhu cầu.d

User data

Cloud-init script mẫu: Với đoạn script mẫu này, các node trong group sẽ chạy một static website, người dùng có thể thực hiện Allocate Floating IP cho node và thực hiện truy cập vào website thông qua Floating IP đó.

#cloud-config

# Update apt database on first boot (run 'apt-get update').
# Note, if packages are given, or package_upgrade is true, then
# update will be done independent of this setting.
package_update: true
chpasswd:
  list: |
    root:Welcome***123

# if packages are specified, this package_update will be set to true
# packages may be supplied as a single package name or as a list
# with the format [<package>, <version>] wherein the specific
# package version will be installed.
packages:
  - nginx
  - git
  
# runcmd contains a list of either lists or a string
# each item will be executed in order at rc.local like level with
# output to the console
# - runcmd only runs during the first boot
# - if the item is a list, the items will be properly executed as if
#   passed to execve(3) (with the first arg as the command).
# - if the item is a string, it will be simply written to the file and
#   will be interpreted by 'sh'
runcmd:
  - systemctl enable nginx
  - systemctl start nginx
  - git clone https://github.com/cloudacademy/static-website-example.git
  - cp -r ./static-website-example/* /var/www/html/
  - rm -r ./static-website-example

Bước 4: Chọn Create Profile.

Hệ thống sẽ xác nhận và tiến hành khởi tạo profile.

Nơi chứa . Khi node khởi động, cloud-init sẽ đọc các metadata được cung cấp từ cloud, và khởi tạo hệ thống dựa trên chúng. Cloud-init thường được dùng với mục đích setup network, storage, SSH keys, và nhiều phần khác của hệ thống.

cloud-init script
VMware platform
Openstack Platform