Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex BareMetal
  • Getting started
    • All guides
      • Leasing a server
      • Getting information about a server
      • Updating a server
      • Connecting to the KVM console
      • Stopping and starting a server
      • Cancel a server lease
      • Uploading a custom OS image
      • Connecting an existing BareMetal server to Cloud Backup
      • Using the Rescue CD
      • Configuring the MC-LAG aggregation group
      • Resetting a password on the server
      • Replacing a disk in a RAID array
      • Adding a new SSH key for a user
      • Restoring the OS bootloader
      • Disk status analysis with HW Watcher
    • Overview
      • Overview
      • Server configurations
      • Disk status analysis
      • Additional server settings
      • Overview
      • DHCP
      • MC-LAG
      • Restrictions in BareMetal networks
    • Images
    • Quotas and limits
    • All tutorials
    • Connecting an existing BareMetal server to Cloud Backup
    • Configuring VRRP for a cluster of BareMetal servers
    • Establishing network connectivity in a BareMetal private subnet
    • Establishing network connectivity between BareMetal and Virtual Private Cloud private subnets
    • Establishing network connectivity between a BareMetal private subnet and on-premise resources
    • Delivering USB devices to a BareMetal server or virtual machine
    • Configuring an OPNsense firewall in high availability cluster mode
    • Deploying a web app on BareMetal servers with an L7 load balancer and Smart Web Security protection
  • Monitoring metrics
  • Audit Trails events
  • Access management
  • Pricing policy
  • FAQ
  1. Step-by-step guides
  2. Servers
  3. Leasing a server

Leasing a server

