Home > Blogs > VMware vSphere Blog > Category Archives: Automation

Category Archives: Automation

vSphere APIs for IO Filtering

I’ve been fortunate to have one of our super sharp product line managers, Alex Jauch (twitter @ajauch), spend some time explaining to me one of the new enabling technologies of vSphere 6.0: VAIO.  Let’s take a look at this really powerful capability and see what types of things it can enable and an overview of how it works.

VAIO stands for “vSphere APIs for IO Filtering”

This had for a time colloquially been known as “IO Filters”. Fundamentally, it is a means by which a VM can have its IO safely and securely filtered in accordance with a policy.

VAIO offers partners the ability to put their technology directly into the IO stream of a VM through a filter that intercepts data before it is committed to disk.

Why would I want to do that? What kinds of things can you do with an IO filter?

Well that’s up to our customers and our partners. VAIO is a filtering framework that will initially allow vendors to present capabilities for caching and replication to individual VMs. This will expand over time as partners come on board to write filters for the framework, so you can imagine where this can go for topics such as security, antivirus, encryption and other areas, as the framework matures. VAIO gives us the ability to do stuff to an IO stream in a safe and certified fashion, and manage the whole thing through profiles to ensure we get a view into the IO stream’s compliance with policy!

The VAIO program itself is for partners – the benefit is for consumers who want to do policy based management of their environment and pull in the value of our partner solutions directly into per-VM and indeed per-virtual disk storage management.

When partners create their solutions their data services are surfaced through the Storage Policy Based Management control plane, just like all the rest of our policy-driven storage offerings like Virtual SAN or Virtual Volumes.

Beyond that, because the data services operate at the VM virtual device level, they can also work with just about any type of storage device, again furthering the value of VSAN and VVOLs, and extending the use of these offerings through these additional data services.

How does it work?

The capabilities of a partner filter solution are registered with the VAIO framework, and are surfaced for user interaction in the SPBM Continue reading

vRealize Operations Management Pack for Virtual SAN Beta – Early Sign-up

If you already heard the exciting news about VMware new offerings – vSphere 6, Virtual SAN 6 and vSphere Virtual Volumes – and thought it can’t get any better, we have a small surprise for you. Virtual SAN 6.0 includes a host of new features including high performance snapshots and clones, all flash Virtual SAN with intelligent 2-tier model, failure domains and more. One of the most requested features among Virtual SAN 5.5 customers is enabling greater visibility to what happens “under the hood”. The Virtual SAN team developed a new health dashboard that will help customers tackle underlying hardware issues as part of the v6.0 release, but in addition to that the vRealize operations team developed an advanced set of dashboards aimed at making Virtual SAN users life much easier.

The Virtual SAN team along with the vRealize Operations team are thrilled to offer you a unique opportunity to beta test the new vRealize Operations Management Pack for Storage Devices. The management pack will feature advanced insight into Virtual SAN through advanced analytics to enable rapid troubleshooting and cluster optimization.

 vrops1 vrops2

 

We will share more details closer to the start of the beta program which will kick off in Q1 2015. If you would like to get more information and be on the list of people who get an invitation to participate in the beta, please sign up here – www.vmware.com/go/vrops4vsan-beta

Check out the vROps MPSD blog post for more details - http://blogs.vmware.com/management/2015/02/vsan-simplifying-sddc-storage-operations-with-vrealize-operations-management-pack-for-storage-devices.html

Assess the Performance Impact of the Security Change in Transparent Page Sharing Behaviour

As VMware continues to use a “secure by default” policy, there are some up-coming security changes to the Transparent Page Sharing (TPS) memory mechanism you need to be aware of and should assess for potential performance impact.

Continue reading

Operationalizing VMware Virtual SAN: Automating vCenter Alarm Configuration Using PowerCLI

powercli 5.8 icon

Welcome to the next installment in our Operationalizing VMware Virtual SAN series. In our previous article we detailed “How to configure vCenter alarms for Virtual SAN”. In today’s article we will demonstrate how to automate that configuration workflow leveraging PowerCLI.

