VMware {code} Community
NikKob1
Contributor
Contributor

VM Storage policy and assign tags API

With vSphere 5.5 Vmware has introduced VM storage policy, but I am not able to find any specific API's in the vSphere web services SDK to find out any specific details about the Storage policy.

Storage policy based management is the next generation of storage porfile feature.  Is Vmware going to provideany API for this feature.

Also Vmware supported assinging tags with any managed object from VSphere 5.1.  I also unable to find any methods to create\update tags of any object.

Reply
0 Kudos
9 Replies
lamw
Community Manager
Community Manager

The VM Storage Policy API (previously known as VM Storage Profiles) is part of the vSphere 5.5 release and is exposed as a separate API endpoint on the vCenter Server. You can find more details in the vSphere Web Services SDK download and there is a spbm directory which contains the API reference docs, Java SDK samples + WSDL (if you wish to build your own language bindings). I will be publishing an article tomorrow with more details on www.virtuallyghetto.com

In terms of vSphere Tagging APIs, they're currently not available in either the vSphere 5.1 or 5.5 release. However, with the vSphere 5.5 release, we will have PowerCLI-only cmdlets for managing vSphere Tags which will allow you to automate the lifecycle of vSphere Tags but will be PowerCLI only for this release.

NikKob1
Contributor
Contributor

Great! Thanks!

VM Storage policy wsdl is really appear in VSphere Web Services SDK. It's cool that VMware provide API for storage policies, because storage policy used in vCloud Director 5.5. So now you can easily automate creation of storage policies on VSphere and use them in vCloud Director 5.5

About vSphere Tagging API:  I can't find any API for Tagging in PowerCLI. It will be cool, if you publish some articles abouts this too.

Reply
0 Kudos
lamw
Community Manager
Community Manager

Here is the article in case you didn't see it VM Storage Policy APIs aka Storage Profile APIs will be available in vSphere 5.5

For vSphere Tagging, as I mentioned earlier, there is no API. There will only be PowerCLI cmdlets (which are pre-compiled). Once vSphere 5.5 GA's, you will be able to find more info in the documentation.

NikKob1
Contributor
Contributor

Thank you for article!

But as for working with Tags and Categories, i didn't mean about real API.

I can't find cmdlets for tagging in PowerCLI beta.

If you can mention cmdlets for creating\assigning tags, it will be really helpfull.

Reply
0 Kudos
adamjg
Hot Shot
Hot Shot

Bumping an old post:  any updates on what these cmdlets might be? I installed PowerCLI 5.5 and can't find anything related to how to set the VM Storage Policy via script.  We figured out how to create them in the web client and assign them to VMs by hand, but it would be nice to be able to incorporate that into my automated build script so our build engineers don't have to do that step by hand.  Any ideas?

Reply
0 Kudos
lamw
Community Manager
Community Manager

Take a look at this blog post regarding the Tagging cmdlets in PowerCLI 5.5 Using Tags with PowerCLI | VMware PowerCLI Blog - VMware Blogs

Reply
0 Kudos
adamjg
Hot Shot
Hot Shot

Thanks much for the reply.  I think that gets me halfway there. I can access the tag, but I still can't find anything on how to change the VM Storage Policies with PowerCLI.  I know that in 5.0 (and I'm assuming 5.1) the APIs were "private" and couldn't be accessed, but I did read a number of things indicating that they would be opened up in 5.5.

5.5 changes storage profiles to storage policies, and they are very different than 5.0.  This article details setting them up:

http://everythingshouldbevirtual.com/vsphere-5-5-storage-profiles-now-storage-policies

In PowerCLI, if I do a get-tag, I do see the tag, but when I do get-tagassignment I only see the tag assigned to the datastores and datastore cluster I created.  When I assign the storage policy to the VM it's not done as a tag per say, it's done via Actions/All vCenter Actions/VM Storage Policies/Manage VM Storage Policies...  This is what I'm looking to set via PowerCLI.  Any ideas?

Reply
0 Kudos
lamw
Community Manager
Community Manager

Tagging != Storage Profile aka VM Storage Policies

Though the APIs have been exposed in vSphere 5.5, there are currently no PowerCLI cmdlets that implement this functionality (it's something the PowerCLI team has heard and hopefully you'll see an update in near future). If you wish to build your own, you can leverage the API as referenced earlier in the thread

Reply
0 Kudos
adamjg
Hot Shot
Hot Shot

Cool thanks for the info.  As long as I know they don't exist, I'll stop looking Smiley Happy

Reply
0 Kudos