Create and connect instance
Create instance
Instance is a virtualized hardware resource that configures servers of various instance types. Here is how to create an instance in the Virtual Machine(VM):
-
Go to Beyond Compute Service > Virtual Machine in the KakaoCloud Console.
-
Click the [Create instance] button in the Instance tab.
-
Enter the required information and click the [Create] button.
- Network connection after creating an instance takes up to 10 minutes.
Create instance
Item Description ① Basic information Name: Instance name
- If creating more than 2 instances, the name of the first created instance is automatically entered.
Description (optional): Description of the instance② Image Select one image to use
- Default tab: Officially provided images by KakaoCloud
- My Image tab: Images created by user (Refer to Manage image)③ Instance type Instance type to choose
④ Volume The volume attached to the instance.
- Root volume is shown by default, and custom volume can be added if necessary.
- Size: Can be created in sizes from 1 to 5,120GB
- Type: Currently (as of November 2022), onlySSD
is supported, with plans to support various types in the future
- Maximum IOPS: Current IOPS information by volume size
Delete when instance is deleted: If selected, the volume will be deleted along with the deletion of attached instance.⑤ Key pair Select an existing key pair to apply to the instance or create a new one
- Click Create key pair to create and assign a new key pair
⚠️ The private key cannot be downloaded again, so it's essential to securely store this information. Please note that you cannot connect to an instance without a key pair.⑥ Network VPC: Network to configure the instance
Subnet: Select one of the subnets created in the network
- A public IP can be associated after an instance is created. For details, refer to Associate public IP.
Security group: Select a security group to apply to the instance
Inbound/Outbound rules
- Inbound tab: Displays the policy applied by the security group above.
ㄴ The following inbound ports should be allowed depending on the selected OS image.
ㄴ Linux series: TCP port 22
ㄴ Windows: TCP port 3389
ㄴ Windows + MSSQL: TCP ports 3389, 1433
- Outbound tab: Allows all protocols of all ports⑦ Advanced settings User script: Enter or execute a user script
- At instance launch, user data is executed to automate the initial setup configuration
- User scripts andcloud-init
commands can be entered or uploaded as a file size within 16KB
- Entered commands are executed only when the instance is first started.
- User scripts are copied and executed under/var/lib/cloud/instances
.
- To check the script execution log, run the following command
ㄴ Ubuntu:sudo cat /var/log/syslog
orsudo journalctl -u cloud-final.service
ㄴ CentOS:sudo cat /var/log/messages
orsudo journalctl -u cloud-final.service
⚠️ Entering or executing an incorrect user script or an incomplete script may result in OS boot failure.
CPU multithreading: CPU multithreading option
- Designates a single thread per CPU core for optimal performance
- Recommended to disable for specific workloads such as high-performance computing (HPC)
- Volumes for which the Delete when instance is deleted option is not selected will remain as detached volumes and be charged for even if the instance is deleted. In that case, delete the instance directly from the volume list.
- Instances created starting January 16, 2023 will automatically have their hostname set to a private IP. (e.g.
host-100-100-17-22
). - After an instance is created, it is updated in
host-IP
format at the networking stage, and hostname may be displayed as the instance name for a while after instance creation.
Connect instance
Metadata is required to connect to an instance. If there is no default security group of the instance, define an outbound rules for metadata acquisition in the Custom security group. For more details, refer to Custom security group.
Connect to Linux instance
Linux instances are connected using the SSH command. Check the related explanation by clicking Virtual Machine > Instance tab > [More] icon > Use SSH to connect. Set up the security group according to the OS image and prepare the connection with public/private IP.
OS | Security group policy | Allowed port |
---|---|---|
Linux | Inbound | TCP port 22 (default) |
SSH connection
Step 1. Prepare SSH client
Install an SSH client in advance to use the SSH command. Below is the preparation requirements for installing an SSH client by operating system:
OS | Preparation |
---|---|
Linux/macOS | Install an SSH client and use the ssh command in the terminal |
Windows | Install OpenSSH client to use the ssh command in the command prompt (cmd) or install a separate SSH client such as PuTTY |
Step 2. Connect via SSH
Use the SSH command to connect to the instance. Enter the path and file name of your private key (.pem
), the username, and the address of the instance.
ssh -i {PATH_TO_PRIVATE_KEY} {USERNAME}@{INSTANCE_IP}
Command | Description |
---|---|
PATH_TO_PRIVATE_KEY | Path to the private SSH key |
USERNAME | Username for connecting to the instance |
INSTANCE_IP | The IP address of the instance - Enter either a public or private IP according to the connection environment |