.

VMware

The S1 system allows you to manage and provision block-level storage for ESXi hypervisors’ by connecting to VMware’s vSphere software development kits (SDKs). This allows you to create file systems for VMs that are hosted in ESXi hypervisors that were provisioned with block-level storage.

It can also provision file-based storage for ESXi hypervisors, enabling shared storage between their VMs.

Logging in to vSphere server

Before you begin you must login to your vSphere server. From the S1CLI terminal use the vmware login command to connect to your vSphere server. Depending on your settings you can either login to your vSphere server using your username and password or you can use session token string.

Usage:

vmware login <ip> (--username=<vSphere_username> --password=<vSphere_password>) | (--sessionToken=<string>) 

Options:

  • Required:
Options and arguments Description
<ip> Positional argument, replace <ip> with the IP of your vSphere server.
--username=<vSphere_username> User name of your vSphere server.
--password=<vSphere_password> User password of your vSphere server
--sessionToken=<string> Replace <string> with your vSphere session string.

Examples:

  1. To login to vSphere server corresponding to IP address 192.168.50.55 with a token ffee4gd5b, run
    vmware login 192.168.50.55 --sessionToken ffee4gd5b
  2. To login to vSphere server corresponding to IP address 192.168.44.55 that has username myFed and user-password fedo4all, run
    vmware login 192.168.55.44 --username=myFed --password fedo4all

What to do next

Verify vSphere connection

Use the command vmware connection state to find vSphere connection status.

Usage:

Vmware connection state

Example:

To find vSphere connection state, run
Vmware connection state

Create a target for ESX server

After connecting to vSphere server, target your bare-metal ESX server. A bare-metal ESX server is typically managed by the vSphere console. However, You can also use S1 CLI interface. To connect to your ESX server using S1 CLI, use the vmware esx target create command.

Usage:

	vmware esx target create (--esxi=<es_IP>) --s1=<S1_ip> [--port=<port_num>]

Options:

Options and arguments Description
--esxi=<name_IP> To Configure ESXi IP, replace <name_ip> with the address of the ESXi bare-metal server hypervisor.
--s1=<S1_ip> To Configure the IP of the S1 two-node cluster, replace <S1_ip> with the S1 IP address
--port=<port_num> To configure the port number of the S1 two-node cluster.

Examples:

To target bare-metal EXSi server on IP 192.168.20.22 for S1 two-node clusters sitting on address 192.168.40.40 and on port 3738, run

vmware esx target create --esxi 192.168.20.22 --s1 192.168.40.40 --port 3738

Listing all ESXis and their VMs

To display all VMs on an EXSi server, use the vmware esx list command.

Usage:

vmware esx list [<host_name>] [--iqn] [--datastores] [--vms]

Options:

Options and arguments Description
<host_name> Optional position argument to filter results by hostname.
--iqn Display iSCSI Qualified Names (iQN) of the host
--datastores Display hosts’ datastores.
--vms Display hosts’ virtual machines.

Example:

To display all VMs and iSCSI Qualified Names on host name math, run

vmware esx list math --iqn --vms

Listing VM file system datastore

First make sure that you are logged in to the ESXi server Login to ESXi server. Use the vmware datastore vmfs list command to list virtual machine file systems (VM FMs). You may either list VM datastores or the application volumes.

Usage:

vmware datastore vmfs list [--datastore=<dt_name>|--application=<app_name> --volume=<vol_name>] [--esxi=<esxi_ip>] [--details] [--vms] [--esxs]

Options:

  • Optional:
    Options and arguments Description
    --datastore=<dt_name> Filter results by datastore name. Replace <dt_name> with the name of the datastore.
    --application=<app_name> Filter results by app volume. Replace <app_name> with the name of the application.
    --volume=<vol_name> Specify app volume name. Replace <vol_name> with the name of the volume.
    --esxi=<esxi_ip> Filter results by the IP address of the bare-metal ESXi hypervisor server.
    --details Display detailed description including device name and partition number.
    --vms Display datastore information about virtual machines.
    --esxs Display information about all the datastore ESXs.

Examples:

  1. To display virtual machine file system data store list with ESXs information, run

    vmware datastore vmfs list --esxs
    
  2. To display virtual machine file system information with application name math and volume algebra (including device name and partition number), run

    vmware datastore vmfs list --application math --volume algebra --details
    

Provisioning block-level storage for ESXi hosts

To install a new VM, you need to have a file system. The S1 system allows you to provision a file-block storage for your ESXi hypervisor by using VMware’s virtual machine file storage (VMFS). Later, when you host a virtual machine on the ESXi hypervisor, you can use the its block-level provisioned storage to create a file system for the VM.

Before provisioning storage for an ESXi hypervisor, make sure that the S1 system is Logged into the ESXi server. Then use the vmware datastore vmfs create command to provision storage for the ESXi hypervisor.

Usage:

	vmware  datastore  vmfs  create   <vmfs_name>  --esxi=<esxi_IP>  (--naa=<naa_id_code> | (--application=<app_name> 	--volume=<vol_name>))

--naa stands for Networking Addressing Authority (NAA) identifier code of the ESX system.

Options:

  • Required:
Options and arguments Description
<vmfs_name> Positional argument indicating the name of the virtual machine file systems.
--esxi <esxi_IP> Specify the IP address of the ESXi bare-metal server hypervisor.
--naa=<naa_id_code> Specify the NAA identifier code of the ESX system. Replace <naa_id_code> with ESX naa-id-code
--application=<app_name> Specify the app volume for the VM FS. Replace <app_name> with the name of the application.
--volume-<vol_name> Specify The name of the application volume.