(Many thanks to VMware genius Alan Renouf (@alanrenouf) for his contributions to this topic) [Joe Cook: @CloudAnimal]

The PowerCLI code required to automate the configuration of vCenter Alarms for Virtual SAN is considerably straightforward.

1. Connect to vCenter

Connect-VIServer -Server 192.168.100.1 -User Administrator@vsphere.local -Password vmware

2. Define the the Virtual SAN cluster where you would like the rules to be created

$Cluster = "Cluster Site A"

3. Next we create a hash table with the desired VMware ESXi Observeration IDs (VOB IDs) for Virtual SAN and include a description for each VOB ID.

If you are not used to programming, the concept of arrays and hash tables may be a bit confusing. Using variables is generally much easier to understand. One way of understanding variables is to think of them simply as a short amount of text used to represent a larger amount of text in your program or script ($x=”larger amount of text”). Instead of typing “larger amount of text” continually, you can simply type $x and the language interpreter (in our case PowerShell), will substitute the string “larger amount of text” wherever it finds $x in your script. Variables can be used to greatly reduce the amount of code you have to type, make your scripts much easier to read, and have many other uses as well.

If we think of variables as ways to store one value to reference, we can think of arrays as a way to store multiple values to reference. In our example today, we would have to create at least 32 variables to perform the same work that we can with one hash table.

A hash table is a type of array that is also known as a dictionary. It is a collection of name-value pairs (e.g. “name”=”value”) that can be used . Here we have an example of a basic hash table:

$HashTableName = @{
VOB_ID_A="VOB Description";
VOB_ID_B="VOB Description";
VOB_ID_C="VOB Description";
}

In the table below we have a breakdown of the components of the code used to create a hash table:

Syntax Component Description
$HashTableName = Replace “HashTableName” with the text you wish to use to reference this list of key-values pairs.
@{ Indicates the start of the hash table or array
VOB_ID_A=”VOB Description”; Key-Value pair to store within the hash table. VOB_ID_A will be the VOB ID from the VMware ESXi Observation Log (VOBD) (e.g. “esx.audit.vsan.clustering.enabled”). “VOB Description” will be the description of the associated “VOB ID” (e.g. “Virtual SAN clustering service had been enabled”). Make sure to use quotation marks whenever spaces are used and to separate each key-value pair with a semicolon (;).Examine /var/log/vobd.log on your vSphere host to obtain possible VOB IDs. See here for a list of VMware ESXi Observation IDs for Virtual SAN.
} Indicates the end of the hash table or array

Here is an example of a hash table with a single key-value pair representing a single vCenter Alarm for Virtual SAN:

$VSANAlerts = @{
"esx.audit.vsan.clustering.enabled" = "Virtual SAN clustering service had been enabled";
}

Below is the actual hash table that we will use in our example Virtual SAN Alarm Configuration script. It is fully populated with all of the recommended VOB IDs for Virtual SAN along with the description for each. We have labeled this hash table as “$VSANAlerts”. You will see $VSANAlerts referenced further along in the script as we reference the items within our hash table.

$VSANAlerts = @{
 "esx.audit.vsan.clustering.enabled" = "Virtual SAN clustering service had been enabled";
 "esx.clear.vob.vsan.pdl.online" = "Virtual SAN device has come online.";
 "esx.clear.vsan.clustering.enabled" = "Virtual SAN clustering services have now been enabled.";
 "esx.clear.vsan.vsan.network.available" = "Virtual SAN now has at least one active network configuration.";
 "esx.clear.vsan.vsan.vmknic.ready" = "A previously reported vmknic now has a valid IP.";
 "esx.problem.vob.vsan.lsom.componentthreshold" = "Virtual SAN Node: Near node component count limit.";
 "esx.problem.vob.vsan.lsom.diskerror" = "Virtual SAN device is under permanent error.";
 "esx.problem.vob.vsan.lsom.diskgrouplimit" = "Failed to create a new disk group.";
 "esx.problem.vob.vsan.lsom.disklimit" = "Failed to add disk to disk group.";
 "esx.problem.vob.vsan.pdl.offline" = "Virtual SAN device has gone offline.";
 "esx.problem.vsan.clustering.disabled" = "Virtual SAN clustering services have been disabled.";
 "esx.problem.vsan.lsom.congestionthreshold" = "Virtual SAN device Memory/SSD congestion has changed.";
 "esx.problem.vsan.net.not.ready" = "A vmknic added to Virtual SAN network config doesn't have valid IP.";
 "esx.problem.vsan.net.redundancy.lost" = "Virtual SAN doesn't haven any redundancy in its network configuration.";
 "esx.problem.vsan.net.redundancy.reduced" = "Virtual SAN is operating on reduced network redundancy.";
 "esx.problem.vsan.no.network.connectivity" = "Virtual SAN doesn't have any networking configuration for use."
 }

