WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple

Retrieving VM DRS Score using vSphere API and PowerCLI

01.27.2022 by William Lam // 1 Comment

VM DRS Score is a new feature that was introduced with the release of vSphere 7.0, check out this blog post by Niels for a closer look at how this feature can benefit your environment.


In the vSphere UI, this information is expressed as both a Cluster DRS Score and a VM DRS Score as shown in the screenshot above.

This information can also be retrieved programmatically using the vSphere API, as alluded in the title of this blog post. Using the vSphere API, there is a new property called SummaryEx under the ClusterComputeResource object which represents a vSphere Cluster from an API point of view. Here, you will find two new properties: drsScore and numVmsPerDrsScoreBucket which maps to the respective information found within the vSphere UI.

To demonstrate how to access these two new properties, below is a small PowerCLI function called Get-DRSScore which uses the vSphere API to retrieve this information and accepts a single parameter which is a vSphere Cluster object by using the Get-Cluster cmdlet.

Function Get-DRSScore {
    param(
        [Parameter(Mandatory=$true)][VMware.VimAutomation.ViCore.Impl.V1.Inventory.ComputeResourceImpl]$Cluster
    )

    $drsScoreBuckets = @("0%-20%","21%-40%","41%-60%","61%-80%","81%-100%")

    $drsScoreResults = $Cluster.ExtensionData.SummaryEx | select DrsScore, NumVmsPerDrsScoreBucket

    Write-Host "Cluster DRS Score: $(${drsScoreResults}.DrsScore)`n"

    Write-Host "VM DRS Score"
    $count = 0
    foreach($i in ${drsScoreBuckets}) {
        Write-Host "${i} - $(${drsScoreResults}.NumVmsPerDrsScoreBucket[$count]) VMs"
        $count++
    }
    Write-Host
}

Here is an example of using the function and the output matches what is shown in the vSphere UI.

Get-DRSScore -Cluster (Get-Cluster Cluster-1)

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Categories // Automation, vSphere 7.0 Tags // drs, PowerCLI, vSphere 7

Is vSphere with Kubernetes available for evaluation? 

07.14.2020 by William Lam // Leave a Comment

Yes. Given the frequency that this question has come up, I thought it would be useful to share some more details on how you can start playing with the new vSphere with Kubernetes (K8s) capability which was introduced as part of the vSphere 7.0 release. vSphere w/K8s requires NSX-T and although vSphere (ESXi and vCenter Server Appliance) has supported a 60 day evaluation period, NSX-T historically did not support any self-service evaluation. In addition, there were also some confusion in how vSphere w/K8s was bundled today from a packaging standpoint which is offered as part of the VMware Cloud Foundation (VCF) 4.0 SKU.

Putting aside the pricing and packaging aspects, customers can indeed evaluate vSphere w/K8s using one of the following two options below:

Option 1: 60 Day Eval

