Skip to main content

Connect a network volume to a dedicated server with VMware ESXi hypervisor

Learn more about network volumes in the General Product Information: Network Volumes guide.

  1. Create a SAN network.
  2. Connect the network volume to the server.
  3. Connect the network volume to the server in the server OS.
  4. Mount the VMFS file system.

1. Create a SAN network

  1. In the Control panel, on the top menu, click Products and select Dedicated Servers.

  2. Go to the Network → tab SAN network.

  3. Click Add SAN network.

  4. Select an availability zone.

  5. Enter a subnet address from the private range (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) or keep the default subnet. The subnet size must be /20.
    Ensure that the subnet is not used in your infrastructure.

  6. Click Create SAN network.

2. Connect the network volume to the server

  1. In the Control panel, on the top menu, click Products and select Dedicated Servers.

  2. Go to the Network Volumes and Storage section → Network Volumes tab.

  3. Open the volume page → Connect to Server tab.

  4. In the Server field, click Select.

  5. Select the server to which the network volume will be connected.

  6. Click Confirm.

  7. If you are connecting a network volume to a server with a private network, configure the network:

    7.1. Select a VLAN.

    7.2. Enter the subnet CIDR from the private address range 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16.
    Ensure that the subnet does not overlap with the SAN network you created in step 1 and that you are not using it elsewhere in your infrastructure.

    7.3. Enter the Next hop 1 and Next hop 2 addresses from the selected private subnet.

    7.4. Click Configure.

3. Connect the network volume to the server in the server OS

