Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Creating a group of dedicated hosts
      • Creating a VM in a group of dedicated hosts
      • Creating a VM on a dedicated host
      • Configuring access permissions for a dedicated host group
    • Viewing operations with resources
  • Yandex Container Solution
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Dedicated hosts
  3. Creating a VM in a group of dedicated hosts

Creating a VM in a group of dedicated hosts

Written by
Yandex Cloud
Updated at May 5, 2025

The VM you create will be linked to a host from a group of dedicated hosts. Once stopped, the VM becomes unavailable on the group hosts and can be linked to a different host from the group when you restart it.

If you do not have a group of dedicated hosts yet, create one.

To create a VM:

CLI
API

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

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. Get the ID of the dedicated host group to create your VM in:

    yc compute host-group list
    

    Result:

    +------------------------------+-------+--------------+-------+---------------+
    |              ID              | CORES |    MEMORY    | DISKS |   DISK SIZE   |
    +------------------------------+-------+--------------+-------+---------------+
    ...
    | intel-6338-c108-m704-n3200x6 |   108 | 755914244096 |     6 | 3198924357632 |
    +------------------------------+-------+--------------+-------+---------------+
    
  2. Get a list of available subnets:

    yc vpc subnet list
    

    Result:

    +----------------------+-----------------------+----------------------+----------------+---------------+-----------------+
    |          ID          |         NAME          |      NETWORK ID      | ROUTE TABLE ID |     ZONE      |      RANGE      |
    +----------------------+-----------------------+----------------------+----------------+---------------+-----------------+
    | b0c6n43f9lgh******** | default-ru-central1-d | enpe3m3fa00u******** |                | ru-central1-d | [10.130.0.0/24] |
    | e2l2da8a20b3******** | default-ru-central1-b | enpe3m3fa00u******** |                | ru-central1-b | [10.129.0.0/24] |
    | e9bnlm18l70a******** | default-ru-central1-a | enpe3m3fa00u******** |                | ru-central1-a | [10.128.0.0/24] |
    +----------------------+-----------------------+----------------------+----------------+---------------+-----------------+
    
  3. Run this command to create a VM:

    yc compute instance create \
      --host-group-id <dedicated_host_group_ID> \
      --zone <availability_zone> \
      --platform <platform_ID> \
      --network-interface subnet-name=<subnet_name> \
      --attach-local-disk size=<disk_size>
    

    Where:

    • --host-group-id: ID of the dedicated host group.

    • --zone: Availability zone where the group of dedicated hosts resides.

    • --platform: Platform. It must match the platform of the dedicated host group:

      • standard-v3: For hosts based on Intel® Ice Lake.
      • standard-v2: For archived hosts based on Intel Cascade Lake.
    • --network-interface: VM network interface description:

      • subnet-name: Name of the subnet in the availability zone.
    • --attach-local-disk: Properties of the local disk being attached to the VM:

      • size: Disk size in bytes. You can find the possible values in the list of dedicated host types and the yc compute host-type list command output. For example, for the intel-6338-c108-m704-n3200x6 host type, specify 3198924357632 (~ 2.91 TB). You cannot set a size different from the host disk size.

      The --attach-local-disk parameter is optional. To attach multiple local disks, specify this parameter as many times as needed. For more information, see Local and network disks.

    To specify other VM properties, use the yc compute instance create command parameters as described in the CLI reference. For more information, see VMs in Compute Cloud and Creating a VM.

    Result:

    done (20s)
    id: fhmbdt1jj2k3********
    folder_id: m4n56op78mev********
    created_at: "2020-10-13T07:41:19Z"
    zone_id: ru-central1-a
    ...
    placement_policy:
      host_affinity_rules:
      - key: yc.hostGroupId
        op: IN
        values:
        - abcdefg1hi23********
    
  1. Get the ID of the dedicated host group using the list REST API method for the HostGroup resource or the HostGroupService/List gRPC API call.
  2. Create a VM using the create REST API method for the Instance resource or the InstanceService/Create gRPC API call.

If you attached local disks to your VM, partition and mount them after the VM is created.

Example of creating a VM with a local disk in a group of dedicated hostsExample of creating a VM with a local disk in a group of dedicated hosts

Before creating a VM:

  1. Create a group of dedicated hosts and get its ID using the yc compute host-group list CLI command.
  2. Generate a key pair to connect to your VM via SSH.

Create a VM with the following parameters:

  • Location: Dedicated host group.
  • Platform: Intel Ice Lake.
  • Number of vCPUs: 64.
  • Amount of RAM: 704 GB.
  • Number of local disks: 2.
  • Size of a local disk: 3,198,924,357,632 B (~ 2.91 TB).
  • Operating system: Ubuntu 22.04 LTS.

To do this, follow these steps:

CLI

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

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

Run this command to create a VM:

yc compute instance create \
  --cloud-id <cloud_ID> \
  --folder-id <folder_ID> \
  --zone <availability_zone> \
  --name <VM_name> \
  --platform standard-v3 \
  --cores 64 \
  --memory 704 \
  --host-group-id <dedicated_host_group_ID> \
  --network-interface subnet-id=<subnet_ID> \
  --attach-local-disk "size=3198924357632" \
  --attach-local-disk "size=3198924357632" \
  --ssh-key <path_to_public_SSH_key_file> \
  --create-boot-disk name=boot-disk,size=1000,image-folder-id=standard-images,image-family=ubuntu-2204-lts

Where:

  • --cloud-id: Cloud ID.
  • --folder-id: Folder ID.
  • --zone: Availability zone where the group of dedicated hosts resides.
  • --name: VM name.
  • --platform: VM platform.
  • --cores: Number of vCPUs.
  • --memory: Amount of RAM.
  • --host-group-id: ID of the dedicated host group.
  • --network-interface: VM network interface description:
    • subnet-id: ID of the subnet in the availability zone hosting the VM.
  • --attach-local-disk: Description of the local disk being attached:
    • size: Disk size.
  • --ssh-key: Public SSH key path. The VM will automatically create a user named yc-user for this key.
  • --create-boot-disk: Boot disk parameters.

Result:

done (20s)
id: fhmbdt1jj2k3********
folder_id: m4n56op78mev********
created_at: "2023-01-16T12:46:50Z"
zone_id: ru-central1-a
...
placement_policy:
  host_affinity_rules:
  - key: yc.hostGroupId
    op: IN
    values:
    - abcdefg1hi23********

Intel is a trademark of Intel Corporation or its subsidiaries.

Was the article helpful?

Previous
Creating a group of dedicated hosts
Next
Creating a VM on a dedicated host
© 2025 Direct Cursus Technology L.L.C.