LogoLogo
Main WebsiteCloud Console
EN
EN
  • FPT Cloud Portal
  • Elastic Compute
    • Overview
    • Virtual Instance
      • 1. Create instance
      • 2. Power off/Reboot instance
      • 3. Terminate Instance
      • 4. Resize VM
      • 5. Create instance snapshot
      • 6. Delete snapshot
      • 7. Restore instance from snapshot
      • 8. View instance details
      • 9. Manage instance storage
      • 10. Configure floating IP
      • 11. View instance monitoring
      • 12. Create Profile SSH Key
      • 13. Configure Remote Desktop
    • Virtual Private Cloud
      • 1. Monitor VPC resources
      • 2. Switch VPC
    • Custom Image
      • 1. Upload Custom Image
      • 2. Create instance from custom image
      • 3. Manage Custom Images
    • High Capacity Storage
      • 1. Create storage disk
      • 2. Attach storage disk to instance
      • 3. Detach storage disk from instance
      • 4. Delete storage disk
      • 5. Resize storage disk
  • Networking Service
    • Overview
    • Floating IP
      • 1. Connect a Floating IP to instance
      • 2. Disconnect Floating IP from instance
      • 3. Check IP Outbound address
    • Security Group & Firewall
      • 1. Create security group
      • 2. Create firewall rules
      • 3. Delete firewall rules
      • 4. Add instance to security group
      • 5. Remove instance from security group
    • Load Balancer
      • 1. Create load balancer
      • 2. View load balancer details
      • 3. Change rules & settings of load balancer
      • 4. Delete load balancer
    • Subnet
      • 1. Create subnet
  • Command Line Interface
    • Overview
    • Command Reference
  • Activity Log
    • Overview
    • Tutorials
      • 1. Access VPC Activity Log
      • 2. Filter VPC Activity Log
      • 3. Instance Activity Log
  • Autoscale
    • Overview
    • Autoscale Profile
      • 1. Create Autoscale Profile from Custom Image
      • 2. Create Autoscale Profile from Cloud-init script
      • 3. Delete Autoscale Profile
    • Autoscale Group
      • 1. Create Autoscale Group
      • 2. On-demand manual scale
      • 3. Delete Autoscale Group
      • 4. Manual Resize Autoscale Group
      • 5. Create Autoscale Schedule
      • 6. Delete Autoscale Schedule
    • Autoscale Policy
      • 1. Create Autoscale Load balancer Policy
      • 2. Create Scaling Policy
      • 3. Attach Autoscale Policy
      • 4. Detach Autoscale Policy
      • 5. Delete Autoscale Policy
  • Database Service
    • Overview
    • Tutorials
      • 1. Create a Database
      • 2. Database details
      • 3. Manage Database
  • Kubenetes Engine
    • Overview
    • Tutorials
      • 1. Initialize Kubernetes cluster
      • 2. Access cluster details
      • 3. Access cluster dashboard
      • 4. Delete cluster
      • 5. Changing K8s cluster configuration.
      • 6. Power On/Off K8s cluster
      • 7. Autoscale
  • Container Registry
    • Overview
    • Tutorials
      • 1. Enable the container registry service
      • 2. Docker Login
      • 3. Tag and push image to FPT Container Registry
      • 4. Pull docker image from FPT Container Registry to local
  • Identity & Access
    • Overview
    • Roles & Permission
      • 1. Create new role and assign permission
      • 2. View available roles
      • 3. Role details
      • 4. Edit role and permission
      • 5. Delete role and permission
    • User Group
      • 1. Create User Group and assign permission
      • 2. View available User Group
      • 3. User Group Details
      • 4. Edit User Group
      • 5. Delete User Group
    • User Account
      • 1. Sign In
      • 2. Change password
      • 3. Enable 2FA
      • 4. Create account and access invited VPC
  • Object Storage
    • Overview
    • Object Storage
      • 1. Create object bucket
      • 2. View objects of bucket
      • 3. Upload objects to bucket
      • 4. Create folders for object management
      • 5. Change permissions in object
      • 6. Delete objects in bucket
      • 7. Delete object bucket
    • Access Key
      • 1. Create access key
      • 2. Delete access key
      • 3. View S3 endpoint details
    • S3 Clients
      • 1. Configure S3 Browser
    • S3 API SDK Documentation
  • Cloud Guard - Alert
    • Overview
    • Manage Recipient
      • 1. Create Recipient
    • Manage Alert
      • 1. Create Alert for Virtual Machine
      • 2. Create Alert for Autoscaling Group
      • 3. View Alert state
      • 4. Turn on/off Alert
      • 5. Delete Alert
  • Glossary
    • Elastic Compute
    • Activity Log
Powered by GitBook
On this page
  1. Autoscale
  2. Autoscale Profile

2. Create Autoscale Profile from Cloud-init script

Previous1. Create Autoscale Profile from Custom ImageNext3. Delete Autoscale Profile

Last updated 2 years ago

Purpose: The use of cloud-init scripts allows users to flexibly customize parameters and automate the process of setting up network, storage, etc. This script should be tested on Virtual Instances before being used for Autocale Profile creation.

Requirements (Can be ignored if VPC is already available):

  • 1. Create subnet

  • 1. Create security group

Step 1: Go to Autoscaling page > Autoscale Profile > Select Create profile.

Step 2: Configure the profile following fields of information:

Section
Field
Description

Credentials

Name

Enter profile name or default name will be set.

Configuration

Image

Each OS group will consist of many different versions. The default is the latest version. Select Custom and select the appropriate Custom Image in the list.

Resource type

Each model will configure CPU and RAM differently. Or users can create a model that best suits their needs.

Storage

Policy

Choose the drive policy that suits your needs. The default will be Premium-SSD.

Size (GB)

Increase/decrease/leave the default capacity. The minimum default size will be 40GB.

Network

Subnet

Automatically selected. It can be changed if desired.

Security Group

Automatically selected. It can be changed if desired

User data

Sample Cloud-init script: With this sample script, the nodes in one group will run a static website, users can allocate Floating IP to the node and access to the website through that 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

Step 3: Select Create Profile.

The system will confirm and create profile.

Where is located. When the node starts, the cloud-init will read the metadata provided from the cloud, and initialize the system based on them. Cloud-init is often used for setting up networks, storage, SSH keys, and many other parts of the system.

the cloud-init script