Written by
Yandex Cloud
Updated at August 25, 2025
Management console
CLI
  1. In the management console, select the folder you want to lease a server in.

  2. In the list of services, select BareMetal and click Lease server.

  3. In the Availability zone field, select the availability zone the server will be leased in.

  4. In the Pool field, select the pool the server will be leased from.

  5. Under Configuration, select the appropriate server configuration.

  6. (Optional) Under Disk, configure disk partitioning:

    1. Click Configure disk layout.

    2. Specify the partitioning parameters. To create a new partition, click Add partition.

      To build RAID arrays and configure disk partitions yourself, click Remove RAID.

    3. Click Save.

  7. Under Image, select:

    • Marketplace: To install one of the available Yandex Cloud Marketplace public OS images on the server.

    • No OS: To lease a server without an operating system.

      You can install the OS from a custom ISO image later.

  8. Under Lease conditions:

    1. In the Number of servers field, specify the number of servers you want to lease.
    2. In the Lease duration field, select a lease period: 1 day, 1 month, 3 months, 6 months, or 1 year.

      When this period expires, server lease will automatically be renewed for the same period. You cannot terminate the lease during the specified lease period, but you can refuse to extend the server lease further.

  9. Under Private network, in the Private subnet field, select an existing private subnet or click Create to create a new one.

  10. Under Public network, in the Public address field, select a public IP address assignment method:

    • From ephemeral subnet: Assign a random IP address. If you need to get the IP address when creating a server via a request to a DHCP server, enable Assign via DHCP.
    • From a dedicated subnet: To assign an IP address from the range of addresses of a dedicated public subnet.

      In the field that opens, select a public subnet or click Order to order a new one.

      Warning

      The dedicated public subnet does not have a DHCP server; therefore, on the network interface of the server connected to such subnet, you should manually configure a static IP address from the subnet’s range of available public IP addresses and specify the default gateway address.

    • No address: Do not assign a public IP address.
  11. If you are installing an OS from a Marketplace public image, specify server access settings under Access:

    1. In the Password field, select one of the following options to create a root password:

      • To generate a new root password, select New password and click Generate.

        Warning

        This option requires you to maintain password security. Save the password you generated in a secure location. Yandex Cloud does not store it, and you will not be able to retrieve it once the server is deployed.

      • To use the root password saved in a Yandex Lockbox secret, select Lockbox secret.

        In the Name, Version, and Key fields, select the secret containing your password, its version, and its key, respectively.

        If you do not have a Yandex Lockbox secret, click Create to create it.

        Choose the Custom secret type to specify a custom password or Generated to generate password automatically.

    2. In the Public SSH key field, select the SSH key saved in your organization user profile.

      If there are no SSH keys in your profile or you want to add a new key:

      1. Click Add key.

      2. Enter a name for the SSH key.

      3. Select one of the following:

        • Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own.

        • Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own.

        • Generate key: Automatically create an SSH key pair.

          When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the /home/<user_name>/.ssh directory. In Windows, unpack the archive to the C:\Users\<user_name>/.ssh directory. You do not need additionally enter the public key in the management console.

      4. Click Add.

      The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

  12. Optionally, enable server backup in Yandex Cloud Backup:

    1. Enable Backup.
    2. Select an existing backup policy or create a new one.
    3. Select a service account with the baremetal.editor and backup.editor roles assigned or create a new one.

    For more information, see Leasing a Yandex BareMetal server connected to Cloud Backup.

  13. Under Server information:

    1. Specify the server name in the Name field.
    2. Optionally, add a server description in the Description field.
    3. Optionally, set labels in the Labels field.
  14. Click Lease server.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. View the description of the command for leasing a server:

    yc baremetal server create --help
    
  2. Get a list of configurations:

    yc baremetal configuration list
    
  3. Lease a server:

    yc baremetal server create \
      --hardware-pool-id <pool> \
      --configuration-id <configuration_ID> \
      --storage "partition={type=<file_system>,size-gib=<partition_size>,mount-point=<mount_point>},raid-type=<RAID array level>,disk={id=<disk_number>,size-gib=<disk_size>,type=<disk_type>}" \
      --os-settings "image-id=<image_ID>,image-name=<image_name>,ssh-key-public=<public_SSH_key_contents>,ssh-key-user-id=<SSH_key_user_ID>,password-plain-text=<user_password>,password-lockbox-secret={secret-id=<secret_ID>,version-id=<secret_version>,key=<secret_key>}" \
      --rental-period-id <lease_period> \
      --network-interfaces private-subnet-id=<private_subnet_ID> \
      --network-interfaces public-subnet-id=<public_subnet_ID> \
      --name <server_name> \
      --description "<server_description>" \
      --labels <label_key>=<label_value>
    

    Where:

    • --hardware-pool-id: Pool to lease a server from.

    • --configuration-id: Server configuration ID.

    • --storage: Disk partitioning settings. This is an optional parameter. Possible settings:

      • partition: Disk partition:

        • type: File system. The possible values are Ext3, Ext4, Swap, or Xfs.
        • size-gib: Partition size in GB.
        • mount-point: Mount point.
      • disk: Disk:

        • id: Disk number.
        • size-gib: Disk size in GB.
        • type: Disk type.
      • raid-type: RAID array level.

    • --os-settings: OS settings. To lease a server without an operating system, skip this parameter. Possible settings:

      • image-id: ID of an available Yandex Cloud Marketplace public OS image.

      • image-name: Name of one of the available Yandex Cloud Marketplace public OS images.

      • ssh-key-public: Public SSH key contents. You will need to create your own SSH key pair to establish a secure server connection.

      • ssh-key-user-id: SSH key user ID.

      • password-plain-text: Root user's password.

        Warning

        This option requires you to maintain password security. Save the password you generated in a secure location. Yandex Cloud does not store it, and you will not be able to retrieve it once the server is deployed.

      • password-lockbox-secret: Yandex Lockbox secret:

        • secret-id: Secret ID.
        • version-id: Secret version.
        • key: Secret key.

      You can install the OS from a custom ISO image later.

    • --rental-period-id: Server lease period. The possible values are 1 day, 1 month, 3 months, 6 months or 1 year.

      When this period expires, server lease will automatically be renewed for the same period. You cannot terminate the lease during the specified lease period, but you can refuse to extend the server lease further.

    • --network-interfaces: Network settings:

      • private-subnet-id: Private subnet ID.
      • public-subnet-id: Dedicated public subnet ID. This is an optional parameter.

      Warning

      The dedicated public subnet does not have a DHCP server; therefore, on the network interface of the server connected to such subnet, you should manually configure a static IP address from the subnet’s range of available public IP addresses and specify the default gateway address.

    • --name: Server name.
    • --description: Server description. This is an optional parameter.
    • --labels: Server labels. This is an optional parameter.

