WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

vdq - A useful little VSAN utility

02.14.2014 by William Lam // 9 Comments

While re-building a couple of my Nested ESXi VMs for VSAN using some newer builds, I came across a nifty little VSAN utility called vdq which I assume stands for either VMware Disk Query or VSAN Disk Query. I actually found this utility by accident while poking around in the ESXi Shell as I was looking for a quick way to inspect the disks and I know there are a couple other methods which are officially supported by VMware such as RVC or ESXCLI.

Disclaimer: This is not officially supported by VMware, please use at your own risk. 

vdq provides two useful commands, one that queries the disks on your ESXi host and show whether they are eligible or not for VSAN. The other is the disk mappings once VSAN has been configured and enabled on your ESXi host.

To query the disks on your ESXi host, you can run the following command: vdq -q

You will be presented with a lot of useful information such as the disk device name, VSAN node UUID, the state of the disk (whether or not it can be used by VSAN or if it is already in use), reason which includes more details, whether the disk is an SSD or HDD and also if the device is in a PDL (Permanent Device Loss) state.

You can also specify the -H option which makes the output a bit more readable as the default output is using Python. In this next screenshot, if we enable VSAN through the vSphere Web Client we now see that the VSANUUID property is now populated and the state of the disks have now changed.

The next command that is also handy once VSAN is enabled is to quickly get the VSAN disk group mapping by running the following command: vdq -i

With this command you can quickly find out the SSD that is front-ending the set of HDD for a given disk group. This command came in handy while re-building my ESXi hosts as I wanted to blow away the existing VSAN configuration. To do so, you would need to use ESXCLI and by leveraging vdq, I was able to quickly get the disk mappings and more importantly a command I could easily remember.

In general, I would still recommend using either ESXCLI or RVC which is already pretty simple to use but thought I share this little tip if you ever need to just quickly inspect an ESXi host for VSAN.

Categories // VSAN Tags // ESXi 5.5, vdq, VSAN, vSphere 5.5

VMware VSAN APIs

02.11.2014 by William Lam // 15 Comments

For customers who are currently evaluating VMware VSAN, the vSphere Web Client is the primary interface for managing and configuring VSAN. However, these exact same VSAN operations can also be accessed programmatically from an Automation perspective. Given that I had spent quite a bit of time playing with VSAN in the lab and exploring some of its APIs, I thought it might be useful to share some of the common VSAN operations mapped to their respective APIs.

There are two main categories of operations that you should be aware of when working with VSAN:

  • VSAN specific operations
  • VM Storage Policy operations

VSAN Operations

The VSAN specific operations are available as part of the vSphere 5.5 API and the list below are the supported operations:

Enable/Disable VSAN on a vSphere Cluster (automatic claiming):

  • Use the ReconfigureComputeResource_Task() and set spec->vsanConfig->enabled to either true or false & spec->vsanConfig->defaultConfig->autoClaimStorage to true

Manual Disk Claiming for an ESXi host:

  • Each ESXi host provides a vsanSystem manager at configManager->vsanSystem which provides the following methods for disk management
    • AddDisks_Task()
    • InitializeDisks_Task()
    • QueryDisksForVsan()
    • QueryHostStatus()
    • RemoveDisk_Task()
    • RemoveDiskMapping_Task()
    • UpdateVsan_Task()

Enable VSAN traffic type for a VMkernel interface

  • Use the ReconfigureComputeResource_Task() and set spec->vsanHostConfigSpec->HostSystem to the ESXi host you wish to configure and  spec->vsanHostConfigSpec->networkInfo->port->device to the specific VMkernel interface you wish to enable VSAN traffic type on

Internal VSAN manager for accessing low level CMMDS (Clustering Monitoring, Membership and Directory Services), object & disk management APIs:

  • Each ESXi host provides a vsanInternalSystem manager at configManager->vsanInternalSystem which provides the following methods for working with the lower level system of VSAN
    • QueryCmmds()
    • QueryObjectsOnPhysicalVsanDisk()
    • QueryPhysicalVsanDisks()
    • QueryVsanObjects()

Change the VM Storage Policy for a Virtual Machine Home OR Virtual Machine Home and Virtual Disk:

  • Use the ReconfigVM_Task() and set spec->vmProfile to the VM Storage Policy ID

Change the VM Storage Policy for Virtual Machine Virtual Disk:

  • Use the ReconfigVM_Task() and set spec->deviceChange->device to the specif Virtual Disk to be reconfigured and set  spec->deviceChange->vmProfile to the VM Storage Policy ID

