Create and connect instance
The following explains how to create and connect instances in the Bare Metal Server service.
Create instance
You can create a new instance.
In Bare Metal Server, configuring network bonding allows multiple network interfaces to be grouped into a single logical interface. This configuration provides high bandwidth and availability.
-
Go to KakaoCloud Console > Beyond Compute Service > Bare Metal Server.
-
Click on Instances and then click the [Create instance] button.
-
Enter the required information and click [Create].
Create Bare Metal Server instance
Item Description ① Basic information Name: Enter the instance name
- Example: instance-01_01
Description (optional): Provide an optional instance description (up to 100 characters)② Image Select an image provided by KakaoCloud ③ Instance type Select an instance type
- For more details, see KakaoCloud Official Site > Bare Metal Server Pricing④ Volume Automatically set between 1,600–3,200 GB, based on selected instance type ⑤ Key pair Select an existing key pair for the instance or create a new one
- Click Create key pair to create and assign a new key pair
- See Create key pair for details
⚠️ Once created, private key files cannot be downloaded again, so store them securely.
⚠️ You cannot connect to an instance without a key pair.⑥ Network Network bonding mode: Automatically set to mode4 LACP:802.3ad(link aggregation)
if enabled; network interface settings are disabled
VPC: Network to which the instance will connect
Network interface: Configure the network interface to connect at instance creation; select an existing or create a new interface
Subnet: Select a subnet from the network
- If a new VPC and subnet are needed, create them under KakaoCloud Console > VPC
- A public IP can be assigned after instance creation via Associate public IP
IP assignment method: Choose the method for assigning IPs to the network interface⑦ Advanced settings User script: Enter or upload a user script
- When the instance starts, the user data script is executed to set up the initial environment automatically
- Scripts can be entered as text or uploaded, up to 16KB
- The command executes only on the initial start
- Scripts are stored in/var/lib/cloud/instances
and executed
- To check script logs, run the following commands:
ᄂ Ubuntu:sudo cat /var/log/syslog
orsudo journalctl -u cloud-final.service
ᄂ CentOS:sudo cat /var/log/messages
orsudo journalctl -u cloud-final.service
-
Click [Create] to create the Bare Metal instance. After creation, you can access it via an SSH client. Additional setup, such as OS installation and configuration, may be required.
- Connecting multiple network interfaces to the same subnet may cause asymmetric routing issues, potentially requiring additional configuration for proper communication. For stable operation, it is recommended to connect each network interface to different subnets. See Use multiple network interfaces for details.
- When starting a Bare Metal instance, the basic server boots, and all hardware and firmware components are checked. This process can take about 20 minutes before the instance becomes available on the network.
- For instances created from January 16, 2023, the hostname is automatically set to the private IP format (e.g., host-100-100-17-22).
- After instance creation, the hostname may briefly appear as the instance name before updating to the host-IP format in the networking stage.
Connect to instance
Use SSH or RDP to connect to the instance, depending on the OS. Ensure that the access environment is configured for public/private IP access.
As of 2024, security group rules do not apply to Bare Metal instances even when connected.
Connect to Linux instance with SSH
You can connect to a Linux instance using an SSH client.
-
Install an SSH client to use SSH commands.
OS Preparation Linux/macOS Download and install OpenSSH
- See OpenSSH Official Site for details -
In the terminal, use the SSH command to connect to the instance. Enter the path and filename of the private key, the username, and the instance's address.
SSH Commandssh -i {PATH_TO_PRIVATE_KEY} {USERNAME}@{INSTANCE_IP}
Parameter Description PATH_TO_PRIVATE_KEY
Private key ( .pem
) pathUSERNAME
Username connecting to the instance INSTANCE_IP
IP that the instance has
- Enter public IP or private IP according to the connection environment
Use GPU instance types
To use GPU instance types, you need to install the appropriate drivers.
You can create an instance using a GPU-specific image with drivers pre-installed or create an instance with a base image and install the public driver separately. The steps below explain how to install GPU drivers by operating system.
For convenience, KakaoCloud provides Ubuntu 20.04 and 22.04 images with NVIDIA driver version 470.199.02 and CUDA Toolkit version 11.4 pre-installed, allowing quick access to GPU instances.
- Linux
The following steps describe how to install a GPU driver on a Linux operating system.
This guide assumes the Ubuntu 20.04 image and NVIDIA A100, as currently provided by KakaoCloud.
Step 1. Install NVIDIA driver
Install the NVIDIA driver. Recommended driver and CUDA versions are as follows:
GPU Type | NVIDIA Version | CUDA Version |
---|---|---|
NVIDIA A100 | 450.80.02+ | CUDA Toolkit 11.1+ |
- For detailed information on downloading NVIDIA drivers, refer to NVIDIA Official Site Driver Downloads.
- For detailed instructions on driver installation and setup, refer to NVIDIA Driver Installation Quickstart Guide.
-
Check if the instance has NVIDIA hardware by running the following command:
NVIDIA hardware check command$ lspci | grep -i NVIDIA
-
Check available driver versions.
-
If the installed driver is not the latest version, run the
apt update -y
command to perform an update. -
If you see the message
Command ‘ubuntu-drivers’ not found
, enter the commandsudo apt install ubuntu-drivers-common
to installubuntu-drivers-common
.Command to check available driver versions$ ubuntu-drivers devices
Check driver versions$ ubuntu-drivers devices
**==** /sys/devices/pci0000:00/0000:00:04.0 **==**
modalias : pci:v000010DEd000020B0sv000010DEsd0000134Fbc03sc02i00
vendor : NVIDIA Corporation
driver : nvidia-driver-515-server - distro non-free
driver : nvidia-driver-470 - distro non-free
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-510-server - distro non-free
driver : nvidia-driver-510 - distro non-free
driver : nvidia-driver-450-server - distro non-free
driver : nvidia-driver-515 - distro non-free recommended
driver : xserver-xorg-video-nouveau - distro free builtin
-
-
Select and install the available driver.
Install driver$ sudo apt install nvidia-driver-470
-
Run a reboot.
Reboot command$ sudo reboot
-
Verify the installed driver information.
Command to check installed driver information$ nvidia-smi
Check installed driver information$ nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.141.03 Driver Version: 470.141.03 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100 80G... Off | 00000000:00:05.0 Off | 0 |
| N/A 33C P0 41W / 300W | 35MiB / 80994MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100 80G... Off | 00000000:00:06.0 Off | 0 |
| N/A 34C P0 43W / 300W | 35MiB / 80994MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
Step 2. Install NVIDIA CUDA Toolkit
Install the NVIDIA CUDA Toolkit.
-
If reinstalling the CUDA Toolkit, prepare the installation environment as follows. For new installations, proceed to step 2.
a. Remove existing CUDA-related configurations.
Command to remove CUDA configuration$ sudo rm -rf /usr/local/cuda*
b. If the following configurations exist in
~/.bashrc
or/etc/profile
, remove them.Delete existing configurationsexport PATH=$PATH:/usr/local/cuda-11.4/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.4/lib64
export CUDADIR=/usr/local/cuda-11.4c. After deleting all existing configurations, run the
nvcc -V
command to confirm that it no longer executes.nvcc -V command output$ nvcc -V
Command 'nvcc' not found, but can be installed with: sudo apt install nvidia-cuda-toolkit -
On the NVIDIA Official Site > CUDA Toolkit Archive, select the version of the CUDA Toolkit to install. After selecting a version, find the Base Installer command at the bottom.
Select CUDA Toolkit version and find Base Installer command
-
Run the Base Installer command (first line) to download the CUDA Toolkit installation file.
Example command to download CUDA Toolkit installation file$ wget https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux.run
Result of running the command to download the Toolkit installation file from Base Installer
-
Run the Base Installer command (second line) to execute the CUDA Toolkit installation file.
- Running the CUDA Toolkit installation file may take more than a minute.
Command to execute CUDA Toolkit installation file$ sudo sh cuda_11.4.0_470.42.01_linux.run
-
Use the arrow keys to select Continue and press Enter.
Select Continue
-
Type
accept
and press Enter.Type accept
-
Press Space to deselect the Driver checkbox, select Install, and press Enter.
- If an existing version is detected, the message
Existing installation of CUDA Toolkit 11.x found
will appear. In this case, select Upgrade all and press Enter.
Select Install
- If an existing version is detected, the message
-
If the CUDA Toolkit installs successfully, you will see the following screen.
CUDA Toolkit installation complete
-
Run the following commands to add environment variables for the CUDA Toolkit.
Commands to add CUDA Toolkit environment variables$ sudo sh -c "echo 'export PATH=$PATH:/usr/local/cuda-11.4/bin' >> /etc/profile"
$ sudo sh -c "echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.4/lib64' >> /etc/profile"
$ sudo sh -c "echo 'export CUDADIR=/usr/local/cuda-11.4' >> /etc/profile"
$ source /etc/profile -
Run the
nvcc -V
command to verify the installed CUDA Toolkit.CUDA Toolkit verification result