vSAN 6.6 RVC Guide Part 1 - Basic Configuration

vSAN 6.6 RVC Guide

The "vSAN 6.6 RVC Guide" series explains how to manage your VMware Virtual SAN environment with the Ruby vSphere Console. RVC is an interactive command line tool to control and automate your platform. If you are new to RVC, make sure to read the Getting Started with Ruby vSphere Console Guide. All commands are from the latest vSAN 6.6 version. The first part explains basic configuration tasks that are required for the initial setup:

To shorten commands I've used marks for the vSAN enabled Cluster, a Virtual Machine and an ESXi Hosts participating in the vSAN. This enables me to use ~cluster, ~vm and ~esx in examples:

/localhost/DC> mark cluster ~/computers/VSAN-Cluster/
/localhost/DC> mark vm ~/vms/vma.virten.lab
/localhost/DC> mark esx ~/computers/VSAN-Cluster/hosts/esx1.virten.lab/

Basic Configuration

vsan.enable_vsan_on_cluster [-d] ~cluster
Enables VSAN on a cluster. When VSAN is already enabled you can also use this command to enable/disable auto claim. When not specified, auto claim is enabled by default.

  • -d, --disable-storage-auto-claim: - Disable auto disk-claim (Manual mode claiming of disks)

Example 1 - Enable VSAN on a Cluster:

/localhost/DC> vsan.enable_vsan_on_cluster ~cluster
ReconfigureComputeResource VSAN-Cluster: success
 esx1.virten.local: success
 esx2.virten.local: success
 esx3.virten.local: success

Example 2 - Enable VSAN on a Cluster with auto claim disabled, or disables auto claim on a VSAN enabled Cluster:

/localhost/DC> vsan.enable_vsan_on_cluster --disable-storage-auto-claim ~cluster
ReconfigureComputeResource VSAN-Cluster: success
 esx1.virten.local: success
 esx2.virten.local: success
 esx3.virten.local: success

vsan.disable_vsan_on_cluster ~cluster
Disables VSAN on a cluster. VMware HA has to be disabled, to disable Virtual SAN. This command will make the vsanDatastore including all virtual machines unavailable. It does not delete any data.

Example 1 - Disable VSAN on an HA enabled Cluster:

/localhost/DC> cluster.configure_ha --disabled ~cluster
ReconfigureComputeResource VSAN-Cluster: success
 esx1.virten.local: success
 esx2.virten.local: success
 esx3.virten.local: success
/localhost/DC> vsan.disable_vsan_on_cluster ~cluster
ReconfigureComputeResource VSAN-Cluster: success
 esx1.virten.local: success
 esx2.virten.local: success
 esx3.virten.local: success

vsan.cluster_change_autoclaim [-e|-d] ~cluster
This command enables or disables auto-claim. With auto-claim enabled all unused disks are automatically consumed by Virtual SAN.

  • -e, --enable: Enable auto-claim
  • -d, --disable: Disable auto-claim

Example 1 - Enable auto-claim:

/localhost/DC> vsan.cluster_change_autoclaim --enable ~cluster
ReconfigureComputeResource VSAN-Cluster: success
 esx2.virten.local: success
 esx3.virten.local: success
 esx1.virten.local: success

Example 2 - Disable auto-claim:

/localhost/DC> vsan.cluster_change_autoclaim --disable ~cluster
ReconfigureComputeResource VSAN-Cluster: success
 esx2.virten.local: success
 esx3.virten.local: success
 esx1.virten.local: success

vsan.apply_license_to_cluster [-k|-r] ~cluster
Applies a Virtual SAN license key to a Cluster. This command also triggers a Null-Reconfigure on all hosts to ensure that all disks are claimed when auto-claim is enabled.

  • -k, --license-key=: License key to be applied to the cluster
  • -r, --null-reconfigure, --no-null-reconfigure: Trigger Null-Reconfigure to force auto-claim (default: true)

