Creating a VM on a dedicated host
A created VM will be linked to the host selected from a group of hosts. When the VM is stopped, it won't be available on the host, and when it's restarted, it will be linked to the same host from the group.
By default, the cloud has a zero quota for using dedicated hosts. To change the quota, contact technical support.
To create a VM on a dedicated host, follow these steps:
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View a description of any CLI command using the
--help
flag. For example:yc compute host-type --help
-
See the list of available dedicated host types:
yc compute host-type list
Execution result:
+---------------------+-------+--------------+ | ID | CORES | MEMORY | +---------------------+-------+--------------+ | intel-6230-с66-m454 | 66 | 487478788096 | +---------------------+-------+--------------+
-
Create a group of dedicated hosts of the selected type. A group may contain one or more hosts.
yc compute host-group create \ --fixed-size 2 \ --type intel-6230-с66-m454 \ --zone ru-central1-a
Where:
fixed-size
: The number of dedicated hosts in the group.type
: The type of dedicated hosts.zone
: The availability zone.
Command execution result:
done (5s) id: fhm123hj4l56abcg10qf folder_id: m4n56op78mev0cljderg created_at: "2020-10-13T07:54:08Z" zone_id: ru-central1-a status: READY type_id: intel-6230-с66-m454 maintenance_policy: RESTART scale_policy: fixed_scale: size: "2"
-
View the IDs of the dedicated hosts in the group and select the host to create your VM on:
yc compute host-group list-hosts fhm123hj4l56abcg10qf
Command execution result:
+----------------------+----------------------+ | ID | SERVER ID | +----------------------+----------------------+ | fhm1ab2mhnf3cd1610f5 | fhmlabct12vp3de45728 | | fhmabcun12kbbvhdeug3 | fhm1a2bcsl13ide4cqp2 | +----------------------+----------------------+
-
Create a VM that is linked to a dedicated host.
For more information about how to create a VM, see Creating VMs
yc compute instance create \ --host-id fhm1ab2mhnf3cd1610f5 \ --network-interface subnet-name=network-ru-central1-a \ --zone ru-central1-a
Where:
host-id
: ID of the dedicated host.subnet-name
: Name of the selected subnet.zone
: Availability zone that corresponds to the selected subnet.
Command execution result:
done (41s) id: fhm1abc23407de854r9e folder_id: m4n56op78mev0cljderg created_at: "2020-10-13T08:00:55Z" zone_id: ru-central1-a ... placement_policy: host_affinity_rules: - key: yc.hostId op: IN values: - fhm1ab2mhnf3cd1610f5
-
Select the host type using the list method for the
HostType
resource. -
Create a group of dedicated hosts using the create method for the
HostGroup
resource. -
Check out the IDs of the dedicated hosts in the group using the listHosts method for the
HostGroup
resource. -
Create a VM on a dedicated host using the create method for the
Instance
resource.