Quantcast
Channel: VMware Communities : Popular Discussions - vCloud Director PowerCLI
Viewing all articles
Browse latest Browse all 13334

PowerCLI 5.0.1 vCloud cmdlets: get-orgvdc bug, ProviderVdcReference.id attribute blank

$
0
0

Hi,

 

1) Get-OrgVdc bug

 

If your vDC name contains space (e.g. "my vDC"), the following command will fail because the REST API call is not urlencoded (%20 instead of space):

$all_powered_on_vms = Search-Cloud -QueryType adminVM -Filter "IsVAppTemplate==False;status==POWERED_ON"

$vm = $all_powered_on_vms[0]

$vdc = Get-OrgVdc -Id $vm.Vdc     <--- fail

 

with the following GET url request:

Get-OrgVdc        The specified Href 'https://vcloud/api/query?type=adminOrgVdc&format=idrecords&filter=isSystemVdc==false;(name==my VDC)&pageSize=128' is not valid.

 

After having tested with the java restclient, it works if urlencoded.

 

So the workaround is to use Get-CIView.

 

2) ProviderVdcReference lacks Id attribute

 

Let's say that you retrieve your vDC with this code:

$vdc = Get-CIView -Id $vm.vdc

$vdc.ProviderVdcReference.Id is blank

 

The workaround is to compute it with the href attribute:

$pvdc_id = $vdc.ProviderVdcReference.href.split('/')[-1]

$pvdc_urn = "urn:vcloud:providervdc:" + $pvdc_id

$pvdc = Get-ProviderVdc -id $pvdc_urn


Viewing all articles
Browse latest Browse all 13334

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>