VMware Cloud Community
TonyCoffman
Contributor
Contributor

PowerCLI for VM Storage Profiles?

Can powershell get/set the VM Storage profile for a VM?

In the middle of an upgrade - looking for a quick way to set profiles based on Resource Group.

0 Kudos
7 Replies
LucD
Leadership
Leadership

Afaik there are currently no cmdlets to make use of StorageProfiles.

But with the RecommendDatastores method you can create VMs using StorageProfiles.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TonyCoffman
Contributor
Contributor

Thanks.  I'm not looking to place so much as I am to audit the existing guests.

--Tony

0 Kudos
LucD
Leadership
Leadership

I'm afraid that VMware decided to keep all the StorageProfile related APIs private for now. Smiley Sad

The ones we would like to use are QueryStorageRollupComplianceStatus and QueryStorageProfileName.

But these are part of the com.vmware.vim.sps extension and that extension is private.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
alanrenouf
VMware Employee
VMware Employee

So im guessing it would mainly be the get cmdlets you would be looking for to start with ?

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
TonyCoffman
Contributor
Contributor

No - sorry I should have been more clear.

We had a written policy in place that said this guest must go onto this storage type.  It was followed as a manual step during provisioning (small environment - less than 1000 VMs)

Now that we have the ability to make that policy a VMware VM Storage Profile, we are going to do that and then run the check compliance to see how well that manual process was actually followed.

I've noticed, and I'm probably not the first, that the whole Profile Driven Storage initiative seems like an unfinished melody.  It's obvious that at some point VMware has to tie VM Storage Profiles into DRS to enable customers to bring a previously non-compliant environment into compliance in a more automated fashion.

The other missing bits are that both VM Storage Profiles and VMDK I/O storage control priorities need a method that enabled mass configuration, checking, and control.  I'm not certain that resource groups are the right method so they may need to create yet another group type that is composed of Resource Groups, VM Storage Profiles, and I/O storage control priorities.

The whole platform feels bolted together more than at any time since 3.5.  I've only been running 5.x for 2 weeks and I already can't wait for 5.1 to fill in some of these gaps.

0 Kudos
IgnitionUSMC
Contributor
Contributor

Any update on PowerCLI for Storage Profiles?

0 Kudos
IgnitionUSMC
Contributor
Contributor

Nevermind, I confirmed using ONYX that those APIs are still not available : /  I also wish the "FindAssociatedProfileForDisk" API would be made public

Here is my onyx output while changing the vm's vm storage profile for its config files, as well as the vmdks:

WARNING: Method 'QueryProfileConfigInfo' is not available in the public API.

WARNING: Method 'FindAssociatedProfileForDisk' is not available in the public API.

WARNING: Method 'FindAssociatedProfileForDisk' is not available in the public API.

// ------- ReconfigVM_Task -------

VMware.Vim.VirtualMachineConfigSpec spec = new VMware.Vim.VirtualMachineConfigSpec();
spec.ChangeVersion = "2012-06-28T14:12:18.51398Z";
spec.VAppConfig = new VMware.Vim.VmConfigSpec();
spec.VAppConfig.Product = new VMware.Vim.VAppProductSpec[1];
spec.VAppConfig.Product[0] = new VMware.Vim.VAppProductSpec();
spec.VAppConfig.Product[0].Operation = VMware.Vim.ArrayUpdateOperation.edit;
spec.VAppConfig.Product[0].Info = new VMware.Vim.VAppProductInfo();
spec.VAppConfig.Product[0].Info.Key = 0;
spec.VAppConfig.Product[0].Info.ClassId = "";
spec.VAppConfig.Product[0].Info.InstanceId = "";
spec.VAppConfig.Product[0].Info.Name = "";
spec.VAppConfig.Product[0].Info.Vendor = "";
spec.VAppConfig.Product[0].Info.Version = "";
spec.VAppConfig.Product[0].Info.FullVersion = "";
spec.VAppConfig.Product[0].Info.VendorUrl = "";
spec.VAppConfig.Product[0].Info.ProductUrl = "";
spec.VAppConfig.Product[0].Info.AppUrl = "";

VMware.Vim.VirtualMachine _this = new VMware.Vim.VirtualMachine(_client, new VMware.Vim.ManagedObjectReference("VirtualMachine-vm-210"));
_this.ReconfigVM_Task(spec);

WARNING: Method 'TrackTask' is not available in the public API.

0 Kudos