WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Hardware Options
    • Hardware Reviews
    • Lab Deployment Scripts
    • Nested Virtualization
    • Homelab Podcasts
  • VMware Nostalgia
  • Apple

Extending RVC to support renaming VM Storage Policies

03.18.2014 by William Lam // 1 Comment

I was recently using RVC (Ruby vSphere Console) to setup one of my VSAN lab environments and I had noticed that in the SPBM namespace, that you could create and delete a VM Storage Policy, but you could not rename an existing one. The great thing about RVC is that it is very extensible and I thought it would be useful to have a spbm.profile_rename command, so I decided to build it!

The management of VM Storage Policies is performed through the SPBM API and there is a method called PbmUpdate() which allows you to rename an existing VM Storage Policy. In my environment, I exclusively use the VCSA (vCenter Server Appliance) and in the /root directory, you should see a .rvc directory. To extend the SPBM namepace, you just need to create a new file called spbm.rb which should contain the following snippet of code:

opts :profile_rename do
  summary "Rename a VM Storage Profile"
  arg :profile, nil, :lookup => RbVmomi::PBM::PbmCapabilityProfile
  arg :name, "New name", :type => :string
end

def profile_rename profile, name
  _catch_spbm_resets(nil) do
    pbm = profile.instance_variable_get(:@connection)
    pm = pbm.serviceContent.profileManager
    spec = PBM::PbmCapabilityProfileUpdateSpec(
      :name => name,
    )
    pm.PbmUpdate(:profileId => profile.profileId, :updateSpec => spec)
  end
end

Once you have saved the file, you can now connect to RVC and you should see a new command called spbm.profile_rename which takes an existing VM Storage Policy and the new name of the policy.

Here is an example of what that would look like where I have a VM Storage Policy called "Platinum" and I want to rename it to "Adamantium":

spbm.profile_rename localhost/Datacenter/storage/vmprofiles/Platinum/ Adamantium

Categories // VSAN, vSphere Tags // rvc, spbm, vm storage policy, vm storage profile

Exploring VSAN APIs Part 5 – VSAN Host Status

03.17.2014 by William Lam // 1 Comment

Another useful bit of information from a troubleshooting perspective is to be able to quickly get summary of all your ESXi hosts participating in a VSAN cluster. Critical information such as the health, state, VSAN Node/Cluster UUID for each ESXi host can be queried through the vsanSystem using the QueryHostStatus() vSphere API method. To demonstrate this simple operation, I have created a vSphere SDK for Perl sample script called vsanHostDiskMapping.pl.

Disclaimer:  These scripts are provided for informational and educational purposes only. It should be thoroughly tested before attempting to use in a production environment.

To show the ESXi host status, you will need to specify a vSphere Cluster running VSAN and use the following command:

./vsanHostStatus.pl --server vcenter55-1.primp-industries.com --username root --cluster VSAN-Cluster

vsan-host-status
As you can see this is an easy way to quickly get the health of ESXi host participating in the VSAN cluster.

  1. Exploring VSAN APIs Part 1 – Enable VSAN Cluster
  2. Exploring VSAN APIs Part 2 – Query available SSDs
  3. Exploring VSAN APIs Part 3 – Enable VSAN Traffic Type
  4. Exploring VSAN APIs Part 4 – VSAN Disk Mappings
  5. Exploring VSAN APIs Part 5 – VSAN Host Status
  6. Exploring VSAN APIs Part 6 – Modifying Virtual Machine VM Storage Policy
  7. Exploring VSAN APIs Part 7 – VSAN Datastore Folder Management
  8. Exploring VSAN APIs Part 8 – Maintenance Mode
  9. Exploring VSAN APIs Part 9 – VSAN Component count
  10. Exploring VSAN APIs Part 10 – VSAN Disk Health

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

How to bootstrap Horizon View 5.3.1 onto a VSAN Datastore using VCT

03.14.2014 by William Lam // 2 Comments

