VMware Cloud Community
exsnafu
Contributor
Contributor

missing PowerCLI cmdlets for external network settings in vCD 5.1?

I have 59 external networks defined in my Provider VDC and over a hundred directly connected OrgVDC networks mapping back to those.

I need to update the DNS records for the static IP pools associated with each external network and it appears to me at least that I cannot do this via the PowerCLI cmdlets for vCloud?

the Set options I have:

Set-CIAccessControlRule
Set-CINetworkAdapter
Set-CIVApp
Set-CIVAppNetwork
Set-CIVAppStartRule
Set-CIVAppTemplate
Set-Org
Set-OrgNetwork <-- does NOT allow editing DNS/pool settings for Directly Connected OvDC networks.
Set-OrgVdc

Am I missing something or is this going to have to be done manually through the UI?

Reply
0 Kudos
4 Replies
dmilov
VMware Employee
VMware Employee

Hi,

PowerCLI has no Set cmdlet for external network, but you can use views to update DNS and IP ranges. Here is an example of how you can do that:

# Get an external network

$myExtNetwork = Get-ExternalNetwork -Name 'PCLI-Ext-943'

# Get the external network's view

$myExtNetworkView = $myExtNetwork.ExtensionData

# Here is how to get current network configuration (DNS)

$myExtNetworkView.Configuration.IpScopes.IPScope


IsInherited          : False
Gateway              : 10.23.95.253
Netmask              : 255.255.254.0
Dns1                 : 10.23.108.1
Dns2                 : 10.23.108.2
DnsSuffix            : eng.vmware.com
IsEnabled            : True
IpRanges             : VMware.VimAutomation.Cloud.Views.IpRanges
AllocatedIpAddresses : VMware.VimAutomation.Cloud.Views.IpAddresses
SubAllocations       : VMware.VimAutomation.Cloud.Views.SubAllocations
AnyAttr              :
VCloudExtension      :

# Here is how to get current network configuration (IPRanges). Bear in mind that here I'm accessing the 1st IPScope element, they could be more than one

$myExtNetworkView.Configuration.IpScopes.IPScope[0].IpRanges.IpRange

StartAddress                                 EndAddress                                   AnyAttr                                      VCloudExtension
------------                                 ----------                                   -------                                      ---------------
10.23.94.1                                   10.23.95.249

# In order to update DNS and IPRange use the follwoing.

$myExtNetworkView.Configuration.IpScopes.IPScope[0].Dns1 = '10.23.83.229'

# Bear in mind that here I'm accessing the 1st IPRange element, they could be more than one

$myExtNetworkView.Configuration.IpScopes.IPScope[0].IpRanges.IpRange[0].StartAddress = '10.23.94.100'

$myExtNetworkView.Configuration.IpScopes.IPScope[0].IpRanges.IpRange[0].EndAddress = '10.23.94.200'

# To update the changed configuration on the server you need to call UpdateServerData

$myExtNetworkView.UpdateServerData()

I hope this will save up your time clicking in the UI.

Regards,

Dimitar Milov

exsnafu
Contributor
Contributor

Thanks Dimitar! that is exactly the kind of detail I need to help with our scripting effort.

out of curiousity, is there a reference guide or some other documentation I should be looking at to get this kind of information? we were digging around the REST API documentation yesterday and coming close to figuring it out there but couldn't actually get a PUT update to take.

Reply
0 Kudos
dmilov
VMware Employee
VMware Employee

Hi,

Unfortunately Views have no official public documentation. Here are the general rules for mapping REST API operations to Views methods:

GET operations are represented by proerties and UpdateViewData method could be used for refresh.

POST operations are represented by methods named as the name of the operation.

PUT operations are represented by UpdateServerData method

DELETE operations are represented by Delete method

Regards,

Dimitar Milov

Reply
0 Kudos
jake_robinson_b
Hot Shot
Hot Shot

I use the vCloud API schema reference. Once you find what you are looking for in the Schema reference, it's pretty easy to find in the PowerCLI objects. :smileygrin:

Cheers,

Jake

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