Sign up for the vSphere 7.0 (ESXi & VCSA) evaluation (https://my.vmware.com/en/web/vmware/evalcenter?p=vsphere-eval-7) and NSX-T 3.0 evaluation (https://my.vmware.com/web/vmware/evalcenter?p=nsx-t-eval). After signing up you will receive evaluation keys that can be used when setting up vSphere w/K8s. If you want to quickly go from 0 to Kubernetes, be sure to check out my vSphere with K8s Automation Lab Deployment which can give you a running environment in under 30min!

Option 2: 365 Day Eval

Sign up for VMUG Advantage which includes VMUGEval that provides licenses for vSphere 7.0, NSX-T 3.0, VCF 4.0 and many other VMware products for an entire year for non-production usage. After signing up you will receive license keys that will be valid for 1 year which can then be used when setting up vSphere w/K8s. With VMUG Advantage, you can consume vSphere w/K8s the "manual" method, using my vSphere with K8s Automation Lab Deployment or using SDDC Manager which is part of VCF 4.0 to automatically deployed the required SDDC infrastructure so that can then enable vSphere w/K8s.

Here is a screenshot of my vSphere w/K8s environment which was deployed using my Sphere with K8s Automation Lab Deployment script and using the evaluation keys which I had just signed up!

Option 3: Infinite Day Eval

VMware Hands-on-Lab is another great option which is completely free and you only need a web browser! You can check out HOL-2113-01-SDC for more details.

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Categories // Kubernetes, VMware Tanzu, vSphere 7.0 Tags // vSphere 7, vSphere with Kubernetes

Five of my favorite enhancements in vSphere 7

06.30.2020 by William Lam // 2 Comments

It is very easy to focus on the speeds and feeds of a new major vSphere release such as vSphere 7 which also includes a TON of new and exciting capabilities. However, often times it is the tiny improvements that has the most significant impact to our end users, especially when it comes to usability and operations. In fact, this was further reinforced by Frank Denneman's post on the Reddit with similiar observations.

I have been using vSphere 7 since it was released back in April and I have been discovering a number of new vSphere UI enhancements that has really delighted my overall user experience. I had been sharing these enhancements on Twitter, but figured it was worth a blog post given most of these features were not well known.

Do you have a favorite new feature in vSphere 7 that might not be well known? If so, share by leaving a comment below.

1. Enhanced VM Summary

I’m really digging the new VM Summary view in the #h5client with #vSphere7, especially with details about any snapshots you might have running! My only pet peeve is the gap of space at the very top /cc @APrabhudev pic.twitter.com/IRofUvMpaQ

— William Lam (@lamw) April 21, 2020

2. Update and Patch Notifications

First patch release for vSphere with Kubernetes is now available

See Release Notes for more details https://t.co/QxDYa7rmTr

Its also really cool to see the vSphere UI is also aware of the update and has nice notification along w/link to RN 🙂 pic.twitter.com/xKYJPfQRGs

— William Lam (@lamw) May 19, 2020

3. ESXi Firmware and Driver View

I just noticed the new enhancements made to ESXi “Hardware” view in #h5client for vSphere 7. Really digging the Firmware section which cleanly & clearly lays out the various devices/components along the specific driver claiming each device which is super useful! pic.twitter.com/OsNPUDaPuj

— William Lam (@lamw) June 15, 2020

4. ESXi Installation Date + Software Package Details

Pleasantly discovered two new #vSphere7 UI features this morning while using the #h5client

Navigate to ESXi Host->Configure->System->Packages

Can now see ESXi Install Date + all VIB/Components nicely listed!

Wrote about Install Date API 4yrs ago https://t.co/QXKQnGNvhj

/1 pic.twitter.com/4yYRCa9vut

— William Lam (@lamw) June 28, 2020

5. Terminate "stuck" VM

In rare case you have pesky VM that is “stuck”, it looks like we’ve now exposed the Kill (Terminate) cmd under the VM Power Operations. No need for SSH/ESXCLI

I initially noticed this with the latest #VMWonAWS release but looks like its made its way into vSphere 7.0b too!

/2 pic.twitter.com/bszXumd65I

— William Lam (@lamw) June 28, 2020

Here are two additional non-UI features that I came to learn about in vSphere 7 that you might also be interested in: Support for HTTPS using wget on ESXi and Guest Customization support for Instant Clones.

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Categories // vSphere 7.0 Tags // HTML5, vSphere 7

  • 1
  • 2
  • 3
  • …
  • 5
  • Next Page »

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

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

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Support

Recent

  • A first look at the new vSphere+ & vSAN+ Cloud Service 07/01/2022
  • Quick Tip - Prepare VMware Photon OS for use with vSphere Guest OS Customization and cloud-init 06/29/2022
  • Using the new vSphere Guest OS Customization with cloud-init in vSphere 7.0 Update 3 06/27/2022
  • How to forcefully disconnect a vSphere VM Console session? 06/24/2022
  • Quick Tip - Using ESXi Scripted Installation (kickstart) to configure IPv6 networking 06/21/2022

Advertisment

Copyright WilliamLam.com © 2022

 

Loading Comments...