Skip to main content

Create and connect instance

An instance consists of virtualized hardware resources, configuring servers of various instance types. Here's how to create and connect instances in Bare Metal Server:

Create instance

info

In Bare Metal Server, configuring network bonding allows multiple network interfaces to be combined into a single logical interface. This enables higher bandwidth and increased availability.

  1. Go to Beyond Compute Service > Bare Metal Server in the KakaoCloud Console.

  2. Click the Instance menu and the [Create instance] button.

  3. Fill in the required fields and select the [Create] button.

    image. Step 1: Image settings Create instance

    ItemDescription
    ① Basic informationName: Instance name
    Description (optional): Description of the instance
    ② ImageOS image provided by KakaoCloud
    ③ Instance typeInstance type to choose
    ④ VolumeAutomatically set to 1,600~3,200 GB
    ⑤ Key pairSelect an existing key pair to apply to the instance or create a new one
    - Click to create a new key pair, allowing for the creation and assignment of a new key pair.
    - For details, refer to Create new key pair
    ⚠️ Since the private key cannot be downloaded again, it is crucial to store it securely.
    Please note that you cannot connect to an instance without a key pair.
    ⑥ NetworkNetwork settings
    - Network bonding mode: When enabled, mode4 LACP:802.3ad(link aggregation) can be selected
    - VPC : Select the network to configure the instance
    - Subnet: Select one of the subnets created on the network

    _ When using LACP, the same two interfaces are set due to the network bonding mode.
    _ Without network bonding, up to two interfaces can be configured.
    ⑦ Advanced settingsUser script: Enter or run a user script
    - When an instance starts, it automatically runs the initial environment configuration by executing user data.
    - Enter the user script and cloud-init command within 16KB or upload a file.
    - 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 or sudo journalctl -u cloud-final.service
    ㄴ CentOS: sudo cat /var/log /messages or sudo journalctl -u cloud-final.service
  4. Click the [Create] button to create the server. Afterwards, you can connect to the server using an SSH client, etc.

    • Additional tasks may be required, such as installing and configuring the server operating system.
caution
  • It is recommended to select the same subnet for all network interfaces. If two network interfaces select different subnets, additional steps may be required for normal communication. For details, please refer to Multi-network interface.
  • When a Bare Metal instance is initiated, the default server boots up, checking all hardware and firmware components. Therefore, it may take approximately 20 minutes before the instance becomes operational and accessible over the network.
info
  • Instances created starting January 16, 2023 will automatically have their hostname set to a private IP. (e.g. host-100-100-17-22).
  • After creating an instance, during the networking phase, the hostname will be updated to the host-IP format, and the instance name may temporarily appear as the hostname shortly after creation.

Connect instance

To connect to an instance, use SSH or RDP depending on the operating system image. In order to connect to an instance, you must set up a security group according to the OS image and prepare a connection environment for access via public/private IP.

Acquiring metadata is essential for connecting to an instance. If the security group of the instance you want to connect to does not include a default security group, you must define an outbound policy for metadata acquisition in a custom security group.

OSSecurity group policyAllowed port
LinuxInbound      TCP port 22 (default)

Connect with SSH to Linux instance

You can connect to your Linux instance using an SSH client.

  1. Install an SSH client to use SSH commands.

    OSPreparation
    Linux/macOSDownload and install OpenSSH
    - For details, refer to OpenSSH official site.
  2. Connect to the instance using the SSH command in the terminal. Enter the path and file name of the private key (.pem), the username of the instance, and the address of the instance.

    SSH command
    ssh -i PATH_TO_PRIVATE_KEY USERNAME@INSTANCE_IP
    ParameterDescription
    PATH_TO_PRIVATE_KEYPrivate key (.pem) path
    USERNAMEUsername connecting to the instance
    INSTANCE_IPIP that the instance has
    - Enter public IP or private IP according to the connection environment

Use GPU instance