Example 1 - Apply a VSAN license and for auto-claim:

/localhost/DC> vsan.apply_license_to_cluster -k 00000-00000-00000-00000-00000 ~cluster
VSAN-Cluster: Applying VSAN License on the cluster...
VSAN-Cluster: Null-Reconfigure to force auto-claim...
ReconfigureComputeResource VSAN-Cluster: success
 esx1.virten.local: success
 esx2.virten.local: success
 esx3.virten.local: success

Example 2 - Replace a VSAN license key:

/localhost/DC> vsan.apply_license_to_cluster -r -k 00000-00000-00000-00000-00000 ~cluster 
VSAN-Cluster: Applying VSAN License on the cluster...

vsan.host_consume_disks [-f|-i] ~cluster|~host
Consumes all eligible disks on a host. When the hosts have multiple SSDs you have to specify the appropriate SSD by its model.

  • -f, --filter-ssd-by-model=: Regex to apply as SSD model filter
  • -i, --filter-hdd-by-model=: Regex to apply as HDD model filter

Example 1 - Identify SSD Model description and create a disk group. This is required when you have more than one SSD:

/localhost/DC> esxcli.execute ~esx storage core device list
[...]
IsSSD: true
Model: "SanDisk SDSSDP06"
[...]
/localhost/DC> vsan.host_consume_disks ~esx --filter-ssd-by-model "SanDisk SDSSDP06"
 AddDisks esx1.virten.local: success

Example 2 - Add all eligible disks to a new or existing disk group:

/localhost/DC> vsan.host_consume_disks ~esx
 AddDisks esx1.virten.local: success