Once you lease a server, you can install or reinstall the OS at any time using either a Cloud Marketplace public image or your own custom ISO. For more information, see Reinstalling an OS from a Marketplace image and Reinstalling an OS from a custom ISO image.

ExampleExample

Lease a server with a public OS image:

CLI
yc baremetal server create \
  --hardware-pool-id ru-central1-m4 \
  --configuration-id ly5lymxdltk3xitpkrmi \
  --storage "partition={type=EXT3,size-gib=1000,mount-point=/},partition={type=EXT4,size-gib=500,mount-point=/root},raid-type=RAID0,disk={id=1,size-gib=1862,type=HDD},disk={id=2,size-gib=1862,type=HDD}" \
  --storage "partition={type=EXT3,size-gib=1000,mount-point=/boot},partition={type=SWAP,size-gib=10},disk={id=3,size-gib=1862,type=HDD}" \
  --os-settings "image-id=ly5vhn4lapeva2qs3bx5,ssh-key-public=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGcM4tRfRHJGrlLMT+YJFr+aOdSQYnYYjAoj********,password-lockbox-secret={secret-id=e6qmvglkitn6********,version-id=e6qquvv4kh8e********,key=password}" \
  --rental-period-id 1-day \
  --network-interfaces private-subnet-id=ly5ztavbezrf******** \
  --network-interfaces public-subnet-id=ly5o6l7pxmk2********* \
  --name demo-baremetal-server \
  --description "My first BareMetal server" \
  --labels env=test

Result:

done (22m45s)
id: ly52dtzdi55r********
cloud_id: b1gia87mbaom********
folder_id: b1g0ijbfaqsn********
name: demo-baremetal-server
description: My first BareMetal server
zone_id: ru-central1-m
hardware_pool_id: ru-central1-m4
status: PROVISIONING
os_settings:
  image_id: ly5vhn4lapev********
  ssh_public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGcM4tRfRHJGrlLMT+YJFr+aOdSQYnYYjAoj********
  storages:
    - partitions:
        - type: EXT3
          size_gib: "999"
          mount_point: /
        - type: EXT4
          size_gib: "499"
          mount_point: /root
      raid:
        type: RAID0
        disks:
          - id: ly5ual3jbnhr********
            type: HDD
            size_gib: "1862"
          - id: ly54qfjw55d4********
            type: HDD
            size_gib: "1862"
    - partitions:
        - type: EXT3
          size_gib: "999"
          mount_point: /boot
        - type: SWAP
          size_gib: "9"
      disk:
        id: ly5ojffpngul********
        type: HDD
        size_gib: "1862"
network_interfaces:
  - id: ly5wbsiklrtd********
    mac_address: 00:25:90:92:fa:48
    private_subnet:
      private_subnet_id: ly5ztavbezrf********
  - id: ly5ygl4loyy6********
    mac_address: 00:25:90:92:fa:49
    public_subnet:
      public_subnet_id: ly5o6l7pxmk2********
configuration_id: ly5lymxdltk3xitpkrmi
created_at: "2025-07-06T21:53:46.186130Z"
labels:
  env: test

Was the article helpful?

Previous
All guides
Next
Getting information about a server
© 2025 Direct Cursus Technology L.L.C.