Reinstalling an OS from a Marketplace image
Marketplace is a catalog of preconfigured images of operating systems available for installation on BareMetal servers.
In Yandex BareMetal, you can reinstall a server OS from a public Marketplace image. During reinstallation, you can select any BareMetal server OS available in Marketplace, redistribute disk space, rebuild RAID arrays, and reconfigure root user access settings.
Warning
After reinstalling the OS, data on the disks will be deleted. The server configuration will remain intact.
To reinstall a BareMetal server OS:
-
In the management console
, select the folder containing your server. -
In the list of services, select BareMetal.
-
Find the server you need in the list, click
in its row, and select Re-install OS. -
In the window that opens:
-
Under Image, select one of the available OS images.
-
(Optional) Under Disk, configure disk partitioning:
-
Click Configure disk layout.
-
Specify the partitioning parameters. To create a new partition, click
Add partition.To build RAID arrays and configure disk partitions yourself, click Remove RAID.
-
Click Save.
If you do not modify the disk partitioning, the server will maintain its existing RAID configuration and disk allocation settings.
-
-
Under Access:
-
In the Password field, select one of the following options to create a root password:
-
To generate a new root password, select
New passwordand 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
Customsecret type to specify a custom password orGeneratedto generate password automatically.
-
-
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:
-
Click Add key.
-
Enter a name for the SSH key.
-
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>/.sshdirectory. In Windows, unpack the archive to theC:\Users\<user_name>/.sshdirectory. You do not need additionally enter the public key in the management console.
-
-
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.
-
-
-
Click Re-install and wait for the server OS reinstallation to complete.
-
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.
-
View the description of the command for reinstalling the OS:
yc baremetal server reinstall --help -
Reinstall the OS:
yc baremetal server reinstall \ --name <server_name> \ --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>}" \ --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>}"Where:
--name: Server name.-
--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.
-
-
--storage: Disk partitioning settings. This is an optional parameter. Possible settings:-
partition: Disk partition:type: File system. The possible values areExt3,Ext4,Swap, orXfs.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.
-
Example
Reinstall the OS:
yc baremetal server reinstall \
--name demo-baremetal-server \
--os-settings "image-id=ly5vtno2mjr3k4iuecur,password-plain-text=FDrxicR********,ssh-key-public=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGcM4tRfRHJGrlLMT+YJFr+aOdSQ********"
Result:
done (22m47s)
id: ly5u2442ulmz********
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: RUNNING
os_settings:
image_id: ly5vtno2mjr3k4iuecur
ssh_public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGcM4tRfRHJGrlLMT+YJFr+aOdSQYnYYjAoj********
storages:
- partitions:
- type: EXT3
size_gib: "9"
mount_point: /boot
- type: SWAP
size_gib: "4"
- type: EXT4
mount_point: /
raid:
type: RAID10
disks:
- id: ly54aes2ecmb********
type: HDD
size_gib: "1862"
- id: ly5nrgud6zrt********
type: HDD
size_gib: "1862"
- id: ly5yf2ylmchh********
type: HDD
size_gib: "1862"
- id: ly5loug77ciu********
type: HDD
size_gib: "1862"
configuration_id: ly5lymxdltk3xitpkrmi
created_at: "2025-07-09T07:23:39.323794Z"
labels:
env: test