Prerequisites
-
Make sure you are in a group that has at least the
editorrole within your tenant; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console. - Install and initialize the Nebius AI Cloud CLI.
-
Install jq to extract IDs and tokens from the JSON data returned by the Nebius AI Cloud CLI:
How to allocate addresses
-
Determine what CIDR block you need and save it to an environment variable. The block must fall within the RFC 1918 private address ranges:
10.0.0.0/8,172.16.0.0/12or192.168.0.0/16, and must not overlap with CIDR blocks already used by other pools or subnets in the network, or with external networks the VM reaches over a Nebius VPN Gateway.When you choose a custom CIDR block, do not use172.17.0.0/16. It conflicts with the Docker default bridge network and can make virtual machines unreachable. For more information, see Virtual machine is unreachable due to a Docker subnet conflict. -
Get the ID of the required network and save it to an environment variable:
-
Get the ID of this network’s private pool and save it to an environment variable:
As this command contains
pools[0], it saves the ID of the private pool that goes first in the network specification. If you need a different pool, specify its index inpools[<index>]. To check the order of pools, runnebius vpc network list. -
Add the
CUSTOM_SUBNET_CIDRblock to the private pool withPRIVATE_POOL_ID: -
Create a new subnet with this private pool and save the subnet ID to an environment variable:
-
(Optional) To assign the VM a specific IP address, create an allocation within this subnet and save its ID to an environment variable:
The
--ipv4-private-cidrparameter sets the IP address for the allocation. Make sure that this address is within the subnet’s CIDR block. Without this parameter, the command creates an allocation with a random IP address from the subnet. -
Create a VM in the new subnet:
The VM is assigned a private IP address from the subnet’s pool. To assign the specific address from the allocation instead, set
ip_addressto{"allocation_id": "$ALLOCATION_ID"}inside the--network-interfacesparameter. If you later delete the VM, you can reuse the allocation for another VM.