To utilize GPU-equipped instances, it is necessary to install the appropriate drivers.
You can create an instance using a GPU-specific OS image with pre-installed drivers, or you can create an instance with a default image and subsequently download and install the public drivers separately. The process for installing GPU drivers varies by operating system, as follows.

info

For your convenience, KakaoCloud provides Ubuntu 20.04 and 22.04 images with NVIDIA driver version 470.199.02 and CUDA Toolkit version 11.4 installed. Utilizing these images allows for the easy use of GPU-type instances.

You can connect to your Linux instance using an SSH client.

info

This documentation is based on the Ubuntu 20.04 image currently provided by KakaoCloud, NVIDIA A100.

Step 1. Install NVIDIA driver

Install NVIDIA drivers. Recommended drivers and CUDA versions are:

GPU typeNVIDIA versionCUDA version
NVIDIA A100450.80.02 and aboveCUDA Toolkit 11.1 or higher

info
  1. Before installing NVIDIA drivers, ensure the instance is equipped with NVIDIA hardware by running the appropriate command.

    NVIDIA device search command
    $ lspci | grep -i NVIDIA
  2. Verify the driver versions available for installation.

    • If the installed driver is not the latest version, run the update by executing the apt update -y command.

    • When the message Command ‘ubuntu-drivers’ not found appears, enter the sudo apt install ubuntu-drivers-common command to install ubuntu-drivers-common.

      Command to check driver version to install
      $ ubuntu-drivers devices
      Example of checking driver version
      $ 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
  3. Select an available driver to proceed with the installation.

    Installing Driver
    $ sudo apt install nvidia-driver-470

    Image

  4. Reboot.

    Reboot command
    $ sudo reboot
  5. Verify the information of the installed driver.

    Command to check installed driver information
    $ nvidia-smi
    Example of checking 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.

  1. If reinstalling the CUDA Toolkit, prepare the installation environment as follows. However, for an initial setup, proceed from the step 2.

    a. Remove any existing CUDA-related configurations.

    CUDA configuration deletion command
    $ sudo rm -rf /usr/local/cuda*

    b. Delete any existing configurations in ~/.bashrc or /etc/profile, if present.

    Delete existing settings
    export 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.4

    c. After removing all existing settings, execute the command nvcc -V to verify that it no longer runs.

    nvcc -V command execution result
    $ nvcc -V
    Command 'nvcc' not found, but can be installed with: sudo apt install nvidia-cuda-toolkit
  2. Select the CUDA Toolkit version to install from NVIDIA Official Site > CUDA Toolkit Archive. When selecting a version, you can find the Base Installer command at the bottom of the page.

    Image Select CUDA Toolkit version and check Base Installer command

  3. Run the Base Installer command (first line) to download the CUDA Toolkit installation file.

    Example of file download command for CUDA Toolkit installation
    $ wget https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux.run

    Result of executing file download command for Toolkit installation of Base Installer Result of executing file download command for Toolkit installation of Base Installer

  4. Execute the Base Installer command (second line) to run the CUDA Toolkit installation file.

    • It takes more than 1 minute to run the CUDA Toolkit installation file.

      File execution command for CUDA Toolkit installation
       $ sudo sh cuda_11.4.0_470.42.01_linux.run
  5. Press the arrow keys to select Continue and press Enter.

    Image Select Continue

  6. Type accept and press Enter.

    Image Enter accept

  7. Press Space to uncheck Driver, select Install, and press Enter.

    • If there is an existing configuration, the message Existing installation of CUDA Toolkit 11.x found will appear. If applicable, select Upgrade all and press Enter.

    Image Select Install

  8. If the CUDA Toolkit has been installed properly, you can see the following screen.

    Image CUDA Toolkit installation complete

  9. Run the following command to add CUDA Toolkit-related environment variables.

    Command for adding environment variables related to CUDA Toolkit
    $ 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
  10. Run the nvcc -V command to check the installed CUDA Toolkit.

    Image CUDA Toolkit installation confirmation result