Enter Maintenance Mode for an ESXi host in a VSAN Cluster:

  • Use the EnterMaintenanceMode_Task() and set spec->
    maintenanceSpec->vsanMode->objectAction to the specific data accessibility mode defined here

Create and Delete directories on a VSAN Datastore:

  • Use the DatastoreNamespaceManager which provides the following two methods
    • CreateDirectory()
    • DeleteDirectory()

SPBM

For VM Storage Policies, VSAN leverages the SPBM (Storage Policy Based Management) framework which allows administrators to create policies that define specific storage capabilities such as performance and reliability that can then be applied to a Virtual Machine. The SPBM API is exposed as a separate API endpoint in vCenter Server and will be required if you wish to create additional VM Storage Policy leveraging VSAN storage capabilities.

Query list of available VM Storage Profiles defined:

  • Use PbmQueryProfile()

Create VM Storage Policy:

  • Use PbmCreate()

Delete VM Storage Policy:

  • Use PbmDelete()

Check VM Storage Policy Compliance:

  • Use PbmCheckCompliance()

Given a Virtual Machine Home or Virtual Disk, provide associated VM Storage Profile:

  • Use PbmQueryAssociatedEntity()

Given a VM Storage Profile, provide the associated Virtual Machine Home or Virtual Disk:

PbmQueryAssociatedEntity
  • Use PbmQueryAssociatedProfiles()
PbmQueryAssociatedProfiles

Hopefully this provides a good overview of some of the common VSAN / SPBM operations and their associated API methods. If I have some spare cycles, I may create some sample scripts leveraging some of these API methods. In the meantime, you can check out these RVC (vSphere SDK for Ruby) modules leveraging both VSAN and SPBM APIs here and here.

Additional Resources:

  • If you wish to evaluate VSAN and its associated APIs, please sign up for the public beta here.
  • Sign up for a special VSAN event here
  • VM Storage Policy APIs aka Storage Profile APIs will be available in vSphere 5.5
  • SPBM (Storage Policy Based Management) MOB in vSphere 5.5

Categories // VSAN, vSphere 5.5 Tags // rvc, spbm, VSAN, vSphere 5.5, vSphere API

How to upgrade to the latest VSAN Beta Refresh of RVC on Windows?

12.03.2013 by William Lam // 4 Comments

A variety of new updates can be found in the latest VSAN Beta Refresh including a new RVC (Ruby vSphere Console) namespace called SPBM (Storage Policy Based Management) that allows users manage and configure VM Storage Policies. However, this update is currently only available for the VCSA (vCenter Server Appliance) and there is no update package for the Windows based vCenter Server (I hear this is being looked into).

UPDATE 12/04/13 - I just received an update from Cormac that we have just released a VSAN Beta Refresh for vCenter Server for Windows which you can download here.

For those of you who are running vCenter Server on Windows for the VSAN Beta and wish to try out the latest release of RVC which includes additional fixes as well as the new SPBM namespace can do so by just updating to the latest RVC package.

Step 1 - Download the rvc_1.3.3-1_x86_64.rpm package from the VSAN Beta website and upload that to your Windows vCenter Server.

Step 2 - Download and install 7zip on the Windows vCenter Server or another Windows server which can be used to extract the contents of the RPM package.

Step 3 - Right click on the RPM package and select the "Extract to rvc_1.3.3-1_x86_64/" option which should create a new folder that contains a new file called rvc_1.3.3-1_x86_64.cpio.

Step 4 - Right click on the CPIO package and select the "Extract to rvc_1.3.3-1_x86_64/" option which will create another folder containing the actual RVC bits.

Step 5 - Copy the contents from inside of opt\vmware\rvc to the following path on your vCenter Server C:\Program Files\VMware\Infrastructure\VirtualCenter Server\support\rvc Once you have replaced the updated RVC bits, you can now change into that directory and launch RVC by just typing "rvc" and hitting enter. To confirm that RVC has been successfully updated, you can then type "spbm." and hit tab and you should see eight new SPBM commands.

To learn more about RVC for Windows, I would highly recommend you check out Eric Bussink's blog article here.

Categories // VSAN, vSphere 5.5 Tags // ruby vsphere console, rvc, spbm, Storage Policy Based Management, vm storage policy, VSAN, vSphere 5.5

  • « Previous Page
  • 1
  • …
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025