(For more information on working with PowerShell hash tables, see this handy Microsoft TechNet article)

4. Next we use the Get-View cmdlet to query the vCenter Alarm Manager for each VOB ID listed in step 3.

The Get-View cmdlet returns the vSphere inventory objects (VIObject) that correspond to the specified search criteria.

$alarmMgr = Get-View AlarmManager
 $entity = Get-Cluster $Cluster | Get-View
 $VSANAlerts.Keys | Foreach {
 $Name = $VSANAlerts.Get_Item($_)
 $Value = $_

5. Create the vCenter Alarm specification object

 $alarm = New-Object VMware.Vim.AlarmSpec
 $alarm.Name = $Name
 $alarm.Description = $Name
 $alarm.Enabled = $TRUE
 $expression = New-Object VMware.Vim.EventAlarmExpression
 $expression.EventType = Vim.Event.EventEx
 $expression.eventTypeId = $Value
 $expression.objectType = "HostSystem"
 $expression.status = "red"
 $alarm.expression = New-Object VMware.Vim.OrAlarmExpression
 $alarm.expression.expression += $expression
 $alarm.setting = New-Object VMware.Vim.AlarmSetting
 $alarm.setting.reportingFrequency = 0
 $alarm.setting.toleranceRange = 0

6. Create the vCenter Alarm in vCenter

 Write-Host "Creating Alarm on $Cluster for $Name"
 $CreatedAlarm = $alarmMgr.CreateAlarm($entity.MoRef, $alarm)
 }
 Write-Host "All Alarms Added to $Cluster"

As you can see, the steps to create vCenter Alarms for Virtual SAN are actually pretty straightforward. If you have not yet began monitoring your Virtual SAN environment, these steps can accelerate the process quite rapidly and you really do not have to be an expert in PowerCLI to do so.

VMware Hands on Labs

Here is a great tip brought to you by our friends at the VMware Hands on Labs. If you would like an excellent shortcut to getting “hands on” creating vCenter Alarms for Virtual SAN, using PowerCLI cmdlets, try out the lab below:

HOL-SDC-1427 – VMware Software Defined Storage: Module 5: Advanced Software Defined Storage With SPBM and PowerCLI (30 minutes)

 

We have many more articles on there way so share, re-tweet, or whatever your favorite social media method is. You will not want to miss these!

(Thanks to @millardjk for his keen eye)


Resources

 

Reference Architecture for building a VMware Software–Defined Datacenter

The latest in our series of reference architectures is now available. This is an update to the previous version which brings in additional products and covers the vCloud Suite 5.8 release.

This reference architecture describes an implementation of a software-defined data center (SDDC) using VMware vCloud® Suite Enterprise 5.8, VMware NSX™ for vSphere® 6.1, VMware IT Business Management Suite™ Standard Edition 1.1, and VMware vCenter™ Log Insight™ 2.0 to create an SDDC. This SDDC implementation is based on real-world scenarios, user workloads, and infrastructure system configurations. The configuration uses industry-standard servers, IP-based storage, and 10-Gigabit Ethernet (10GbE) networking to support a scalable and redundant architecture.

