VMware Cloud Community
siemin81
Contributor
Contributor

Remove Storage Profile from vDC

Hello,

How to remove storage profile from Organization vDC in vCloud Director 5.1. To be exact, I want to remove *(Any) profile from all my vdcs. I know how to create it and how to enable / disable it, but I cannot find any info regarding its deletion / removing. Here are some hints on how to remove it via vcloud API, but I need it to be done by PowerCLI: http://pubs.vmware.com/vcd-51/index.jsp?topic=%2Fcom.vmware.vcloud.api.reference.doc_51%2Fdoc%2Ftype...

TIA

Tags (2)
Reply
0 Kudos
1 Reply
dcouturier
Enthusiast
Enthusiast

Hello,

I know this thread is quite old but I have a solution to your issue :

          $org = get-org -name <Orgname>

         $orgvdc= $org | get-orgvdc

        # Disable the "* (any)" Profile 

        $orgvDCAnyProfile = search-cloud -querytype AdminOrgVdcStorageProfile | where {($_.Name -match '\*') -and ($_.VdcName -eq $orgvdc.Name)} | Get-CIView

        $orgvDCAnyProfile.Enabled = $False 

        $return = $orgvDCAnyProfile.UpdateServerData() 

 

        # Remove the "* (any)" profile form the Org vDC completely 

        $ProfileUpdateParams = new-object VMware.VimAutomation.Cloud.Views.UpdateVdcStorageProfiles 

        $ProfileUpdateParams.RemoveStorageProfile = $orgvDCAnyProfile.href 

        $remove = $orgvdc.extensiondata.CreatevDCStorageProfile($ProfileUpdateParams)

Regards

Reply
0 Kudos