VMware Sample Exchange

Browse and download code samples from VMware as well as code samples contributed by the VMware community. Log in to Sample Exchange using your MyVMware credentials to submit requests for new samples, contribute your own samples, as well as propose a sample as a solution for open requests.

Disclaimer: All sample content and code in Sample Exchange is licensed to you by the sample's author. VMware does not guarantee the samples; they are provided "AS IS". Use of this site is subject to the VMware Community Terms of Use.

Browse the list below for code samples from VMware and the community. You can filter the list of samples by selecting a platform or language, or enter other search keywords above.

Filters

SDK / Platform / Tool

  • Automation Tools

  • Cloud Management Platform

  • Cloud Native Applications

  • Data Center & Cloud Infrastructure

  • Desktop & Application Virtualization

  • Enterprise Mobility Management

  • Hybrid Cloud & Data Center Infrastructure

  • Networking & Security

  • Storage & Availability

  • Other Platform

Contributor

Language

1 - 10 of 52 Results Sample vSAN
  • Sample RVC Style Report using PowerCLI 11

    Contributor Jasemccarty

    This is the first of many RVC Style Functions that use PowerCLI 11 to mimic some of the tasks available in the Ruby vSphere Console for vSAN Requires William Lam's VSANUUIDtoVM Function, located here: ...
    VMware PowerCLI PowerShell
    Download

    155 Downloads

    0 Comments

    Updated 7 months ago

  • vSAN Set Swap Chunk Size

    Contributor Jasemccarty

    This script will go through a single host, or each host in a designated cluster, and set /Mem/SwapExtendChunkSizeInMB to either 0 or 65536 Used to mitigate KB 2150316 https://kb.vmware.com/kb/2150316 ...
    VMware PowerCLI PowerShell
    Download

    139 Downloads

    0 Comments

    Updated 1 year ago

  • Script with Functions to Enable or Disable Large Cluster Support on vSAN 6.2 or Higher

    Contributor Jasemccarty

    After importing this script, the Set-VsanLargeClusterSupport function will be available to either enable or disable Large Cluster Support in vSAN 6.2 or higher, per KB 2110081 (https://kb.vmware.com/k ...
    VMware PowerCLI PowerShell
    Download

    119 Downloads

    0 Comments

    Updated 5 months ago

  • Delete all disk groups of a vSAN ruthlessly

    Contributor IchbinTonyWu

    This script is to delete all disk groups when vSAN is enabled, and you just want to delete the existing DGs without caring the data on it. Please use it when you only want to delete them all and want ...
    vSAN PowerShell
    Download

    111 Downloads

    0 Comments

    Updated 9 months ago

  • Quick and Easy vSAN Capacity by Disk - DiskGroup - Host Report

    Contributor Jasemccarty

    This code sample will report the disk utilization of a vSAN Cluster by disk/diskgroup/host
    VMware PowerCLI PowerShell
    Download

    136 Downloads

    2 Comments

    Updated 2 months ago

  • List Folders on a VSAN Datastore using PowerCLI

    Contributor lamw

    This sample lists the "friendly name" of the top level folders of a VSAN Datastore. VSAN uses UUID to reference everythign and you just need to use the vSphere API to translate to the friendly name pr ...
    VMware Cloud on AWS VMware PowerCLI PowerShell
    Download

    155 Downloads

    0 Comments

    Updated 8 months ago

  • vSAN Storage Policy Example Creation

    Contributor jaredlutgen

    ... spbm-policy V1.0 Purpose: This script was built to help demonstrate the power of Storage policy based management. The script creates the following policies: vSAN No Protect - FTT-0 vSAN Basic Pro ...
    VMware PowerCLI PowerShell
    Download

    137 Downloads

    0 Comments

    Updated 2 years ago

  • Setup vSAN Stretched Cluster DRS Rules

    Contributor Jasemccarty

    This script can be run against a vSAN Stretched Cluster to create Host Groups and VM Groups. The script requires PowerCLI 6.5.1, released 4/20/2017 and has been tested against vSAN 6.6. Using PowerCLI ...
    VMware PowerCLI PowerShell
    Download

    279 Downloads

    0 Comments

    Updated 1 year ago

  • vSAN 6.6 Encryption Rekey

    Contributor Jasemccarty

    This script will initiate a Rekey of a vSAN Cluster. Shallow Rekeying (KEK Only) or Deep Rekeying (DEK Also) are supported, as well as Reduced Redundancy if necessary. This requires PowerCLI 6.5.1 a ...
    VMware PowerCLI PowerShell
    Download

    265 Downloads

    0 Comments

    Updated 1 year ago

  • vSAN Cluster Maintenance

    Contributor tifosi1988

    In a cluster without DRS enabled, user should manually migrate the virtual machines off a host to let the host enter Maintenance Mode. This sample script can automate this process and let the hosts en ...
    VMware PowerCLI PowerShell
    Download

    240 Downloads

    0 Comments

    Updated 1 year ago