Continue reading

vSphere PowerCLI 5.8 SPBM Walkthrough (Part4): Provisioning a new VM

powercli 5.8 iconWelcome to the next installment of our vSphere PowerCLI 5.8 walkthrough series of the new cmdlets for vSphere Storage Policy Based Management. So far we have seen:

Introduction to vSphere Storage Policies
Creating vSphere Storage Policies
Associating vSphere Storage Policies

In this article we will take the next step and illustrate how to leverage vSphere Storage Policies to enhance the provisioning of New VMs. We will have a few provisioning examples involving a virtual machine with a single traditional storage array backed datastore, a vsanDatastore, and a multi-vendor mixed datastore environment.

PowerCLI cmdlets referenced in this blog article:

New-VM
Get-SpbmCompatibleStorage
Get-SpbmEntityConfiguration
Set-SpbmEntityConfiguration

Follow these links for more information on creating vSphere Storage Policies for Virtual SAN:

Using the vSphere Web Client
Using PowerCLI

Continue reading

vSphere PowerCLI 5.8 SPBM – Part3: Associating vSphere Storage Policies

powercli 5.8 icon
In our last article we demonstrated how to use the new vSphere PowerCLI 5.8 SPBM cmdlets to create vSphere Storage Policies. In this article we will demonstrate how to quickly associate a vSphere Storage Policy with  a new or existing VM.

Example Provisioning Scenariospbm_1vmdk_vsan

To illustrate how to leverage PowerCLI to associate vSphere Storage Policies with VMs we will continue with the provisioning example from our previous article.

  • Virtual machine
  • Single virtual disk
  • Virtual SAN datastore

Follow these links for more information on creating vSphere Storage Policies for Virtual SAN:

Previously in order to create, manage, and associate vSphere Storage Policies with VMs using PowerCLI, one would need to leverage an intermediary method as well (e.g. Esxcli, RVC, REST API, etc). Often this could require the use of third party applications to bridge the gap in interfacing with the vSphere Storage Policy Based Management service. This resulted in added complexities and additional processing time for workflows that were automated with PowerCLI.

With the new PowerCLI 5.8 cmdlets for vSphere Storage Policy Based Management we are able to greatly reduce the complexity of vSphere Storage Policies with PowerCLI now by using PowerCLI exclusively. In the example below, we will demonstrate how to enhance the VM provisioning process by associating a vSphere Storage Policy with a virtual machine.

Continue reading

Disaster Recovery for Virtualized Business Critical Applications (Part 3 of 3)

Planned Migration:

One of the relatively newer use cases for SRM is planned migration. With this use case, customers can migrate their business critical workloads to the recovery or cloud provider sites in a planned manner. This could be in planning for an upcoming threat such as a hurricane or other disaster or an actual datacenter migration to a different location or cloud provider. Continue reading

vSphere PowerCLI 5.8 SPBM Walkthrough (Part 2): Creating vSphere Storage Policies

powercli 5.8 icon
Greetings and welcome to our next article in the PowerCLI 5.8 series for the new vSphere Policy Based Management cmdlets. In today’s article we are going to dive right in and start building our own vSphere storage policies leveraging the new SPBM cmdlets within PowerCLI.


Before we begin though, if you have not yet had an opportunity to familiarize yourself with vSphere Storage Policy Based Management, here are a few key blog articles that can help you build a good foundation.

Continue reading

vSphere Storage Policy Based Management Overview (part 2)

Welcome to part 2 of the vSphere Storage Policy Based Management Overview. In our previous article, we looked at challenges with traditional storage provisioning models, the advantages of the Software-Defined Storage model, as well as an introduction and background to VMware vSphere Storage Policy Based Management. If you have not yet had opportunity to read it, it might be beneficial to glance through before continuing on.

In today’s article, we will be carrying on with the vSphere Storage Policy Based Management (SPBM) theme as we look to understand the components of the vSphere Storage Policy. Afterwards we will display a few policy examples for single VM provisioning and options for a collection of VMs as well.

Continue reading