vsan.cluster_set_default_policy ~cluster ~policy
Set default policy on a cluster. That policy is used by default when an object has no VM Storage Policy defined. A policy defines how objects are stored in the Virtual SAN. Available values are:

  • hostFailuresToTolerate (Number of failures to tolerate)
  • forceProvisioning (If VSAN can't fulfill the policy requirements for an object, it will still deploy it)
  • stripeWidth (Number of disk stripes per object)
  • cacheReservation (Flash read cache reservation)
  • proportionalCapacity (Object space reservation)

Default Policy: (("hostFailuresToTolerate" i1))

Example 1 - Change the default policy to tolerate two host failures:

/localhost/DC> vsan.cluster_set_default_policy ~cluster '(("hostFailuresToTolerate" i2))'

Example 2 - Determine the current default policy from an existing host and add a rule:

/localhost/DC> esxcli.execute ~esx vsan policy getdefault
+--------------+----------------------------------------------------------+
| Policy Class | Policy Value                                             |
+--------------+----------------------------------------------------------+
| cluster      | (("hostFailuresToTolerate" i1))                          |
| vdisk        | (("hostFailuresToTolerate" i1))                          |
| vmnamespace  | (("hostFailuresToTolerate" i1))                          |
| vmswap       | (("hostFailuresToTolerate" i1) ("forceProvisioning" i1)) |
+--------------+----------------------------------------------------------+
/localhost/DC> vsan.cluster_set_default_policy ~cluster '(("hostFailuresToTolerate" i1) ("stripeWidth" i2))'

vsan.host_wipe_vsan_disks [-d|-i|-a|-n|-f] ~host
Deletes the content of all VSAN enabled disks on a host. When the command is uses without the force option it only tells what it would wipe.

  • -d, --disk=: Disk's canonical name, as identifier of disk to be wiped
  • -i, --interactive: Select disks to wipe from given disk list, cannot be set together with parameter 'disks'
  • -a, --allow-reduced-redundancy: Removes the need for disks worth of free space, by allowing reduced redundancy during disk wiping
  • -n, --no-action: Take no action to protect data during disk wiping
  • -f, --force: Forcely wipe disks without any confirmation

Example 1 - Run the command in dry mode:

/localhost/DC> vsan.host_wipe_vsan_disks ~esx
Would wipe disk WDC_WD1500HLFS (ATA WDC WD1500HLFS-0, ssd = false)
Would wipe disk WDC_WD1500HLFS (ATA WDC WD1500HLFS-0, ssd = false)
Would wipe disk WDC_WD1500HLFS (ATA WDC WD1500HLFS-0, ssd = false)
Would wipe disk SanDisk_SDSSDP064G (ATA SanDisk SDSSDP06, ssd = true)

NO ACTION WAS TAKEN. Use --force to actually wipe.
CAUTION: Wiping disks means all user data will be destroyed!

Example 2 - Wipe the content of all VSAN disks:

/localhost/DC> vsan.host_wipe_vsan_disks ~esx --force
 RemoveDiskMapping esx1.virten.local: success

vsan.host_wipe_non_vsan_disk [-d|-f|-i] ~host
Wipe disks with partitions other than VSAN partitions. This command is intended to wipe a disk that was previously used for other filesystems (e.g. VMFS, FAT, vFRC) and you now want to use the disk for Virtual SAN. When the command is used without the force option it only tells what it would wipe.

  • -d, --disk=: Disk to be wiped clean (multiple allowed)
  • -f, --force: Do it for real
  • -i, --interactive: Select disks to wipe from given disk list, cannot be set together with parameter 'disks'

Example 1 - Run the command in dry mode:

/localhost/DC> vsan.host_wipe_non_vsan_disk -d naa.6589cfc00000001917172ff67b90be59 ~esx
Gathering disk information for host vesx1.virten.lab
Done gathering disk information
Disks on host esx1.virten.lab:
Disk: FreeBSD iSCSI Disk (naa.6589cfc00000001917172ff67b90be59)
  Host: esx1.virten.lab
  Make/Model: FreeBSD iSCSI Disk
  Type: SSD
  Size: 50 GB
  Partition table:
Are you sure you want to delete all partitions? [y/N]
y
Would have deleted all partitions and all data, but
didn't. Run with --force to delete partitions and
erase all data on disk naa.6589cfc00000001917172ff67b90be59 for real.

Example 2 - Run the command in interactive mode:

/localhost/DC>  vsan.host_wipe_non_vsan_disk ~esx/ -i
Gathering disk information for host vesx1.virten.lab
Done gathering disk information
Disks on host vesx1.virten.lab:
+-------+-----------------------------------------------------------------+-------------------------------------------------+
| Index | Disk info                                                       | Partition info                                  |
+-------+-----------------------------------------------------------------+-------------------------------------------------+
| 1     | Disk: FreeBSD iSCSI Disk (naa.6589cfc00000001917172ff67b90be59) | Partition table:                                |
|       | Make/Model: FreeBSD iSCSI Disk                                  |                                                 |
|       | Type: SSD                                                       |                                                 |
|       | Size: 50 GB                                                     |                                                 |
+-------+-----------------------------------------------------------------+-------------------------------------------------+
| 2     | Disk: FreeNAS iSCSI Disk (naa.6589cfc0000000572b71f35019e9c31f) | Partition table:                                |
|       | Make/Model: FreeNAS iSCSI Disk                                  |   1: 400.00 GB, type = vmfs ('flash-iscsi02')   |
|       | Type: SSD                                                       |                                                 |
|       | Size: 400 GB                                                    |                                                 |
+-------+-----------------------------------------------------------------+-------------------------------------------------+
Please input index of disks to be wiped, use comma to separate, input 'none' to skip:
1
Disk: FreeBSD iSCSI Disk (naa.6589cfc00000001917172ff67b90be59)
  Host: vesx1.virten.lab
  Make/Model: FreeBSD iSCSI Disk
  Type: SSD
  Size: 50 GB
  Partition table:
Are you sure you want to delete all partitions? [y/N]
y
Would have deleted all partitions and all data, but
didn't. Run with --force to delete partitions and
erase all data on disk naa.6589cfc00000001917172ff67b90be59 for real.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>