You can connect a network volume to the server manually or using a ready-made script generated in the control panel. The script can only be used on Ubuntu OS — for more details, see the Connect a network volume to a dedicated Linux server guide.

  1. Connect to the server via SSH or via KVM console.

  2. Display the list of network interfaces:

    esxcli network nic list

    The response will show a list of network interfaces. For example:

    Name PCI Device Driver Admin Status Link Status Speed Duplex MAC Address MTU Description
    -------- ------------ -------- ------------ ----------- ----- ------ ----------------- ---- -----------
    vmnic0 0000:01:00.0 nmlx4_en Up Up 10000 Full 1x:11:xx:0x:00:x0 1500 Mellanox Technologies ConnectX-3 Pro EN NIC; 10GigE; dual-port SFP+ (MCX312B-XCC)
    vmnic1 0000:02:00.0 igbn Up Up 1000 Full aa:1a:0a:11:1a:a0 1500 Intel Corporation I350 Gigabit Network Connection
    vmnic128 0000:01:00.0 nmlx4_en Up Up 10000 Full 1c:00:cc:0c:00:c0 1500 Mellanox Technologies ConnectX-3 Pro EN NIC; 10GigE; dual-port SFP+ (MCX312B-XCC)
    vmnic2 0000:02:00.1 igbn Up Up 1000 Full cc:1c:6c:01:6c:c1 1500 Intel Corporation I350 Gigabit Network Connection

    Here, in the Name field, are the names of the network interfaces.

  3. Display information about the network interface configuration:

    esxcli network vswitch standard list

    The response will show the current network interface configuration. For example:

    vSwitch0
    Name: vSwitch0
    Class: cswitch
    Num Ports: 2560
    Used Ports: 4
    Configured Ports: 128
    MTU: 1500
    CDP Status: listen
    Beacon Enabled: false
    Beacon Interval: 1
    Beacon Threshold: 3
    Beacon Required By:
    Uplinks: vmnic1
    Portgroups: VM Network, Management Network
  4. Create two virtual switches for the SAN network:

    esxcli network vswitch standard add --vswitch-name=<switch_name_1>
    esxcli network vswitch standard add --vswitch-name=<switch_name_2>

    Specify:

    • <switch_name_1> — the name of the first virtual switch;
    • <switch_name_2> — the name of the second virtual switch.
  5. Assign network interfaces to the virtual switches:

    esxcli network vswitch standard uplink add --vswitch-name=<switch_name_1> --uplink-name=<eth_name_1>
    esxcli network vswitch standard uplink add --vswitch-name=<switch_name_2> --uplink-name=<eth_name_2>

    Specify:

    • <switch_name_1> — the name of the first virtual switch that you created in step 4;
    • <eth_name_1> — the name of the first network interface on the first port of the network card that you obtained in step 2;
    • <switch_name_2> — the name of the second virtual switch that you created in step 4;
    • <eth_name_2> — the name of the second network interface on the second port of the network card that you obtained in step 2.
  6. Ensure that the network interfaces are configured correctly:

    esxcli network vswitch standard list

    The response will show the configuration of the network interfaces that you configured in steps 4 and 5.

  7. Create port groups on the virtual switches:

    esxcli network vswitch standard portgroup add --portgroup-name=<portgroup_name_1> --vswitch-name=<switch_name_1>
    esxcli network vswitch standard portgroup add --portgroup-name=<portgroup_name_2> --vswitch-name=<switch_name_2>

    Specify:

    • <portgroup_name_1> — the name of the first port group;
    • <switch_name_1> — the name of the first virtual switch that you created in step 4;
    • <portgroup_name_2> — the name of the second port group;
    • <switch_name_2> — the name of the second virtual switch that you created in step 4.
  8. Ensure that the port groups are correctly created on the virtual switches:

    esxcli network vswitch standard portgroup list

    The response will contain a list of the port groups that you created in step 7.

  9. Create virtual interfaces:

    esxcli network ip interface add --interface-name=<vmkernel_name_1> --portgroup-name=<portgroup_name_1>
    esxcli network ip interface add --interface-name=<vmkernel_name_2> --portgroup-name=<portgroup_name_2>

    Specify:

    • <vmkernel_name_1> — the name of the first virtual interface;
    • <portgroup_name_1> — the name of the first port group that you created in step 7;
    • <vmkernel_name_2> — the name of the second virtual interface;
    • <portgroup_name_2> — the name of the second port group you created in step 7.
  10. Add IP addresses to the virtual interfaces:

    esxcli network ip interface ipv4 set --interface-name=<vmkernel_name_1> --ipv4 <ip_address_1> --netmask <mask_1> --type static
    esxcli network ip interface ipv4 set --interface-name=<vmkernel_name_2> --ipv4 <ip_address_2> --netmask <mask_2> --type static

    Specify:

    • <vmkernel_name_1> — the name of the first virtual network interface that you created in step 9;
    • <ip_address_1> - The IP address of the first port on the network card. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Port IP address;
    • <mask_1> - The destination subnet mask for the first port on the network card. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Static routes for connecting to iSCSI targets → column Destination Subnet;
    • <vmkernel_name_2> — the name of the second virtual network interface that you created in step 9;
    • <ip_address_2> - The IP address of the second port on the network card. You can view it in control panel: from the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Port IP address;
    • <mask_2> - The destination subnet mask for the second port on the network card. You can look it up in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Static routes for connecting to iSCSI targets → column Destination Subnet.
  11. Ensure that the virtual network interfaces are created and configured correctly:

    esxcfg-vmknic -l

    The response will show the configuration of the virtual network interfaces that you configured in steps 9 and 10.

  12. Ensure that the destination network gateway is reachable:

    vmkping -I <vmkernel_name_1> <next_hop_1>
    vmkping -I <vmkernel_name_2> <next_hop_2>

    Specify:

    • <vmkernel_name_1> — the name of the first virtual network interface that you created in step 9;
    • <next_hop_1> - gateway for the first port on the network card. You can see it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Next hop (gateway);
    • <vmkernel_name_2> — the name of the second virtual network interface that you created in step 9;
    • <next_hop_2> - gateway for the second port on the network card. You can look it up in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Next hop (gateway).
  13. Add static routes to access the iSCSI targets:

    esxcli network ip route ipv4 add --network <destination_subnet_1> --gateway <next_hop_1>
    esxcli network ip route ipv4 add --network <destination_subnet_2> --gateway <next_hop_2>

    Specify:

    • <destination_subnet_1> - the destination subnet for the first port on the network card. You can view it in the control panel: from the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Static routes for connecting to iSCSI targets → column Destination Subnet;
    • <next_hop_1> - gateway for the first port on the network card. You can see it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Next hop (gateway);
    • <destination_subnet_2> - The destination subnet for the second port on the network card. You can look in the control panel: from the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Static routes for connecting to iSCSI targets → column Destination Subnet;
    • <next_hop_2> - gateway for the second port on the network card. You can look it up in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Next hop (gateway).
  14. Ensure that the routes added in step 13 have been applied:

    esxcli network ip route ipv4 list
  15. Ensure that the iSCSI target is reachable:

    vmkping -I <vmkernel_name_1> <iscsi_target_ip_address_1>
    vmkping -I <vmkernel_name_2> <iscsi_target_ip_address_2>

    Specify:

    • <vmkernel_name_1> — the name of the first virtual network interface that you created in step 9;
    • <iscsi_target_ip_address_1> - IP address of the first iSCSI target. Can be viewed in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
    • <vmkernel_name_2> — the name of the second virtual network interface that you created in step 9;
    • <iscsi_target_ip_address_2> - IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2.
  16. Check the status of the iSCSI initiator:

    esxcli iscsi software get
  17. If the iSCSI initiator status is false, enable it:

    esxcli iscsi software set --enabled true
  18. Display the list of iSCSI adapters:

    esxcli iscsi adapter list

    The response will show a list of iSCSI adapters. For example:

    Adapter Driver State UID Description
    ------- --------- ------ ------------- -----------
    vmhba64 iscsi_vmk online iscsi.vmhba64 iSCSI Software Adapter

    Here, in the Adapter field, are the names of the iSCSI adapters.

  19. Set the iSCSI initiator name:

    esxcli iscsi adapter set --adapter=<iscsi_adapter_name> --name=<initiator_name>

    Specify:

    • <iscsi_adapter_name> — the name of the iSCSI adapter that you obtained in step 18;
    • <initiator_name> - name of the iSCSI initiator. You can look it up in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Initiator name.
  20. Bind the virtual interfaces to the iSCSI adapter:

    esxcli iscsi networkportal add --nic <vmkernel_name_1> --adapter <iscsi_adapter_name>
    esxcli iscsi networkportal add --nic <vmkernel_name_2> --adapter <iscsi_adapter_name>

    Specify:

    • <vmkernel_name_1> — the name of the first virtual network interface that you created in step 9;
    • <vmkernel_name_2> — the name of the second virtual network interface that you created in step 9;
    • <iscsi_adapter_name> — the name of the iSCSI adapter that you obtained in step 18.
  21. Ensure that the virtual interfaces are bound to the iSCSI adapter:

    esxcli iscsi networkportal list
  22. Configure CHAP authentication for the iSCSI initiator:

    esxcli iscsi adapter auth chap set -A <iscsi_adapter_name> --authname=<username> --secret=<password> --level required

    Specify:

    • <iscsi_adapter_name> — the name of the iSCSI adapter that you obtained in step 18;
    • <username> - username to authorize the iSCSI initiator. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Username;
    • <password> - password for authorization of the iSCSI initiator. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Password.
  23. Ensure that CHAP authentication is configured correctly:

    esxcli iscsi adapter auth chap get -A <iscsi_adapter_name>

    Specify <iscsi_adapter_name>, the name of the iSCSI adapter that you obtained in step 18.

  24. Configure static iSCSI targets for the iSCSI adapter:

    esxcli iscsi adapter discovery statictarget add -A <iscsi_adapter_name> -a <iscsi_target_ip_address_1>:3260 -n <iqn>
    esxcli iscsi adapter discovery statictarget add -A <iscsi_adapter_name> -a <iscsi_target_ip_address_2>:3260 -n <iqn>

    Specify:

    • <iscsi_adapter_name> — the name of the iSCSI adapter that you obtained in step 18;
    • <iscsi_target_ip_address_1> - IP address of the first iSCSI target. Can be viewed in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
    • <iscsi_target_ip_address_2> - IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 2;
    • <iqn> - IQNs of the first and second iSCSI target. You can view them in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Target name.
  25. Ensure that static iSCSI targets for the iSCSI adapter are configured correctly:

    esxcli iscsi adapter target list
  26. Initiate a rescan for iSCSI targets for the iSCSI adapter:

    esxcli iscsi adapter discovery rediscover -A <iscsi_adapter_name>

    Specify <iscsi_adapter_name>, the name of the iSCSI adapter that you obtained in step 18.

  27. Check the status of the last iSCSI target discovery:

    esxcli iscsi adapter discovery status get -A <iscsi_adapter_name>

    Specify <iscsi_adapter_name>, the name of the iSCSI adapter that you obtained in step 18.

  28. Ensure that all static iSCSI targets are configured correctly:

    esxcli iscsi adapter discovery statictarget list -A <iscsi_adapter_name>

    Specify <iscsi_adapter_name>, the name of the iSCSI adapter that you obtained in step 18.

  29. Initiate an iSCSI session:

    esxcli iscsi session add -A <iscsi_adapter_name> -n <iqn>

    Specify:

    • <iscsi_adapter_name> — the name of the iSCSI adapter that you obtained in step 18;
    • <iqn> - IQNs of the first and second iSCSI target. You can view them in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field Target name.
  30. Ensure that the iSCSI session is running:

    esxcli iscsi session list
  31. Check connectivity to the iSCSI targets:

    nc -s <ip_address_1> -z <iscsi_target_ip_address_1> 3260
    nc -s <ip_address_2> -z <iscsi_target_ip_address_2> 3260

    Specify:

    • <ip_address_1> - The IP address of the first port on the network card. You can view it in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Port IP address;
    • <iscsi_target_ip_address_1> - IP address of the first iSCSI target. Can be viewed in the control panel: in the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring an iSCSI connection → field IP address of the iSCSI target 1;
    • <ip_address_2> - The IP address of the second port on the network card. You can view it in control panel: from the top menu, click ProductsDedicated Servers → section network volumes and Storage → tab network volumes → disk page → block Configuring network interfaces → column Port IP address;
    • <iscsi_target_ip_address_2> — IP address of the second iSCSI target. You can view it in the control panel: in the top menu, click ProductsDedicated ServersNetwork Volumes and StorageNetwork Volumes tab → disk page → Configure iSCSI connection block → iSCSI target 2 IP address.
  32. Update the list of all adapters:

    esxcli storage core adapter rescan --all
  33. Get the network volume identifier:

    esxcli storage core device list

    The response will show a list of connected storage devices. For example:

    Device: naa.600140558e7a2bfee234358ad22f7c79
    Display Name: naa.600140558e7a2bfee234358ad22f7c79
    Has Settable Display Name: true
    Size: 100.00 GB
    Device Type: Direct-Access
    Multipath Plugin: NMP
    Devfs Path: /vmfs/devices/disks/naa.600140558e7a2bfee234358ad22f7c79
    Vendor: LIO-ORG
    Model: iscsi-disk

    Where:

    • Device - identifier of the network volume;
    • Model — the model or software description of the storage device specified by the target, for example, an iSCSI server.
  34. Display the network volume information:

    esxcli storage core device list -d <device_id>

    specify <device_id> — the network volume ID that you obtained in step 33.

  35. Configure the network volume access policy:

    esxcli storage nmp device set -d <device_id> -P <path_selection_policy>

    Specify:

    • <device_id> — the network volume ID that you obtained in step 33.

    • <path_selection_policy> — the path selection policy, which determines how I/O requests are routed to the storage when multiple paths are available:

      • Round Robin (VMW_PSP_RR) — evenly distributes I/O requests across all available paths;

      • Most Recently Used (VMW_PSP_MRU) — uses the last active path. Upon failure, it switches to another, and does not return to the original path after it is restored. Suitable for configurations with active-passive storage;

      • Fixed (VMW_PSP_FIXED) — uses only one designated path, by default the first operational one. Upon failure, it switches to an available path, but returns to the original one when it is restored;

      • Fixed with Automatic Path Failover (VMW_PSP_FIXED_AP) — this policy is similar to Fixed, but switching between paths occurs automatically.

  36. Display the network volume information:

    esxcli storage nmp device list -d <device_id>

    specify <device_id> — the network volume ID that you obtained in step 33.

  37. Ensure that Round Robin is configured correctly:

    esxcli storage nmp psp roundrobin deviceconfig get -d <device_id>

    specify <device_id> — the network volume ID that you obtained in step 33.

  38. Ensure that the paths the server uses to connect to the network volume are configured correctly:

    esxcli storage core path list -d <device_id>

    specify <device_id> — the network volume ID that you obtained in step 33.