As some of you may have heard, vSphere 5.5 Update 1 including the much anticipated  VMware Virtual SAN (VSAN) was released earlier this week. To take advantage of this new vSphere release, other VMware solutions were also updated including the latest Horizon View 5.3.1 which now supports VSAN. Having spent some time playing around with the recent VMware Fling VCT which I have written about here and here, I thought why not give the latest version a try? I really like the simplicity of the VCT appliance which allows you to easily deploy an entire Horizon View environment from scratch and it just requires a stand-alone ESXi host not managed by vCenter Server and a Window 2008 ISO. Out of the box, VCT only supports vSphere 5.5 and Horizon View 5.3, but you can easily tweak either the HTML pages or modify the POST request to deploy the latest version of VCSA and Horizon View/Composer.

horizon-view-bootstrap-vsan
Since Horizon View 5.3.1 supports VSAN, I thought it would be neat to be able to "bootstrap" the entire Horizon View environment onto a VSAN datastore which would allow you to consume all the underlying physical disks without having to resort to a "temporary" VMFS volume to deploy the additional infrastructure. Now of course, this assumes you have no existing infrastructure or if you want to quickly spin up a POC or testing environment for View. The diagram above illustrates what the environment will look like at the end.

Below are the instructions for leveraging VCT to automate the deployment of vCenter Server Appliance 5.5 Update 1 and Horizon View 5.3.1

Step 1 - Install ESXi 5.5 Update 1 on your physical ESXi host or even virtual (which is how I tested this configuration)

Step 2 - Configure VSAN datastore on your single ESXi node using the "bootstrap" instructions here

Step 2 - Download VMware VCT & Studio and follow the optimized deployment here and deploy onto the VSAN datastore in previous step

Step 3 - Download VCSA 5.5 Update 1 & Horizon View 5.3.1, download links can be found here

Step 4 - Upload the three files to the VCT appliance via SCP and store them in /installers directory

horizon-view-on-vsan-0
Step 5 - If you plan on automating the Horizon View deployment from the command line, you will need the automateVCT.sh script and modify the following variables so they look like the following:

VIEW_SERVER_BIN=VMware-viewconnectionserver-x86_64-5.3.1-1634134.exe
VIEW_COMPOSER_BIN=VMware-viewcomposer-5.3.1-1634135.exe
VCSA_OVA=VMware-vCenter-Server-Appliance-5.5.0.10000-1624811_OVF10.ova

If you plan on using the VCT UI to deploy your Horizon View environment, then you will need to edit the following HTML files and either append or replace the VCSA OVA / View filenames

/apache-tomcat-7.0.27/webapps/vct/existing.html
/apache-tomcat-7.0.27/webapps/vct/new.html

horizon-view-on-vsan-1
Once the files have been uploaded, you will then be able to run through VCT as you normally would and in an hour or so, you should have a fully deployed VCSA 5.5 Update 1 and Horizon View 5.3.1 environment up and running on top of a VSAN datastore.

horizon-view-on-vsan-2
Once your initial ESXi host is configured, you can then deploy your other ESXi hosts and add them to your VSAN Cluster. Remember, you should have at least a minimum of 3 nodes with a recommendation of 4 as pointed out by Duncan Epping in his blog article here. From what I can tell, VCT had no issues provisioning VCSA 5.5 Update 1, there were no major changes and the same goes for Horizon View 5.3.1. I was even able to add in my vCenter Server to ensure basic View functionality was working.

horizon-view-on-vsan-3
I think this is a great way if you want to quickly setup a vSphere 5.5 Update 1 environment and evaluate the latest Horizon View 5.3.1 release. I also came across this Horizon View 5.3.1 on VMware Virtual SAN - Quick Start Guide KB that will also come in handy if you are looking to use Horizon View with VSAN.

Categories // Horizon View, VSAN, vSphere 5.5 Tags // Fling, horizon composer, horizon view, VCT

  • « Previous Page
  • 1
  • …
  • 45
  • 46
  • 47
  • 48
  • 49
  • …
  • 53
  • 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

  • Automating the vSAN Data Migration Pre-check using vSAN API 06/04/2025
  • VCF 9.0 Hardware Considerations 05/30/2025
  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/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

 

Loading Comments...