VMware Cloud Community
cann0nf0dder
Enthusiast
Enthusiast

vCloud Director PowerCLI set-OrgVdc error

Hi all,

vCD version 5.6.2.2548647

Having issues running a script to disable org and vdc.

Disabling org works fine however disabling vdc throws an error as follows:

Part of code:

  Get-Org $orgs[$i] | Set-Org -Enabled $false

  Get-OrgVdc -Name $orgs[$i] | Set-OrgVdc -Enabled $false

Return for the last line:

Set-OrgVdc : 2/8/2016 2:53:23 PM    Set-OrgVdc        The specified Href

'<URL>/api/Internal errror: ComposeOperationHref() : serviceUrl is not prefix of

sourceHref' is not valid.

At C:\Scripts\new.ps1:25 char:5

+                 Set-OrgVdc -OrgVdc $orgs[$i] -Enabled $false

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Set-OrgVdc], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Cloud.Commands.Cmdlets.SetOrgVdc

Any suggestions?

Thanks,

Reply
0 Kudos
3 Replies
RvdNieuwendijk
Leadership
Leadership

Your second command will only work if your OrgVdc has the same name as your Org. Otherwise you should use:

Get-Org -Name $orgs[$i] | Get-OrgVdc | Set-OrgVdc -Enabled $false

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
cann0nf0dder
Enthusiast
Enthusiast

Hi RvdNieuwendijk,

Thanks for your reply, the org and VDC are in fact the same.

Also tried the command you suggested and I still receive the same error.

Any suggestions?

Thanks

Reply
0 Kudos
cann0nf0dder
Enthusiast
Enthusiast

I'll try RestAPI for now and see how that goes.

Reply
0 Kudos