Examples:

To create a datastore virtual machine file system on an application volume with:

  • Name of the VM file system: debMe
  • The IP of the ESXi: 192.168.20.21
  • The application name: myMachines
  • The application volume (of myMachine) is: Mstore
    run:
vmware datastore vmfs create debMe --esxi 192.168.20.21 --application myMachines --volume Mstore

Provision file-based storage for ESXi hosts

To provision file-based storage for ESXi hosts, the S1 system uses the network file system (NFS) protocol. By provisioning file-based storage to the ESXi hypervisor, the ESXi host is configured to access a shared directory path on a NAS server. This allows the VM machines hosted on this ESXi host to share files between them. Before creating an NFS for the ESXi host, make sure that you are logged in to the ESXi server. Login to ESXi server. To create a network file system, use the vmware datastore nfs create command. You can choose between read-only mode or read and write mode.

Usage:

```
vmware datastore nfs create <nfs_name> --esxi=<esxi_IP> --nas=<nas_IP> --path=<path> --read|--readwrite
```

Options:

  • Required:
    Options and arguments Description
    <nfs_name> Position argument for the NFS name, replace <nfs_name> with a name of your choice.
    --esxi<esxi_IP> Specify the IP of the ESXi hypervisor. Replace <esxi_IP> with the IP of the ESXi hypervisor.
    --nas=<nas_IP> Specify the NAS server IP. Replace <nas_IP> with the IP of the NAS server.
    --path=<path> Specify the NAS share path. Replace <path> with the NAS share path.
    --read Configure read only data access mode.
    --readwrite Configure read and write access mode.

Examples:

To create a network file system named RH for hypervisor with IP 192.168.44.33 on NAS server IP 192.168.55.99 with share path /home/openHypo/RH and with read only data access mode, run

vmware datastore nfs create RH --esxi 192.168.44.33 --nas 192.168.55.99 --path /home/openHypo/RH --read

Listing network file system (NFS)

First make sure that you are logged in to the ESXi server Login to ESXi server. Use the vmware datastore nfs list command to list network file systems. You may choose to list a specific datastore (by name) or a specific network attached storage (NAS).

Usage:

vmware datastore nfs list [--datastore=<ds_name>| --nas=<nas_ip> --share=<path>] [--esxi=<esxi_ip>] [--details] [--vms] [--esxs]

Options:

Options and arguments Description
--datastore=<ds_name> Filter results by datastore name, replace <ds_name> with the data datastore name.
--nas=<nas_ip> Filter results by NAS IP, replace <nas_ip> with the NAS IP.
--path=<path> Specify the NFS shared directory. Replace <path> with NFS shared directory.
--exsi=<esxi_ip> Filter results by the IP of the ESXi hypervisor. Replace <esxi_ip> with the ESXi IP.
--details Display additional datastore details.
--vms Display datastores of the virtual machines (VMs).
--esxs Display ESX datastore.

Example:

  1. To list a network file system on a NAS server with an IP 192.168.44.33 and a shared directory /home/openHypo/RH that relates to ESXi hypervisor 192.168.55.11, run

    	vmware datastores nfs list --nas 192.168.44.33 --path /home/openHypo/RH --esxi 192.168.55.11
    
  2. To get a detailed list of a network file system on datastore name math with shared path /home/openHypo/RH that relates to ESXi hypervisor 192.168.55.11, run

    	vmware datastores nfs list --datastore math --path /home/openHypo/RH --esxi 192.168.55.11 --details
    

Listing datastores

First make sure that you are logged in to the ESXi server Login to ESXi server. Use the vmware datastore list command to list your virtual machine file system datastores.

Usage:

	vmware datastore list [--datastore=<datastore_name>] [--esxi=<esxi_IP>] [--details] [--vms] [--esxs]

Options:

  • Optional:
    Options and arguments Description
    --datastore=<datastore_name> Filter results by the name of the datastore.
    --exsi=<esxi_IP> Filter results by the ESXi, replace <esxi_IP by the IP of the ESXi server.
    --details Display additional details about device name and partition number.
    --vms Display datastore information about virtual machines.
    --esxs Display information about all the datastore ESXs.

Examples:

To display the ESXs that relate to all datastores, run

```
vmware datasore list --esxs
```

List virtual machines

To list all virtual machines, use the command vmware vms list. This command can display all virtual machines of all the datastores.

Usage:

vmware vms list [--datastoreName=<ds_name> | --application=<app_name> --volume=<vol_name>] [--esxi=<esxi_ip>] [--datastores]

Options:

Options and arguments Description
--datastoreName=<ds_name> List a specific datastore, replace <ds_name> with the name of the datastore.
--application=<app_name> List a specific application name, replace <app_name> with the name of the application.
--volume=<vol_name> List the app volume, replace <vol_name> with the name of the application volume name.
--esxi=<esxi_ip> Specify the ESXi IP, replace <esxi_ip> with the name of the ESXi’s IP address.
--datastores Display datastores.

Examples:

  1. To list all datastores and all VMs, run

    vmware vms list --datastores
    
  2. To list all VMs on application OP and volume study, run

    vmware vms list --application OP --volume study
    

Log out from vSphere

Use the command vmware logout to disconnect from the vSphere server.

Usage:

vmware logout

Example:

To logout from vmware connection, run:
vmware logout

Last updated on 15 Nov 2022
Published on 30 Oct 2022