4. Mount the VMFS file system

VMFS (VMware File System) — a clustered file system used by VMware ESXi for storing virtual machine files. VMFS supports shared access to storage by multiple ESXi hosts. This is the mandatory file system type for network storage.

  1. Create a GPT partition table on the disk:

    partedUtil mklabel /dev/disks/<device_id> gpt

    specify <device_id> — the network volume ID that you obtained when connecting the network volume to the server in the server OS in step 33.

  2. Obtain the range of valid sectors for partitioning:

    partedUtil getUsableSectors /dev/disks/<device_id>

    specify <device_id> — the network volume ID that you obtained when connecting the network volume to the server in the server OS in step 33.

    The response will contain the start and end sector values that are available for use. For example:

    2048 314572766

    Where:

    • 2048 — start sector;
    • 314572766 — end sector.
  3. Create a partition on the disk:

    partedUtil setptbl /dev/disks/<device_id> gpt "<partition_number> <start_sector> <end_sector> AA31E02A400F11DB9590000C2911D1B8 0"

    Specify:

  4. Format the partition with the VMFS file system:

    vmkfstools -C vmfs6 -S <datastore_name> /dev/disks/<device_id>:<partition_number>

    Specify:

  5. Ensure that the file system is available for mounting:

    esxcli storage filesystem list
  6. Ensure that the datastore you created in step 4 is available for use:

    6.1. Open the vSphere Web Client web interface.

    6.2. Go to StorageDatastore.

    6.3. Check that a datastore with the VMFS6 type has appeared in the list with the Accessible`` status.