VMware Cloud Community
slimak
Contributor
Contributor

PowerCLI/API for update storage profile in vDC

Hi,

I found how to add or remove storage profile via vcloud API (VMware vCloud Director Documentation Center), but does anyone know how to do update (change size or disable) storage profile via API or PowerCLI (prefered)?

Thank you very much in advance.

Best Regards,

Tomas Kamm

Tags (1)
0 Kudos
4 Replies
LucD
Leadership
Leadership

Moved to the vCloud Director PowerCLI community.


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

0 Kudos
jake_robinson_b
Hot Shot
Hot Shot

Hi Tomas,

The properties of a storage profile are located here: http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/AdminVdcStorage...

You should be able to get this object by using:

$myProfile = Search-Cloud -querytype AdminOrgVdcStorageProfile -Name "MyProfileName" | Get-CIView -viewlevel Admin

Once you have the admin level object, you should have an updateServerData() method.

So, disabling the storage profile would look something like this:

$myProfile.enabled = $false

$myProfile.updateServerData()

*disclaimer* I don't have a 5.1 environment handy right now to tell you that this is exactly what you need to do, so be sure to update this thread with any changes to my code above. Smiley Happy

Cheers,

Jake

Jake Robinson VCP, vExpert - geekafterfive.com - Twitter: @jakerobinson
jake_robinson_b
Hot Shot
Hot Shot

Side note: Your documentation link is dead... In order to get the correct link with the vCloud API schema reference, I right click on the frame, click "Show FRAME source," and then copy the link from the URL bar.

Maybe VMware could un-nest the schema reference from that other system. *wink wink* to whoever from VMware sees this thread. Smiley Happy

Jake Robinson VCP, vExpert - geekafterfive.com - Twitter: @jakerobinson
0 Kudos
slimak
Contributor
Contributor

Hi Jake,

thank you for your very fast and helpful answer (I tried to find this about 3 hours :smileycry:).

Correct link was: http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/UpdateVdcStorag...

Tomas

0 Kudos